From 60840c7f3919affb80d9d3f6924380bc7f125aef Mon Sep 17 00:00:00 2001 From: Roshan Desai Date: Mon, 23 Sep 2024 22:20:48 -0700 Subject: [PATCH 1/6] fix up some formatting and make ui overall smoother --- client/.env => .env | 1 - client/.eslintrc.json => .eslintrc.json | 0 .gitignore | 33 +- .idea/bolt.iml | 9 - .idea/dataSources.local.xml | 20 - .idea/dataSources.xml | 11 - .../699faafa-7f3b-41c0-847c-a675e7213b60.xml | 783 - .../_src_/database/bolt.lTouAA.meta | 1 - .../schema/information_schema.FNRwLQ.meta | 2 - .../bolt.lTouAA/schema/pg_catalog.0S1ZNQ.meta | 2 - .../bolt.lTouAA/schema/public.abK9xQ.meta | 2 - .idea/inspectionProfiles/Project_Default.xml | 7 - .idea/misc.xml | 9 - .idea/modules.xml | 8 - .idea/runConfigurations/client.xml | 11 - .idea/runConfigurations/server.xml | 9 - .idea/sqldialects.xml | 7 - .idea/vcs.xml | 13 - .idea/workspace.xml | 172 - Dockerfile | 20 - LICENSE.md | 2 +- README.md | 31 +- client/.gitignore | 24 - client/README.md | 44 - client/generate-build-version.js | 18 - client/package.json | 100 - client/src/App.tsx | 153 - client/src/index.tsx | 130 - client/yarn.lock | 15845 ---------- cloudbuild.yaml | 27 - deployment.yaml | 16 - gulpfile.js | 44 - package.json | 113 +- {client/public => public}/favicon.ico | Bin {client/public => public}/hexlabs_favicon.ico | Bin {client/public => public}/index.html | 0 {client/public => public}/manifest.json | 0 {client/public => public}/meta.json | 0 server/codegen.yaml | 9 - server/gulpfile.js | 24 - server/package.json | 85 - .../migrations/20210420034832_/migration.sql | 97 - .../migrations/20210420034925_/migration.sql | 24 - .../migrations/20210421043509_/migration.sql | 88 - .../migrations/20210421065141_/migration.sql | 8 - .../migrations/20210421065354_/migration.sql | 12 - .../migrations/20210518212337_/migration.sql | 9 - .../migrations/20211020203231_/migration.sql | 8 - server/prisma/migrations/migration_lock.toml | 3 - server/prisma/schema.prisma | 102 - server/src/api/api.graphql | 213 - server/src/api/api.ts | 112 - .../src/api/controllers/QuantityController.ts | 156 - server/src/api/resolvers/common.ts | 91 - server/src/api/resolvers/mutation.ts | 462 - server/src/api/resolvers/query.ts | 231 - server/src/api/resolvers/subscription.ts | 10 - server/src/api/util.ts | 12 - server/src/app.ts | 160 - server/src/auth/auth.ts | 154 - server/src/auth/strategies.ts | 261 - server/src/common.ts | 235 - server/src/config/config.json.example | 20 - server/tsconfig.json | 3 - server/yarn.lock | 7837 ----- {client/src => src}/App.test.tsx | 0 src/App.tsx | 75 + {client/src => src}/actions/index.ts | 0 {client/src => src}/actions/types.ts | 0 {client/src => src}/axios.tsx | 0 .../src => src}/components/FeedbackLink.tsx | 0 .../src => src}/components/admin/AdminHub.tsx | 2 - .../components/admin/AdminLinksCard.tsx | 0 .../admin/AdminRequestSettingsWrapper.tsx | 0 .../components/admin/AdminUsersList.tsx | 0 .../components/admin/UserRequestsModal.tsx | 0 .../components/admin/csv/CSVComplete.tsx | 0 .../components/admin/csv/CSVReview.tsx | 0 .../components/admin/csv/CSVUpload.tsx | 0 .../components/admin/csv/CSVWizard.tsx | 0 .../components/admin/desk/CardList.tsx | 0 .../components/admin/desk/Desk.css | 0 .../components/admin/desk/DeskContainer.tsx | 0 .../components/admin/desk/DeskUtil.tsx | 0 .../components/admin/desk/ItemAndQuantity.tsx | 0 .../desk/fulfillment/ReadyToPrepareCard.tsx | 0 .../desk/fulfillment/ReadyToPrepareList.tsx | 0 .../admin/desk/pickup/PhotoIdCheck.tsx | 0 .../admin/desk/pickup/ReadyForPickupCard.tsx | 0 .../admin/desk/pickup/ReadyForPickupList.tsx | 0 .../admin/desk/returns/PhotoIdReturn.tsx | 0 .../admin/desk/returns/ReadyForReturnCard.tsx | 0 .../admin/desk/returns/ReadyForReturnList.tsx | 0 .../admin/desk/submitted/EditRequest.tsx | 0 .../admin/desk/submitted/SubmittedCard.tsx | 0 .../admin/desk/submitted/SubmittedCards.tsx | 0 .../admin/desk/submitted/SubmittedList.tsx | 0 .../admin/desk/submitted/SubmittedTable.tsx | 0 .../components/admin/reports/ReportError.tsx | 0 .../admin/reports/demand/ItemDemandReport.tsx | 0 .../statistics/DetailedItemStatistics.tsx | 0 {client/src => src}/components/cart/Cart.tsx | 0 .../categories/CreateCategoryForm.tsx | 0 .../categories/CreateCategoryWrapper.tsx | 0 .../components/home/HardwareHeader.tsx | 0 .../components/home/HomeContainer.tsx | 18 +- .../components/home/LandingPage.tsx | 0 .../components/home/NewHardwareList.tsx | 90 +- .../components/home/RequestedList.tsx | 55 +- .../components/inventory/HardwareCategory.tsx | 0 .../components/inventory/HardwareItem.tsx | 0 .../components/inventory/HardwareLocation.tsx | 0 .../inventory/HardwareLocationContents.tsx | 0 .../components/inventory/NoItemsFound.tsx | 0 .../components/inventory/RequestButton.tsx | 0 .../components/items/CreateItemWrapper.tsx | 0 .../components/items/EditItemWrapper.tsx | 0 .../components/items/ItemEditForm.tsx | 0 .../userProfile/EditUserProfileWrapper.tsx | 0 .../components/userProfile/UserProfile.tsx | 0 .../userProfile/UserProfileWrapper.tsx | 0 .../components/util/AddOptionDropdown.tsx | 0 .../components/util/CacheBuster.tsx | 0 .../components/util/LoadingSpinner.tsx | 0 .../components/util/PrivateRoute.tsx | 0 .../components/util/ProtectedRoute.tsx | 0 {client/src => src}/graphql/Fragments.ts | 0 {client/src => src}/graphql/Mutations.ts | 0 {client/src => src}/graphql/Queries.ts | 0 {client/src => src}/graphql/Subscriptions.ts | 0 {client/src => src}/index.css | 0 src/index.tsx | 20 + {client/src => src}/react-app-env.d.ts | 0 {client/src => src}/state/Account.ts | 0 {client/src => src}/state/Desk.ts | 0 {client/src => src}/state/Store.ts | 0 {client/src => src}/styles/hardware.css | 0 {client/src => src}/types/Hardware.ts | 2 + {client/src => src}/types/Request.ts | 0 {client/src => src}/types/Setting.ts | 0 {client/src => src}/types/User.ts | 0 client/tsconfig.json => tsconfig.json | 0 yarn.lock | 25307 ++++++++++++++-- 143 files changed, 23041 insertions(+), 30621 deletions(-) rename client/.env => .env (53%) rename client/.eslintrc.json => .eslintrc.json (100%) delete mode 100644 .idea/bolt.iml delete mode 100644 .idea/dataSources.local.xml delete mode 100644 .idea/dataSources.xml delete mode 100644 .idea/dataSources/699faafa-7f3b-41c0-847c-a675e7213b60.xml delete mode 100644 .idea/dataSources/699faafa-7f3b-41c0-847c-a675e7213b60/storage_v2/_src_/database/bolt.lTouAA.meta delete mode 100644 .idea/dataSources/699faafa-7f3b-41c0-847c-a675e7213b60/storage_v2/_src_/database/bolt.lTouAA/schema/information_schema.FNRwLQ.meta delete mode 100644 .idea/dataSources/699faafa-7f3b-41c0-847c-a675e7213b60/storage_v2/_src_/database/bolt.lTouAA/schema/pg_catalog.0S1ZNQ.meta delete mode 100644 .idea/dataSources/699faafa-7f3b-41c0-847c-a675e7213b60/storage_v2/_src_/database/bolt.lTouAA/schema/public.abK9xQ.meta delete mode 100644 .idea/inspectionProfiles/Project_Default.xml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/runConfigurations/client.xml delete mode 100644 .idea/runConfigurations/server.xml delete mode 100644 .idea/sqldialects.xml delete mode 100644 .idea/vcs.xml delete mode 100644 .idea/workspace.xml delete mode 100644 Dockerfile delete mode 100644 client/.gitignore delete mode 100644 client/README.md delete mode 100644 client/generate-build-version.js delete mode 100644 client/package.json delete mode 100644 client/src/App.tsx delete mode 100644 client/src/index.tsx delete mode 100644 client/yarn.lock delete mode 100644 cloudbuild.yaml delete mode 100644 deployment.yaml delete mode 100644 gulpfile.js rename {client/public => public}/favicon.ico (100%) rename {client/public => public}/hexlabs_favicon.ico (100%) rename {client/public => public}/index.html (100%) rename {client/public => public}/manifest.json (100%) rename {client/public => public}/meta.json (100%) delete mode 100644 server/codegen.yaml delete mode 100644 server/gulpfile.js delete mode 100644 server/package.json delete mode 100644 server/prisma/migrations/20210420034832_/migration.sql delete mode 100644 server/prisma/migrations/20210420034925_/migration.sql delete mode 100644 server/prisma/migrations/20210421043509_/migration.sql delete mode 100644 server/prisma/migrations/20210421065141_/migration.sql delete mode 100644 server/prisma/migrations/20210421065354_/migration.sql delete mode 100644 server/prisma/migrations/20210518212337_/migration.sql delete mode 100644 server/prisma/migrations/20211020203231_/migration.sql delete mode 100644 server/prisma/migrations/migration_lock.toml delete mode 100644 server/prisma/schema.prisma delete mode 100644 server/src/api/api.graphql delete mode 100644 server/src/api/api.ts delete mode 100644 server/src/api/controllers/QuantityController.ts delete mode 100644 server/src/api/resolvers/common.ts delete mode 100644 server/src/api/resolvers/mutation.ts delete mode 100644 server/src/api/resolvers/query.ts delete mode 100644 server/src/api/resolvers/subscription.ts delete mode 100644 server/src/api/util.ts delete mode 100644 server/src/app.ts delete mode 100644 server/src/auth/auth.ts delete mode 100644 server/src/auth/strategies.ts delete mode 100644 server/src/common.ts delete mode 100644 server/src/config/config.json.example delete mode 100644 server/tsconfig.json delete mode 100644 server/yarn.lock rename {client/src => src}/App.test.tsx (100%) create mode 100644 src/App.tsx rename {client/src => src}/actions/index.ts (100%) rename {client/src => src}/actions/types.ts (100%) rename {client/src => src}/axios.tsx (100%) rename {client/src => src}/components/FeedbackLink.tsx (100%) rename {client/src => src}/components/admin/AdminHub.tsx (96%) rename {client/src => src}/components/admin/AdminLinksCard.tsx (100%) rename {client/src => src}/components/admin/AdminRequestSettingsWrapper.tsx (100%) rename {client/src => src}/components/admin/AdminUsersList.tsx (100%) rename {client/src => src}/components/admin/UserRequestsModal.tsx (100%) rename {client/src => src}/components/admin/csv/CSVComplete.tsx (100%) rename {client/src => src}/components/admin/csv/CSVReview.tsx (100%) rename {client/src => src}/components/admin/csv/CSVUpload.tsx (100%) rename {client/src => src}/components/admin/csv/CSVWizard.tsx (100%) rename {client/src => src}/components/admin/desk/CardList.tsx (100%) rename {client/src => src}/components/admin/desk/Desk.css (100%) rename {client/src => src}/components/admin/desk/DeskContainer.tsx (100%) rename {client/src => src}/components/admin/desk/DeskUtil.tsx (100%) rename {client/src => src}/components/admin/desk/ItemAndQuantity.tsx (100%) rename {client/src => src}/components/admin/desk/fulfillment/ReadyToPrepareCard.tsx (100%) rename {client/src => src}/components/admin/desk/fulfillment/ReadyToPrepareList.tsx (100%) rename {client/src => src}/components/admin/desk/pickup/PhotoIdCheck.tsx (100%) rename {client/src => src}/components/admin/desk/pickup/ReadyForPickupCard.tsx (100%) rename {client/src => src}/components/admin/desk/pickup/ReadyForPickupList.tsx (100%) rename {client/src => src}/components/admin/desk/returns/PhotoIdReturn.tsx (100%) rename {client/src => src}/components/admin/desk/returns/ReadyForReturnCard.tsx (100%) rename {client/src => src}/components/admin/desk/returns/ReadyForReturnList.tsx (100%) rename {client/src => src}/components/admin/desk/submitted/EditRequest.tsx (100%) rename {client/src => src}/components/admin/desk/submitted/SubmittedCard.tsx (100%) rename {client/src => src}/components/admin/desk/submitted/SubmittedCards.tsx (100%) rename {client/src => src}/components/admin/desk/submitted/SubmittedList.tsx (100%) rename {client/src => src}/components/admin/desk/submitted/SubmittedTable.tsx (100%) rename {client/src => src}/components/admin/reports/ReportError.tsx (100%) rename {client/src => src}/components/admin/reports/demand/ItemDemandReport.tsx (100%) rename {client/src => src}/components/admin/reports/statistics/DetailedItemStatistics.tsx (100%) rename {client/src => src}/components/cart/Cart.tsx (100%) rename {client/src => src}/components/categories/CreateCategoryForm.tsx (100%) rename {client/src => src}/components/categories/CreateCategoryWrapper.tsx (100%) rename {client/src => src}/components/home/HardwareHeader.tsx (100%) rename {client/src => src}/components/home/HomeContainer.tsx (59%) rename {client/src => src}/components/home/LandingPage.tsx (100%) rename {client/src => src}/components/home/NewHardwareList.tsx (54%) rename {client/src => src}/components/home/RequestedList.tsx (83%) rename {client/src => src}/components/inventory/HardwareCategory.tsx (100%) rename {client/src => src}/components/inventory/HardwareItem.tsx (100%) rename {client/src => src}/components/inventory/HardwareLocation.tsx (100%) rename {client/src => src}/components/inventory/HardwareLocationContents.tsx (100%) rename {client/src => src}/components/inventory/NoItemsFound.tsx (100%) rename {client/src => src}/components/inventory/RequestButton.tsx (100%) rename {client/src => src}/components/items/CreateItemWrapper.tsx (100%) rename {client/src => src}/components/items/EditItemWrapper.tsx (100%) rename {client/src => src}/components/items/ItemEditForm.tsx (100%) rename {client/src => src}/components/userProfile/EditUserProfileWrapper.tsx (100%) rename {client/src => src}/components/userProfile/UserProfile.tsx (100%) rename {client/src => src}/components/userProfile/UserProfileWrapper.tsx (100%) rename {client/src => src}/components/util/AddOptionDropdown.tsx (100%) rename {client/src => src}/components/util/CacheBuster.tsx (100%) rename {client/src => src}/components/util/LoadingSpinner.tsx (100%) rename {client/src => src}/components/util/PrivateRoute.tsx (100%) rename {client/src => src}/components/util/ProtectedRoute.tsx (100%) rename {client/src => src}/graphql/Fragments.ts (100%) rename {client/src => src}/graphql/Mutations.ts (100%) rename {client/src => src}/graphql/Queries.ts (100%) rename {client/src => src}/graphql/Subscriptions.ts (100%) rename {client/src => src}/index.css (100%) create mode 100644 src/index.tsx rename {client/src => src}/react-app-env.d.ts (100%) rename {client/src => src}/state/Account.ts (100%) rename {client/src => src}/state/Desk.ts (100%) rename {client/src => src}/state/Store.ts (100%) rename {client/src => src}/styles/hardware.css (100%) rename {client/src => src}/types/Hardware.ts (97%) rename {client/src => src}/types/Request.ts (100%) rename {client/src => src}/types/Setting.ts (100%) rename {client/src => src}/types/User.ts (100%) rename client/tsconfig.json => tsconfig.json (100%) diff --git a/client/.env b/.env similarity index 53% rename from client/.env rename to .env index b9e10ff..44af0d3 100644 --- a/client/.env +++ b/.env @@ -1,2 +1 @@ -REACT_APP_ENABLE_BUGSNAG=false REACT_APP_API_ENVIRONMENT=PRODUCTION \ No newline at end of file diff --git a/client/.eslintrc.json b/.eslintrc.json similarity index 100% rename from client/.eslintrc.json rename to .eslintrc.json diff --git a/.gitignore b/.gitignore index 24d587a..bd874d3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,25 @@ -**/.vscode/ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js +.yarn + +# testing +/coverage + +# production +/build + +# misc .DS_Store -.env -node_modules/ -server/src/config/config.json -server/build/ -server/dist/ -server/src/api/graphql.types.ts - -yarn-error.log \ No newline at end of file +.env.local +.env.development.local +.env.test.local +.env.production.local + +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json \ No newline at end of file diff --git a/.idea/bolt.iml b/.idea/bolt.iml deleted file mode 100644 index d6ebd48..0000000 --- a/.idea/bolt.iml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/dataSources.local.xml b/.idea/dataSources.local.xml deleted file mode 100644 index c6293fa..0000000 --- a/.idea/dataSources.local.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - " - - - master_key - ballot - - - - - - - - - - \ No newline at end of file diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml deleted file mode 100644 index d623395..0000000 --- a/.idea/dataSources.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - postgresql - true - org.postgresql.Driver - jdbc:postgresql://localhost:5432/bolt - - - \ No newline at end of file diff --git a/.idea/dataSources/699faafa-7f3b-41c0-847c-a675e7213b60.xml b/.idea/dataSources/699faafa-7f3b-41c0-847c-a675e7213b60.xml deleted file mode 100644 index 2b3c2d6..0000000 --- a/.idea/dataSources/699faafa-7f3b-41c0-847c-a675e7213b60.xml +++ /dev/null @@ -1,783 +0,0 @@ - - - - - 10.11 - 1588292698 - - - 16385 - postgres - - - 40960 - evan - 1625 - 1 - sequence|table|40961|40963|1 -sequence|table|40969|40971|1 -sequence|table|40989|40991|1 -sequence|table|41002|41004|1 -sequence|table|41022|41024|1 -sequence|table|41046|41048|1 - - - - 24578 - evan - - - 24577 - evan - - - 13018 - default administrative connection database - postgres - - - 16384 - 1 - - - 24576 - 1 - 1 - 1 - 1 - - - 3373 - - - 3374 - - - 3375 - - - 4200 - - - 3377 - - - 10 - 1 - 1 - 1 - 1 - 1 - 1 - - - 12728 - 353 - postgres - - - 11 - system catalog schema - 350 - postgres - - - 2200 - standard public schema - 351 - postgres - 1626 - 1 - - - 403 - b-tree index access method - 1 - pg_catalog.bthandler - 330 - index - - - 405 - hash index access method - 1 - pg_catalog.hashhandler - 331 - index - - - 783 - GiST index access method - 1 - pg_catalog.gisthandler - 332 - index - - - 2742 - GIN index access method - 1 - pg_catalog.ginhandler - 333 - index - - - 4000 - SP-GiST index access method - 1 - pg_catalog.spghandler - 334 - index - - - 3580 - block range index (BRIN) access method - 1 - pg_catalog.brinhandler - 335 - index - - - 13004 - PL/pgSQL procedural language - 505 - 1.0 - pg_catalog - 11 - - - - - - - 40989 - 1268 - ballot - 1 - 1 - integer|0s - - - 41002 - 1268 - ballot - 1 - 1 - integer|0s - - - 40961 - 1265 - ballot - 1 - 1 - integer|0s - - - 40969 - 1266 - ballot - 1 - 1 - integer|0s - - - 41046 - 1268 - ballot - 1 - 1 - integer|0s - - - 41022 - 1268 - ballot - 1 - 1 - integer|0s - - - 40991 - ballot - 1268 -
- - 41004 - ballot - 1268 -
- - 40963 - ballot - 1265 -
- - 40971 - ballot - 1266 -
- - 41048 - ballot - 1268 -
- - 41024 - ballot - 1268 -
- - 41083 - ballot - 1269 -
- - 41073 - ballot - 1268 -
- - 40977 - ballot - 1268 -
- - 1 - integer|0s - 1 - 1268 - nextval('categories_category_id_seq'::regclass) - 23 - - - 2 - text|0s - 1 - 1268 - 25 - - - 40998 - 1268 - category_id - 1 - 1 - - - 41000 - 1268 - category_name - 1 - - - 40999 - 1268 - category_id - 1 - categories_pkey - - - 41001 - 1268 - category_name - categories_category_name_unique - - - 1 - integer|0s - 1 - 1268 - nextval('items_item_id_seq'::regclass) - 23 - - - 2 - text|0s - 1 - 1268 - 25 - - - 3 - text|0s - 1 - 1268 - 25 - - - 4 - text|0s - 1 - 1268 - 25 - - - 5 - integer|0s - 1 - 1268 - 23 - - - 6 - integer|0s - 1 - 1268 - 23 - - - 7 - integer|0s - 1 - 1268 - 23 - - - 8 - numeric(6,2 digit)|0s - 1268 - '0'::numeric - 1700 - - - 9 - boolean|0s - 1 - 1268 - false - 16 - - - 10 - boolean|0s - 1 - 1268 - true - 16 - - - 11 - boolean|0s - 1 - 1268 - true - 16 - - - 12 - text|0s - 1 - 1268 - 25 - - - 13 - integer|0s - 1 - 1268 - 1 - 23 - - - 41015 - 1268 - item_id - 1 - 1 - - - 41016 - 1268 - item_id - 1 - items_pkey - - - 41017 - 1268 - category_id - 40991 - 1 - categories - categories_pkey - category_id - - - 41068 - 1268 - location_id - 41048 - 1 - locations - locations_pkey - location_id - - - 1 - integer|0s - 1 - 1265 - nextval('knex_migrations_id_seq'::regclass) - 23 - - - 2 - varchar(255)|0s - 1265 - 1043 - - - 3 - integer|0s - 1265 - 23 - - - 4 - timestamp with time zone|0s - 1265 - 1184 - - - 40967 - 1265 - id - 1 - 1 - - - 40968 - 1265 - id - 1 - knex_migrations_pkey - - - 1 - integer|0s - 1 - 1266 - nextval('knex_migrations_lock_index_seq'::regclass) - 23 - - - 2 - integer|0s - 1266 - 23 - - - 40975 - 1266 - index - 1 - 1 - - - 40976 - 1266 - index - 1 - knex_migrations_lock_pkey - - - 1 - integer|0s - 1 - 1268 - nextval('locations_location_id_seq'::regclass) - 23 - - - 2 - text|0s - 1 - 1268 - 25 - - - 3 - boolean|0s - 1 - 1268 - false - 16 - - - 41056 - 1268 - location_id - 1 - 1 - - - 41058 - 1268 - location_name - 1 - - - 41057 - 1268 - location_id - 1 - locations_pkey - - - 41059 - 1268 - location_name - locations_location_name_unique - - - 1 - integer|0s - 1 - 1268 - nextval('requests_request_id_seq'::regclass) - 23 - - - 2 - integer|0s - 1 - 1268 - 23 - - - 3 - integer|0s - 1 - 1268 - 23 - - - 4 - uuid|0s - 1 - 1268 - 2950 - - - 5 - text|0s - 1268 - 25 - - - 6 - timestamp with time zone|0s - 1 - 1268 - CURRENT_TIMESTAMP - 1184 - - - 7 - timestamp with time zone|0s - 1 - 1268 - CURRENT_TIMESTAMP - 1184 - - - 41034 - 1268 - request_id - 1 - 1 - - - 41035 - 1268 - request_id - 1 - requests_pkey - - - 41036 - 1268 - request_item_id - 41004 - 1 - items - items_pkey - item_id - - - 41041 - 1268 - user_id - 40977 - 1 - users - users_pkey - uuid - - - 41030 - 1268 - status - status = ANY (ARRAY['SUBMITTED'::text, 'APPROVED'::text, 'DENIED'::text, 'ABANDONED'::text, 'CANCELLED'::text, 'READY_FOR_PICKUP'::text, 'FULFILLED'::text, 'RETURNED'::text, 'LOST'::text, 'DAMAGED'::text]) - - - 1 - varchar|0s - 1 - 1269 - 1043 - - - 2 - json|0s - 1 - 1269 - 114 - - - 3 - timestamp(6)|0s - 1 - 1269 - 1114 - - - 41089 - 1269 - sid - 1 - 1 - - - 41090 - 1269 - sid - 1 - session_pkey - - - 1 - text|0s - 1 - 1268 - 25 - - - 2 - text|0s - 1 - 1268 - 25 - - - 41079 - 1268 - name - 1 - - - 41081 - 1268 - name - 1 - 1 - - - 41082 - 1268 - name - 1 - settings_pkey - - - 41080 - 1268 - name - settings_name_unique - - - 1 - uuid|0s - 1 - 1268 - 2950 - - - 2 - varchar(256)|0s - 1268 - 1043 - - - 3 - text|0s - 1 - 1268 - 25 - - - 4 - text|0s - 1 - 1268 - 25 - - - 5 - text|0s - 1 - 1268 - 25 - - - 6 - text|0s - 1 - 1268 - 25 - - - 7 - boolean|0s - 1 - 1268 - false - 16 - - - 8 - boolean|0s - 1 - 1268 - false - 16 - - - 40987 - 1268 - uuid - 1 - 1 - - - 40985 - 1268 - uuid - 1 - - - 40988 - 1268 - uuid - 1 - users_pkey - - - 40986 - 1268 - uuid - users_uuid_unique - -
-
\ No newline at end of file diff --git a/.idea/dataSources/699faafa-7f3b-41c0-847c-a675e7213b60/storage_v2/_src_/database/bolt.lTouAA.meta b/.idea/dataSources/699faafa-7f3b-41c0-847c-a675e7213b60/storage_v2/_src_/database/bolt.lTouAA.meta deleted file mode 100644 index af3b1d9..0000000 --- a/.idea/dataSources/699faafa-7f3b-41c0-847c-a675e7213b60/storage_v2/_src_/database/bolt.lTouAA.meta +++ /dev/null @@ -1 +0,0 @@ -#n:bolt \ No newline at end of file diff --git a/.idea/dataSources/699faafa-7f3b-41c0-847c-a675e7213b60/storage_v2/_src_/database/bolt.lTouAA/schema/information_schema.FNRwLQ.meta b/.idea/dataSources/699faafa-7f3b-41c0-847c-a675e7213b60/storage_v2/_src_/database/bolt.lTouAA/schema/information_schema.FNRwLQ.meta deleted file mode 100644 index 1ff3db2..0000000 --- a/.idea/dataSources/699faafa-7f3b-41c0-847c-a675e7213b60/storage_v2/_src_/database/bolt.lTouAA/schema/information_schema.FNRwLQ.meta +++ /dev/null @@ -1,2 +0,0 @@ -#n:information_schema -! [null, 0, null, null, -2147483648, -2147483648] diff --git a/.idea/dataSources/699faafa-7f3b-41c0-847c-a675e7213b60/storage_v2/_src_/database/bolt.lTouAA/schema/pg_catalog.0S1ZNQ.meta b/.idea/dataSources/699faafa-7f3b-41c0-847c-a675e7213b60/storage_v2/_src_/database/bolt.lTouAA/schema/pg_catalog.0S1ZNQ.meta deleted file mode 100644 index 44e65b1..0000000 --- a/.idea/dataSources/699faafa-7f3b-41c0-847c-a675e7213b60/storage_v2/_src_/database/bolt.lTouAA/schema/pg_catalog.0S1ZNQ.meta +++ /dev/null @@ -1,2 +0,0 @@ -#n:pg_catalog -! [null, 0, null, null, -2147483648, -2147483648] diff --git a/.idea/dataSources/699faafa-7f3b-41c0-847c-a675e7213b60/storage_v2/_src_/database/bolt.lTouAA/schema/public.abK9xQ.meta b/.idea/dataSources/699faafa-7f3b-41c0-847c-a675e7213b60/storage_v2/_src_/database/bolt.lTouAA/schema/public.abK9xQ.meta deleted file mode 100644 index 72e9c99..0000000 --- a/.idea/dataSources/699faafa-7f3b-41c0-847c-a675e7213b60/storage_v2/_src_/database/bolt.lTouAA/schema/public.abK9xQ.meta +++ /dev/null @@ -1,2 +0,0 @@ -#n:public -! [1626, 0, null, null, -2147483648, -2147483648] diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index 70fb766..0000000 --- a/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index fe90235..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index e980059..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/runConfigurations/client.xml b/.idea/runConfigurations/client.xml deleted file mode 100644 index 337341b..0000000 --- a/.idea/runConfigurations/client.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/runConfigurations/server.xml b/.idea/runConfigurations/server.xml deleted file mode 100644 index 75b6823..0000000 --- a/.idea/runConfigurations/server.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/sqldialects.xml b/.idea/sqldialects.xml deleted file mode 100644 index 6f2f0a0..0000000 --- a/.idea/sqldialects.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 3a129e9..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 41483fe..0000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1588292768173 - - - 1588659428429 - - - 1589511505526 - - - 1590463420366 - - - 1590465054997 - - - 1590465715110 - - - 1590547769047 - - - 1593990759178 - - - 1613697948794 - - - 1613698202158 - - - - - - - \ No newline at end of file diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 44f6080..0000000 --- a/Dockerfile +++ /dev/null @@ -1,20 +0,0 @@ -FROM node:14-alpine - -# Bundle Source -RUN mkdir -p /usr/src/bolt -WORKDIR /usr/src/bolt -COPY . /usr/src/bolt -RUN yarn install - -# Set Timezone to EST -RUN apk add tzdata -ENV TZ="/usr/share/zoneinfo/America/New_York" - -FROM node:14-alpine -COPY --from=0 /usr/src/bolt/server/ /usr/src/bolt/server/ -COPY --from=0 /usr/src/bolt/client/ /usr/src/bolt/client/ -WORKDIR /usr/src/bolt - -EXPOSE 3000 -WORKDIR /usr/src/bolt/server -CMD ["yarn", "start-migrate"] diff --git a/LICENSE.md b/LICENSE.md index 4e5c446..0d567b3 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,4 +1,4 @@ -Copyright 2019 HackGT, Inc. +Copyright 2024 HackGT, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/README.md b/README.md index 93fdd63..925bb92 100644 --- a/README.md +++ b/README.md @@ -2,27 +2,6 @@ Simple and efficient hardware checkout system -# Server setup - -Required items: - -- A postrgesql server and database -- Install dependencies: `yarn install` -- Configure the required environment variables in `configs/config.json`. You can copy and rename `configs/configs.json.example`. -- Run the database migrations using `yarn migrate:dev`. -- Start the server for development with `yarn dev` - -# Client setup - -Note: the hardware desk page (/admin/desk) relies on a WebSocket connection to the server. The client assumes that you are -running the server on port 3000. If this isn't right, then you'll need to update the port in - -1. The `proxy` property in the **client's** package.json file -2. The local development WebSocket URL in `client/index.tsx` -3. `baseUrl` in `client/src/components/admin/AdminOverviewContainer.tsx` - -to use the correct server port. Make sure you don't commit the files with the changed port! - ## Required environment variables ### Backend @@ -47,16 +26,12 @@ variables, or define them as temporary environment variables in your shell. | Variable | Description | | ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -| REACT_APP_ENABLE_BUGSNAG | "true" or "false" whether to enable the Bugsnag integration. Keep disabled for local development unless testing Bugsnag-specific features | -| REACT_APP_BUGSNAG_API_KEY | Required if REACT_APP_ENABLE_BUGSNAG is enabled. Value should be the Notifier API Key for the Bugsnag project | +| REACT_APP_API_ENVIRONMENT | "production" or "development" depending on the environment you want to connect to (local development should be "development") | # Development -- For local development: - - Access server endpoints, such as authentication, using the development server. - - For frontend development, run `yarn start` inside the `/client` directory. -- You can find GraphiQL at `/api/graphiql`, but note that this endpoint is restricted to admin users. For local development, - promote your account to an admin in order to access GraphiQL. +`yarn start` to run the frontend +`yarn build` to build the app for production ## Code Style diff --git a/client/.gitignore b/client/.gitignore deleted file mode 100644 index f40a7a5..0000000 --- a/client/.gitignore +++ /dev/null @@ -1,24 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js - -# testing -/coverage - -# production -/build - -# misc -.DS_Store -.env.local -.env.development.local -.env.test.local -.env.production.local - -npm-debug.log* -yarn-debug.log* -yarn-error.log* -package-lock.json \ No newline at end of file diff --git a/client/README.md b/client/README.md deleted file mode 100644 index 897dc83..0000000 --- a/client/README.md +++ /dev/null @@ -1,44 +0,0 @@ -This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). - -## Available Scripts - -In the project directory, you can run: - -### `npm start` - -Runs the app in the development mode.
-Open [http://localhost:3000](http://localhost:3000) to view it in the browser. - -The page will reload if you make edits.
-You will also see any lint errors in the console. - -### `npm test` - -Launches the test runner in the interactive watch mode.
-See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. - -### `npm run build` - -Builds the app for production to the `build` folder.
-It correctly bundles React in production mode and optimizes the build for the best performance. - -The build is minified and the filenames include the hashes.
-Your app is ready to be deployed! - -See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. - -### `npm run eject` - -**Note: this is a one-way operation. Once you `eject`, you can’t go back!** - -If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. - -Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. - -You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. - -## Learn More - -You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). - -To learn React, check out the [React documentation](https://reactjs.org/). diff --git a/client/generate-build-version.js b/client/generate-build-version.js deleted file mode 100644 index b88f2cd..0000000 --- a/client/generate-build-version.js +++ /dev/null @@ -1,18 +0,0 @@ -// From https://dev.to/flexdinesh/cache-busting-a-react-app-22lk -const fs = require('fs'); - -const packageJson = require('./package.json'); - -const {version} = packageJson; -const jsonContent = JSON.stringify({ - version -}); - -fs.writeFile('./public/meta.json', jsonContent, 'utf8', (err) => { - if (err) { - console.log(`An error occured while writing JSON Object to meta.json (version v${version}`); - console.log(err); - } - - console.log(`meta.json file has been saved with latest version number v${version}`); -}); diff --git a/client/package.json b/client/package.json deleted file mode 100644 index b957c6d..0000000 --- a/client/package.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "name": "bolt-client", - "version": "1.3.2", - "private": true, - "dependencies": { - "@apollo/client": "^3.3.14", - "@bugsnag/js": "^7.9.2", - "@bugsnag/plugin-react": "^7.9.2", - "@chakra-ui/icons": "^2.0.9", - "@chakra-ui/react": "^2.3.2", - "@emotion/react": "^11", - "@emotion/styled": "^11", - "@heroicons/react": "^2.0.11", - "@hex-labs/core": "^1.0.51", - "@tanstack/react-query": "^4.3.9", - "@tanstack/react-query-devtools": "^4.3.9", - "@tanstack/react-table": "^8.5.13", - "accounting": "^0.4.1", - "axios": "^0.27.2", - "axios-hooks": "^3.1.5", - "cleave.js": "^1.6.0", - "firebase": "^9.9.4", - "framer-motion": "^6", - "graphql": "^15.5.0", - "graphql-tag": "^2.11.0", - "graphql-tools": "^7.0.4", - "lodash": "^4.17.21", - "react": "^18.2.0", - "react-beautiful-dnd": "^13.1.1", - "react-data-table-component": "^6.11.7", - "react-dom": "^18.2.0", - "react-dropzone": "^14.2.3", - "react-hook-form": "^7.36.0", - "react-redux": "^7.2.3", - "react-router": "^6.3.0", - "react-router-dom": "6.3.0", - "react-scripts": "5.0.1", - "react-slack-feedback": "^2.1.1", - "react-timeago": "^5.2.0", - "react-toast-notifications": "^2.4.3", - "redux": "^4.0.5", - "redux-thunk": "^2.3.0", - "semantic-ui-css": "^2.5.0", - "semantic-ui-react": "^2.1.3", - "stuff-with-good-eyesight": "^1.2.0", - "styled-components": "^5.2.3", - "subscriptions-transport-ws": "^0.9.18", - "typescript": "4.2.4" - }, - "scripts": { - "generate-build-version": "node generate-build-version", - "prebuild": "npm run generate-build-version", - "predeploy": "npm run build", - "deploy": "gh-pages -d build", - "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test", - "eject": "react-scripts eject", - "lint": "eslint src/ --fix; stylelint src/**/*.css --fix; prettier src/ --write", - "postinstall": "semantic-ui-css-patch" - }, - "prettier": "@hex-labs/prettier-config", - "stylelint": { - "extends": "@hex-labs/stylelint-config" - }, - "browserslist": [ - ">0.2%", - "not dead", - "not ie <= 11", - "not op_mini all" - ], - "author": "Evan Strat", - "devDependencies": { - "@hex-labs/eslint-config-react": "^1.1.5", - "@hex-labs/prettier-config": "^1.1.5", - "@hex-labs/stylelint-config": "^1.1.5", - "@semantic-ui-react/css-patch": "^1.1.2", - "@types/accounting": "^0.4.1", - "@types/axios": "^0.14.0", - "@types/cleave.js": "^1.4.4", - "@types/firebase": "^3.2.1", - "@types/jest": "26.0.22", - "@types/lodash": "^4.14.168", - "@types/react": "*", - "@types/react-beautiful-dnd": "^13.1.2", - "@types/react-dom": "18", - "@types/react-redux": "^7.1.16", - "@types/react-router": "^5.1.18", - "@types/react-router-dom": "^5.3.3", - "@types/react-timeago": "^4.1.2", - "@types/semantic-ui": "^2.2.7", - "eslint": "^8.23.1", - "prettier": "^2.2.1", - "redux-devtools": "^3.5.0", - "stylelint": "^13.12.0" - }, - "options": { - "proxy": "http://localhost:3000" - } -} diff --git a/client/src/App.tsx b/client/src/App.tsx deleted file mode 100644 index 6e613cb..0000000 --- a/client/src/App.tsx +++ /dev/null @@ -1,153 +0,0 @@ -import React, { useEffect, useState } from "react"; -import { ToastProvider } from "react-toast-notifications"; -import { BrowserRouter as Router, Route, Routes, Link } from "react-router-dom"; -import { connect } from "react-redux"; -import { useQuery } from "@apollo/client"; -import { initializeApp } from "firebase/app"; -import { setPersistence, getAuth, inMemoryPersistence } from "firebase/auth"; -import axios from "axios"; -import { - AuthProvider, - ErrorScreen, - Footer, - Header, - HeaderItem, - LoadingScreen, - useLogin, -} from "@hex-labs/core"; -import { Box, Container } from "@chakra-ui/react"; -import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; -import { ReactQueryDevtools } from "@tanstack/react-query-devtools"; - -import HomeContainer from "./components/home/HomeContainer"; -import CSVWizard from "./components/admin/csv/CSVWizard"; -import AdminOverviewContainer from "./components/admin/AdminHub"; -import AdminUsersList from "./components/admin/AdminUsersList"; -import AdminRequestSettingsWrapper from "./components/admin/AdminRequestSettingsWrapper"; -import UserProfileWrapper from "./components/userProfile/UserProfileWrapper"; -import DeskContainer from "./components/admin/desk/DeskContainer"; -import { User } from "./types/User"; -import { loginUser } from "./state/Account"; -import { AppState } from "./state/Store"; -import CacheBuster from "./components/util/CacheBuster"; -import DetailedItemStatistics from "./components/admin/reports/statistics/DetailedItemStatistics"; -import ItemDemandReport from "./components/admin/reports/demand/ItemDemandReport"; -import { USER_INFO } from "./graphql/Queries"; -import LoadingSpinner from "./components/util/LoadingSpinner"; -import CreateItemWrapper from "./components/items/CreateItemWrapper"; -import EditItemWrapper from "./components/items/EditItemWrapper"; -import PrivateRoute from "./components/util/PrivateRoute"; -import AxiosProvider from "./axios"; -import Cart from "./components/cart/Cart"; -import HardwareHeader from "./components/home/HardwareHeader"; -import EditRequest from "./components/admin/desk/submitted/EditRequest"; -import ProtectedRoute from "./components/util/ProtectedRoute"; -import LandingPage from "./components/home/LandingPage"; -import UserProfile from "./components/userProfile/UserProfile"; -import CreateCategoryWrapper from "./components/categories/CreateCategoryWrapper"; - -export const app = initializeApp({ - apiKey: "AIzaSyCsukUZtMkI5FD_etGfefO4Sr7fHkZM7Rg", - authDomain: "hexlabs-cloud.firebaseapp.com", -}); - -setPersistence(getAuth(app), inMemoryPersistence); - -axios.defaults.withCredentials = true; - -const queryClient = new QueryClient(); - -export const App: React.FC = () => { - const [loading, loggedIn] = useLogin(app); - - if (loading) { - return ; - } - - if (!loggedIn) { - window.location.href = `https://login.hexlabs.org?redirect=${window.location.href}`; - } - - return ( - - {/* - - - } /> - - - - - - } /> - } /> - {/* } /> - } /> - - - - - - - - - - }> - } /> - } /> - } /> - - } /> - } /> - - }> - } /> - - } /> - - - -