Skip to content

Commit cdf4d5b

Browse files
committed
Merge branch 'fix-observation-sync' of https://github.com/ngageoint/mage-server into add-arcgis-docs
2 parents ccd0d75 + db73111 commit cdf4d5b

File tree

3 files changed

+20
-27
lines changed

3 files changed

+20
-27
lines changed

plugins/arcgis/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Build with arcgis plugin
22

3+
This plugin allows for MAGE observation data to be passed to an Arcgis feature service.
34
Follow the instructions in the root README. After completing the web-app package install and build in the 'Building from source' section:
45

56
Build arcgis plugin:

plugins/arcgis/service/src/AddLayersRequest.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ export interface Field {
2121
alias: string
2222
sqlType: string
2323
length: number
24-
nullable: boolean
2524
editable: boolean
2625
domain?: string
2726
defaultValue?: unknown

plugins/arcgis/service/src/FeatureServiceAdmin.ts

Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -183,33 +183,33 @@ export class FeatureServiceAdmin {
183183
private fields(events: MageEvent[]): Field[] {
184184
const fields: Field[] = [];
185185

186-
fields.push(this.createTextField(this._config.observationIdField, false));
186+
fields.push(this.createTextField(this._config.observationIdField));
187187
if (this._config.eventIdField != null) {
188-
fields.push(this.createIntegerField(this._config.eventIdField, false));
188+
fields.push(this.createIntegerField(this._config.eventIdField));
189189
}
190190
if (this._config.eventNameField != null) {
191-
fields.push(this.createTextField(this._config.eventNameField, true));
191+
fields.push(this.createTextField(this._config.eventNameField));
192192
}
193193
if (this._config.userIdField != null) {
194-
fields.push(this.createTextField(this._config.userIdField, true));
194+
fields.push(this.createTextField(this._config.userIdField));
195195
}
196196
if (this._config.usernameField != null) {
197-
fields.push(this.createTextField(this._config.usernameField, true));
197+
fields.push(this.createTextField(this._config.usernameField));
198198
}
199199
if (this._config.userDisplayNameField != null) {
200-
fields.push(this.createTextField(this._config.userDisplayNameField, true));
200+
fields.push(this.createTextField(this._config.userDisplayNameField));
201201
}
202202
if (this._config.deviceIdField != null) {
203-
fields.push(this.createTextField(this._config.deviceIdField, true));
203+
fields.push(this.createTextField(this._config.deviceIdField));
204204
}
205205
if (this._config.createdAtField != null) {
206-
fields.push(this.createDateTimeField(this._config.createdAtField, true));
206+
fields.push(this.createDateTimeField(this._config.createdAtField));
207207
}
208208
if (this._config.lastModifiedField != null) {
209-
fields.push(this.createDateTimeField(this._config.lastModifiedField, true));
209+
fields.push(this.createDateTimeField(this._config.lastModifiedField));
210210
}
211211
if (this._config.geometryType != null) {
212-
fields.push(this.createTextField(this._config.geometryType, true));
212+
fields.push(this.createTextField(this._config.geometryType));
213213
}
214214

215215
const fieldNames = new Set<string>();
@@ -226,16 +226,14 @@ export class FeatureServiceAdmin {
226226
* Create a field
227227
* @param {string} name field name
228228
* @param {FormFieldType} type form field type
229-
* @param {boolean} nullable nullable flag
230229
* @param {boolean} [integer] integer flag when numeric
231230
* @returns {Field} field
232231
*/
233-
private createField(name: string, type: FormFieldType, nullable: boolean, integer?: boolean): Field {
232+
private createField(name: string, type: FormFieldType, integer?: boolean): Field {
234233
const field = this.initField(type, integer) as Field;
235234
if (field != null) {
236235
field.name = ObservationsTransformer.replaceSpaces(name);
237236
field.alias = field.name;
238-
field.nullable = nullable;
239237
field.editable = true;
240238
}
241239
return field;
@@ -244,42 +242,38 @@ export class FeatureServiceAdmin {
244242
/**
245243
* Create a text field
246244
* @param {string} name field name
247-
* @param {boolean} nullable nullable flag
248245
* @returns {Field} field
249246
*/
250-
private createTextField(name: string, nullable: boolean): Field {
251-
return this.createField(name, FormFieldType.Text, nullable);
247+
private createTextField(name: string): Field {
248+
return this.createField(name, FormFieldType.Text);
252249
}
253250

254251
/**
255252
* Create a numeric field
256253
* @param {string} name field name
257-
* @param {boolean} nullable nullable flag
258254
* @param {boolean} [integer] integer flag
259255
* @returns {Field} field
260256
*/
261-
private createNumericField(name: string, nullable: boolean, integer?: boolean): Field {
262-
return this.createField(name, FormFieldType.Numeric, nullable, integer);
257+
private createNumericField(name: string, integer?: boolean): Field {
258+
return this.createField(name, FormFieldType.Numeric, integer);
263259
}
264260

265261
/**
266262
* Create an integer field
267263
* @param {string} name field name
268-
* @param {boolean} nullable nullable flag
269264
* @returns {Field} field
270265
*/
271-
private createIntegerField(name: string, nullable: boolean): Field {
272-
return this.createNumericField(name, nullable, true);
266+
private createIntegerField(name: string): Field {
267+
return this.createNumericField(name, true);
273268
}
274269

275270
/**
276271
* Create a date time field
277272
* @param {string} name field name
278-
* @param {boolean} nullable nullable flag
279273
* @returns {Field} field
280274
*/
281-
private createDateTimeField(name: string, nullable: boolean): Field {
282-
return this.createField(name, FormFieldType.DateTime, nullable);
275+
private createDateTimeField(name: string): Field {
276+
return this.createField(name, FormFieldType.DateTime);
283277
}
284278

285279
/**
@@ -336,7 +330,6 @@ export class FeatureServiceAdmin {
336330

337331
field.name = name;
338332
field.alias = field.name;
339-
field.nullable = !formField.required;
340333
field.editable = true;
341334
field.defaultValue = formField.value;
342335

0 commit comments

Comments
 (0)