Skip to content

Commit c817894

Browse files
authored
Added imagery JSON URL field under External Apps section in workspaces settings page (#9)
This pull request enhances the workspace settings page by adding support for uploading, validating, and saving external application configurations, specifically for "Imagery JSON Definition" and "Long Form Quest JSON Definition". It introduces JSON schema validation for the imagery configuration, improves the user interface with drag-and-drop file support, and updates documentation and dependencies accordingly. **External app configuration enhancements:** * Added two new configuration fields to the workspace settings page: "AVIV ScoutRoute Long Form Quest JSON Definition" and "Imagery JSON Definition", both supporting direct JSON input or drag-and-drop file upload. Helpful links to schema and example files are provided for both. ([pages/workspace/[id]/settings.vueL33-R77](diffhunk://#diff-df660f7ed890a7937381f40d9ea64aafa7852e4f8a13ebd03f31b4a360dbe5a1L33-R77)) * Implemented drag-and-drop handlers for both configuration fields, with visual feedback and error handling for invalid files. ([pages/workspace/[id]/settings.vueL33-R77](diffhunk://#diff-df660f7ed890a7937381f40d9ea64aafa7852e4f8a13ebd03f31b4a360dbe5a1L33-R77), [pages/workspace/[id]/settings.vueL94-R136](diffhunk://#diff-df660f7ed890a7937381f40d9ea64aafa7852e4f8a13ebd03f31b4a360dbe5a1L94-R136), [pages/workspace/[id]/settings.vueL124-R247](diffhunk://#diff-df660f7ed890a7937381f40d9ea64aafa7852e4f8a13ebd03f31b4a360dbe5a1L124-R247), [pages/workspace/[id]/settings.vueR261-R268](diffhunk://#diff-df660f7ed890a7937381f40d9ea64aafa7852e4f8a13ebd03f31b4a360dbe5a1R261-R268)) **Validation and saving logic:** * Integrated `ajv` and `ajv-formats` libraries to validate the "Imagery JSON Definition" against a remote JSON schema before saving. User receives clear feedback if the JSON is invalid or does not match the schema. ([package.jsonR15-R16](diffhunk://#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R15-R16), [pages/workspace/[id]/settings.vueR117-R118](diffhunk://#diff-df660f7ed890a7937381f40d9ea64aafa7852e4f8a13ebd03f31b4a360dbe5a1R117-R118), [pages/workspace/[id]/settings.vueL124-R247](diffhunk://#diff-df660f7ed890a7937381f40d9ea64aafa7852e4f8a13ebd03f31b4a360dbe5a1L124-R247)) * Updated the save logic to persist both the imagery and quest definitions together, with improved error handling and success messages. ([pages/workspace/[id]/settings.vueL124-R247](diffhunk://#diff-df660f7ed890a7937381f40d9ea64aafa7852e4f8a13ebd03f31b4a360dbe5a1L124-R247)) **Documentation and environment variables:** * Added new environment variables in `README.md` for the imagery and quest schema/example URLs, ensuring the frontend can dynamically link to the correct resources. **Dependency updates:** * Added `ajv` and `ajv-formats` as new dependencies in `package.json` for JSON schema validation. Ticket: https://dev.azure.com/TDEI-UW/TDEI/_workitems/edit/2326 <img width="1624" height="977" alt="2326" src="https://github.com/user-attachments/assets/c1cbd491-3d3c-4b81-81e2-183ff7eb1fa4" />
2 parents 4ba2136 + 24b9e6e commit c817894

File tree

4 files changed

+299
-61
lines changed

4 files changed

+299
-61
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.
44

5-
### ⚠️ Reminder: you must set the tag of the environment you wish to deploy in this repo, then run the deploy workflow in workspaces-stack to deploy to dev, stage or prod.
5+
### ⚠️ Reminder: you must set the tag of the environment you wish to deploy in this repo, then run the deploy workflow in workspaces-stack to deploy to dev, stage or prod.
66

77
## Dev Setup
88

99
NB: This will start the dev server against the cloud-hosted backend. If you need to change both the frontend and the backend, you'll
10-
need to start a local copy of the backend (workspaces-tasking-manager) and set the environment vars appropriately below.
10+
need to start a local copy of the backend (workspaces-tasking-manager) and set the environment vars appropriately below.
1111

1212
The below values are for cloud-hosted dev:
1313

@@ -19,6 +19,10 @@ export VITE_OSM_URL=https://osm.workspaces-dev.sidewalks.washington.edu/
1919
export VITE_RAPID_URL=https://rapid.workspaces-dev.sidewalks.washington.edu/
2020
export VITE_PATHWAYS_EDITOR_URL=https://pathways.workspaces-dev.sidewalks.washington.edu/
2121
export CODE_VERSION="local"
22+
export VITE_IMAGERY_SCHEMA=https://raw.githubusercontent.com/TaskarCenterAtUW/tdei-tools/main/docs/imagery-layer/schema.json
23+
export VITE_IMAGERY_EXAMPLE_URL=https://raw.githubusercontent.com/TaskarCenterAtUW/tdei-tools/main/docs/imagery-layer/example.json
24+
export VITE_LONG_FORM_QUEST_SCHEMA=https://raw.githubusercontent.com/TaskarCenterAtUW/tdei-tools/refs/heads/main/docs/quest-definition/schema.json
25+
export VITE_LONG_FORM_QUEST_EXAMPLE_URL=https://raw.githubusercontent.com/TaskarCenterAtUW/tdei-tools/refs/heads/main/docs/quest-definition/example.json
2226
2327
# install deps
2428
npm install

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
},
1212
"dependencies": {
1313
"@zip.js/zip.js": "^2.7.41",
14+
"ajv": "^8.17.1",
15+
"ajv-formats": "^3.0.1",
1416
"bootstrap": "^5.3.3",
1517
"js-cookie": "^3.0.5",
1618
"nuxt": "^4.0.0",

0 commit comments

Comments
 (0)