Commit ee6944e0 by Mac Stephens

priority badges added to complaints, default markers created and added for…

priority badges added to complaints, default markers created and added for complaints and units without types, updated server code to handle these, committing while handling unstable VM
parent de1aebb1
......@@ -19,3 +19,5 @@ emiMobileServer/logs/*
*.identcache
*.res
*.tvsconfig
*.dxsettings
......@@ -600,7 +600,7 @@ object ApiDatabaseModule: TApiDatabaseModule
Server = 'BUFENTCAD'
Connected = True
LoginPrompt = False
Left = 36
Left = 38
Top = 98
EncryptedPassword = 'BAFFB1FFABFFBCFFBEFFBBFF'
end
......@@ -701,7 +701,6 @@ object ApiDatabaseModule: TApiDatabaseModule
'from dual;'
'')
ReadOnly = True
Active = True
Left = 194
Top = 270
object uqBadgeCountsCOMPLAINTS: TFloatField
......
......@@ -230,7 +230,7 @@ begin
DataSet.FieldByName('priorityKey').AsString := derivedPriorityKey;
if Trim(rawCategory) = '' then
computedPngName := 'default.png'
computedPngName := Format('default_%s.png', [derivedPriorityKey])
else
computedPngName := Format('%s_%s.png', [HandleUniqueFilenames(rawCategory), derivedPriorityKey]);
......
......@@ -22,5 +22,8 @@ object AuthServerModule: TAuthServerModule
end
object XDataServerCompress: TSparkleCompressMiddleware
end
object XDataServerBasicauth: TSparkleBasicAuthMiddleware
Realm = 'TMS Sparkle Server'
end
end
end
......@@ -10,7 +10,8 @@ uses
Sparkle.Comp.Server, Sparkle.Comp.JwtMiddleware, XData.Comp.Server,
Sparkle.Comp.HttpSysDispatcher, Sparkle.Comp.CompressMiddleware,
Sparkle.Comp.CorsMiddleware, Sparkle.HttpServer.Module,
Sparkle.HttpServer.Context, Sparkle.Comp.GenericMiddleware;
Sparkle.HttpServer.Context, Sparkle.Comp.GenericMiddleware,
Sparkle.Comp.BasicAuthMiddleware;
type
TAuthServerModule = class(TDataModule)
......@@ -19,6 +20,7 @@ type
XDataServerLogging: TSparkleGenericMiddleware;
XDataServerCORS: TSparkleCorsMiddleware;
XDataServerCompress: TSparkleCompressMiddleware;
XDataServerBasicauth: TSparkleBasicAuthMiddleware;
procedure XDataServerLoggingMiddlewareCreate(Sender: TObject;
var Middleware: IHttpServerMiddleware);
private
......
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{2A3028D9-BC39-4625-9BA5-0338012E2824}</ProjectGuid>
<ProjectVersion>20.2</ProjectVersion>
<ProjectVersion>20.3</ProjectVersion>
<FrameworkType>VCL</FrameworkType>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
......@@ -321,6 +321,16 @@
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashStylesV35">
<Platform Name="Android">
<RemoteDir>res\values-v35</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values-v35</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_AdaptiveIcon">
<Platform Name="Android">
<RemoteDir>res\drawable-anydpi-v26</RemoteDir>
......
[Settings]
LogFileNum=493
LogFileNum=512
webClientVersion=0.1.0
TwilioUpdateTime=0
[Database]
Server=192.168.102.130
Server=192.168.102.129
--Server=192.168.75.133
Database=envoy_db
......
[ExpressSkins]
Version=1.0.0
Enabled=1
ShowNotifications=1
Kind=2
NativeStyle=1
ScrollbarMode=0
ScrollMode=0
SkinName=WXICompact
RenderMode=0
TouchMode=0
FormCorners=0
SkinPaletteName=Default
ShowFormShadow=2
UseSkins=1
UseImageSet=0
UseSkinsInPopupMenus=1
LightStyleMode=3
UseGlobalSkin=1
dxSkinWXI=1
dxSkinTheBezier=1
dxSkinOffice2019Colorful=1
dxSkinOffice2019Black=1
dxSkinOffice2019DarkGray=1
dxSkinOffice2019White=1
dxSkinBasic=1
dxSkinBlack=0
dxSkinBlue=0
dxSkinBlueprint=0
dxSkinCaramel=0
dxSkinCoffee=0
dxSkinDarkroom=0
dxSkinDarkSide=0
dxSkinDevExpressDarkStyle=0
dxSkinDevExpressStyle=0
dxSkinFoggy=0
dxSkinGlassOceans=0
dxSkinHighContrast=0
dxSkiniMaginary=0
dxSkinLilian=0
dxSkinLiquidSky=0
dxSkinLondonLiquidSky=0
dxSkinMcSkin=0
dxSkinMetropolis=0
dxSkinMetropolisDark=0
dxSkinMoneyTwins=0
dxSkinOffice2007Black=0
dxSkinOffice2007Blue=0
dxSkinOffice2007Green=0
dxSkinOffice2007Pink=0
dxSkinOffice2007Silver=0
dxSkinOffice2010Black=0
dxSkinOffice2010Blue=0
dxSkinOffice2010Silver=0
dxSkinOffice2013DarkGray=0
dxSkinOffice2013LightGray=0
dxSkinOffice2013White=0
dxSkinOffice2016Colorful=0
dxSkinOffice2016Dark=0
dxSkinPumpkin=0
dxSkinSeven=0
dxSkinSevenClassic=0
dxSkinSharp=0
dxSkinSharpPlus=0
dxSkinSilver=0
dxSkinSpringtime=0
dxSkinStardust=0
dxSkinSummer2008=0
dxSkinTheAsphaltWorld=0
dxSkinValentine=0
dxSkinVisualStudio2013Blue=0
dxSkinVisualStudio2013Dark=0
dxSkinVisualStudio2013Light=0
dxSkinVS2010=0
dxSkinWhiteprint=0
dxSkinXmas2008Blue=0
......@@ -68,7 +68,8 @@ uses
View.Units,
View.Admin,
View.Users,
View.EditUser;
View.EditUser,
Utils;
{$R *.dfm}
......@@ -82,7 +83,7 @@ begin
FChildForm := nil;
if (not (JS.toBoolean(AuthService.TokenPayload.Properties['user_admin']))) then
lblUsers.Visible := false;
Utils.HideSpinner('spinner');
ShowForm(TFViewMap);
RefreshBadgesAsync;
end;
......
......@@ -29,7 +29,7 @@ type
procedure lfMapPolyElementMouseEnter(Sender: TObject; AElement: TTMSFNCMapsPolyElement);
procedure lfMapPolyElementMouseLeave(Sender: TObject; AElement: TTMSFNCMapsPolyElement);
procedure lfMapCustomizeMarker(Sender: TObject;
var ACustomizeMarker: string);
var ACustomizeMarker: string);
procedure lfMapCustomizeCSS(Sender: TObject; var ACustomizeCSS: string);
private
FUnitsLoaded: Boolean;
......@@ -125,15 +125,16 @@ var
L: Char;
begin
U := UpperCase(Trim(DistrictCode));
if U = '' then
Exit('assets/markers/car_X.png');
Exit('assets/markers/car_default.png');
L := U[1];
case L of
'A','B','C','D','E','X':
Result := 'assets/markers/car_' + L + '.png';
else
Result := 'assets/markers/default.png';
Result := 'assets/markers/car_default.png';
end;
end;
......@@ -212,7 +213,7 @@ begin
if Trim(pngName) <> '' then
iconUrl := 'assets/markers/' + pngName
else
iconUrl := 'assets/markers/default.png';
iconUrl := 'assets/markers/default_5-9.png';
m := lfMap.Markers.Add;
m.Latitude := lat;
m.Longitude := lng;
......@@ -241,17 +242,54 @@ procedure TFViewMap.lfMapCustomizeMarker(Sender: TObject; var ACustomizeMarker:
begin
ACustomizeMarker :=
'var m=' + MARKERVAR + ', o=m.options||{};' + #13#10 +
'if (o.icon && o.icon.options && o.icon.options.iconUrl) {' + #13#10 +
' var u = o.icon.options.iconUrl;' + #13#10 +
' m.setIcon(L.icon({' + #13#10 +
' iconUrl: u,' + #13#10 +
' iconSize: [32,32],' + #13#10 +
' iconAnchor: [16,32],' + #13#10 +
' popupAnchor: [0,-20]' + #13#10 +
' }));' + #13#10 +
'}' + #13#10 +
'var t = (o && o.title) ? o.title : "";' + #13#10 +
'var u = (o.icon && o.icon.options && o.icon.options.iconUrl) ? o.icon.options.iconUrl : null;' + #13#10 +
'try { m.unbindTooltip(); } catch(e) {}' + #13#10 +
'if (!u) {' + #13#10 +
' m.bindTooltip(t, {' + #13#10 +
' className: "emi-tip",' + #13#10 +
' direction: "top",' + #13#10 +
' offset: [0,-28],' + #13#10 +
' sticky: true' + #13#10 +
' });' + #13#10 +
' return;' + #13#10 +
'}' + #13#10 +
// derive badgeText from the icon filename suffix: *_2.png, *_3.png, *_4.png, *_5-9.png, etc.
'var badgeText = "";' + #13#10 +
'try {' + #13#10 +
' var file = u.split("/").pop();' + #13#10 +
' var base = file.replace(/\.[^/.]+$/, "");' + #13#10 + // strip .png
' var idx = base.lastIndexOf("_");' + #13#10 +
' if (idx >= 0 && idx < base.length - 1) {' + #13#10 +
' var suffix = base.substring(idx + 1);' + #13#10 +
' if (suffix && suffix.length > 0) {' + #13#10 +
' var ch = suffix.charAt(0);' + #13#10 +
' if (ch >= "1" && ch <= "9") {' + #13#10 +
' badgeText = ch;' + #13#10 +
' }' + #13#10 +
' }' + #13#10 +
' }' + #13#10 +
'} catch(e) {}' + #13#10 +
// build HTML wrapper + optional badge
'var html = ''<div class="emi-marker-wrap"><img src="'' + u + ''" class="emi-marker-img">'';' + #13#10 +
'if (badgeText) {' + #13#10 +
' html += ''<div class="emi-marker-badge">'' + badgeText + ''</div>'';' + #13#10 +
'}' + #13#10 +
'html += ''</div>'';' + #13#10 +
// use a divIcon for all markers (units + complaints),
// units just won''t get a badgeText because their suffix isn''t numeric
'm.setIcon(L.divIcon({' + #13#10 +
' html: html,' + #13#10 +
' iconSize: [32,32],' + #13#10 +
' iconAnchor: [16,32],' + #13#10 +
' popupAnchor: [0,-20],' + #13#10 +
' className: ""' + #13#10 +
'}));' + #13#10 +
'm.bindTooltip(t, {' + #13#10 +
' className: "emi-tip",' + #13#10 +
' direction: "top",' + #13#10 +
......@@ -261,6 +299,11 @@ begin
end;
procedure TFViewMap.lfMapCustomizeCSS(Sender: TObject; var ACustomizeCSS: string);
begin
ACustomizeCSS :=
......@@ -276,10 +319,33 @@ begin
'.leaflet-tooltip-top.emi-tip:before { border-top-color: #111; }' + #13#10 +
'.leaflet-tooltip-bottom.emi-tip:before { border-bottom-color: #111; }' + #13#10 +
'.leaflet-tooltip-left.emi-tip:before { border-left-color: #111; }' + #13#10 +
'.leaflet-tooltip-right.emi-tip:before { border-right-color: #111; }';
'.leaflet-tooltip-right.emi-tip:before { border-right-color: #111; }' + #13#10 +
'.emi-marker-wrap {' + #13#10 +
' position: relative;' + #13#10 +
' display: inline-block;' + #13#10 +
'}' + #13#10 +
'.emi-marker-img {' + #13#10 +
' display: block;' + #13#10 +
'}' + #13#10 +
'.emi-marker-badge {' + #13#10 +
' position: absolute;' + #13#10 +
' top: -4px;' + #13#10 +
' right: -4px;' + #13#10 +
' min-width: 16px;' + #13#10 +
' height: 16px;' + #13#10 +
' padding: 0 4px;' + #13#10 +
' border-radius: 999px;' + #13#10 +
' background: var(--bs-danger);' + #13#10 +
' color: #fff;' + #13#10 +
' font: 700 11px/16px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;' + #13#10 +
' text-align: center;' + #13#10 +
' box-shadow: 0 0 0 2px #fff;' + #13#10 +
'}';
end;
procedure TFViewMap.lfMapPolyElementMouseEnter(Sender: TObject; AElement: TTMSFNCMapsPolyElement);
begin
if AElement is TTMSFNCMapsPolygon then
......
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{DB6F5DBF-7E4B-45DA-AFFA-6C8DF15BA740}</ProjectGuid>
<ProjectVersion>20.2</ProjectVersion>
<ProjectVersion>20.3</ProjectVersion>
<FrameworkType>VCL</FrameworkType>
<MainSource>webEmiMobile.dpr</MainSource>
<Base>True</Base>
......@@ -97,7 +97,7 @@
<TMSWebSingleInstance>1</TMSWebSingleInstance>
<TMSUseJSDebugger>2</TMSUseJSDebugger>
<VerInfo_Release>3</VerInfo_Release>
<TMSWebBrowser>3</TMSWebBrowser>
<TMSWebBrowser>1</TMSWebBrowser>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
......@@ -366,6 +366,16 @@
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashStylesV35">
<Platform Name="Android">
<RemoteDir>res\values-v35</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values-v35</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_AdaptiveIcon">
<Platform Name="Android">
<RemoteDir>res\drawable-anydpi-v26</RemoteDir>
......
[ExpressSkins]
Version=1.0.0
Enabled=1
ShowNotifications=1
Kind=2
NativeStyle=1
ScrollbarMode=0
ScrollMode=0
SkinName=WXICompact
RenderMode=0
TouchMode=0
FormCorners=0
SkinPaletteName=Default
ShowFormShadow=2
UseSkins=1
UseImageSet=0
UseSkinsInPopupMenus=1
LightStyleMode=3
UseGlobalSkin=1
dxSkinWXI=1
dxSkinTheBezier=1
dxSkinOffice2019Colorful=1
dxSkinOffice2019Black=1
dxSkinOffice2019DarkGray=1
dxSkinOffice2019White=1
dxSkinBasic=1
dxSkinBlack=0
dxSkinBlue=0
dxSkinBlueprint=0
dxSkinCaramel=0
dxSkinCoffee=0
dxSkinDarkroom=0
dxSkinDarkSide=0
dxSkinDevExpressDarkStyle=0
dxSkinDevExpressStyle=0
dxSkinFoggy=0
dxSkinGlassOceans=0
dxSkinHighContrast=0
dxSkiniMaginary=0
dxSkinLilian=0
dxSkinLiquidSky=0
dxSkinLondonLiquidSky=0
dxSkinMcSkin=0
dxSkinMetropolis=0
dxSkinMetropolisDark=0
dxSkinMoneyTwins=0
dxSkinOffice2007Black=0
dxSkinOffice2007Blue=0
dxSkinOffice2007Green=0
dxSkinOffice2007Pink=0
dxSkinOffice2007Silver=0
dxSkinOffice2010Black=0
dxSkinOffice2010Blue=0
dxSkinOffice2010Silver=0
dxSkinOffice2013DarkGray=0
dxSkinOffice2013LightGray=0
dxSkinOffice2013White=0
dxSkinOffice2016Colorful=0
dxSkinOffice2016Dark=0
dxSkinPumpkin=0
dxSkinSeven=0
dxSkinSevenClassic=0
dxSkinSharp=0
dxSkinSharpPlus=0
dxSkinSilver=0
dxSkinSpringtime=0
dxSkinStardust=0
dxSkinSummer2008=0
dxSkinTheAsphaltWorld=0
dxSkinValentine=0
dxSkinVisualStudio2013Blue=0
dxSkinVisualStudio2013Dark=0
dxSkinVisualStudio2013Light=0
dxSkinVS2010=0
dxSkinWhiteprint=0
dxSkinXmas2008Blue=0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment