Skip to content

Commit 81961d5

Browse files
committed
Merge branch 'develop' of https://github.com/ngageoint/mage-server into fix-event-sync
2 parents e98eb82 + 95d6319 commit 81961d5

File tree

4 files changed

+94
-183
lines changed

4 files changed

+94
-183
lines changed

plugins/arcgis/service/src/index.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ const InjectedServices = {
3636

3737
const pluginWebRoute = "plugins/@ngageoint/mage.arcgis.service"
3838

39-
const sanitizeFeatureService = async (config: FeatureServiceConfig, identityService: ArcGISIdentityService): Promise<Omit<FeatureServiceConfig & { authenticated: boolean }, 'identityManager'>> => {
39+
const sanitizeFeatureService = async (config: FeatureServiceConfig, identityService: ArcGISIdentityService): Promise<Omit<FeatureServiceConfig & { authenticated: boolean }, 'identityManager'>> => {
4040
let authenticated = false
4141
try {
4242
await identityService.signin(config)
4343
authenticated = true
44-
} catch(ignore) {}
44+
} catch (ignore) { }
4545

4646
const { identityManager, ...sanitized } = config;
4747
return { ...sanitized, authenticated }
@@ -133,7 +133,7 @@ const arcgisPluginHooks: InitPluginHook<typeof InjectedServices> = {
133133
</head>
134134
</html>
135135
`);
136-
}).catch((error) => res.status(400).json(error))
136+
}).catch((error) => res.status(400).json(error))
137137
})
138138

139139
return routes
@@ -167,7 +167,7 @@ const arcgisPluginHooks: InitPluginHook<typeof InjectedServices> = {
167167
const config = await stateRepo.get()
168168
const { featureServices: updatedServices, ...updateConfig } = req.body
169169

170-
170+
171171
// Convert event names to event IDs
172172
// Fetch all events and create a mapping of event names to event IDs
173173
const allEvents = await eventRepo.findAll();
@@ -176,7 +176,7 @@ const arcgisPluginHooks: InitPluginHook<typeof InjectedServices> = {
176176
eventNameToIdMap.set(event.name, event.id);
177177
});
178178

179-
// Process the incoming feature services with eventIds instead of event names
179+
// Process the incoming feature services with eventIds instead of event names
180180
const featureServices: FeatureServiceConfig[] = updatedServices.map((updateService: any) => {
181181
const existingService = config.featureServices.find(
182182
(featureService: FeatureServiceConfig) => featureService.url === updateService.url
@@ -206,12 +206,12 @@ const arcgisPluginHooks: InitPluginHook<typeof InjectedServices> = {
206206
url: updateService.url,
207207
layers: layers,
208208
// Map exisiting identityManager, client does not send this
209-
identityManager: existingService?.identityManager,
209+
identityManager: existingService?.identityManager || '',
210210
};
211211
});
212-
212+
213213
await stateRepo.patch({ ...updateConfig, featureServices })
214-
214+
215215
// Sync configuration with feature servers by restarting observation processor
216216
processor.stop()
217217
processor.start()
@@ -229,7 +229,7 @@ const arcgisPluginHooks: InitPluginHook<typeof InjectedServices> = {
229229
let service: FeatureServiceConfig
230230
let identityManager: ArcGISIdentityManager
231231
if (token) {
232-
identityManager = await ArcGISIdentityManager.fromToken({ token })
232+
identityManager = await ArcGISIdentityManager.fromToken({ token })
233233
service = { url, layers: [], identityManager: identityManager.serialize() }
234234
} else if (username && password) {
235235
identityManager = await ArcGISIdentityManager.signIn({
@@ -255,7 +255,7 @@ const arcgisPluginHooks: InitPluginHook<typeof InjectedServices> = {
255255
return res.send('Invalid credentials provided to communicate with feature service').status(400)
256256
}
257257
})
258-
258+
259259
routes.get('/featureService/layers', async (req, res, next) => {
260260
const url = req.query.featureServiceUrl as string
261261
const config = await processor.safeGetConfig()

plugins/arcgis/web-app/projects/main/src/lib/arc-admin/arc-admin.component.html

Lines changed: 76 additions & 166 deletions
Original file line numberDiff line numberDiff line change
@@ -3,80 +3,88 @@ <h1>ArcGIS Configuration</h1>
33
<mat-card appearance="outlined">
44
<mat-card-header>
55
<mat-card-title>
6-
Processing <button class="edit-button" mat-icon-button (click)="onEditProcessing()"><mat-icon>edit</mat-icon></button>
6+
Processing
77
</mat-card-title>
88
<mat-card-subtitle>MAGE ArcGIS plugin processing settings.</mat-card-subtitle>
99
</mat-card-header>
1010
<mat-card-content>
11-
<div class="processing">
12-
<table class="processing-table">
13-
<tr>
14-
<th>Enabled
15-
<button class="info-button" mat-icon-button
16-
(click)="showInfo('Enabled', 'Process observations and send to configured ArcGIS feature layers')">
17-
<mat-icon class="info-icon" [inline]="true">info_outline</mat-icon>
18-
</button>
19-
</th>
20-
<td>{{config.enabled}}</td>
21-
</tr>
22-
<tr>
23-
<th>Base URL
24-
<button class="info-button" mat-icon-button (click)="showInfo('Base URL', 'MAGE server base URL')">
25-
<mat-icon class="info-icon" [inline]="true">info_outline</mat-icon>
26-
</button>
27-
</th>
28-
<td>{{config.baseUrl}}</td>
29-
</tr>
30-
<tr>
31-
<th>Interval (s)
32-
<button class="info-button" mat-icon-button
33-
(click)="showInfo('Interval', 'Observation query and processing frequency time interval in seconds')">
34-
<mat-icon class="info-icon" [inline]="true">info_outline</mat-icon>
35-
</button>
36-
</th>
37-
<td>{{config.intervalSeconds}}</td>
38-
</tr>
39-
<tr>
40-
<th>Startup Interval (s)
41-
<button class="info-button" mat-icon-button
42-
(click)="showInfo('Startup Interval', 'Startup interval in seconds to wait for feature layer processors to be ready')">
43-
<mat-icon class="info-icon" [inline]="true">info_outline</mat-icon>
44-
</button>
45-
</th>
46-
<td>{{config.startupIntervalSeconds}}</td>
47-
</tr>
48-
<tr>
49-
<th>Update Interval (s)
50-
<button class="info-button" mat-icon-button
51-
(click)="showInfo('Update Interval', 'Processing wait time interval in seconds when pending observation updates exist')">
52-
<mat-icon class="info-icon" [inline]="true">info_outline</mat-icon>
53-
</button>
54-
</th>
55-
<td>{{config.updateIntervalSeconds}}</td>
56-
</tr>
57-
<tr>
58-
<th>Batch Size
59-
<button class="info-button" mat-icon-button
60-
(click)="showInfo('Batch Size', 'Maximum number of observations to process during a single time interval')">
61-
<mat-icon class="info-icon" [inline]="true">info_outline</mat-icon>
62-
</button>
63-
</th>
64-
<td>{{config.batchSize}}</td>
65-
</tr>
66-
<tr>
67-
<th>Attachment Tolerance (ms)
68-
<button class="info-button" mat-icon-button
69-
(click)="showInfo('Attachment Tolerance', 'Time tolerance in milliseconds to consider an attachment as modified compared to the observation')">
70-
<mat-icon class="info-icon" [inline]="true">info_outline</mat-icon>
71-
</button>
72-
</th>
73-
<td>{{config.attachmentModifiedTolerance}}</td>
74-
</tr>
75-
</table>
11+
<div style="width: 100%;">
12+
<div class="edit-processing-form">
13+
<div class="edit-enabled-field">
14+
<mat-form-field appearance="fill">
15+
<mat-label>Enabled</mat-label>
16+
<mat-select placeholder="Enabled" [(value)]="editConfig.enabled"
17+
(selectionChange)="setField('enabled', $event.value)">
18+
<mat-option [value]="true">true</mat-option>
19+
<mat-option [value]="false">false</mat-option>
20+
</mat-select>
21+
<mat-hint>Process observations and send to configured ArcGIS feature layers</mat-hint>
22+
</mat-form-field>
23+
</div>
24+
<div class="edit-enabled-field">
25+
<mat-form-field appearance="fill" floatLabel="always">
26+
<mat-label>Base URL</mat-label>
27+
<input type="text" matInput value="{{editConfig.baseUrl}}"
28+
placeholder="https://mock.mage.com"
29+
(keyup)="setField('baseUrl', baseUrlField.value)"
30+
(input)="setField('baseUrl', baseUrlField.value)" #baseUrlField />
31+
<mat-hint>Mage server base URL</mat-hint>
32+
</mat-form-field>
33+
</div>
34+
<div class="edit-interval-field">
35+
<mat-form-field appearance="fill">
36+
<mat-label>Interval</mat-label>
37+
<input type="number" min="0" matInput value="{{editConfig.intervalSeconds}}"
38+
(keyup)="setNumberField('intervalSeconds', intervalSecondsField.value, 0)"
39+
(input)="setNumberField('intervalSeconds', intervalSecondsField.value, 0)" #intervalSecondsField />
40+
<mat-hint>Observation query and processing frequency time interval in seconds</mat-hint>
41+
</mat-form-field>
42+
</div>
43+
<div class="edit-startup-interval-field">
44+
<mat-form-field appearance="fill">
45+
<mat-label>Startup Interval</mat-label>
46+
<input type="number" min="0" matInput value="{{editConfig.startupIntervalSeconds}}"
47+
(keyup)="setNumberField('startupIntervalSeconds', startupIntervalSecondsField.value, 0)"
48+
(input)="setNumberField('startupIntervalSeconds', startupIntervalSecondsField.value, 0)"
49+
#startupIntervalSecondsField />
50+
<mat-hint>Startup interval in seconds to wait for feature layer processors to be ready</mat-hint>
51+
</mat-form-field>
52+
</div>
53+
<div class="edit-update-interval-field">
54+
<mat-form-field appearance="fill">
55+
<mat-label>Update Interval</mat-label>
56+
<input type="number" min="0" matInput value="{{editConfig.updateIntervalSeconds}}"
57+
(keyup)="setNumberField('updateIntervalSeconds', updateIntervalSecondsField.value, 0)"
58+
(input)="setNumberField('updateIntervalSeconds', updateIntervalSecondsField.value, 0)"
59+
#updateIntervalSecondsField />
60+
<mat-hint>Processing wait time interval in seconds when pending observation updates exist</mat-hint>
61+
</mat-form-field>
62+
</div>
63+
<div class="batch-size-field">
64+
<mat-form-field appearance="fill">
65+
<mat-label>Batch Size</mat-label>
66+
<input type="number" min="1" matInput value="{{editConfig.batchSize}}"
67+
(keyup)="setNumberField('batchSize', batchSizeField.value, 1)"
68+
(input)="setNumberField('batchSize', batchSizeField.value, 1)" #batchSizeField />
69+
<mat-hint>Maximum number of observations to process during a single time interval</mat-hint>
70+
</mat-form-field>
71+
</div>
72+
<div class="attachment-modified-tolerance-field">
73+
<mat-form-field appearance="fill">
74+
<mat-label>Attachment Tolerance</mat-label>
75+
<input type="number" min="0" matInput value="{{editConfig.attachmentModifiedTolerance}}"
76+
(keyup)="setNumberField('attachmentModifiedTolerance', attachmentModifiedToleranceField.value, 0)"
77+
(input)="setNumberField('attachmentModifiedTolerance', attachmentModifiedToleranceField.value, 0)"
78+
#attachmentModifiedToleranceField />
79+
<mat-hint>Time tolerance in milliseconds to consider an attachment as modified compared to the observation</mat-hint>
80+
</mat-form-field>
81+
</div>
82+
</div>
7683
</div>
7784
</mat-card-content>
7885
<mat-card-actions>
79-
<button (click)="onEditProcessing()" mat-button>Edit</button>
86+
<button mat-flat-button color="primary" matDialogClose (click)="saveEdit()">SAVE</button>
87+
<button mat-button matDialogClose (click)="cancelEdit()">CANCEL</button>
8088
</mat-card-actions>
8189
</mat-card>
8290
<arc-layer [config]="config" (configChanged)="configChanged($event)"></arc-layer>
@@ -651,104 +659,6 @@ <h3 matDialogTitle>{{infoTitle}}</h3>
651659
</div>
652660
</mat-dialog-content>
653661
</ng-template>
654-
<ng-template #editProcessingDialog let-data>
655-
<h2 matDialogTitle>Processing Configuration</h2>
656-
<mat-dialog-content>
657-
<div class="edit-processing-form">
658-
<div class="edit-enabled-field">
659-
<mat-form-field [style.width.%]="90">
660-
<mat-select placeholder="Enabled" [(value)]="editConfig.enabled"
661-
(selectionChange)="setField('enabled', $event.value)">
662-
<mat-option [value]="true">true</mat-option>
663-
<mat-option [value]="false">false</mat-option>
664-
</mat-select>
665-
</mat-form-field>
666-
<button class="info-button" mat-icon-button
667-
(click)="showInfo('Enabled', 'Process observations and send to configured ArcGIS feature layers')">
668-
<mat-icon class="info-icon" [inline]="true">info_outline</mat-icon>
669-
</button>
670-
</div>
671-
<div class="edit-enabled-field">
672-
<mat-form-field [style.width.%]="90">
673-
<input type="text" matInput value="{{editConfig.baseUrl}}"
674-
(keyup)="setField('baseUrl', baseUrlField.value)"
675-
(input)="setField('baseUrl', baseUrlField.value)" #baseUrlField />
676-
</mat-form-field>
677-
<button class="info-button" mat-icon-button
678-
(click)="showInfo('Base URL', 'Mage server base URL')">
679-
<mat-icon class="info-icon" [inline]="true">info_outline</mat-icon>
680-
</button>
681-
</div>
682-
<div class="edit-interval-field">
683-
<mat-form-field [style.width.%]="90">
684-
<mat-label>Interval</mat-label>
685-
<input type="number" min="0" matInput value="{{editConfig.intervalSeconds}}"
686-
(keyup)="setNumberField('intervalSeconds', intervalSecondsField.value, 0)"
687-
(input)="setNumberField('intervalSeconds', intervalSecondsField.value, 0)" #intervalSecondsField />
688-
</mat-form-field>
689-
<button class="info-button" mat-icon-button
690-
(click)="showInfo('Interval', 'Observation query and processing frequency time interval in seconds')">
691-
<mat-icon class="info-icon" [inline]="true">info_outline</mat-icon>
692-
</button>
693-
</div>
694-
<div class="edit-startup-interval-field">
695-
<mat-form-field [style.width.%]="90">
696-
<mat-label>Startup Interval</mat-label>
697-
<input type="number" min="0" matInput value="{{editConfig.startupIntervalSeconds}}"
698-
(keyup)="setNumberField('startupIntervalSeconds', startupIntervalSecondsField.value, 0)"
699-
(input)="setNumberField('startupIntervalSeconds', startupIntervalSecondsField.value, 0)"
700-
#startupIntervalSecondsField />
701-
</mat-form-field>
702-
<button class="info-button" mat-icon-button
703-
(click)="showInfo('Startup Interval', 'Startup interval in seconds to wait for feature layer processors to be ready')">
704-
<mat-icon class="info-icon" [inline]="true">info_outline</mat-icon>
705-
</button>
706-
</div>
707-
<div class="edit-update-interval-field">
708-
<mat-form-field [style.width.%]="90">
709-
<mat-label>Update Interval</mat-label>
710-
<input type="number" min="0" matInput value="{{editConfig.updateIntervalSeconds}}"
711-
(keyup)="setNumberField('updateIntervalSeconds', updateIntervalSecondsField.value, 0)"
712-
(input)="setNumberField('updateIntervalSeconds', updateIntervalSecondsField.value, 0)"
713-
#updateIntervalSecondsField />
714-
</mat-form-field>
715-
<button class="info-button" mat-icon-button
716-
(click)="showInfo('Update Interval', 'Processing wait time interval in seconds when pending observation updates exist')">
717-
<mat-icon class="info-icon" [inline]="true">info_outline</mat-icon>
718-
</button>
719-
</div>
720-
<div class="batch-size-field">
721-
<mat-form-field [style.width.%]="90">
722-
<mat-label>Batch Size</mat-label>
723-
<input type="number" min="1" matInput value="{{editConfig.batchSize}}"
724-
(keyup)="setNumberField('batchSize', batchSizeField.value, 1)"
725-
(input)="setNumberField('batchSize', batchSizeField.value, 1)" #batchSizeField />
726-
</mat-form-field>
727-
<button class="info-button" mat-icon-button
728-
(click)="showInfo('Batch Size', 'Maximum number of observations to process during a single time interval')">
729-
<mat-icon class="info-icon" [inline]="true">info_outline</mat-icon>
730-
</button>
731-
</div>
732-
<div class="attachment-modified-tolerance-field">
733-
<mat-form-field [style.width.%]="90">
734-
<mat-label>Attachment Tolerance</mat-label>
735-
<input type="number" min="0" matInput value="{{editConfig.attachmentModifiedTolerance}}"
736-
(keyup)="setNumberField('attachmentModifiedTolerance', attachmentModifiedToleranceField.value, 0)"
737-
(input)="setNumberField('attachmentModifiedTolerance', attachmentModifiedToleranceField.value, 0)"
738-
#attachmentModifiedToleranceField />
739-
</mat-form-field>
740-
<button class="info-button" mat-icon-button
741-
(click)="showInfo('Attachment Tolerance', 'Time tolerance in milliseconds to consider an attachment as modified compared to the observation')">
742-
<mat-icon class="info-icon" [inline]="true">info_outline</mat-icon>
743-
</button>
744-
</div>
745-
</div>
746-
</mat-dialog-content>
747-
<mat-dialog-actions align="end">
748-
<button mat-button matDialogClose (click)="cancelEdit()">CANCEL</button>
749-
<button mat-flat-button color="primary" matDialogClose (click)="saveEdit()">SAVE</button>
750-
</mat-dialog-actions>
751-
</ng-template>
752662
<ng-template #editAttributesDialog let-data>
753663
<h2 matDialogTitle>Attributes Configuration</h2>
754664
<mat-dialog-content>
@@ -888,8 +798,8 @@ <h2 matDialogTitle>Attributes Configuration</h2>
888798
</div>
889799
</mat-dialog-content>
890800
<mat-dialog-actions align="end">
891-
<button mat-button matDialogClose (click)="cancelEdit()">CANCEL</button>
892801
<button mat-flat-button color="primary" matDialogClose (click)="saveEdit()">SAVE</button>
802+
<button mat-button matDialogClose (click)="cancelEdit()">CANCEL</button>
893803
</mat-dialog-actions>
894804
</ng-template>
895805
<ng-template #deleteFieldDialog let-data>

plugins/arcgis/web-app/projects/main/src/lib/arc-admin/arc-admin.component.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
padding: 1rem;
88
}
99

10+
.edit-processing-form .mat-form-field {
11+
margin-bottom: 1.5rem !important;
12+
}
13+
1014
section {
1115
>* {
1216
margin-inline-start: 0em;

0 commit comments

Comments
 (0)