Skip to content

Commit

Permalink
Don't use form field title for geopackage column name, as geopackage …
Browse files Browse the repository at this point in the history
…column name is required to be unique
  • Loading branch information
newmanw committed Mar 11, 2024
1 parent f0b853c commit 5bdc810
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
13 changes: 13 additions & 0 deletions service/functionalTests/exports/fixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,19 @@ export const formsSeed: MageFormCreateRequest[] = [
{ id: 3, value: 3, title: 'gold' },
]
},
{
id: 5,
archived: true,
name: 'form1/dropdown3',
required: false,
title: 'Choice 2',
type: FormFieldType.Dropdown,
choices: [
{ id: 1, value: 1, title: 'red' },
{ id: 2, value: 2, title: 'green' },
{ id: 3, value: 3, title: 'gold' },
]
}
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion service/src/export/geopackage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ export class GeoPackage extends Exporter {
dataColumn: {
column_name: field.name,
table_name: 'Form_' + form.id,
name: field.title,
name: field.name,
title: field.title
},
name: field.name,
Expand Down
2 changes: 1 addition & 1 deletion service/test/export/geopackageTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ describe("geopackage export tests", function () {
const writable = new TestWritableStream();
writable.on('finish', async () => {
const zip = await JSZip.loadAsync(writable.byteArray);
const jsobj = zip.files['mage-' + event.name + '.gpkg'];
const jsobj = zip.files['MAGE ' + event.name + '.gpkg'];
expect(jsobj).to.be.not.undefined;

const gpkg = await jsobj.async('nodebuffer');
Expand Down

0 comments on commit 5bdc810

Please sign in to comment.