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/* ...@@ -19,3 +19,5 @@ emiMobileServer/logs/*
*.identcache *.identcache
*.res *.res
*.tvsconfig *.tvsconfig
*.dxsettings
...@@ -600,7 +600,7 @@ object ApiDatabaseModule: TApiDatabaseModule ...@@ -600,7 +600,7 @@ object ApiDatabaseModule: TApiDatabaseModule
Server = 'BUFENTCAD' Server = 'BUFENTCAD'
Connected = True Connected = True
LoginPrompt = False LoginPrompt = False
Left = 36 Left = 38
Top = 98 Top = 98
EncryptedPassword = 'BAFFB1FFABFFBCFFBEFFBBFF' EncryptedPassword = 'BAFFB1FFABFFBCFFBEFFBBFF'
end end
...@@ -701,7 +701,6 @@ object ApiDatabaseModule: TApiDatabaseModule ...@@ -701,7 +701,6 @@ object ApiDatabaseModule: TApiDatabaseModule
'from dual;' 'from dual;'
'') '')
ReadOnly = True ReadOnly = True
Active = True
Left = 194 Left = 194
Top = 270 Top = 270
object uqBadgeCountsCOMPLAINTS: TFloatField object uqBadgeCountsCOMPLAINTS: TFloatField
......
...@@ -230,7 +230,7 @@ begin ...@@ -230,7 +230,7 @@ begin
DataSet.FieldByName('priorityKey').AsString := derivedPriorityKey; DataSet.FieldByName('priorityKey').AsString := derivedPriorityKey;
if Trim(rawCategory) = '' then if Trim(rawCategory) = '' then
computedPngName := 'default.png' computedPngName := Format('default_%s.png', [derivedPriorityKey])
else else
computedPngName := Format('%s_%s.png', [HandleUniqueFilenames(rawCategory), derivedPriorityKey]); computedPngName := Format('%s_%s.png', [HandleUniqueFilenames(rawCategory), derivedPriorityKey]);
......
...@@ -22,5 +22,8 @@ object AuthServerModule: TAuthServerModule ...@@ -22,5 +22,8 @@ object AuthServerModule: TAuthServerModule
end end
object XDataServerCompress: TSparkleCompressMiddleware object XDataServerCompress: TSparkleCompressMiddleware
end end
object XDataServerBasicauth: TSparkleBasicAuthMiddleware
Realm = 'TMS Sparkle Server'
end
end end
end end
...@@ -10,7 +10,8 @@ uses ...@@ -10,7 +10,8 @@ uses
Sparkle.Comp.Server, Sparkle.Comp.JwtMiddleware, XData.Comp.Server, Sparkle.Comp.Server, Sparkle.Comp.JwtMiddleware, XData.Comp.Server,
Sparkle.Comp.HttpSysDispatcher, Sparkle.Comp.CompressMiddleware, Sparkle.Comp.HttpSysDispatcher, Sparkle.Comp.CompressMiddleware,
Sparkle.Comp.CorsMiddleware, Sparkle.HttpServer.Module, Sparkle.Comp.CorsMiddleware, Sparkle.HttpServer.Module,
Sparkle.HttpServer.Context, Sparkle.Comp.GenericMiddleware; Sparkle.HttpServer.Context, Sparkle.Comp.GenericMiddleware,
Sparkle.Comp.BasicAuthMiddleware;
type type
TAuthServerModule = class(TDataModule) TAuthServerModule = class(TDataModule)
...@@ -19,6 +20,7 @@ type ...@@ -19,6 +20,7 @@ type
XDataServerLogging: TSparkleGenericMiddleware; XDataServerLogging: TSparkleGenericMiddleware;
XDataServerCORS: TSparkleCorsMiddleware; XDataServerCORS: TSparkleCorsMiddleware;
XDataServerCompress: TSparkleCompressMiddleware; XDataServerCompress: TSparkleCompressMiddleware;
XDataServerBasicauth: TSparkleBasicAuthMiddleware;
procedure XDataServerLoggingMiddlewareCreate(Sender: TObject; procedure XDataServerLoggingMiddlewareCreate(Sender: TObject;
var Middleware: IHttpServerMiddleware); var Middleware: IHttpServerMiddleware);
private private
......
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<ProjectGuid>{2A3028D9-BC39-4625-9BA5-0338012E2824}</ProjectGuid> <ProjectGuid>{2A3028D9-BC39-4625-9BA5-0338012E2824}</ProjectGuid>
<ProjectVersion>20.2</ProjectVersion> <ProjectVersion>20.3</ProjectVersion>
<FrameworkType>VCL</FrameworkType> <FrameworkType>VCL</FrameworkType>
<Base>True</Base> <Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config> <Config Condition="'$(Config)'==''">Debug</Config>
...@@ -321,6 +321,16 @@ ...@@ -321,6 +321,16 @@
<Operation>1</Operation> <Operation>1</Operation>
</Platform> </Platform>
</DeployClass> </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"> <DeployClass Name="Android_AdaptiveIcon">
<Platform Name="Android"> <Platform Name="Android">
<RemoteDir>res\drawable-anydpi-v26</RemoteDir> <RemoteDir>res\drawable-anydpi-v26</RemoteDir>
......
[Settings] [Settings]
LogFileNum=493 LogFileNum=512
webClientVersion=0.1.0 webClientVersion=0.1.0
TwilioUpdateTime=0 TwilioUpdateTime=0
[Database] [Database]
Server=192.168.102.130 Server=192.168.102.129
--Server=192.168.75.133 --Server=192.168.75.133
Database=envoy_db 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 ...@@ -68,7 +68,8 @@ uses
View.Units, View.Units,
View.Admin, View.Admin,
View.Users, View.Users,
View.EditUser; View.EditUser,
Utils;
{$R *.dfm} {$R *.dfm}
...@@ -82,7 +83,7 @@ begin ...@@ -82,7 +83,7 @@ begin
FChildForm := nil; FChildForm := nil;
if (not (JS.toBoolean(AuthService.TokenPayload.Properties['user_admin']))) then if (not (JS.toBoolean(AuthService.TokenPayload.Properties['user_admin']))) then
lblUsers.Visible := false; lblUsers.Visible := false;
Utils.HideSpinner('spinner');
ShowForm(TFViewMap); ShowForm(TFViewMap);
RefreshBadgesAsync; RefreshBadgesAsync;
end; end;
......
...@@ -29,7 +29,7 @@ type ...@@ -29,7 +29,7 @@ type
procedure lfMapPolyElementMouseEnter(Sender: TObject; AElement: TTMSFNCMapsPolyElement); procedure lfMapPolyElementMouseEnter(Sender: TObject; AElement: TTMSFNCMapsPolyElement);
procedure lfMapPolyElementMouseLeave(Sender: TObject; AElement: TTMSFNCMapsPolyElement); procedure lfMapPolyElementMouseLeave(Sender: TObject; AElement: TTMSFNCMapsPolyElement);
procedure lfMapCustomizeMarker(Sender: TObject; procedure lfMapCustomizeMarker(Sender: TObject;
var ACustomizeMarker: string); var ACustomizeMarker: string);
procedure lfMapCustomizeCSS(Sender: TObject; var ACustomizeCSS: string); procedure lfMapCustomizeCSS(Sender: TObject; var ACustomizeCSS: string);
private private
FUnitsLoaded: Boolean; FUnitsLoaded: Boolean;
...@@ -125,15 +125,16 @@ var ...@@ -125,15 +125,16 @@ var
L: Char; L: Char;
begin begin
U := UpperCase(Trim(DistrictCode)); U := UpperCase(Trim(DistrictCode));
if U = '' then if U = '' then
Exit('assets/markers/car_X.png'); Exit('assets/markers/car_default.png');
L := U[1]; L := U[1];
case L of case L of
'A','B','C','D','E','X': 'A','B','C','D','E','X':
Result := 'assets/markers/car_' + L + '.png'; Result := 'assets/markers/car_' + L + '.png';
else else
Result := 'assets/markers/default.png'; Result := 'assets/markers/car_default.png';
end; end;
end; end;
...@@ -212,7 +213,7 @@ begin ...@@ -212,7 +213,7 @@ begin
if Trim(pngName) <> '' then if Trim(pngName) <> '' then
iconUrl := 'assets/markers/' + pngName iconUrl := 'assets/markers/' + pngName
else else
iconUrl := 'assets/markers/default.png'; iconUrl := 'assets/markers/default_5-9.png';
m := lfMap.Markers.Add; m := lfMap.Markers.Add;
m.Latitude := lat; m.Latitude := lat;
m.Longitude := lng; m.Longitude := lng;
...@@ -241,17 +242,54 @@ procedure TFViewMap.lfMapCustomizeMarker(Sender: TObject; var ACustomizeMarker: ...@@ -241,17 +242,54 @@ procedure TFViewMap.lfMapCustomizeMarker(Sender: TObject; var ACustomizeMarker:
begin begin
ACustomizeMarker := ACustomizeMarker :=
'var m=' + MARKERVAR + ', o=m.options||{};' + #13#10 + '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 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 + '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 + 'm.bindTooltip(t, {' + #13#10 +
' className: "emi-tip",' + #13#10 + ' className: "emi-tip",' + #13#10 +
' direction: "top",' + #13#10 + ' direction: "top",' + #13#10 +
...@@ -261,6 +299,11 @@ begin ...@@ -261,6 +299,11 @@ begin
end; end;
procedure TFViewMap.lfMapCustomizeCSS(Sender: TObject; var ACustomizeCSS: string); procedure TFViewMap.lfMapCustomizeCSS(Sender: TObject; var ACustomizeCSS: string);
begin begin
ACustomizeCSS := ACustomizeCSS :=
...@@ -276,10 +319,33 @@ begin ...@@ -276,10 +319,33 @@ begin
'.leaflet-tooltip-top.emi-tip:before { border-top-color: #111; }' + #13#10 + '.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-bottom.emi-tip:before { border-bottom-color: #111; }' + #13#10 +
'.leaflet-tooltip-left.emi-tip:before { border-left-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; end;
procedure TFViewMap.lfMapPolyElementMouseEnter(Sender: TObject; AElement: TTMSFNCMapsPolyElement); procedure TFViewMap.lfMapPolyElementMouseEnter(Sender: TObject; AElement: TTMSFNCMapsPolyElement);
begin begin
if AElement is TTMSFNCMapsPolygon then if AElement is TTMSFNCMapsPolygon then
......
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<ProjectGuid>{DB6F5DBF-7E4B-45DA-AFFA-6C8DF15BA740}</ProjectGuid> <ProjectGuid>{DB6F5DBF-7E4B-45DA-AFFA-6C8DF15BA740}</ProjectGuid>
<ProjectVersion>20.2</ProjectVersion> <ProjectVersion>20.3</ProjectVersion>
<FrameworkType>VCL</FrameworkType> <FrameworkType>VCL</FrameworkType>
<MainSource>webEmiMobile.dpr</MainSource> <MainSource>webEmiMobile.dpr</MainSource>
<Base>True</Base> <Base>True</Base>
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
<TMSWebSingleInstance>1</TMSWebSingleInstance> <TMSWebSingleInstance>1</TMSWebSingleInstance>
<TMSUseJSDebugger>2</TMSUseJSDebugger> <TMSUseJSDebugger>2</TMSUseJSDebugger>
<VerInfo_Release>3</VerInfo_Release> <VerInfo_Release>3</VerInfo_Release>
<TMSWebBrowser>3</TMSWebBrowser> <TMSWebBrowser>1</TMSWebBrowser>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''"> <PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols> <DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
...@@ -366,6 +366,16 @@ ...@@ -366,6 +366,16 @@
<Operation>1</Operation> <Operation>1</Operation>
</Platform> </Platform>
</DeployClass> </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"> <DeployClass Name="Android_AdaptiveIcon">
<Platform Name="Android"> <Platform Name="Android">
<RemoteDir>res\drawable-anydpi-v26</RemoteDir> <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