Skip to content

Commit

Permalink
add boundary form validation and table permissions update
Browse files Browse the repository at this point in the history
  • Loading branch information
RODO94 committed Jul 5, 2024
1 parent c37bc8c commit 1a28987
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,12 @@ export default function BoundaryForm({ formikConfig, onSuccess }: FormProps) {
onSubmit: async (values, { resetForm }) => {
try {
const { data } = await axios.get(`${values.boundaryUrl}.geojson`);

//lambeth: 626195
//bmingham: 8600271
const bboxPoly = bboxPolygon(bbox(data));
const bboxFeature = feature(bboxPoly.geometry);

const isUpdateSuccess = await useStore.getState().updateTeamSettings({
boundaryUrl: values.boundaryUrl,
boundaryBbox: data,
boundaryBbox: bboxFeature,
});
if (isUpdateSuccess) {
onSuccess();
Expand Down
2 changes: 2 additions & 0 deletions hasura.planx.uk/metadata/tables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1729,6 +1729,7 @@
- role: platformAdmin
permission:
columns:
- boundary_bbox
- boundary_url
- email_reply_to_id
- external_planning_site_name
Expand All @@ -1744,6 +1745,7 @@
- role: teamEditor
permission:
columns:
- boundary_bbox
- boundary_url
- email_reply_to_id
- external_planning_site_name
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@
"tests": "./scripts/start-containers-for-tests.sh",
"analytics": "docker compose -f ./docker-compose.yml -f ./docker-compose.local.yml --profile mock-services --profile analytics up -d --quiet-pull",
"logs": "docker compose logs --tail 30 -f"
},
"dependencies": {
"@types/geojson": "^7946.0.14"
}
}
11 changes: 11 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1a28987

Please sign in to comment.