From 0b2a7f07a7df28ed4f12b253436f4cb2c9af4a4a Mon Sep 17 00:00:00 2001 From: Dave Date: Mon, 12 Jan 2026 13:55:50 -0500 Subject: [PATCH] feature/IO-3497-Ant-Design-v5-to-v6 - Revert any apollo updates --- client/package-lock.json | 77 ++++++++++++++----- client/package.json | 4 +- .../card-payment-modal.component.jsx | 9 +-- .../schedule-event.component.jsx | 3 +- ...etail-header-actions.toggle-production.jsx | 3 +- .../owner-find-modal.container.jsx | 6 +- client/src/graphql/apollo-error-handling.js | 8 +- 7 files changed, 77 insertions(+), 33 deletions(-) diff --git a/client/package-lock.json b/client/package-lock.json index cd1ad58a2..52ec61f4a 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@amplitude/analytics-browser": "^2.33.1", "@ant-design/pro-layout": "^7.22.6", - "@apollo/client": "^4.0.12", + "@apollo/client": "^3.13.9", "@emotion/is-prop-valid": "^1.4.0", "@fingerprintjs/fingerprintjs": "^4.6.1", "@firebase/analytics": "^0.10.19", @@ -27,7 +27,7 @@ "@splitsoftware/splitio-react": "^2.6.1", "@tanem/react-nprogress": "^5.0.56", "antd": "^6.1.4", - "apollo-link-logger": "^3.0.0", + "apollo-link-logger": "^2.0.1", "apollo-link-sentry": "^4.4.0", "autosize": "^6.0.1", "axios": "^1.13.2", @@ -553,30 +553,30 @@ } }, "node_modules/@apollo/client": { - "version": "4.0.12", - "resolved": "https://registry.npmjs.org/@apollo/client/-/client-4.0.12.tgz", - "integrity": "sha512-CyDR+2A18TFH08rKvH3DaV63eRE0E4pj34gT8UZIQVP64bRRXnQiYuKTf/c6oJNY8+4FrCrcPwWEldnVbh02bA==", + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/@apollo/client/-/client-3.14.0.tgz", + "integrity": "sha512-0YQKKRIxiMlIou+SekQqdCo0ZTHxOcES+K8vKB53cIDpwABNR0P0yRzPgsbgcj3zRJniD93S/ontsnZsCLZrxQ==", "license": "MIT", - "workspaces": [ - "dist", - "codegen", - "scripts/codemods/ac3-to-ac4" - ], "dependencies": { "@graphql-typed-document-node/core": "^3.1.1", "@wry/caches": "^1.0.0", "@wry/equality": "^0.5.6", "@wry/trie": "^0.5.0", "graphql-tag": "^2.12.6", + "hoist-non-react-statics": "^3.3.2", "optimism": "^0.18.0", - "tslib": "^2.3.0" + "prop-types": "^15.7.2", + "rehackt": "^0.1.0", + "symbol-observable": "^4.0.0", + "ts-invariant": "^0.10.3", + "tslib": "^2.3.0", + "zen-observable-ts": "^1.2.5" }, "peerDependencies": { - "graphql": "^16.0.0", + "graphql": "^15.0.0 || ^16.0.0", "graphql-ws": "^5.5.5 || ^6.0.3", - "react": "^17.0.0 || ^18.0.0 || >=19.0.0-rc", - "react-dom": "^17.0.0 || ^18.0.0 || >=19.0.0-rc", - "rxjs": "^7.3.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc", "subscriptions-transport-ws": "^0.9.0 || ^0.11.0" }, "peerDependenciesMeta": { @@ -7266,16 +7266,16 @@ } }, "node_modules/apollo-link-logger": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/apollo-link-logger/-/apollo-link-logger-3.0.0.tgz", - "integrity": "sha512-7j557AndpQXqmOg6MLERh9eCGrKdQSoIzHPSU+9Umw8EnkwU+CphCXb4p22Zx6yRnYxVV7fOrqbB+4lsfloATQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/apollo-link-logger/-/apollo-link-logger-2.0.1.tgz", + "integrity": "sha512-4KkdwCqWtlOc0vx0W/5o+UfotyZtcJZicraKNyo2KTaCmAGSJ8vDnNRyDlv6o5XtSgdv4NA36cSe6dt49OkGWA==", "license": "MIT", "engines": { "node": ">= 10", "npm": "> 3" }, "peerDependencies": { - "@apollo/client": "^4.0.0" + "@apollo/client": "^3.0.0" } }, "node_modules/apollo-link-sentry": { @@ -15266,6 +15266,24 @@ "regjsparser": "bin/parser" } }, + "node_modules/rehackt": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/rehackt/-/rehackt-0.1.0.tgz", + "integrity": "sha512-7kRDOuLHB87D/JESKxQoRwv4DzbIdwkAGQ7p6QKGdVlY1IZheUnVhlk/4UZlNUVxdAXpyxikE3URsG067ybVzw==", + "license": "MIT", + "peerDependencies": { + "@types/react": "*", + "react": "*" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "react": { + "optional": true + } + } + }, "node_modules/remark-parse": { "version": "11.0.0", "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-11.0.0.tgz", @@ -16673,6 +16691,15 @@ "react": "^16.11.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, + "node_modules/symbol-observable": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-4.0.0.tgz", + "integrity": "sha512-b19dMThMV4HVFynSAM1++gBHAbk2Tc/osgLIBZMKsyqh34jb2e8Os7T6ZW/Bt3pJFdBTd2JwAnAAEQV7rSNvcQ==", + "license": "MIT", + "engines": { + "node": ">=0.10" + } + }, "node_modules/symbol-tree": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", @@ -17007,6 +17034,18 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/ts-invariant": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.10.3.tgz", + "integrity": "sha512-uivwYcQaxAucv1CzRp2n/QdYPo4ILf9VXgH19zEIjFx2EJufV16P0JtJVpYHy89DItG6Kwj2oIUjrcK5au+4tQ==", + "license": "MIT", + "dependencies": { + "tslib": "^2.1.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", diff --git a/client/package.json b/client/package.json index 50a0c94c4..f20203a00 100644 --- a/client/package.json +++ b/client/package.json @@ -10,7 +10,7 @@ "dependencies": { "@amplitude/analytics-browser": "^2.33.1", "@ant-design/pro-layout": "^7.22.6", - "@apollo/client": "^4.0.12", + "@apollo/client": "^3.13.9", "@emotion/is-prop-valid": "^1.4.0", "@fingerprintjs/fingerprintjs": "^4.6.1", "@firebase/analytics": "^0.10.19", @@ -26,7 +26,7 @@ "@splitsoftware/splitio-react": "^2.6.1", "@tanem/react-nprogress": "^5.0.56", "antd": "^6.1.4", - "apollo-link-logger": "^3.0.0", + "apollo-link-logger": "^2.0.1", "apollo-link-sentry": "^4.4.0", "autosize": "^6.0.1", "axios": "^1.13.2", diff --git a/client/src/components/card-payment-modal/card-payment-modal.component.jsx b/client/src/components/card-payment-modal/card-payment-modal.component.jsx index 0f280bdec..cf40c9c50 100644 --- a/client/src/components/card-payment-modal/card-payment-modal.component.jsx +++ b/client/src/components/card-payment-modal/card-payment-modal.component.jsx @@ -51,11 +51,10 @@ const CardPaymentModalComponent = ({ const { t } = useTranslation(); const notification = useNotification(); - const [executeQuery, { data, loading: queryLoading }] = useLazyQuery(QUERY_RO_AND_OWNER_BY_JOB_PKS); - - const refetch = (variables) => { - return executeQuery({ variables }); - }; + const [, { data, refetch, queryLoading }] = useLazyQuery(QUERY_RO_AND_OWNER_BY_JOB_PKS, { + variables: { jobids: [context.jobid] }, + skip: !context?.jobid + }); const collectIPayFields = () => { const iPayFields = document.querySelectorAll(".ipayfield"); diff --git a/client/src/components/job-at-change/schedule-event.component.jsx b/client/src/components/job-at-change/schedule-event.component.jsx index 927dd23df..91fec5ce6 100644 --- a/client/src/components/job-at-change/schedule-event.component.jsx +++ b/client/src/components/job-at-change/schedule-event.component.jsx @@ -66,6 +66,7 @@ export function ScheduleEventComponent({ const [form] = Form.useForm(); const [popOverVisible, setPopOverVisible] = useState(false); const [getJobDetails] = useLazyQuery(GET_JOB_BY_PK_QUICK_INTAKE, { + variables: { id: event.job?.id }, onCompleted: (data) => { if (data?.jobs_by_pk) { const totalHours = @@ -408,7 +409,7 @@ export function ScheduleEventComponent({ onClick={(e) => { if (event.job?.id) { e.stopPropagation(); - getJobDetails({ variables: { id: event.job.id } }); + getJobDetails(); } }} getPopupContainer={(trigger) => trigger.parentNode} diff --git a/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.toggle-production.jsx b/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.toggle-production.jsx index 4c3afd66b..6e89cf316 100644 --- a/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.toggle-production.jsx +++ b/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.toggle-production.jsx @@ -42,6 +42,7 @@ export function JobsDetailHeaderActionsToggleProduction({ const notification = useNotification(); const [getJobDetails, { loading: jobDetailsLoading }] = useLazyQuery(GET_JOB_BY_PK_QUICK_INTAKE, { + variables: { id: job.id }, onCompleted: (data) => { if (data?.jobs_by_pk) { const totalHours = @@ -203,7 +204,7 @@ export function JobsDetailHeaderActionsToggleProduction({ open={popOverVisible} onOpenChange={setPopOverVisible} onClick={(e) => { - getJobDetails({ variables: { id: job.id } }); + getJobDetails(); e.stopPropagation(); }} getPopupContainer={(trigger) => trigger.parentNode} diff --git a/client/src/components/owner-find-modal/owner-find-modal.container.jsx b/client/src/components/owner-find-modal/owner-find-modal.container.jsx index 855721d63..580466c82 100644 --- a/client/src/components/owner-find-modal/owner-find-modal.container.jsx +++ b/client/src/components/owner-find-modal/owner-find-modal.container.jsx @@ -22,7 +22,11 @@ export default function OwnerFindModalContainer({ const { t } = useTranslation(); const [searchText, setSearchText] = useState(null); - const [callSearchowners, ownersList] = useLazyQuery(QUERY_SEARCH_OWNER_BY_IDX); + const [callSearchowners, ownersList] = useLazyQuery(QUERY_SEARCH_OWNER_BY_IDX, { + variables: { + search: searchText + } + }); useEffect(() => { if (modalProps.open && owner) { diff --git a/client/src/graphql/apollo-error-handling.js b/client/src/graphql/apollo-error-handling.js index c97030aa0..3fdaa929c 100644 --- a/client/src/graphql/apollo-error-handling.js +++ b/client/src/graphql/apollo-error-handling.js @@ -1,13 +1,13 @@ import { onError } from "@apollo/client/link/error"; //https://stackoverflow.com/questions/57163454/refreshing-a-token-with-apollo-client-firebase-auth -const errorLink = onError(({ error, operation, forward }) => { - if (error?.graphQLErrors) { - error.graphQLErrors.forEach(({ message, locations, path }) => { +const errorLink = onError(({ graphQLErrors, networkError, operation, forward }) => { + if (graphQLErrors) { + graphQLErrors.forEach(({ message, locations, path }) => { console.log(`[GraphQL error]: Message: ${message}, Location: ${locations}, Path: ${path}`); }); } - if (error?.networkError) console.log(`[Network error]: ${JSON.stringify(error.networkError)}`); + if (networkError) console.log(`[Network error]: ${JSON.stringify(networkError)}`); console.log(operation.getContext()); return forward(operation); });