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 b0a5a6cba..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 @@ -1,196 +1,189 @@

ArcGIS Configuration

-
-
-

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}}
-
-
- - -
-
-

Attributes

-

MAGE Field to ArcGIS Attribute mappings.

-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Observation Id Field - - {{config.observationIdField}}
Id Separator - - {{config.idSeparator}}
Event Id Field - - {{config.eventIdField}}
Last Edited Date Field - - {{config.lastEditedDateField}}
Event Name Field - - {{config.eventNameField}}
User Id Field - - {{config.userIdField}}
Username Field - - {{config.usernameField}}
User Display Name Field - - {{config.userDisplayNameField}}
Device Id Field - - {{config.deviceIdField}}
Created At Field - - {{config.createdAtField}}
Last Modified Field - - {{config.lastModifiedField}}
Geometry Type Field - - {{config.geometryType}}
-
+ + + + 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}}
+
+
+ + + +
+ + +
+ + + Attributes + 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 + same as last edited date field if editable) + +
+
+ + Geometry Type Field + + The ArcGIS layer text field attribute name to store the Esri geometry type + +
+
+ + +
+
+
+
+
+
Field Mappings
+ +
+

ArcGIS layers that MAGE event named {{currentEditingEvent.name}} is synchronizing

@@ -48,4 +54,5 @@

