From 3ec5de38d567e1a6d3a52d9c1ebfeaa8ac27b70c Mon Sep 17 00:00:00 2001 From: Ayobami Akingbade Date: Mon, 23 Oct 2023 11:30:05 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(fields-settings):=20improve=20?= =?UTF-8?q?field=20types=20input=20label?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 26 +---- package.json | 99 ++++++++++--------- .../implementations/is-authenticated.ts | 6 +- .../design-system/components/index.ts | 9 -- .../views/entity/Fields/FieldsType.form.tsx | 1 + 5 files changed, 56 insertions(+), 85 deletions(-) delete mode 100644 src/frontend/design-system/components/index.ts diff --git a/package-lock.json b/package-lock.json index f7a97f558..66803b2ad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "dashpress", - "version": "0.1.7", + "version": "1.0.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "dashpress", - "version": "0.1.7", + "version": "1.0.1", "license": "GPL-3.0-or-later", "dependencies": { "@dashpress/bacteria": "^0.0.9", @@ -17,7 +17,6 @@ "@types/microseconds": "^0.2.0", "@types/multer": "^1.4.7", "@types/nodemailer": "^6.4.6", - "@types/nprogress": "^0.2.0", "@types/prismjs": "^1.26.0", "@types/qs": "^6.9.7", "@types/ramda": "0.27.40", @@ -47,7 +46,6 @@ "next": "12.3.1", "next-connect": "^0.13.0", "nodemailer": "^6.8.0", - "nprogress": "^0.2.0", "path": "^0.12.7", "polished": "^4.2.2", "prismjs": "^1.28.0", @@ -8902,11 +8900,6 @@ "integrity": "sha512-WKG4gTr8przEZBiJ5r3s8ZIAoMXNbOgQ+j/d5O4X3x6kZJRLNvyUJuUK/KoG3+8BaOHPhp2m7WC6JKKeovDSzQ==", "dev": true }, - "node_modules/@types/nprogress": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@types/nprogress/-/nprogress-0.2.0.tgz", - "integrity": "sha512-1cYJrqq9GezNFPsWTZpFut/d4CjpZqA0vhqDUPFWYKF1oIyBz5qnoYMzR+0C/T96t3ebLAC1SSnwrVOm5/j74A==" - }, "node_modules/@types/parse-json": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", @@ -23708,11 +23701,6 @@ "set-blocking": "^2.0.0" } }, - "node_modules/nprogress": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/nprogress/-/nprogress-0.2.0.tgz", - "integrity": "sha512-I19aIingLgR1fmhftnbWWO3dXc0hSxqHQHQb3H8m+K3TnEn/iSeTZZOyvKXWqQESMwuUVnatlCnZdLBZZt2VSA==" - }, "node_modules/nth-check": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", @@ -39491,11 +39479,6 @@ "integrity": "sha512-WKG4gTr8przEZBiJ5r3s8ZIAoMXNbOgQ+j/d5O4X3x6kZJRLNvyUJuUK/KoG3+8BaOHPhp2m7WC6JKKeovDSzQ==", "dev": true }, - "@types/nprogress": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@types/nprogress/-/nprogress-0.2.0.tgz", - "integrity": "sha512-1cYJrqq9GezNFPsWTZpFut/d4CjpZqA0vhqDUPFWYKF1oIyBz5qnoYMzR+0C/T96t3ebLAC1SSnwrVOm5/j74A==" - }, "@types/parse-json": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", @@ -50564,11 +50547,6 @@ "set-blocking": "^2.0.0" } }, - "nprogress": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/nprogress/-/nprogress-0.2.0.tgz", - "integrity": "sha512-I19aIingLgR1fmhftnbWWO3dXc0hSxqHQHQb3H8m+K3TnEn/iSeTZZOyvKXWqQESMwuUVnatlCnZdLBZZt2VSA==" - }, "nth-check": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", diff --git a/package.json b/package.json index 2e2592de7..3b4a98cdd 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,8 @@ "lint:fix": "eslint --fix", "verify": "npm run typecheck && npm run lint && npm run test:cov", "storybook": "start-storybook -p 6006", - "build-storybook": "build-storybook" + "build-storybook": "build-storybook", + "prepare": "husky install" }, "files": [ ".next", @@ -31,24 +32,32 @@ ], "bin": "./bin/dashpress", "dependencies": { - "@types/lodash": "^4.14.182", - "@types/qs": "^6.9.7", - "@types/ramda": "0.27.40", - "@types/react": "^18.0.11", - "@types/uuid": "^8.3.4", "@dashpress/bacteria": "^0.0.9", + "@tanstack/react-table": "^8.7.9", "@types/cryptr": "^4.0.1", "@types/jsonwebtoken": "^8.5.8", + "@types/lodash": "^4.14.182", "@types/microseconds": "^0.2.0", "@types/multer": "^1.4.7", "@types/nodemailer": "^6.4.6", + "@types/prismjs": "^1.26.0", + "@types/qs": "^6.9.7", + "@types/ramda": "0.27.40", + "@types/react": "^18.0.11", + "@types/react-datepicker": "^4.4.1", + "@types/styled-components": "^5.1.25", + "@types/uuid": "^8.3.4", + "axios": "^1.2.1", "bcrypt": "^5.0.1", "change-case": "^4.1.2", "class-validator": "^0.13.2", "cryptr": "^6.0.3", + "date-fns": "^2.28.0", "execa": "^6.1.0", + "final-form": "^4.20.7", "final-form-arrays": "^3.0.2", "fs-extra": "^10.1.0", + "immer": "9.0.3", "jsonwebtoken": "^8.5.1", "knex": "^2.3.0", "latest-version": "^7.0.0", @@ -61,58 +70,61 @@ "next-connect": "^0.13.0", "nodemailer": "^6.8.0", "path": "^0.12.7", - "react": "18.1.0", - "react-dom": "18.1.0", - "react-feather": "^2.0.10", - "react-final-form": "^6.5.9", - "react-final-form-arrays": "^3.1.4", - "react-query": "^3.39.2", - "react-use": "^17.4.0", - "redis": "^4.4.0", - "styled-components": "^5.3.6", - "terminal-link": "^3.0.0", - "winston": "^3.8.2", - "zod": "^3.21.4", - "date-fns": "^2.28.0", - "final-form": "^4.20.7", - "immer": "9.0.3", + "polished": "^4.2.2", + "prismjs": "^1.28.0", "qs": "^6.11.0", "ramda": "0.27.1", "randomstring": "^1.2.2", - "react-hot-toast": "^2.2.0", - "uuid": "^8.3.2", - "zustand": "3.4.2", - "@tanstack/react-table": "^8.7.9", - "@types/prismjs": "^1.26.0", - "@types/react-datepicker": "^4.4.1", - "@types/styled-components": "^5.1.25", - "axios": "^1.2.1", - "polished": "^4.2.2", - "prismjs": "^1.28.0", + "react": "18.1.0", "react-bootstrap": "^2.4.0", "react-confirm-alert": "^3.0.2", "react-datepicker": "^4.8.0", + "react-dom": "18.1.0", "react-dropzone": "^14.2.1", "react-easy-sort": "^1.5.0", + "react-feather": "^2.0.10", + "react-final-form": "^6.5.9", + "react-final-form-arrays": "^3.1.4", + "react-hot-toast": "^2.2.0", "react-paginate": "^8.1.3", + "react-query": "^3.39.2", "react-quill": "^2.0.0", "react-select": "^5.3.2", "react-simple-code-editor": "^0.11.0", "react-tooltip": "^5.7.4", - "tiny-skeleton-loader-react": "^1.2.1" + "react-use": "^17.4.0", + "redis": "^4.4.0", + "styled-components": "^5.3.6", + "terminal-link": "^3.0.0", + "tiny-skeleton-loader-react": "^1.2.1", + "uuid": "^8.3.2", + "winston": "^3.8.2", + "zod": "^3.21.4", + "zustand": "3.4.2" }, "devDependencies": { + "@babel/core": "^7.18.0", "@babel/preset-env": "^7.18.10", "@babel/preset-react": "^7.18.6", "@babel/preset-typescript": "^7.18.6", "@commitlint/cli": "^17.2.0", "@commitlint/config-conventional": "^17.2.0", "@dashpress/eslint-config": "^1.0.6", + "@storybook/addon-essentials": "^6.5.14", + "@storybook/addon-info": "^4.1.18", + "@storybook/addon-links": "^6.5.3", + "@storybook/addons": "^6.5.3", + "@storybook/react": "^6.5.14", + "@svgr/webpack": "^6.2.1", "@testing-library/jest-dom": "^5.16.4", "@testing-library/react": "^13.3.0", "@testing-library/user-event": "^14.2.1", "@types/node": "^18.0.0", "@types/react": "^18.0.9", + "@types/react-dom": "^18.0.4", + "@typescript-eslint/eslint-plugin": "^5.31.0", + "@typescript-eslint/parser": "^5.31.0", + "babel-loader": "^8.2.5", "commitlint-config-git-commit-emoji": "^1.0.0", "cz-emoji-conventional": "^1.0.1", "eslint": "^8.19.0", @@ -125,27 +137,16 @@ "msw": "^0.44.1", "next-router-mock": "^0.7.4", "node-mocks-http": "^1.11.0", - "prettier": "^2.7.1", - "rimraf": "^3.0.2", - "standard-version": "^9.5.0", - "tsup": "^6.2.2", - "typescript": "^4.7.4", - "@babel/core": "^7.18.0", - "@storybook/addon-essentials": "^6.5.14", - "@storybook/addon-info": "^4.1.18", - "@storybook/addon-links": "^6.5.3", - "@storybook/addons": "^6.5.3", - "@storybook/react": "^6.5.14", - "@svgr/webpack": "^6.2.1", - "@types/react-dom": "^18.0.4", - "@typescript-eslint/eslint-plugin": "^5.31.0", - "@typescript-eslint/parser": "^5.31.0", - "babel-loader": "^8.2.5", "postcss": "^8.4.16", + "prettier": "^2.7.1", "react-is": "^18.1.0", + "rimraf": "^3.0.2", "rollup-plugin-postcss": "^4.0.2", "rollup-plugin-svg": "^2.0.0", - "rollup-plugin-svg-import": "^1.6.0" + "rollup-plugin-svg-import": "^1.6.0", + "standard-version": "^9.5.0", + "tsup": "^6.2.2", + "typescript": "^4.7.4" }, "engines": { "node": ">=16" diff --git a/src/backend/lib/request/validations/implementations/is-authenticated.ts b/src/backend/lib/request/validations/implementations/is-authenticated.ts index 246f905c3..5d5cd4ac0 100644 --- a/src/backend/lib/request/validations/implementations/is-authenticated.ts +++ b/src/backend/lib/request/validations/implementations/is-authenticated.ts @@ -10,14 +10,14 @@ export const isAuthenticatedValidationImpl: ValidationImplType = async ( protectedRoute: boolean ) => { try { - const reqHeaders = req.headers.authorization; - if (!reqHeaders) { + const authHeader = req.headers.authorization; + if (!authHeader) { throw new UnauthorizedError( "No authorization token provided", NO_AUTH_ERROR_CODE ); } - const authToken = reqHeaders.slice(7); + const authToken = authHeader.slice(7); if (!authToken) { throw new UnauthorizedError( "The authorization token provided is empty", diff --git a/src/frontend/design-system/components/index.ts b/src/frontend/design-system/components/index.ts deleted file mode 100644 index a5dafa054..000000000 --- a/src/frontend/design-system/components/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -export {}; -// TODO TO storybook -/* -Button -Text -ComponentIsLoading -Progress bar -SelectAnItem -*/ diff --git a/src/frontend/views/entity/Fields/FieldsType.form.tsx b/src/frontend/views/entity/Fields/FieldsType.form.tsx index 41fb1f4f8..686103d2d 100644 --- a/src/frontend/views/entity/Fields/FieldsType.form.tsx +++ b/src/frontend/views/entity/Fields/FieldsType.form.tsx @@ -119,6 +119,7 @@ export function FieldsTypeForm({ )} [${values.validations[name] .map(({ validationType }) => validationType) .join(",")}]`} + defaultLabel={`Select ${getEntityFieldLabels(name)} Type`} selectData={FIELD_TYPES_CONFIG_MAP_AS_SELECTION} rightActions={rightActions} disabledOptions={listOfEntitiesThatCantBeChanged}