Skip to content

Commit

Permalink
Remove custom geojson layer dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
martinRenou committed Jul 19, 2024
1 parent 205ec99 commit afe6cf0
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 132 deletions.
21 changes: 16 additions & 5 deletions packages/base/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { UUID } from '@lumino/coreutils';
import { Ajv } from 'ajv';
import * as geojson from 'geojson-schema/GeoJSON.json';

import { GeoJSONLayerDialog } from './dialogs/geoJsonLayerDialog';
import { LayerBrowserWidget } from './dialogs/layerBrowserDialog';
import {
DataErrorDialog,
Expand Down Expand Up @@ -340,9 +339,21 @@ namespace Private {
return;
}

const dialog = new GeoJSONLayerDialog({
model: current.context.model,
registry: formSchemaRegistry
const dialog = new CreationFormDialog({
context: current.context,
title: 'Create GeoJSON Layer',
createLayer: true,
createSource: true,
sourceData: {
minZoom: 0,
maxZoom: 0
},
layerData: {
name: 'Custom GeoJSON Layer'
},
sourceType: 'GeoJSONSource',
layerType: 'VectorLayer',
formSchemaRegistry
});
await dialog.launch();
};
Expand All @@ -366,7 +377,7 @@ namespace Private {
createSource: true,
sourceData: {
minZoom: 0,
maxZoom: 0,
maxZoom: 0
},
layerData: {
name: 'Custom Vector Tile Layer'
Expand Down
4 changes: 3 additions & 1 deletion packages/base/src/dialogs/formdialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ export class CreationFormDialog extends Dialog<IDict> {
});

// Disable ok button by default. It will be enabled automatically once the form is valid.
this.node.getElementsByClassName('jp-mod-accept')[0].setAttribute('disabled', '');
this.node
.getElementsByClassName('jp-mod-accept')[0]
.setAttribute('disabled', '');

this.okSignal = new Signal(this);
okSignalPromise.resolve(this.okSignal);
Expand Down
126 changes: 0 additions & 126 deletions packages/base/src/dialogs/geoJsonLayerDialog.tsx

This file was deleted.

3 changes: 3 additions & 0 deletions packages/base/src/formbuilder/objectform/geojsonsource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ export class GeoJSONSourcePropertiesForm extends BaseForm {
return;
}

// This is not user-editable
delete schema.properties.valid;

if (data.path !== '') {
this.removeFormEntry('data', data, schema, uiSchema);
}
Expand Down

0 comments on commit afe6cf0

Please sign in to comment.