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 36278454a..316095fb9 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 @@ -88,80 +88,80 @@

ArcGIS Configuration

MAGE Field to ArcGIS Attribute mappings. -
+
- + Observation Id Field The ArcGIS layer text field attribute name to store the MAGE observation id
- + Id Separator When event id field is not configured, the separator combining observation ids and event ids in the observation id field
- + Event Id Field The ArcGIS layer integer field attribute name to store the MAGE event id
- + Last Edited Date Field The last edited date field attribute name on the ArcGIS layer
- + Event Name Field The ArcGIS layer text field attribute name to store the MAGE event name
- + User Id Field The ArcGIS layer text field attribute name to store the MAGE user id
- + Username Field The ArcGIS layer text field attribute name to store the MAGE username
- + User Display Name Field The ArcGIS layer text field attribute name to store the MAGE user display name
- + Device Id Field The ArcGIS layer text field attribute name to store the MAGE device id
- + Created At Field The ArcGIS layer date time field attribute name to store the MAGE created at date
- + Last Modified Field The ArcGIS layer date time field attribute name to store the MAGE last modified date (may be the @@ -169,7 +169,7 @@

ArcGIS Configuration

- + Geometry Type Field The ArcGIS layer text field attribute name to store the Esri geometry type @@ -177,7 +177,7 @@

ArcGIS 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 995bcb62f..0cd37aa01 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 @@ -181,9 +181,9 @@ section { } -mat-form-field { +.mat-form-field { width: 100%; - margin-bottom: 16px; + margin-bottom: 32px; } mat-card { 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 253fe1e82..c66602f0d 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 @@ -72,59 +72,74 @@ export class ArcAdminComponent implements OnInit { this.config = config; this.configChangedNotifier.next(); } - - //map attribute form to fields +// Visually blank but has underlying value in editConfig ngOnInit(): void { this.attributesForm = this.fb.group({ - observationIdField: [this.editConfig.observationIdField], - idSeparator: [this.editConfig.idSeparator], - eventIdField: [this.editConfig.eventIdField], - lastEditedDateField: [this.editConfig.lastEditedDateField], - eventNameField: [this.editConfig.eventNameField], - userIdField: [this.editConfig.userIdField], - usernameField: [this.editConfig.usernameField], - userDisplayNameField: [this.editConfig.userDisplayNameField], - deviceIdField: [this.editConfig.deviceIdField], - createdAtField: [this.editConfig.createdAtField], - lastModifiedField: [this.editConfig.lastModifiedField], - geometryType: [this.editConfig.geometryType] + observationIdField: [''], + idSeparator: [''], + eventIdField: [''], + lastEditedDateField: [''], + eventNameField: [''], + userIdField: [''], + usernameField: [''], + userDisplayNameField: [''], + deviceIdField: [''], + createdAtField: [''], + lastModifiedField: [''], + geometryType: [''] }); } - //save attributes form + //Save attributes form. If left blank, assign default value onSubmit(): void { + console.log('submitting form...'); + if (this.attributesForm.valid) { const formValue = this.attributesForm.value; - this.editConfig = { ...this.editConfig, - observationIdField: formValue.observationIdField, - idSeparator: formValue.idSeparator, - eventIdField: formValue.eventIdField, - lastEditedDateField: formValue.lastEditedDateField, - eventNameField: formValue.eventNameField, - userIdField: formValue.userIdField, - usernameField: formValue.usernameField, - userDisplayNameField: formValue.userDisplayNameField, - deviceIdField: formValue.deviceIdField, - createdAtField: formValue.createdAtField, - lastModifiedField: formValue.lastModifiedField, - geometryType: formValue.geometryType - }; + observationIdField: formValue.observationIdField || this.editConfig.observationIdField, + idSeparator: formValue.idSeparator || this.editConfig.idSeparator, + eventIdField: formValue.eventIdField || this.editConfig.eventIdField, + lastEditedDateField: formValue.lastEditedDateField || this.editConfig.lastEditedDateField, + eventNameField: formValue.eventNameField || this.editConfig.eventNameField, + userIdField: formValue.userIdField || this.editConfig.userIdField, + usernameField: formValue.usernameField || this.editConfig.usernameField, + userDisplayNameField: formValue.userDisplayNameField || this.editConfig.userDisplayNameField, + deviceIdField: formValue.deviceIdField || this.editConfig.deviceIdField, + createdAtField: formValue.createdAtField || this.editConfig.createdAtField, + lastModifiedField: formValue.lastModifiedField || this.editConfig.lastModifiedField, + geometryType: formValue.geometryType || this.editConfig.geometryType + }; console.log('Form Submitted:', this.editConfig); + console.log('formValue: ', formValue); this.editConfig = this.copyConfig(); } + else{ + console.log('Form is invalid, please correct the errors.') + } } - //when edit attributes is canceled, preserve initial data + //when edit attributes is canceled, display and empty form but preserved data in editConfig onCancel(): void { this.attributesForm.reset({ - ...this.editConfig + observationIdField: '', + idSeparator: '', + eventIdField: '', + lastEditedDateField: '', + eventNameField: '', + userIdField: '', + usernameField: '', + userDisplayNameField: '', + deviceIdField: '', + createdAtField: '', + lastModifiedField: '', + geometryType: '' }); - console.log('Canceled edit'); + console.log('Current data: ', this.editConfig) } handleEventResults(x: MageEvent[]) {