diff --git a/plugins/arcgis/service/src/index.ts b/plugins/arcgis/service/src/index.ts index 97e32caa8..544fb8fd2 100644 --- a/plugins/arcgis/service/src/index.ts +++ b/plugins/arcgis/service/src/index.ts @@ -36,12 +36,12 @@ const InjectedServices = { const pluginWebRoute = "plugins/@ngageoint/mage.arcgis.service" -const sanitizeFeatureService = async (config: FeatureServiceConfig, identityService: ArcGISIdentityService): Promise> => { +const sanitizeFeatureService = async (config: FeatureServiceConfig, identityService: ArcGISIdentityService): Promise> => { let authenticated = false try { await identityService.signin(config) authenticated = true - } catch(ignore) {} + } catch (ignore) { } const { identityManager, ...sanitized } = config; return { ...sanitized, authenticated } @@ -133,7 +133,7 @@ const arcgisPluginHooks: InitPluginHook = { `); - }).catch((error) => res.status(400).json(error)) + }).catch((error) => res.status(400).json(error)) }) return routes @@ -167,7 +167,7 @@ const arcgisPluginHooks: InitPluginHook = { const config = await stateRepo.get() const { featureServices: updatedServices, ...updateConfig } = req.body - + // Convert event names to event IDs // Fetch all events and create a mapping of event names to event IDs const allEvents = await eventRepo.findAll(); @@ -176,7 +176,7 @@ const arcgisPluginHooks: InitPluginHook = { eventNameToIdMap.set(event.name, event.id); }); - // Process the incoming feature services with eventIds instead of event names + // Process the incoming feature services with eventIds instead of event names const featureServices: FeatureServiceConfig[] = updatedServices.map((updateService: any) => { const existingService = config.featureServices.find( (featureService: FeatureServiceConfig) => featureService.url === updateService.url @@ -206,12 +206,12 @@ const arcgisPluginHooks: InitPluginHook = { url: updateService.url, layers: layers, // Map exisiting identityManager, client does not send this - identityManager: existingService?.identityManager, + identityManager: existingService?.identityManager || '', }; }); - + await stateRepo.patch({ ...updateConfig, featureServices }) - + // Sync configuration with feature servers by restarting observation processor processor.stop() processor.start() @@ -229,7 +229,7 @@ const arcgisPluginHooks: InitPluginHook = { let service: FeatureServiceConfig let identityManager: ArcGISIdentityManager if (token) { - identityManager = await ArcGISIdentityManager.fromToken({ token }) + identityManager = await ArcGISIdentityManager.fromToken({ token }) service = { url, layers: [], identityManager: identityManager.serialize() } } else if (username && password) { identityManager = await ArcGISIdentityManager.signIn({ @@ -255,7 +255,7 @@ const arcgisPluginHooks: InitPluginHook = { return res.send('Invalid credentials provided to communicate with feature service').status(400) } }) - + routes.get('/featureService/layers', async (req, res, next) => { const url = req.query.featureServiceUrl as string const config = await processor.safeGetConfig() diff --git a/plugins/arcgis/web-app/projects/main/src/lib/arc-admin/arc-admin.component.html b/plugins/arcgis/web-app/projects/main/src/lib/arc-admin/arc-admin.component.html index 316095fb9..d09362254 100644 --- a/plugins/arcgis/web-app/projects/main/src/lib/arc-admin/arc-admin.component.html +++ b/plugins/arcgis/web-app/projects/main/src/lib/arc-admin/arc-admin.component.html @@ -3,80 +3,88 @@

ArcGIS Configuration

- Processing + Processing MAGE ArcGIS plugin processing settings. -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Enabled - - {{config.enabled}}
Base URL - - {{config.baseUrl}}
Interval (s) - - {{config.intervalSeconds}}
Startup Interval (s) - - {{config.startupIntervalSeconds}}
Update Interval (s) - - {{config.updateIntervalSeconds}}
Batch Size - - {{config.batchSize}}
Attachment Tolerance (ms) - - {{config.attachmentModifiedTolerance}}
+
+
+
+ + Enabled + + true + false + + Process observations and send to configured ArcGIS feature layers + +
+
+ + Base URL + + Mage server base URL + +
+
+ + Interval + + Observation query and processing frequency time interval in seconds + +
+
+ + Startup Interval + + Startup interval in seconds to wait for feature layer processors to be ready + +
+
+ + Update Interval + + Processing wait time interval in seconds when pending observation updates exist + +
+
+ + Batch Size + + Maximum number of observations to process during a single time interval + +
+
+ + Attachment Tolerance + + Time tolerance in milliseconds to consider an attachment as modified compared to the observation + +
+
- + + @@ -651,104 +659,6 @@

{{infoTitle}}

- -

Processing Configuration

- -
-
- - - true - false - - - -
-
- - - - -
-
- - Interval - - - -
-
- - Startup Interval - - - -
-
- - Update Interval - - - -
-
- - Batch Size - - - -
-
- - Attachment Tolerance - - - -
-
-
- - - - -

Attributes Configuration

@@ -888,8 +798,8 @@

Attributes Configuration

- +
diff --git a/plugins/arcgis/web-app/projects/main/src/lib/arc-admin/arc-admin.component.scss b/plugins/arcgis/web-app/projects/main/src/lib/arc-admin/arc-admin.component.scss index 0cd37aa01..f308245d6 100644 --- a/plugins/arcgis/web-app/projects/main/src/lib/arc-admin/arc-admin.component.scss +++ b/plugins/arcgis/web-app/projects/main/src/lib/arc-admin/arc-admin.component.scss @@ -7,6 +7,10 @@ padding: 1rem; } +.edit-processing-form .mat-form-field { + margin-bottom: 1.5rem !important; +} + section { >* { margin-inline-start: 0em; diff --git a/plugins/arcgis/web-app/projects/main/src/lib/arc-admin/arc-admin.component.ts b/plugins/arcgis/web-app/projects/main/src/lib/arc-admin/arc-admin.component.ts index 6d8ff2336..5171c4ea3 100644 --- a/plugins/arcgis/web-app/projects/main/src/lib/arc-admin/arc-admin.component.ts +++ b/plugins/arcgis/web-app/projects/main/src/lib/arc-admin/arc-admin.component.ts @@ -57,7 +57,7 @@ export class ArcAdminComponent implements OnInit { constructor(private arcService: ArcService, private dialog: MatDialog, private fb: FormBuilder) { this.config = defaultArcGISPluginConfig; - this.editConfig = defaultArcGISPluginConfig; + this.editConfig = this.copyConfig(); this.editFieldMappings = false; this.attributesForm = this.fb.group({ observationIdField: [''], @@ -79,6 +79,7 @@ export class ArcAdminComponent implements OnInit { if (!this.config.baseUrl) { this.config.baseUrl = window.location.origin } + this.editConfig = this.copyConfig(); arcService.fetchPopulatedEvents().subscribe(x => this.handleEventResults(x)); }) } @@ -141,7 +142,7 @@ export class ArcAdminComponent implements OnInit { console.log('Form Submitted:', this.editConfig); console.log('formValue: ', formValue); - this.editConfig = this.copyConfig(); + this.saveEdit(); } else{ console.log('Form is invalid, please correct the errors.') @@ -192,11 +193,6 @@ export class ArcAdminComponent implements OnInit { this.saveConfig(); } - onEditProcessing() { - this.editConfig = this.copyConfig() - this.dialog.open(this.editProcessingTemplate) - } - setField(field: string, value: any) { if (value != undefined && value.length == 0) { value = undefined @@ -303,6 +299,7 @@ export class ArcAdminComponent implements OnInit { cancelEdit() { console.log('Canceled configuration edit') + this.editConfig = this.copyConfig(); } keys(value: any): string[] {