Skip to content

Commit

Permalink
Modifications after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
brichet committed Jul 10, 2024
1 parent 049be7f commit dde64eb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
12 changes: 5 additions & 7 deletions packages/base/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@ import { PathExt } from '@jupyterlab/coreutils';
import { ITranslator } from '@jupyterlab/translation';
import { redoIcon, undoIcon } from '@jupyterlab/ui-components';
import {
IDict,
IGeoJSONSource,
IJGISFormSchemaRegistry,
IJGISLayer,
IJGISLayerBrowserRegistry,
IJGISSource
IJGISSource,
IJupyterGISModel
} from '@jupytergis/schema';
import { UUID } from '@lumino/coreutils';
import { Ajv } from 'ajv';
import * as geojson from 'geojson-schema/GeoJSON.json';

import { DataErrorDialog, DialogAddDataSourceBody } from './formdialog';
import { DataErrorDialog, DialogAddDataSourceBody, FormDialog } from './formdialog';
import { geoJSONIcon } from './icons';
import { LayerBrowserWidget } from './layerBrowser/layerBrowserDialog';
import { JupyterGISWidget } from './widget';
Expand Down Expand Up @@ -252,8 +255,6 @@ namespace Private {
}
};

current.context.model.syncFormData(form);

FORM_SCHEMA['VectorLayer'].properties.source.enumNames =
Object.values(sources);
FORM_SCHEMA['VectorLayer'].properties.source.enum = Object.keys(sources);
Expand Down Expand Up @@ -283,9 +284,6 @@ namespace Private {
};

current.context.model.addLayer(UUID.uuid4(), layerModel);
},
cancelButton: () => {
current.context.model.syncFormData(undefined);
}
});
await dialog.launch();
Expand Down
9 changes: 2 additions & 7 deletions packages/base/src/panelview/formbuilder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -407,11 +407,6 @@ export class GeoJSONSourcePropertiesForm extends ObjectPropertiesForm {
}
};

const internalData = this.state.internalData;
if (internalData) {
internalData.path = path;
}

this.props.model
.readGeoJSON(path)
.then(async geoJSONData => {
Expand All @@ -422,11 +417,11 @@ export class GeoJSONSourcePropertiesForm extends ObjectPropertiesForm {
extraErrors.path.__errors.push(error.message);
});
}
this.setState({ extraErrors, internalData });
this.setState({ extraErrors });
})
.catch(e => {
extraErrors.path.__errors = ['Invalid path'];
this.setState({ extraErrors, internalData });
this.setState({ extraErrors });
});
}

Expand Down

0 comments on commit dde64eb

Please sign in to comment.