ArcGIS layers that MAGE event named {{currentEditingEvent.nam - \ No newline at end of file + +

\ No newline at end of file diff --git a/plugins/arcgis/web-app/projects/main/src/lib/arc-layer/arc-layer-delete-dialog.component.spec.ts b/plugins/arcgis/web-app/projects/main/src/lib/arc-layer/arc-layer-delete-dialog.component.spec.ts index 826571959..e476864f3 100644 --- a/plugins/arcgis/web-app/projects/main/src/lib/arc-layer/arc-layer-delete-dialog.component.spec.ts +++ b/plugins/arcgis/web-app/projects/main/src/lib/arc-layer/arc-layer-delete-dialog.component.spec.ts @@ -1,29 +1,40 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { HttpClientTestingModule } from '@angular/common/http/testing'; -import { MatDialogRef } from '@angular/material/dialog'; +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { HttpClientModule } from '@angular/common/http'; +import { MatDialogModule } from '@angular/material/dialog'; import { ArcLayerDeleteDialogComponent } from './arc-layer-delete-dialog.component'; +import { ArcService } from '../arc.service' describe('Arc Layer Delete Dialog', () => { let component: ArcLayerDeleteDialogComponent; let fixture: ComponentFixture; - beforeEach(waitForAsync(() => { - TestBed.configureTestingModule({ + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [HttpClientModule, MatDialogModule], declarations: [ArcLayerDeleteDialogComponent], - imports: [HttpClientTestingModule], - providers: [{ - provide: MatDialogRef, - useValue: {} - },] + providers: [ + { + provide: MatDialogRef, + useValue: { + close: jasmine.createSpy('close') + } + }, + { + provide: MAT_DIALOG_DATA, + useValue: {} + }, + ArcService + ] }).compileComponents(); - })); + }); beforeEach(() => { fixture = TestBed.createComponent(ArcLayerDeleteDialogComponent); component = fixture.componentInstance; + fixture.detectChanges(); }); - it('should create', () => { expect(component).toBeTruthy(); }); diff --git a/plugins/arcgis/web-app/projects/main/src/lib/arc-layer/arc-layer-dialog.component.spec.ts b/plugins/arcgis/web-app/projects/main/src/lib/arc-layer/arc-layer-dialog.component.spec.ts index 79b6b67a4..0e844e44d 100644 --- a/plugins/arcgis/web-app/projects/main/src/lib/arc-layer/arc-layer-dialog.component.spec.ts +++ b/plugins/arcgis/web-app/projects/main/src/lib/arc-layer/arc-layer-dialog.component.spec.ts @@ -1,29 +1,40 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { HttpClientTestingModule } from '@angular/common/http/testing'; -import { MatDialogRef } from '@angular/material/dialog'; +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { HttpClientModule } from '@angular/common/http'; +import { MatDialogModule } from '@angular/material/dialog'; import { ArcLayerDialogComponent } from './arc-layer-dialog.component'; +import { ArcService } from '../arc.service'; describe('Arc Layer Dialog', () => { let component: ArcLayerDialogComponent; let fixture: ComponentFixture; - beforeEach(waitForAsync(() => { - TestBed.configureTestingModule({ + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [HttpClientModule, MatDialogModule], declarations: [ArcLayerDialogComponent], - imports: [HttpClientTestingModule], - providers: [{ - provide: MatDialogRef, - useValue: {} - },] + providers: [ + { + provide: MatDialogRef, + useValue: { + close: jasmine.createSpy('close') + } + }, + { + provide: MAT_DIALOG_DATA, + useValue: {} + }, + ArcService + ] }).compileComponents(); - })); + }); beforeEach(() => { fixture = TestBed.createComponent(ArcLayerDialogComponent); component = fixture.componentInstance; + fixture.detectChanges(); }); - it('should create', () => { expect(component).toBeTruthy(); }); diff --git a/plugins/arcgis/web-app/projects/main/src/lib/arc-layer/arc-layer.component.html b/plugins/arcgis/web-app/projects/main/src/lib/arc-layer/arc-layer.component.html index 931d1c6e6..19f2ad22e 100644 --- a/plugins/arcgis/web-app/projects/main/src/lib/arc-layer/arc-layer.component.html +++ b/plugins/arcgis/web-app/projects/main/src/lib/arc-layer/arc-layer.component.html @@ -1,4 +1,5 @@
+

Feature Layers

@@ -34,4 +35,5 @@

Feature Layers

+ \ No newline at end of file diff --git a/plugins/arcgis/web-app/projects/main/src/lib/arc-layer/arc-layer.component.scss b/plugins/arcgis/web-app/projects/main/src/lib/arc-layer/arc-layer.component.scss index 0336d7fab..b4b3333cb 100644 --- a/plugins/arcgis/web-app/projects/main/src/lib/arc-layer/arc-layer.component.scss +++ b/plugins/arcgis/web-app/projects/main/src/lib/arc-layer/arc-layer.component.scss @@ -83,4 +83,8 @@ section { height: inherit; line-height: inherit; width: inherit; -} \ No newline at end of file +} + +mat-card { + margin-bottom: 16px; + } \ No newline at end of file diff --git a/plugins/arcgis/web-app/projects/showcase/src/app/app.component.spec.ts b/plugins/arcgis/web-app/projects/showcase/src/app/app.component.spec.ts index bb71eca86..696225048 100644 --- a/plugins/arcgis/web-app/projects/showcase/src/app/app.component.spec.ts +++ b/plugins/arcgis/web-app/projects/showcase/src/app/app.component.spec.ts @@ -1,35 +1,23 @@ -import { TestBed } from '@angular/core/testing'; -import { RouterTestingModule } from '@angular/router/testing'; +import { ComponentFixture, TestBed } from '@angular/core/testing'; import { AppComponent } from './app.component'; describe('AppComponent', () => { + let component: AppComponent; + let fixture: ComponentFixture; + beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ - RouterTestingModule - ], - declarations: [ - AppComponent - ], + declarations: [AppComponent], }).compileComponents(); }); - it('should create the app', () => { - const fixture = TestBed.createComponent(AppComponent); - const app = fixture.componentInstance; - expect(app).toBeTruthy(); - }); - - it(`should have as title 'showcase'`, () => { - const fixture = TestBed.createComponent(AppComponent); - const app = fixture.componentInstance; - expect(app.title).toEqual('showcase'); + beforeEach(() => { + fixture = TestBed.createComponent(AppComponent); + component = fixture.componentInstance; + fixture.detectChanges(); }); - it('should render title', () => { - const fixture = TestBed.createComponent(AppComponent); - fixture.detectChanges(); - const compiled = fixture.nativeElement as HTMLElement; - expect(compiled.querySelector('.content span')?.textContent).toContain('showcase app is running!'); + it('should create the app component', () => { + expect(component).toBeTruthy(); }); }); diff --git a/plugins/arcgis/web-app/projects/showcase/src/app/arc.service.mock.ts b/plugins/arcgis/web-app/projects/showcase/src/app/arc.service.mock.ts index 0a5ee0709..1fee9ae29 100644 --- a/plugins/arcgis/web-app/projects/showcase/src/app/arc.service.mock.ts +++ b/plugins/arcgis/web-app/projects/showcase/src/app/arc.service.mock.ts @@ -24,7 +24,49 @@ export class MockArcService implements ArcServiceInterface { throw new Error("Method not implemented."); } fetchArcConfig(): Observable { - return of(defaultArcGISPluginConfig) + return of({ + enabled: true, + baseUrl: 'https://mock.mage.com', + intervalSeconds: 60, + startupIntervalSeconds: 1, + updateIntervalSeconds: 1, + batchSize: 100, + featureServices: [], + attachmentModifiedTolerance: 5000, + textFieldLength: 100, + textAreaFieldLength: 256, + observationIdField: 'mock_description', + idSeparator: 'mock-', + eventIdField: 'mock_event_id', + lastEditedDateField: 'mock_last_edited_date', + eventNameField: 'mock_event_name', + userIdField: 'mock_user_id', + usernameField: 'mock_username', + userDisplayNameField: 'mock_user_display_name', + deviceIdField: 'mock_device_id', + createdAtField: 'mock_created_at', + lastModifiedField: 'mock_last_modified', + geometryType: 'mock_geometry_type', + fieldAttributes: {}, + attributes: { + 'symbolid': { + defaults: [ + { + value: 3, + condition: [ + { attribute: 'geometry_type', values: ['esriGeometryPolyline'] } + ] + }, + { + value: 1, + condition: [ + { attribute: 'geometry_type', values: ['esriGeometryPolygon'] } + ] + } + ] + } + } + }) } fetchArcLayers(featureUrl: string) {