Skip to content

Commit

Permalink
add: check json during precommit checks
Browse files Browse the repository at this point in the history
  • Loading branch information
mahesh-naxa committed May 3, 2024
1 parent 0b54581 commit 2a43844
Show file tree
Hide file tree
Showing 53 changed files with 3,859,223 additions and 26,817 deletions.
18 changes: 9 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ repos:
language: python
types: [text]

# - id: pretty-format-json
# name: pretty format json
# description: sets a standard for formatting json files.
# entry: pretty-format-json
# language: python
# types: [text]
# files: \.(json)$
# args:
# - "--autofix"
- id: pretty-format-json
name: pretty format json
description: sets a standard for formatting json files.
entry: pretty-format-json
language: python
types: [text]
files: \.(json)$
args:
- "--autofix"

- id: check-merge-conflict
name: check for merge conflicts
Expand Down
52 changes: 26 additions & 26 deletions backend/error_messages.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
{
"NOT_FOUND": "The requested resource was not found on the server.",
"APPLICATION_NOT_FOUND": "The requested application was not found on the server.",
"CAMPAIGN_NOT_FOUND": "The requested campaign was not found on the server.",
"COMMENTS_NOT_FOUND": "The comments associated with the requested resource were not found on the server.",
"INTEREST_NOT_FOUND": "The requested interest was not found on the server.",
"ISSUE_CATEGORY_NOT_FOUND": "The requested mapping issue category was not found on the server.",
"JOIN_REQUEST_NOT_FOUND": "Team join request by the user was not found on the server.",
"LICENSE_NOT_FOUND": "The requested license was not found on the server.",
"MESSAGE_NOT_FOUND": "The requested message was not found on the server.",
"MESSAGES_NOT_FOUND": "The messages associated with the requested resource were not found on the server.",
"NOTIFICATIONS_NOT_FOUND": "The notifications associated with the requested resource were not found on the server.",
"ORGANISATION_NOT_FOUND": "The requested organisation was not found on the server.",
"ORGANISATION_CAMPAIGN_NOT_FOUND": "The requested campaign associated with the requested organisation was not found on the server.",
"PROJECT_CAMPAIGN_NOT_FOUND": "The requested campaign associated with the requested project was not found on the server.",
"PROJECT_NOT_FOUND": "The requested project was not found on the server.",
"PROJECTS_NOT_FOUND": "The projects associated with the requested resource were not found on the server.",
"TASK_NOT_FOUND": "The requested task was not found on the server.",
"TASKS_NOT_FOUND": "The tasks associated with the requested resource were not found on the server.",
"TEAM_NOT_FOUND": "The requested team was not found on the server.",
"USER_NOT_IN_TEAM": "The requested user is not a member of the team.",
"USER_NOT_FOUND": "The requested user was not found on the server.",
"BAD_REQUEST": "The request was invalid or cannot be otherwise served.",
"UNAUTHORIZED": "Authentication credentials were missing or incorrect.",
"FORBIDDEN": "The request is understood, but it has been refused or access is not allowed.",
"CONFLICT": "The request could not be completed due to a conflict with the current state of the resource.",
"INTERNAL_SERVER_ERROR": "An unexpected error occurred while processing the request. Please contact the system administrator."
"APPLICATION_NOT_FOUND": "The requested application was not found on the server.",
"BAD_REQUEST": "The request was invalid or cannot be otherwise served.",
"CAMPAIGN_NOT_FOUND": "The requested campaign was not found on the server.",
"COMMENTS_NOT_FOUND": "The comments associated with the requested resource were not found on the server.",
"CONFLICT": "The request could not be completed due to a conflict with the current state of the resource.",
"FORBIDDEN": "The request is understood, but it has been refused or access is not allowed.",
"INTEREST_NOT_FOUND": "The requested interest was not found on the server.",
"INTERNAL_SERVER_ERROR": "An unexpected error occurred while processing the request. Please contact the system administrator.",
"ISSUE_CATEGORY_NOT_FOUND": "The requested mapping issue category was not found on the server.",
"JOIN_REQUEST_NOT_FOUND": "Team join request by the user was not found on the server.",
"LICENSE_NOT_FOUND": "The requested license was not found on the server.",
"MESSAGES_NOT_FOUND": "The messages associated with the requested resource were not found on the server.",
"MESSAGE_NOT_FOUND": "The requested message was not found on the server.",
"NOTIFICATIONS_NOT_FOUND": "The notifications associated with the requested resource were not found on the server.",
"NOT_FOUND": "The requested resource was not found on the server.",
"ORGANISATION_CAMPAIGN_NOT_FOUND": "The requested campaign associated with the requested organisation was not found on the server.",
"ORGANISATION_NOT_FOUND": "The requested organisation was not found on the server.",
"PROJECTS_NOT_FOUND": "The projects associated with the requested resource were not found on the server.",
"PROJECT_CAMPAIGN_NOT_FOUND": "The requested campaign associated with the requested project was not found on the server.",
"PROJECT_NOT_FOUND": "The requested project was not found on the server.",
"TASKS_NOT_FOUND": "The tasks associated with the requested resource were not found on the server.",
"TASK_NOT_FOUND": "The requested task was not found on the server.",
"TEAM_NOT_FOUND": "The requested team was not found on the server.",
"UNAUTHORIZED": "Authentication credentials were missing or incorrect.",
"USER_NOT_FOUND": "The requested user was not found on the server.",
"USER_NOT_IN_TEAM": "The requested user is not a member of the team."
}
82 changes: 41 additions & 41 deletions frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
{
"name": "TaskingManager-frontend",
"version": "0.1.0",
"license": "BSD-2-Clause",
"private": false,
"browserslist": {
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
],
"production": [
">0.2%",
"not dead",
"not op_mini all"
]
},
"dependencies": {
"@hotosm/id": "^2.21.1",
"@hotosm/underpass-ui": "^0.0.4",
"@hotosm/iso-countries-languages": "^1.1.2",
"@hotosm/underpass-ui": "^0.0.4",
"@mapbox/mapbox-gl-draw": "^1.4.3",
"@mapbox/mapbox-gl-geocoder": "^5.0.2",
"@mapbox/mapbox-gl-language": "^0.10.1",
Expand Down Expand Up @@ -77,37 +85,6 @@
"workbox-routing": "^7.0.0",
"workbox-strategies": "^7.0.0"
},
"scripts": {
"build-locales": "combine-messages -i './src/**/messages.js' -o './src/locales/en.json'",
"copy-static": "bash -c \"mkdir -p public/static/id; mkdir -p public/static/rapid; if ! (test -a public/static/id/index.js); then cp -R node_modules/@hotosm/id/dist/* public/static/id; fi; if ! (test -a public/static/rapid/rapid.js); then cp -R node_modules/@rapideditor/rapid/dist/* public/static/rapid; fi\"",
"update-static": "bash -c \"mkdir -p public/static/id; mkdir -p public/static/rapid; cp -R node_modules/@hotosm/id/dist/* public/static/id; cp -R node_modules/@rapideditor/rapid/dist/* public/static/rapid;\"",
"patch-id": "bash -c \"cp patch/imagery.min.json public/static/id/data\"",
"patch-rapid": "bash -c \"cp patch/rapid-imagery.min.json public/static/rapid/data/imagery.min.json\"",
"preparation": "bash -c \"if (test -a ../tasking-manager.env); then grep -hs ^ ../tasking-manager.env .env.expand > .env; else cp .env.expand .env; fi\"",
"start": "npm run preparation && npm run copy-static && npm run patch-id && npm run patch-rapid && craco start",
"build": "npm run preparation && npm run update-static && npm run patch-id && npm run patch-rapid && craco build && npm run sentry:sourcemaps",
"prettier": "prettier --write 'src/**/*.js'",
"lint": "eslint src",
"test": "npm run lint && craco test --env=jsdom",
"coverage": "npm run test -- --coverage --watchAll=false",
"analyze": "source-map-explorer 'build/static/js/*.js'",
"sentry:sourcemaps": "if sentry-cli info; then sentry-cli sourcemaps inject --org humanitarian-openstreetmap-tea --project taskingmanager-frontend ./build && sentry-cli sourcemaps upload --org humanitarian-openstreetmap-tea --project taskingmanager-frontend ./build; fi"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@craco/craco": "^7.1.0",
Expand All @@ -125,11 +102,8 @@
"react-test-renderer": "^18.2.0",
"source-map-explorer": "^2.5.3"
},
"resolutions": {
"dom-accessibility-api": "0.5.14"
},
"overrides": {
"dom-accessibility-api": "0.5.14"
"eslintConfig": {
"extends": "react-app"
},
"jest": {
"coverageReporters": [
Expand All @@ -139,6 +113,32 @@
"node_modules/@uiw/react-md-editor/"
]
},
"license": "BSD-2-Clause",
"name": "TaskingManager-frontend",
"overrides": {
"dom-accessibility-api": "0.5.14"
},
"private": false,
"resolutions": {
"dom-accessibility-api": "0.5.14"
},
"scripts": {
"analyze": "source-map-explorer 'build/static/js/*.js'",
"build": "npm run preparation && npm run update-static && npm run patch-id && npm run patch-rapid && craco build && npm run sentry:sourcemaps",
"build-locales": "combine-messages -i './src/**/messages.js' -o './src/locales/en.json'",
"copy-static": "bash -c \"mkdir -p public/static/id; mkdir -p public/static/rapid; if ! (test -a public/static/id/index.js); then cp -R node_modules/@hotosm/id/dist/* public/static/id; fi; if ! (test -a public/static/rapid/rapid.js); then cp -R node_modules/@rapideditor/rapid/dist/* public/static/rapid; fi\"",
"coverage": "npm run test -- --coverage --watchAll=false",
"lint": "eslint src",
"patch-id": "bash -c \"cp patch/imagery.min.json public/static/id/data\"",
"patch-rapid": "bash -c \"cp patch/rapid-imagery.min.json public/static/rapid/data/imagery.min.json\"",
"preparation": "bash -c \"if (test -a ../tasking-manager.env); then grep -hs ^ ../tasking-manager.env .env.expand > .env; else cp .env.expand .env; fi\"",
"prettier": "prettier --write 'src/**/*.js'",
"sentry:sourcemaps": "if sentry-cli info; then sentry-cli sourcemaps inject --org humanitarian-openstreetmap-tea --project taskingmanager-frontend ./build && sentry-cli sourcemaps upload --org humanitarian-openstreetmap-tea --project taskingmanager-frontend ./build; fi",
"start": "npm run preparation && npm run copy-static && npm run patch-id && npm run patch-rapid && craco start",
"test": "npm run lint && craco test --env=jsdom",
"update-static": "bash -c \"mkdir -p public/static/id; mkdir -p public/static/rapid; cp -R node_modules/@hotosm/id/dist/* public/static/id; cp -R node_modules/@rapideditor/rapid/dist/* public/static/rapid;\""
},
"version": "0.1.0",
"volta": {
"node": "18.19.1"
}
Expand Down
444,085 changes: 444,084 additions & 1 deletion frontend/patch/imagery.min.json

Large diffs are not rendered by default.

641,870 changes: 641,869 additions & 1 deletion frontend/patch/rapid-imagery.min.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions frontend/public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"short_name": "Tasking Manager",
"name": "Tasking Manager",
"background_color": "#ffffff",
"display": "standalone",
"icons": [
{
"src": "static/favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"src": "static/favicon.ico",
"type": "image/x-icon"
}
],
"name": "Tasking Manager",
"short_name": "Tasking Manager",
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
"theme_color": "#000000"
}

0 comments on commit 2a43844

Please sign in to comment.