Skip to content

Commit

Permalink
[service] prepend form name to all event form fields for clarity and …
Browse files Browse the repository at this point in the history
…to avoid ESRI column name conflicts
  • Loading branch information
newmanw committed Nov 1, 2024
1 parent 07986a6 commit 8592110
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions plugins/arcgis/service/src/FeatureServiceAdmin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,16 +352,13 @@ export class FeatureServiceAdmin {
* @param fieldNames set of all field names
*/
private createFormField(form: Form, formField: FormField, fields: Field[], fieldNames: Set<string>) {

const field = this.initField(formField.type)

if (field != null) {

let name = ObservationsTransformer.replaceSpaces(formField.title)

if (fieldNames.has(name)) {
name = form.name + '_' + name
}
const sanitizedName = ObservationsTransformer.replaceSpaces(formField.title)
const sanitizedFormName = ObservationsTransformer.replaceSpaces(form.name)
const name = `${sanitizedFormName}_${sanitizedName}`

fieldNames.add(name)

field.name = name
Expand All @@ -372,7 +369,6 @@ export class FeatureServiceAdmin {

fields.push(field)
}

}

/**
Expand Down

0 comments on commit 8592110

Please sign in to comment.