diff --git a/.storybook/helpers/MockedUserProvider.tsx b/.storybook/helpers/MockedUserProvider.tsx index 870899ea5..47f1ad61a 100644 --- a/.storybook/helpers/MockedUserProvider.tsx +++ b/.storybook/helpers/MockedUserProvider.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import * as React from "react"; import { UserContext } from "../../src/auth"; import { adminUserPermissions } from "../../src/fixtures"; diff --git a/package-lock.json b/package-lock.json index cb97cfc1e..957ce7586 100644 --- a/package-lock.json +++ b/package-lock.json @@ -162,6 +162,7 @@ "rollup-plugin-polyfill-node": "^0.11.0", "start-server-and-test": "^1.11.0", "typescript": "^5.0.2", + "typescript-strict-plugin": "^2.1.0", "vite": "^3.2.4", "vite-plugin-html": "^3.2.0", "vite-plugin-pwa": "^0.13.3", @@ -33952,6 +33953,211 @@ "node": ">=12.20" } }, + "node_modules/typescript-strict-plugin": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/typescript-strict-plugin/-/typescript-strict-plugin-2.1.0.tgz", + "integrity": "sha512-ilLV3nyWUAzh8il8Q0ItX8j5xdprWAvZYNsebOkjfz/FAoVc8DiBvAS9+QxAYMMzbOq7XNtx5cUy84SVKTohyw==", + "dev": true, + "dependencies": { + "chalk": "^3.0.0", + "execa": "^4.0.0", + "ora": "^5.4.1", + "yargs": "^16.2.0" + }, + "bin": { + "tsc-strict": "dist/cli/tsc-strict/index.js", + "update-strict-comments": "dist/cli/update-strict-comments/index.js" + } + }, + "node_modules/typescript-strict-plugin/node_modules/chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/typescript-strict-plugin/node_modules/cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, + "dependencies": { + "restore-cursor": "^3.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/typescript-strict-plugin/node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/typescript-strict-plugin/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/typescript-strict-plugin/node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typescript-strict-plugin/node_modules/log-symbols/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/typescript-strict-plugin/node_modules/ora": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", + "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", + "dev": true, + "dependencies": { + "bl": "^4.1.0", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.5.0", + "is-interactive": "^1.0.0", + "is-unicode-supported": "^0.1.0", + "log-symbols": "^4.1.0", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typescript-strict-plugin/node_modules/ora/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/typescript-strict-plugin/node_modules/restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/typescript-strict-plugin/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/typescript-strict-plugin/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/typescript-strict-plugin/node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/typescript-strict-plugin/node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/typescript-strict-plugin/node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/ua-parser-js": { "version": "0.7.35", "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.35.tgz", @@ -59319,6 +59525,162 @@ "integrity": "sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==", "dev": true }, + "typescript-strict-plugin": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/typescript-strict-plugin/-/typescript-strict-plugin-2.1.0.tgz", + "integrity": "sha512-ilLV3nyWUAzh8il8Q0ItX8j5xdprWAvZYNsebOkjfz/FAoVc8DiBvAS9+QxAYMMzbOq7XNtx5cUy84SVKTohyw==", + "dev": true, + "requires": { + "chalk": "^3.0.0", + "execa": "^4.0.0", + "ora": "^5.4.1", + "yargs": "^16.2.0" + }, + "dependencies": { + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, + "requires": { + "restore-cursor": "^3.1.0" + } + }, + "cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "requires": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "dependencies": { + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + } + } + }, + "ora": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", + "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", + "dev": true, + "requires": { + "bl": "^4.1.0", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.5.0", + "is-interactive": "^1.0.0", + "is-unicode-supported": "^0.1.0", + "log-symbols": "^4.1.0", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1" + }, + "dependencies": { + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + } + } + }, + "restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "requires": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true + }, + "yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + } + }, + "yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true + } + } + }, "ua-parser-js": { "version": "0.7.35", "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.35.tgz", diff --git a/package.json b/package.json index b7fabcf56..d268df6bc 100644 --- a/package.json +++ b/package.json @@ -169,6 +169,7 @@ "rollup-plugin-polyfill-node": "^0.11.0", "start-server-and-test": "^1.11.0", "typescript": "^5.0.2", + "typescript-strict-plugin": "^2.1.0", "vite": "^3.2.4", "vite-plugin-html": "^3.2.0", "vite-plugin-pwa": "^0.13.3", @@ -299,7 +300,7 @@ "build-types": "node scripts/build-types.js", "prebuild": "npm run build-types", "check-strict-null-errors": "tsc --noEmit --strictNullChecks | node scripts/count-strict-null-check-errors.js", - "check-types": "tsc --noEmit", + "check-types": "tsc --noEmit && tsc-strict", "extract-json-messages": "formatjs extract 'src/**/*.{ts,tsx}' --out-file locale/defaultMessages.json --format scripts/formatter.js", "extract-messages": "npm run extract-json-messages", "fetch-schema": "graphql-codegen --config ./fetch-schema.yml", diff --git a/src/apps/components/AppAvatar/AppAvatar.tsx b/src/apps/components/AppAvatar/AppAvatar.tsx index a9daed26a..b76f2024e 100644 --- a/src/apps/components/AppAvatar/AppAvatar.tsx +++ b/src/apps/components/AppAvatar/AppAvatar.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { AppLogo } from "@dashboard/apps/types"; import { Box, GenericAppIcon } from "@saleor/macaw-ui/next"; import React from "react"; diff --git a/src/apps/components/AppDetailsPage/AppDetailsPage.test.tsx b/src/apps/components/AppDetailsPage/AppDetailsPage.test.tsx index 0106a4bc8..50e0a22e0 100644 --- a/src/apps/components/AppDetailsPage/AppDetailsPage.test.tsx +++ b/src/apps/components/AppDetailsPage/AppDetailsPage.test.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { render } from "@testing-library/react"; import React from "react"; diff --git a/src/apps/components/AppDetailsPage/DataPrivacyCard.tsx b/src/apps/components/AppDetailsPage/DataPrivacyCard.tsx index 4156d0a41..428c84038 100644 --- a/src/apps/components/AppDetailsPage/DataPrivacyCard.tsx +++ b/src/apps/components/AppDetailsPage/DataPrivacyCard.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import CardTitle from "@dashboard/components/CardTitle"; import ExternalLink from "@dashboard/components/ExternalLink"; import Skeleton from "@dashboard/components/Skeleton"; diff --git a/src/apps/components/AppDetailsPage/Header.tsx b/src/apps/components/AppDetailsPage/Header.tsx index acbcd87df..02abc3140 100644 --- a/src/apps/components/AppDetailsPage/Header.tsx +++ b/src/apps/components/AppDetailsPage/Header.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { AppPageNav } from "@dashboard/apps/components/AppPage/AppPageNav"; import { AppUrls } from "@dashboard/apps/urls"; import { AppQuery } from "@dashboard/graphql"; diff --git a/src/apps/components/AppDetailsPage/PermissionsCard.tsx b/src/apps/components/AppDetailsPage/PermissionsCard.tsx index b294ba4f9..488f06ed8 100644 --- a/src/apps/components/AppDetailsPage/PermissionsCard.tsx +++ b/src/apps/components/AppDetailsPage/PermissionsCard.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import CardTitle from "@dashboard/components/CardTitle"; import Skeleton from "@dashboard/components/Skeleton"; import { AppQuery } from "@dashboard/graphql"; diff --git a/src/apps/components/AppFrame/AppFrame.tsx b/src/apps/components/AppFrame/AppFrame.tsx index 1c24d3253..3257dcc4d 100644 --- a/src/apps/components/AppFrame/AppFrame.tsx +++ b/src/apps/components/AppFrame/AppFrame.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useAppDashboardUpdates } from "@dashboard/apps/components/AppFrame/useAppDashboardUpdates"; import { useUpdateAppToken } from "@dashboard/apps/components/AppFrame/useUpdateAppToken"; import { diff --git a/src/apps/components/AppFrame/AppIFrame.tsx b/src/apps/components/AppFrame/AppIFrame.tsx index ff15f8261..373605e71 100644 --- a/src/apps/components/AppFrame/AppIFrame.tsx +++ b/src/apps/components/AppFrame/AppIFrame.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { AppDetailsUrlQueryParams, AppUrls } from "@dashboard/apps/urls"; import { ThemeType } from "@saleor/app-sdk/app-bridge"; import { useTheme } from "@saleor/macaw-ui"; diff --git a/src/apps/components/AppFrame/appActionsHandler.test.ts b/src/apps/components/AppFrame/appActionsHandler.test.ts index 83d6e8b2b..0ee4e6dde 100644 --- a/src/apps/components/AppFrame/appActionsHandler.test.ts +++ b/src/apps/components/AppFrame/appActionsHandler.test.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { AppActionsHandler } from "@dashboard/apps/components/AppFrame/appActionsHandler"; import * as ExternalAppContext from "@dashboard/apps/components/ExternalAppContext/ExternalAppContext"; import * as dashboardConfig from "@dashboard/config"; diff --git a/src/apps/components/AppFrame/useUpdateAppToken.ts b/src/apps/components/AppFrame/useUpdateAppToken.ts index 910d7e616..91a315081 100644 --- a/src/apps/components/AppFrame/useUpdateAppToken.ts +++ b/src/apps/components/AppFrame/useUpdateAppToken.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { createAppsDebug } from "@dashboard/apps/apps-debug"; import { DashboardEventFactory, Events } from "@saleor/app-sdk/app-bridge"; import { useEffect, useRef } from "react"; diff --git a/src/apps/components/AppListPage/utils.ts b/src/apps/components/AppListPage/utils.ts index af9758cd1..78005a4e0 100644 --- a/src/apps/components/AppListPage/utils.ts +++ b/src/apps/components/AppListPage/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { GetV2SaleorAppsResponse } from "@dashboard/apps/marketplace.types"; import { AppInstallation, InstalledApp } from "@dashboard/apps/types"; import { diff --git a/src/apps/components/AppListRow/AppListRow.tsx b/src/apps/components/AppListRow/AppListRow.tsx index a706d8e31..adf923203 100644 --- a/src/apps/components/AppListRow/AppListRow.tsx +++ b/src/apps/components/AppListRow/AppListRow.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useAppListContext } from "@dashboard/apps/context"; import { GetV2SaleorAppsResponse } from "@dashboard/apps/marketplace.types"; import { diff --git a/src/apps/components/AppPage/AppPage.tsx b/src/apps/components/AppPage/AppPage.tsx index db91d377e..4d735b5d7 100644 --- a/src/apps/components/AppPage/AppPage.tsx +++ b/src/apps/components/AppPage/AppPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { AppUrls } from "@dashboard/apps/urls"; import { borderHeight, diff --git a/src/apps/hooks/useExtensions.ts b/src/apps/hooks/useExtensions.ts index 1beb8e957..3c0ffcba0 100644 --- a/src/apps/hooks/useExtensions.ts +++ b/src/apps/hooks/useExtensions.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useUserPermissions } from "@dashboard/auth/hooks/useUserPermissions"; import { AppExtensionMountEnum, diff --git a/src/apps/hooks/useMarketplaceApps.test.ts b/src/apps/hooks/useMarketplaceApps.test.ts index 380a87319..4db325542 100644 --- a/src/apps/hooks/useMarketplaceApps.test.ts +++ b/src/apps/hooks/useMarketplaceApps.test.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { renderHook } from "@testing-library/react-hooks"; import { comingSoonApp, releasedApp } from "../fixtures"; diff --git a/src/apps/utils.ts b/src/apps/utils.ts index b5a82782a..edc3e7a5b 100644 --- a/src/apps/utils.ts +++ b/src/apps/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { getAppsConfig } from "@dashboard/config"; import { AppInstallationFragment, JobStatusEnum } from "@dashboard/graphql"; import { IntlShape } from "react-intl"; diff --git a/src/attributes/components/AttributeDetails/utils.ts b/src/attributes/components/AttributeDetails/utils.ts index e28ce478d..65d840968 100644 --- a/src/attributes/components/AttributeDetails/utils.ts +++ b/src/attributes/components/AttributeDetails/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Choice } from "@dashboard/components/SingleSelectField"; import { MeasurementUnitsEnum } from "@dashboard/graphql"; import React from "react"; diff --git a/src/attributes/components/AttributeListPage/AttributeListPage.tsx b/src/attributes/components/AttributeListPage/AttributeListPage.tsx index ef53354a5..f00e2b1fa 100644 --- a/src/attributes/components/AttributeListPage/AttributeListPage.tsx +++ b/src/attributes/components/AttributeListPage/AttributeListPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { attributeAddUrl, AttributeListUrlSortField, diff --git a/src/attributes/components/AttributePage/AttributePage.tsx b/src/attributes/components/AttributePage/AttributePage.tsx index 70c7b5e09..5304b3a2b 100644 --- a/src/attributes/components/AttributePage/AttributePage.tsx +++ b/src/attributes/components/AttributePage/AttributePage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { attributeListUrl } from "@dashboard/attributes/urls"; import { ATTRIBUTE_TYPES_WITH_DEDICATED_VALUES } from "@dashboard/attributes/utils/data"; import { TopNav } from "@dashboard/components/AppLayout/TopNav"; diff --git a/src/attributes/components/AttributeSwatchField/AttributeSwatchField.tsx b/src/attributes/components/AttributeSwatchField/AttributeSwatchField.tsx index 95c7abfa8..487fd65da 100644 --- a/src/attributes/components/AttributeSwatchField/AttributeSwatchField.tsx +++ b/src/attributes/components/AttributeSwatchField/AttributeSwatchField.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { inputTypeMessages } from "@dashboard/attributes/components/AttributeDetails/messages"; import { AttributeValueEditDialogFormData } from "@dashboard/attributes/utils/data"; import { ColorPicker } from "@dashboard/components/ColorPicker"; diff --git a/src/attributes/utils/data.ts b/src/attributes/utils/data.ts index f9a276d0e..a2d6f2978 100644 --- a/src/attributes/utils/data.ts +++ b/src/attributes/utils/data.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FetchResult } from "@apollo/client"; import { AttributeInput, diff --git a/src/attributes/views/AttributeList/AttributeList.tsx b/src/attributes/views/AttributeList/AttributeList.tsx index 8c41257c2..472b36599 100644 --- a/src/attributes/views/AttributeList/AttributeList.tsx +++ b/src/attributes/views/AttributeList/AttributeList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { deleteFilterTab, getActiveFilters, diff --git a/src/auth/AuthProvider.test.tsx b/src/auth/AuthProvider.test.tsx index 7e97a4b0e..f7c047ffe 100644 --- a/src/auth/AuthProvider.test.tsx +++ b/src/auth/AuthProvider.test.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useApolloClient } from "@apollo/client"; import { useUserDetailsQuery } from "@dashboard/graphql"; import useNotifier from "@dashboard/hooks/useNotifier"; diff --git a/src/auth/components/LoginPage/LoginPage.stories.tsx b/src/auth/components/LoginPage/LoginPage.stories.tsx index 69a8e2212..04a51674b 100644 --- a/src/auth/components/LoginPage/LoginPage.stories.tsx +++ b/src/auth/components/LoginPage/LoginPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import React from "react"; import { CardDecorator } from "../../../../.storybook/decorators"; diff --git a/src/auth/components/LoginPage/LoginPage.tsx b/src/auth/components/LoginPage/LoginPage.tsx index c9d49874c..286011eef 100644 --- a/src/auth/components/LoginPage/LoginPage.tsx +++ b/src/auth/components/LoginPage/LoginPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { UserContextError } from "@dashboard/auth/types"; import { passwordResetUrl } from "@dashboard/auth/urls"; import { Button } from "@dashboard/components/Button"; diff --git a/src/auth/components/NewPasswordPage/NewPasswordPage.stories.tsx b/src/auth/components/NewPasswordPage/NewPasswordPage.stories.tsx index f24cf9054..e93483372 100644 --- a/src/auth/components/NewPasswordPage/NewPasswordPage.stories.tsx +++ b/src/auth/components/NewPasswordPage/NewPasswordPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { AccountErrorCode } from "@dashboard/graphql"; import React from "react"; diff --git a/src/auth/components/NewPasswordPage/NewPasswordPage.tsx b/src/auth/components/NewPasswordPage/NewPasswordPage.tsx index 3b995fe1d..f396665b7 100644 --- a/src/auth/components/NewPasswordPage/NewPasswordPage.tsx +++ b/src/auth/components/NewPasswordPage/NewPasswordPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Button } from "@dashboard/components/Button"; import Form from "@dashboard/components/Form"; import FormSpacer from "@dashboard/components/FormSpacer"; diff --git a/src/auth/components/ResetPasswordPage/ResetPasswordPage.stories.tsx b/src/auth/components/ResetPasswordPage/ResetPasswordPage.stories.tsx index d83f48f61..66e7bb4aa 100644 --- a/src/auth/components/ResetPasswordPage/ResetPasswordPage.stories.tsx +++ b/src/auth/components/ResetPasswordPage/ResetPasswordPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import React from "react"; import { CardDecorator } from "../../../../.storybook/decorators"; diff --git a/src/auth/components/ResetPasswordPage/ResetPasswordPage.tsx b/src/auth/components/ResetPasswordPage/ResetPasswordPage.tsx index c7c01959d..571952d94 100644 --- a/src/auth/components/ResetPasswordPage/ResetPasswordPage.tsx +++ b/src/auth/components/ResetPasswordPage/ResetPasswordPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Button } from "@dashboard/components/Button"; import Form from "@dashboard/components/Form"; import FormSpacer from "@dashboard/components/FormSpacer"; diff --git a/src/auth/errors.ts b/src/auth/errors.ts index 38fa225a6..1b2d473a4 100644 --- a/src/auth/errors.ts +++ b/src/auth/errors.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ApolloError } from "@apollo/client"; import { findValueInEnum } from "@dashboard/misc"; import { GraphQLError } from "graphql"; @@ -15,7 +16,7 @@ export const AuthError = { OAuthError: "OAuthError", } as const; -export type AuthError = typeof AuthError[keyof typeof AuthError]; +export type AuthError = (typeof AuthError)[keyof typeof AuthError]; export function isJwtError(error: GraphQLError): boolean { let jwtError: boolean; diff --git a/src/auth/hooks/useAuthProvider.ts b/src/auth/hooks/useAuthProvider.ts index 8f65a2127..d194fd3f4 100644 --- a/src/auth/hooks/useAuthProvider.ts +++ b/src/auth/hooks/useAuthProvider.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ApolloClient, ApolloError } from "@apollo/client"; import { IMessageContext } from "@dashboard/components/messages"; import { DEMO_MODE } from "@dashboard/config"; diff --git a/src/auth/hooks/useAuthRedirection.ts b/src/auth/hooks/useAuthRedirection.ts index 03d6b98bb..6ffbb6e59 100644 --- a/src/auth/hooks/useAuthRedirection.ts +++ b/src/auth/hooks/useAuthRedirection.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { getAppMountUri } from "@dashboard/config"; import { getAppMountUriForRedirect } from "@dashboard/utils/urls"; import { useEffect } from "react"; diff --git a/src/auth/index.tsx b/src/auth/index.tsx index 1bfaaafe3..26eb821ef 100644 --- a/src/auth/index.tsx +++ b/src/auth/index.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { parse as parseQs } from "qs"; import React, { useContext } from "react"; import { Route, RouteComponentProps, Switch } from "react-router-dom"; diff --git a/src/auth/misc.ts b/src/auth/misc.ts index ee170f982..c695c44f1 100644 --- a/src/auth/misc.ts +++ b/src/auth/misc.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { PermissionEnum, UserFragment } from "@dashboard/graphql"; export const hasPermission = (permission: PermissionEnum, user: UserFragment) => diff --git a/src/auth/utils.ts b/src/auth/utils.ts index a870a49fa..4c1e14ef9 100644 --- a/src/auth/utils.ts +++ b/src/auth/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ApolloError, ServerError } from "@apollo/client/core"; import { IMessage, IMessageContext } from "@dashboard/components/messages"; import { UseNotifierResult } from "@dashboard/hooks/useNotifier"; diff --git a/src/auth/views/Login.tsx b/src/auth/views/Login.tsx index 23a15c623..f2daa0ddb 100644 --- a/src/auth/views/Login.tsx +++ b/src/auth/views/Login.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useAvailableExternalAuthenticationsLazyQuery } from "@dashboard/graphql"; import useNavigator from "@dashboard/hooks/useNavigator"; import { getAppMountUriForRedirect } from "@dashboard/utils/urls"; diff --git a/src/auth/views/NewPassword.tsx b/src/auth/views/NewPassword.tsx index ef68283df..2467e65b5 100644 --- a/src/auth/views/NewPassword.tsx +++ b/src/auth/views/NewPassword.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import useNavigator from "@dashboard/hooks/useNavigator"; import { SetPasswordData, useAuth } from "@saleor/sdk"; import { parse as parseQs } from "qs"; diff --git a/src/auth/views/ResetPassword.tsx b/src/auth/views/ResetPassword.tsx index 4d167f607..95c144e99 100644 --- a/src/auth/views/ResetPassword.tsx +++ b/src/auth/views/ResetPassword.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useRequestPasswordResetMutation } from "@dashboard/graphql"; import useNavigator from "@dashboard/hooks/useNavigator"; import { commonMessages } from "@dashboard/intl"; @@ -17,30 +18,28 @@ const ResetPasswordView: React.FC = () => { const navigate = useNavigator(); const intl = useIntl(); - const [ - requestPasswordReset, - requestPasswordResetOpts, - ] = useRequestPasswordResetMutation({ - onCompleted: data => { - if (data.requestPasswordReset.errors.length === 0) { - navigate(passwordResetSuccessUrl); - } else { - if ( - data.requestPasswordReset.errors.find(err => err.field === "email") - ) { - setError( - intl.formatMessage({ - id: "C0JLNW", - defaultMessage: - "Provided email address does not exist in our database.", - }), - ); + const [requestPasswordReset, requestPasswordResetOpts] = + useRequestPasswordResetMutation({ + onCompleted: data => { + if (data.requestPasswordReset.errors.length === 0) { + navigate(passwordResetSuccessUrl); } else { - setError(intl.formatMessage(commonMessages.somethingWentWrong)); + if ( + data.requestPasswordReset.errors.find(err => err.field === "email") + ) { + setError( + intl.formatMessage({ + id: "C0JLNW", + defaultMessage: + "Provided email address does not exist in our database.", + }), + ); + } else { + setError(intl.formatMessage(commonMessages.somethingWentWrong)); + } } - } - }, - }); + }, + }); const handleSubmit = (data: ResetPasswordPageFormData) => extractMutationErrors( diff --git a/src/categories/components/CategoryBackground/CategoryBackground.tsx b/src/categories/components/CategoryBackground/CategoryBackground.tsx index 6829ac012..fb2d77947 100644 --- a/src/categories/components/CategoryBackground/CategoryBackground.tsx +++ b/src/categories/components/CategoryBackground/CategoryBackground.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Button } from "@dashboard/components/Button"; import CardTitle from "@dashboard/components/CardTitle"; import Hr from "@dashboard/components/Hr"; diff --git a/src/categories/components/CategoryCreatePage/CategoryCreatePage.tsx b/src/categories/components/CategoryCreatePage/CategoryCreatePage.tsx index 313011b33..b035e7278 100644 --- a/src/categories/components/CategoryCreatePage/CategoryCreatePage.tsx +++ b/src/categories/components/CategoryCreatePage/CategoryCreatePage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import { CardSpacer } from "@dashboard/components/CardSpacer"; import { ConfirmButtonTransitionState } from "@dashboard/components/ConfirmButton"; diff --git a/src/categories/components/CategoryCreatePage/form.tsx b/src/categories/components/CategoryCreatePage/form.tsx index 7025aaab9..136a88b80 100644 --- a/src/categories/components/CategoryCreatePage/form.tsx +++ b/src/categories/components/CategoryCreatePage/form.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useExitFormDialog } from "@dashboard/components/Form/useExitFormDialog"; import { MetadataFormData } from "@dashboard/components/Metadata"; import useForm, { @@ -74,9 +75,8 @@ function useCategoryCreateForm( triggerChange, }); - const { - makeChangeHandler: makeMetadataChangeHandler, - } = useMetadataChangeTrigger(); + const { makeChangeHandler: makeMetadataChangeHandler } = + useMetadataChangeTrigger(); const changeMetadata = makeMetadataChangeHandler(handleChange); diff --git a/src/categories/components/CategoryDeleteDialog/CategoryDeleteDialog.tsx b/src/categories/components/CategoryDeleteDialog/CategoryDeleteDialog.tsx index 4ddde8392..1dcbeaf7b 100644 --- a/src/categories/components/CategoryDeleteDialog/CategoryDeleteDialog.tsx +++ b/src/categories/components/CategoryDeleteDialog/CategoryDeleteDialog.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import BackButton from "@dashboard/components/BackButton"; import { Button } from "@dashboard/components/Button"; import { buttonMessages } from "@dashboard/intl"; diff --git a/src/categories/components/CategoryDetailsForm/CategoryDetailsForm.tsx b/src/categories/components/CategoryDetailsForm/CategoryDetailsForm.tsx index 72f2b16fc..4e65942d7 100644 --- a/src/categories/components/CategoryDetailsForm/CategoryDetailsForm.tsx +++ b/src/categories/components/CategoryDetailsForm/CategoryDetailsForm.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import CardTitle from "@dashboard/components/CardTitle"; import FormSpacer from "@dashboard/components/FormSpacer"; import RichTextEditor from "@dashboard/components/RichTextEditor"; @@ -28,12 +29,8 @@ export const CategoryDetailsForm: React.FC = ({ errors, }) => { const intl = useIntl(); - const { - defaultValue, - editorRef, - isReadyForMount, - handleChange, - } = useRichTextContext(); + const { defaultValue, editorRef, isReadyForMount, handleChange } = + useRichTextContext(); const formErrors = getFormErrors(["name", "description"], errors); diff --git a/src/categories/components/CategoryList/CategoryList.tsx b/src/categories/components/CategoryList/CategoryList.tsx index bda9d0a0c..e2951c749 100644 --- a/src/categories/components/CategoryList/CategoryList.tsx +++ b/src/categories/components/CategoryList/CategoryList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { CategoryListUrlSortField, categoryUrl, diff --git a/src/categories/components/CategoryListPage/CategoryListPage.stories.tsx b/src/categories/components/CategoryListPage/CategoryListPage.stories.tsx index bc3128f6d..bd7bf00b0 100644 --- a/src/categories/components/CategoryListPage/CategoryListPage.stories.tsx +++ b/src/categories/components/CategoryListPage/CategoryListPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { categories } from "@dashboard/categories/fixtures"; import { CategoryListUrlSortField } from "@dashboard/categories/urls"; import { diff --git a/src/categories/components/CategoryProductList/CategoryProductList.tsx b/src/categories/components/CategoryProductList/CategoryProductList.tsx index 3890dfec5..76a67d880 100644 --- a/src/categories/components/CategoryProductList/CategoryProductList.tsx +++ b/src/categories/components/CategoryProductList/CategoryProductList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import Checkbox from "@dashboard/components/Checkbox"; import ResponsiveTable from "@dashboard/components/ResponsiveTable"; import Skeleton from "@dashboard/components/Skeleton"; @@ -55,7 +56,9 @@ interface CategoryProductListProps extends ListProps, ListActions { products: RelayToFlat; } -export const CategoryProductList: React.FC = props => { +export const CategoryProductList: React.FC< + CategoryProductListProps +> = props => { const { disabled, isChecked, diff --git a/src/categories/components/CategoryProducts/CategoryProducts.tsx b/src/categories/components/CategoryProducts/CategoryProducts.tsx index 6a7d84c16..e0af64af2 100644 --- a/src/categories/components/CategoryProducts/CategoryProducts.tsx +++ b/src/categories/components/CategoryProducts/CategoryProducts.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Button } from "@dashboard/components/Button"; import CardTitle from "@dashboard/components/CardTitle"; import HorizontalSpacer from "@dashboard/components/HorizontalSpacer"; diff --git a/src/categories/components/CategoryUpdatePage/CategoryUpdatePage.stories.tsx b/src/categories/components/CategoryUpdatePage/CategoryUpdatePage.stories.tsx index 96bb077cc..0575db897 100644 --- a/src/categories/components/CategoryUpdatePage/CategoryUpdatePage.stories.tsx +++ b/src/categories/components/CategoryUpdatePage/CategoryUpdatePage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import placeholderImage from "@assets/images/placeholder255x255.png"; import { category as categoryFixture } from "@dashboard/categories/fixtures"; import { listActionsProps } from "@dashboard/fixtures"; diff --git a/src/categories/components/CategoryUpdatePage/CategoryUpdatePage.tsx b/src/categories/components/CategoryUpdatePage/CategoryUpdatePage.tsx index 3b5c13ada..884468050 100644 --- a/src/categories/components/CategoryUpdatePage/CategoryUpdatePage.tsx +++ b/src/categories/components/CategoryUpdatePage/CategoryUpdatePage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { categoryAddUrl, categoryListUrl, diff --git a/src/categories/components/CategoryUpdatePage/form.tsx b/src/categories/components/CategoryUpdatePage/form.tsx index 126a0f1c4..b79979c8f 100644 --- a/src/categories/components/CategoryUpdatePage/form.tsx +++ b/src/categories/components/CategoryUpdatePage/form.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useExitFormDialog } from "@dashboard/components/Form/useExitFormDialog"; import { MetadataFormData } from "@dashboard/components/Metadata"; import { CategoryDetailsFragment } from "@dashboard/graphql"; diff --git a/src/categories/index.tsx b/src/categories/index.tsx index df2dfa628..9542d8d6d 100644 --- a/src/categories/index.tsx +++ b/src/categories/index.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { sectionNames } from "@dashboard/intl"; import { asSortParams } from "@dashboard/utils/sort"; import { parse as parseQs } from "qs"; diff --git a/src/categories/views/CategoryCreate.tsx b/src/categories/views/CategoryCreate.tsx index b114830fc..ca73cb26d 100644 --- a/src/categories/views/CategoryCreate.tsx +++ b/src/categories/views/CategoryCreate.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { WindowTitle } from "@dashboard/components/WindowTitle"; import { CategoryCreateMutation, diff --git a/src/categories/views/CategoryDetails.tsx b/src/categories/views/CategoryDetails.tsx index 039980cbd..16de5c9dd 100644 --- a/src/categories/views/CategoryDetails.tsx +++ b/src/categories/views/CategoryDetails.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import ActionDialog from "@dashboard/components/ActionDialog"; import NotFoundPage from "@dashboard/components/NotFoundPage"; import { WindowTitle } from "@dashboard/components/WindowTitle"; @@ -142,29 +143,25 @@ export const CategoryDetails: React.FC = ({ } }; - const [ - categoryBulkDelete, - categoryBulkDeleteOpts, - ] = useCategoryBulkDeleteMutation({ - onCompleted: handleBulkCategoryDelete, - }); + const [categoryBulkDelete, categoryBulkDeleteOpts] = + useCategoryBulkDeleteMutation({ + onCompleted: handleBulkCategoryDelete, + }); - const [ - productBulkDelete, - productBulkDeleteOpts, - ] = useProductBulkDeleteMutation({ - onCompleted: data => { - if (data.productBulkDelete.errors.length === 0) { - closeModal(); - notify({ - status: "success", - text: intl.formatMessage(commonMessages.savedChanges), - }); - refetch(); - reset(); - } - }, - }); + const [productBulkDelete, productBulkDeleteOpts] = + useProductBulkDeleteMutation({ + onCompleted: data => { + if (data.productBulkDelete.errors.length === 0) { + closeModal(); + notify({ + status: "success", + text: intl.formatMessage(commonMessages.savedChanges), + }); + refetch(); + reset(); + } + }, + }); const [openModal, closeModal] = createDialogActionHandlers< CategoryUrlDialog, diff --git a/src/categories/views/CategoryList/CategoryList.tsx b/src/categories/views/CategoryList/CategoryList.tsx index 4b521d325..c65283a72 100644 --- a/src/categories/views/CategoryList/CategoryList.tsx +++ b/src/categories/views/CategoryList/CategoryList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import ActionDialog from "@dashboard/components/ActionDialog"; import DeleteFilterTabDialog from "@dashboard/components/DeleteFilterTabDialog"; import SaveFilterTabDialog, { @@ -131,12 +132,10 @@ export const CategoryList: React.FC = ({ params }) => { } }; - const [ - categoryBulkDelete, - categoryBulkDeleteOpts, - ] = useCategoryBulkDeleteMutation({ - onCompleted: handleCategoryBulkDelete, - }); + const [categoryBulkDelete, categoryBulkDeleteOpts] = + useCategoryBulkDeleteMutation({ + onCompleted: handleCategoryBulkDelete, + }); const handleSort = createSortHandler(navigate, categoryListUrl, params); diff --git a/src/categories/views/CategoryList/sort.ts b/src/categories/views/CategoryList/sort.ts index dc0e1bb94..16d5f7508 100644 --- a/src/categories/views/CategoryList/sort.ts +++ b/src/categories/views/CategoryList/sort.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { CategoryListUrlSortField } from "@dashboard/categories/urls"; import { CategorySortField } from "@dashboard/graphql"; import { createGetSortQueryVariables } from "@dashboard/utils/sort"; @@ -17,6 +18,5 @@ export function getSortQueryField( } } -export const getSortQueryVariables = createGetSortQueryVariables( - getSortQueryField, -); +export const getSortQueryVariables = + createGetSortQueryVariables(getSortQueryField); diff --git a/src/channels/components/AssignmentList/AssignmentList.tsx b/src/channels/components/AssignmentList/AssignmentList.tsx index f442c6194..c124ddc3f 100644 --- a/src/channels/components/AssignmentList/AssignmentList.tsx +++ b/src/channels/components/AssignmentList/AssignmentList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import Skeleton from "@dashboard/components/Skeleton"; import { ReorderEvent } from "@dashboard/types"; import { Accordion, Divider, Typography } from "@material-ui/core"; diff --git a/src/channels/components/AssignmentList/AssignmentListFooter.tsx b/src/channels/components/AssignmentList/AssignmentListFooter.tsx index e1008016c..46580188b 100644 --- a/src/channels/components/AssignmentList/AssignmentListFooter.tsx +++ b/src/channels/components/AssignmentList/AssignmentListFooter.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import SingleAutocompleteSelectField from "@dashboard/components/SingleAutocompleteSelectField"; import CardAddItemsFooter from "@dashboard/products/components/ProductStocks/CardAddItemsFooter"; import { mapNodeToChoice } from "@dashboard/utils/maps"; diff --git a/src/channels/components/ChannelAllocationStrategy/ChannelAllocationStrategy.tsx b/src/channels/components/ChannelAllocationStrategy/ChannelAllocationStrategy.tsx index 06d556f70..78ec3b46e 100644 --- a/src/channels/components/ChannelAllocationStrategy/ChannelAllocationStrategy.tsx +++ b/src/channels/components/ChannelAllocationStrategy/ChannelAllocationStrategy.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import CardTitle from "@dashboard/components/CardTitle"; import PreviewPill from "@dashboard/components/PreviewPill"; import RadioGroupField from "@dashboard/components/RadioGroupField"; diff --git a/src/channels/components/ChannelForm/ChannelForm.tsx b/src/channels/components/ChannelForm/ChannelForm.tsx index 202a17ee7..45db8d0c6 100644 --- a/src/channels/components/ChannelForm/ChannelForm.tsx +++ b/src/channels/components/ChannelForm/ChannelForm.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ChannelShippingZones, ChannelWarehouses, diff --git a/src/channels/components/ShippingZones/ShippingZones.tsx b/src/channels/components/ShippingZones/ShippingZones.tsx index 2c75b1490..eaa2407ad 100644 --- a/src/channels/components/ShippingZones/ShippingZones.tsx +++ b/src/channels/components/ShippingZones/ShippingZones.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ChannelShippingZones } from "@dashboard/channels/pages/ChannelDetailsPage/types"; import CardTitle from "@dashboard/components/CardTitle"; import { SearchShippingZonesQuery } from "@dashboard/graphql"; diff --git a/src/channels/components/Warehouses/Warehouses.tsx b/src/channels/components/Warehouses/Warehouses.tsx index 81f325458..99e88de49 100644 --- a/src/channels/components/Warehouses/Warehouses.tsx +++ b/src/channels/components/Warehouses/Warehouses.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ChannelWarehouses } from "@dashboard/channels/pages/ChannelDetailsPage/types"; import CardTitle from "@dashboard/components/CardTitle"; import { SearchWarehousesQuery } from "@dashboard/graphql"; diff --git a/src/channels/fixtures.ts b/src/channels/fixtures.ts index a404998ee..98a3b1c46 100644 --- a/src/channels/fixtures.ts +++ b/src/channels/fixtures.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { AllocationStrategyEnum, ChannelDetailsFragment, diff --git a/src/channels/pages/ChannelDetailsPage/ChannelDetailsPage.stories.tsx b/src/channels/pages/ChannelDetailsPage/ChannelDetailsPage.stories.tsx index 96c2f2258..bbe93c88b 100644 --- a/src/channels/pages/ChannelDetailsPage/ChannelDetailsPage.stories.tsx +++ b/src/channels/pages/ChannelDetailsPage/ChannelDetailsPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { channel, channelCreateErrors } from "@dashboard/channels/fixtures"; import { countries } from "@dashboard/fixtures"; import { ChannelErrorFragment } from "@dashboard/graphql"; diff --git a/src/channels/pages/ChannelDetailsPage/ChannelDetailsPage.tsx b/src/channels/pages/ChannelDetailsPage/ChannelDetailsPage.tsx index 95fb2791f..eb02a468c 100644 --- a/src/channels/pages/ChannelDetailsPage/ChannelDetailsPage.tsx +++ b/src/channels/pages/ChannelDetailsPage/ChannelDetailsPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import ChannelAllocationStrategy from "@dashboard/channels/components/ChannelAllocationStrategy"; import ShippingZones from "@dashboard/channels/components/ShippingZones"; import Warehouses from "@dashboard/channels/components/Warehouses"; diff --git a/src/channels/pages/ChannelDetailsPage/handlers.ts b/src/channels/pages/ChannelDetailsPage/handlers.ts index 5c3c82aed..27183a70c 100644 --- a/src/channels/pages/ChannelDetailsPage/handlers.ts +++ b/src/channels/pages/ChannelDetailsPage/handlers.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FormData } from "@dashboard/channels/components/ChannelForm"; import { SearchData } from "@dashboard/hooks/makeTopLevelSearch"; import { getParsedSearchData } from "@dashboard/hooks/makeTopLevelSearch/utils"; diff --git a/src/channels/pages/ChannelDetailsPage/types.ts b/src/channels/pages/ChannelDetailsPage/types.ts index 81ba086d0..7886e7488 100644 --- a/src/channels/pages/ChannelDetailsPage/types.ts +++ b/src/channels/pages/ChannelDetailsPage/types.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ChannelShippingZonesQuery, WarehouseFragment, diff --git a/src/channels/pages/ChannelsListPage/ChannelsListPage.tsx b/src/channels/pages/ChannelsListPage/ChannelsListPage.tsx index bb0bb59ef..cac6601d8 100644 --- a/src/channels/pages/ChannelsListPage/ChannelsListPage.tsx +++ b/src/channels/pages/ChannelsListPage/ChannelsListPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { channelAddUrl, channelUrl } from "@dashboard/channels/urls"; import { LimitsInfo } from "@dashboard/components/AppLayout/LimitsInfo"; import { TopNav } from "@dashboard/components/AppLayout/TopNav"; diff --git a/src/channels/utils.ts b/src/channels/utils.ts index eb30bc299..4610c6ac8 100644 --- a/src/channels/utils.ts +++ b/src/channels/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ChannelSaleFormData, SaleDetailsPageFormData, diff --git a/src/channels/views/ChannelCreate/ChannelCreate.tsx b/src/channels/views/ChannelCreate/ChannelCreate.tsx index 5fbd305cb..cacc403dd 100644 --- a/src/channels/views/ChannelCreate/ChannelCreate.tsx +++ b/src/channels/views/ChannelCreate/ChannelCreate.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FormData } from "@dashboard/channels/components/ChannelForm/ChannelForm"; import { WindowTitle } from "@dashboard/components/WindowTitle"; import { diff --git a/src/channels/views/ChannelDetails/ChannelDetails.tsx b/src/channels/views/ChannelDetails/ChannelDetails.tsx index 9d6ec55b0..498f54d0d 100644 --- a/src/channels/views/ChannelDetails/ChannelDetails.tsx +++ b/src/channels/views/ChannelDetails/ChannelDetails.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import ChannelDeleteDialog from "@dashboard/channels/components/ChannelDeleteDialog"; import { FormData } from "@dashboard/channels/components/ChannelForm/ChannelForm"; import { getChannelsCurrencyChoices } from "@dashboard/channels/utils"; diff --git a/src/channels/views/ChannelDetails/useShippingZones.ts b/src/channels/views/ChannelDetails/useShippingZones.ts index 2a04a88d8..fd36d200f 100644 --- a/src/channels/views/ChannelDetails/useShippingZones.ts +++ b/src/channels/views/ChannelDetails/useShippingZones.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useUserPermissions } from "@dashboard/auth/hooks/useUserPermissions"; import { hasPermissions } from "@dashboard/components/RequirePermissions"; import { DEFAULT_INITIAL_SEARCH_DATA } from "@dashboard/config"; @@ -14,10 +15,8 @@ export const useShippingZones = (channelId?: string) => { PermissionEnum.MANAGE_SHIPPING, ]); - const { - data: shippingZonesCountData, - loading: shippingZonesCountLoading, - } = useShippingZonesCountQuery({ skip: !canLoadShippingZones }); + const { data: shippingZonesCountData, loading: shippingZonesCountLoading } = + useShippingZonesCountQuery({ skip: !canLoadShippingZones }); const { data: channelShippingZonesData, diff --git a/src/channels/views/ChannelDetails/useWarehouses.ts b/src/channels/views/ChannelDetails/useWarehouses.ts index bc0865170..c4e743822 100644 --- a/src/channels/views/ChannelDetails/useWarehouses.ts +++ b/src/channels/views/ChannelDetails/useWarehouses.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useUserPermissions } from "@dashboard/auth/hooks/useUserPermissions"; import { hasOneOfPermissions } from "@dashboard/components/RequirePermissions"; import { DEFAULT_INITIAL_SEARCH_DATA } from "@dashboard/config"; @@ -12,10 +13,8 @@ export const useWarehouses = () => { PermissionEnum.MANAGE_PRODUCTS, ]); - const { - data: warehousesCountData, - loading: warehousesCountLoading, - } = useWarehousesCountQuery({ skip: !canLoadWarehouses }); + const { data: warehousesCountData, loading: warehousesCountLoading } = + useWarehousesCountQuery({ skip: !canLoadWarehouses }); const { loadMore: fetchMoreWarehouses, diff --git a/src/channels/views/ChannelsList/ChannelsList.tsx b/src/channels/views/ChannelsList/ChannelsList.tsx index 3d17d4187..d6b79db6a 100644 --- a/src/channels/views/ChannelsList/ChannelsList.tsx +++ b/src/channels/views/ChannelsList/ChannelsList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { getChannelsCurrencyChoices } from "@dashboard/channels/utils"; import { useShopLimitsQuery } from "@dashboard/components/Shop/queries"; import { diff --git a/src/collections/components/CollectionCreatePage/CollectionCreatePage.stories.tsx b/src/collections/components/CollectionCreatePage/CollectionCreatePage.stories.tsx index d0a9b8d03..82f79ce17 100644 --- a/src/collections/components/CollectionCreatePage/CollectionCreatePage.stories.tsx +++ b/src/collections/components/CollectionCreatePage/CollectionCreatePage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { channelsList } from "@dashboard/channels/fixtures"; import { createCollectionChannels } from "@dashboard/channels/utils"; import { CollectionErrorCode } from "@dashboard/graphql"; diff --git a/src/collections/components/CollectionCreatePage/CollectionCreatePage.tsx b/src/collections/components/CollectionCreatePage/CollectionCreatePage.tsx index 7e76bc46b..b488523e6 100644 --- a/src/collections/components/CollectionCreatePage/CollectionCreatePage.tsx +++ b/src/collections/components/CollectionCreatePage/CollectionCreatePage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ChannelCollectionData } from "@dashboard/channels/utils"; import { collectionListUrl } from "@dashboard/collections/urls"; import { TopNav } from "@dashboard/components/AppLayout/TopNav"; diff --git a/src/collections/components/CollectionCreatePage/form.tsx b/src/collections/components/CollectionCreatePage/form.tsx index 01ef43da6..f94954904 100644 --- a/src/collections/components/CollectionCreatePage/form.tsx +++ b/src/collections/components/CollectionCreatePage/form.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ChannelCollectionData } from "@dashboard/channels/utils"; import { createChannelsChangeHandler } from "@dashboard/collections/utils"; import { COLLECTION_CREATE_FORM_ID } from "@dashboard/collections/views/consts"; @@ -102,9 +103,8 @@ function useCollectionCreateForm( triggerChange, }); - const { - makeChangeHandler: makeMetadataChangeHandler, - } = useMetadataChangeTrigger(); + const { makeChangeHandler: makeMetadataChangeHandler } = + useMetadataChangeTrigger(); const changeMetadata = makeMetadataChangeHandler(handleChange); diff --git a/src/collections/components/CollectionDetails/CollectionDetails.tsx b/src/collections/components/CollectionDetails/CollectionDetails.tsx index 9db4e32d4..97aceefa4 100644 --- a/src/collections/components/CollectionDetails/CollectionDetails.tsx +++ b/src/collections/components/CollectionDetails/CollectionDetails.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import CardTitle from "@dashboard/components/CardTitle"; import FormSpacer from "@dashboard/components/FormSpacer"; import RichTextEditor from "@dashboard/components/RichTextEditor"; @@ -28,12 +29,8 @@ const CollectionDetails: React.FC = ({ errors, }) => { const intl = useIntl(); - const { - defaultValue, - editorRef, - isReadyForMount, - handleChange, - } = useRichTextContext(); + const { defaultValue, editorRef, isReadyForMount, handleChange } = + useRichTextContext(); const formErrors = getFormErrors(["name", "description"], errors); return ( diff --git a/src/collections/components/CollectionDetailsPage/CollectionDetailsPage.stories.tsx b/src/collections/components/CollectionDetailsPage/CollectionDetailsPage.stories.tsx index d796404ed..01a3d020d 100644 --- a/src/collections/components/CollectionDetailsPage/CollectionDetailsPage.stories.tsx +++ b/src/collections/components/CollectionDetailsPage/CollectionDetailsPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import placeholderCollectionImage from "@assets/images/block1.jpg"; import placeholderProductImage from "@assets/images/placeholder60x60.png"; import { createCollectionChannelsData } from "@dashboard/channels/utils"; diff --git a/src/collections/components/CollectionDetailsPage/CollectionDetailsPage.tsx b/src/collections/components/CollectionDetailsPage/CollectionDetailsPage.tsx index e7c64dba8..d69815a90 100644 --- a/src/collections/components/CollectionDetailsPage/CollectionDetailsPage.tsx +++ b/src/collections/components/CollectionDetailsPage/CollectionDetailsPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ChannelCollectionData } from "@dashboard/channels/utils"; import { collectionListUrl } from "@dashboard/collections/urls"; import { TopNav } from "@dashboard/components/AppLayout/TopNav"; diff --git a/src/collections/components/CollectionDetailsPage/form.tsx b/src/collections/components/CollectionDetailsPage/form.tsx index e9f5db5af..5fcc835fc 100644 --- a/src/collections/components/CollectionDetailsPage/form.tsx +++ b/src/collections/components/CollectionDetailsPage/form.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ChannelCollectionData } from "@dashboard/channels/utils"; import { createChannelsChangeHandler } from "@dashboard/collections/utils"; import { COLLECTION_DETAILS_FORM_ID } from "@dashboard/collections/views/consts"; diff --git a/src/collections/components/CollectionImage/CollectionImage.tsx b/src/collections/components/CollectionImage/CollectionImage.tsx index c6902f859..0a2223c62 100644 --- a/src/collections/components/CollectionImage/CollectionImage.tsx +++ b/src/collections/components/CollectionImage/CollectionImage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Button } from "@dashboard/components/Button"; import CardTitle from "@dashboard/components/CardTitle"; import Hr from "@dashboard/components/Hr"; diff --git a/src/collections/components/CollectionList/CollectionList.tsx b/src/collections/components/CollectionList/CollectionList.tsx index 9d97bc088..5b522527e 100644 --- a/src/collections/components/CollectionList/CollectionList.tsx +++ b/src/collections/components/CollectionList/CollectionList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { CollectionListUrlSortField, collectionUrl, diff --git a/src/collections/components/CollectionListPage/CollectionListPage.tsx b/src/collections/components/CollectionListPage/CollectionListPage.tsx index 5df47b0c5..0a84a9eaf 100644 --- a/src/collections/components/CollectionListPage/CollectionListPage.tsx +++ b/src/collections/components/CollectionListPage/CollectionListPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { collectionAddUrl } from "@dashboard/collections/urls"; import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import { Button } from "@dashboard/components/Button"; diff --git a/src/collections/components/CollectionProducts/CollectionProducts.tsx b/src/collections/components/CollectionProducts/CollectionProducts.tsx index da8dd0f25..a515ae0e7 100644 --- a/src/collections/components/CollectionProducts/CollectionProducts.tsx +++ b/src/collections/components/CollectionProducts/CollectionProducts.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Button } from "@dashboard/components/Button"; import CardTitle from "@dashboard/components/CardTitle"; import { ChannelsAvailabilityDropdown } from "@dashboard/components/ChannelsAvailabilityDropdown"; diff --git a/src/collections/fixtures.ts b/src/collections/fixtures.ts index de75ce95d..451579959 100644 --- a/src/collections/fixtures.ts +++ b/src/collections/fixtures.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { CollectionDetailsQuery, CollectionListQuery, diff --git a/src/collections/utils.ts b/src/collections/utils.ts index 5be571d34..3e62fe633 100644 --- a/src/collections/utils.ts +++ b/src/collections/utils.ts @@ -1,28 +1,33 @@ +// @ts-strict-ignore import { ChannelCollectionData } from "@dashboard/channels/utils"; import { CollectionDetailsQuery, SearchProductsQuery, } from "@dashboard/graphql"; -export const createChannelsChangeHandler = ( - channelListings: ChannelCollectionData[], - updateChannels: (data: ChannelCollectionData[]) => void, - triggerChange: () => void, -) => (id: string, data: Omit) => { - const channelIndex = channelListings.findIndex(channel => channel.id === id); - const channel = channelListings[channelIndex]; +export const createChannelsChangeHandler = + ( + channelListings: ChannelCollectionData[], + updateChannels: (data: ChannelCollectionData[]) => void, + triggerChange: () => void, + ) => + (id: string, data: Omit) => { + const channelIndex = channelListings.findIndex( + channel => channel.id === id, + ); + const channel = channelListings[channelIndex]; - const updatedChannels = [ - ...channelListings.slice(0, channelIndex), - { - ...channel, - ...data, - }, - ...channelListings.slice(channelIndex + 1), - ]; - updateChannels(updatedChannels); - triggerChange(); -}; + const updatedChannels = [ + ...channelListings.slice(0, channelIndex), + { + ...channel, + ...data, + }, + ...channelListings.slice(channelIndex + 1), + ]; + updateChannels(updatedChannels); + triggerChange(); + }; export const getAssignedProductIdsToCollection = ( collection: CollectionDetailsQuery["collection"], diff --git a/src/collections/views/CollectionCreate.tsx b/src/collections/views/CollectionCreate.tsx index 869bc7198..805c96bc4 100644 --- a/src/collections/views/CollectionCreate.tsx +++ b/src/collections/views/CollectionCreate.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ChannelsAction } from "@dashboard/channels/urls"; import { createCollectionChannels } from "@dashboard/channels/utils"; import useAppChannel from "@dashboard/components/AppLayout/AppChannelContext"; @@ -48,16 +49,12 @@ export const CollectionCreate: React.FC = ({ CollectionCreateUrlQueryParams >(navigate, params => collectionAddUrl(params), params); - const [ - updateChannels, - updateChannelsOpts, - ] = useCollectionChannelListingUpdateMutation({}); + const [updateChannels, updateChannelsOpts] = + useCollectionChannelListingUpdateMutation({}); const { availableChannels } = useAppChannel(false); - const allChannels = createCollectionChannels( - availableChannels, - )?.sort((channel, nextChannel) => - channel.name.localeCompare(nextChannel.name), + const allChannels = createCollectionChannels(availableChannels)?.sort( + (channel, nextChannel) => channel.name.localeCompare(nextChannel.name), ); const { diff --git a/src/collections/views/CollectionDetails.tsx b/src/collections/views/CollectionDetails.tsx index 0a1e1eef0..605dbdc50 100644 --- a/src/collections/views/CollectionDetails.tsx +++ b/src/collections/views/CollectionDetails.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { createCollectionChannels, createCollectionChannelsData, @@ -80,10 +81,8 @@ export const CollectionDetails: React.FC = ({ const [updateMetadata] = useUpdateMetadataMutation({}); const [updatePrivateMetadata] = useUpdatePrivateMetadataMutation({}); - const [ - updateChannels, - updateChannelsOpts, - ] = useCollectionChannelListingUpdateMutation({}); + const [updateChannels, updateChannelsOpts] = + useCollectionChannelListingUpdateMutation({}); const { availableChannels } = useAppChannel(false); const handleCollectionUpdate = (data: CollectionUpdateMutation) => { @@ -127,24 +126,22 @@ export const CollectionDetails: React.FC = ({ }, ); - const [ - unassignProduct, - unassignProductOpts, - ] = useUnassignCollectionProductMutation({ - onCompleted: data => { - if (data.collectionRemoveProducts.errors.length === 0) { - notify({ - status: "success", - text: intl.formatMessage({ - id: "WW+Ruy", - defaultMessage: "Deleted product from collection", - }), - }); - reset(); - closeModal(); - } - }, - }); + const [unassignProduct, unassignProductOpts] = + useUnassignCollectionProductMutation({ + onCompleted: data => { + if (data.collectionRemoveProducts.errors.length === 0) { + notify({ + status: "success", + text: intl.formatMessage({ + id: "WW+Ruy", + defaultMessage: "Deleted product from collection", + }), + }); + reset(); + closeModal(); + } + }, + }); const [removeCollection, removeCollectionOpts] = useRemoveCollectionMutation({ onCompleted: data => { @@ -161,9 +158,8 @@ export const CollectionDetails: React.FC = ({ }, }); - const [paginationState, setPaginationState] = useLocalPaginationState( - PAGINATE_BY, - ); + const [paginationState, setPaginationState] = + useLocalPaginationState(PAGINATE_BY); const paginate = useLocalPaginator(setPaginationState); const [selectedChannel] = useLocalStorage("collectionListChannel", ""); @@ -174,10 +170,8 @@ export const CollectionDetails: React.FC = ({ }); const collection = data?.collection; - const allChannels = createCollectionChannels( - availableChannels, - )?.sort((channel, nextChannel) => - channel.name.localeCompare(nextChannel.name), + const allChannels = createCollectionChannels(availableChannels)?.sort( + (channel, nextChannel) => channel.name.localeCompare(nextChannel.name), ); const collectionChannelsChoices = createCollectionChannelsData(collection); const { diff --git a/src/collections/views/CollectionList/CollectionList.tsx b/src/collections/views/CollectionList/CollectionList.tsx index 82fb732a1..46f930e39 100644 --- a/src/collections/views/CollectionList/CollectionList.tsx +++ b/src/collections/views/CollectionList/CollectionList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import ActionDialog from "@dashboard/components/ActionDialog"; import useAppChannel from "@dashboard/components/AppLayout/AppChannelContext"; import DeleteFilterTabDialog from "@dashboard/components/DeleteFilterTabDialog"; @@ -65,17 +66,14 @@ export const CollectionList: React.FC = ({ params }) => { usePaginationReset(collectionListUrl, params, settings.rowNumber); - const [ - changeFilters, - resetFilters, - handleSearchChange, - ] = createFilterHandlers({ - cleanupFn: reset, - createUrl: collectionListUrl, - getFilterQueryParam, - navigate, - params, - }); + const [changeFilters, resetFilters, handleSearchChange] = + createFilterHandlers({ + cleanupFn: reset, + createUrl: collectionListUrl, + getFilterQueryParam, + navigate, + params, + }); const { availableChannels } = useAppChannel(false); const channelOpts = availableChannels @@ -100,22 +98,20 @@ export const CollectionList: React.FC = ({ params }) => { variables: queryVariables, }); - const [ - collectionBulkDelete, - collectionBulkDeleteOpts, - ] = useCollectionBulkDeleteMutation({ - onCompleted: data => { - if (data.collectionBulkDelete.errors.length === 0) { - notify({ - status: "success", - text: intl.formatMessage(commonMessages.savedChanges), - }); - refetch(); - reset(); - closeModal(); - } - }, - }); + const [collectionBulkDelete, collectionBulkDeleteOpts] = + useCollectionBulkDeleteMutation({ + onCompleted: data => { + if (data.collectionBulkDelete.errors.length === 0) { + notify({ + status: "success", + text: intl.formatMessage(commonMessages.savedChanges), + }); + refetch(); + reset(); + closeModal(); + } + }, + }); const filterOpts = getFilterOpts(params, channelOpts); const tabs = getFilterTabs(); diff --git a/src/collections/views/CollectionList/filters.test.ts b/src/collections/views/CollectionList/filters.test.ts index 3455c755a..124f3dd1b 100644 --- a/src/collections/views/CollectionList/filters.test.ts +++ b/src/collections/views/CollectionList/filters.test.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { createFilterStructure } from "@dashboard/collections/components/CollectionListPage"; import { CollectionListUrlFilters } from "@dashboard/collections/urls"; import { CollectionPublished } from "@dashboard/graphql"; diff --git a/src/collections/views/CollectionList/filters.ts b/src/collections/views/CollectionList/filters.ts index 30053a73b..e03010bd5 100644 --- a/src/collections/views/CollectionList/filters.ts +++ b/src/collections/views/CollectionList/filters.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { CollectionFilterKeys, CollectionListFilterOpts, @@ -72,16 +73,10 @@ export function getFilterQueryParam( } } -export const { - deleteFilterTab, - getFilterTabs, - saveFilterTab, -} = createFilterTabUtils(COLLECTION_FILTERS_KEY); +export const { deleteFilterTab, getFilterTabs, saveFilterTab } = + createFilterTabUtils(COLLECTION_FILTERS_KEY); -export const { - areFiltersApplied, - getActiveFilters, - getFiltersCurrentTab, -} = createFilterUtils( - CollectionListUrlFiltersEnum, -); +export const { areFiltersApplied, getActiveFilters, getFiltersCurrentTab } = + createFilterUtils( + CollectionListUrlFiltersEnum, + ); diff --git a/src/collections/views/CollectionList/sort.ts b/src/collections/views/CollectionList/sort.ts index f18754718..1c7a8969f 100644 --- a/src/collections/views/CollectionList/sort.ts +++ b/src/collections/views/CollectionList/sort.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { CollectionListUrlSortField } from "@dashboard/collections/urls"; import { CollectionSortField } from "@dashboard/graphql"; import { createGetSortQueryVariables } from "@dashboard/utils/sort"; @@ -34,6 +35,5 @@ export function getSortQueryField( } } -export const getSortQueryVariables = createGetSortQueryVariables( - getSortQueryField, -); +export const getSortQueryVariables = + createGetSortQueryVariables(getSortQueryField); diff --git a/src/components/AccountPermissionGroups/AccountPermissionGroups.tsx b/src/components/AccountPermissionGroups/AccountPermissionGroups.tsx index aa9ef311a..ca2790316 100644 --- a/src/components/AccountPermissionGroups/AccountPermissionGroups.tsx +++ b/src/components/AccountPermissionGroups/AccountPermissionGroups.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { SearchPermissionGroupsQuery, StaffErrorFragment, @@ -27,7 +28,9 @@ export interface AccountPermissionGroupsProps displayValues: MultiAutocompleteChoiceType[]; } -const AccountPermissionGroups: React.FC = props => { +const AccountPermissionGroups: React.FC< + AccountPermissionGroupsProps +> = props => { const { availablePermissionGroups, disabled, diff --git a/src/components/AccountPermissions/AccountPermissions.tsx b/src/components/AccountPermissions/AccountPermissions.tsx index e2fe4f76d..e11eaf2a3 100644 --- a/src/components/AccountPermissions/AccountPermissions.tsx +++ b/src/components/AccountPermissions/AccountPermissions.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useUser } from "@dashboard/auth"; import CardTitle from "@dashboard/components/CardTitle"; import Skeleton from "@dashboard/components/Skeleton"; diff --git a/src/components/AccountPermissions/utils.ts b/src/components/AccountPermissions/utils.ts index b7c844813..cbcaea78d 100644 --- a/src/components/AccountPermissions/utils.ts +++ b/src/components/AccountPermissions/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { PermissionGroupDetailsQuery, ShopInfoQuery, diff --git a/src/components/ActionDialog/ActionDialog.tsx b/src/components/ActionDialog/ActionDialog.tsx index ff4d038a7..d59447784 100644 --- a/src/components/ActionDialog/ActionDialog.tsx +++ b/src/components/ActionDialog/ActionDialog.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ConfirmButtonTransitionState } from "@dashboard/components/ConfirmButton"; import { DialogProps } from "@dashboard/types"; import { Dialog, DialogContent, DialogTitle } from "@material-ui/core"; diff --git a/src/components/ActionDialog/DialogButtons.tsx b/src/components/ActionDialog/DialogButtons.tsx index e29949597..a4c58fe99 100644 --- a/src/components/ActionDialog/DialogButtons.tsx +++ b/src/components/ActionDialog/DialogButtons.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ConfirmButtonTransitionState } from "@dashboard/components/ConfirmButton"; import { buttonMessages } from "@dashboard/intl"; import { DialogActions } from "@material-ui/core"; diff --git a/src/components/AddressEdit/AddressEdit.tsx b/src/components/AddressEdit/AddressEdit.tsx index fe63be706..a6ee4388c 100644 --- a/src/components/AddressEdit/AddressEdit.tsx +++ b/src/components/AddressEdit/AddressEdit.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { AddressTypeInput } from "@dashboard/customers/types"; import { AccountErrorFragment, OrderErrorFragment } from "@dashboard/graphql"; import { commonMessages } from "@dashboard/intl"; diff --git a/src/components/AddressEdit/getErrorMessage.ts b/src/components/AddressEdit/getErrorMessage.ts index eecb07d46..20cf8f1ed 100644 --- a/src/components/AddressEdit/getErrorMessage.ts +++ b/src/components/AddressEdit/getErrorMessage.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { AccountErrorFragment, OrderErrorFragment } from "@dashboard/graphql"; import getAccountErrorMessage from "@dashboard/utils/errors/account"; import getOrderErrorMessage from "@dashboard/utils/errors/order"; diff --git a/src/components/AddressEdit/useAddressValidation.ts b/src/components/AddressEdit/useAddressValidation.ts index 3e5db93bc..43453257f 100644 --- a/src/components/AddressEdit/useAddressValidation.ts +++ b/src/components/AddressEdit/useAddressValidation.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { AddressValidationRulesQuery, CountryCode, diff --git a/src/components/AppLayout/AppChannelContext.tsx b/src/components/AppLayout/AppChannelContext.tsx index e9c67dd6f..41991db98 100644 --- a/src/components/AppLayout/AppChannelContext.tsx +++ b/src/components/AppLayout/AppChannelContext.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useUser } from "@dashboard/auth"; import { ChannelFragment, useBaseChannelsQuery } from "@dashboard/graphql"; import useLocalStorage from "@dashboard/hooks/useLocalStorage"; diff --git a/src/components/AppLayout/ListFilters/components/FiltersSelect.tsx b/src/components/AppLayout/ListFilters/components/FiltersSelect.tsx index 8d27ffd2b..568b973c3 100644 --- a/src/components/AppLayout/ListFilters/components/FiltersSelect.tsx +++ b/src/components/AppLayout/ListFilters/components/FiltersSelect.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FilterContent, FilterElement, diff --git a/src/components/AppLayout/util.ts b/src/components/AppLayout/util.ts index 109bcca09..fa392317c 100644 --- a/src/components/AppLayout/util.ts +++ b/src/components/AppLayout/util.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore export const extractQueryParams = (queryString: string) => { const urlSearchParams = new URLSearchParams(queryString); const queryParams = {}; diff --git a/src/components/AssignAttributeDialog/AssignAttributeDialog.tsx b/src/components/AssignAttributeDialog/AssignAttributeDialog.tsx index 71ef3891f..c4a1a77e8 100644 --- a/src/components/AssignAttributeDialog/AssignAttributeDialog.tsx +++ b/src/components/AssignAttributeDialog/AssignAttributeDialog.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import Checkbox from "@dashboard/components/Checkbox"; import { ConfirmButton, diff --git a/src/components/AssignAttributeValueDialog/AssignAttributeValueDialog.tsx b/src/components/AssignAttributeValueDialog/AssignAttributeValueDialog.tsx index e3388edae..b42db91f4 100644 --- a/src/components/AssignAttributeValueDialog/AssignAttributeValueDialog.tsx +++ b/src/components/AssignAttributeValueDialog/AssignAttributeValueDialog.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { AttributeEntityTypeEnum, SearchPagesQuery } from "@dashboard/graphql"; import { RelayToFlat } from "@dashboard/types"; import React from "react"; diff --git a/src/components/AssignCategoryDialog/AssignCategoryDialog.tsx b/src/components/AssignCategoryDialog/AssignCategoryDialog.tsx index 58a6e0420..0acd17e0f 100644 --- a/src/components/AssignCategoryDialog/AssignCategoryDialog.tsx +++ b/src/components/AssignCategoryDialog/AssignCategoryDialog.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { SearchCategoriesQuery } from "@dashboard/graphql"; import { RelayToFlat } from "@dashboard/types"; import React from "react"; diff --git a/src/components/AssignCollectionDialog/AssignCollectionDialog.tsx b/src/components/AssignCollectionDialog/AssignCollectionDialog.tsx index 2fa4456c2..89ff05ceb 100644 --- a/src/components/AssignCollectionDialog/AssignCollectionDialog.tsx +++ b/src/components/AssignCollectionDialog/AssignCollectionDialog.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { SearchCollectionsQuery } from "@dashboard/graphql"; import { RelayToFlat } from "@dashboard/types"; import React from "react"; diff --git a/src/components/AssignProductDialog/AssignProductDialog.tsx b/src/components/AssignProductDialog/AssignProductDialog.tsx index 0f61ec321..2209f58d0 100644 --- a/src/components/AssignProductDialog/AssignProductDialog.tsx +++ b/src/components/AssignProductDialog/AssignProductDialog.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ConfirmButton, ConfirmButtonTransitionState, diff --git a/src/components/AssignVariantDialog/AssignVariantDialog.tsx b/src/components/AssignVariantDialog/AssignVariantDialog.tsx index 52134eb7d..34cd9fb71 100644 --- a/src/components/AssignVariantDialog/AssignVariantDialog.tsx +++ b/src/components/AssignVariantDialog/AssignVariantDialog.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ConfirmButton, ConfirmButtonTransitionState, diff --git a/src/components/AssignVariantDialog/utils.ts b/src/components/AssignVariantDialog/utils.ts index 14aa1e51a..48dca3feb 100644 --- a/src/components/AssignVariantDialog/utils.ts +++ b/src/components/AssignVariantDialog/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { SearchProductsQuery } from "@dashboard/graphql"; import { getById, getByUnmatchingId } from "@dashboard/misc"; import { RelayToFlat } from "@dashboard/types"; diff --git a/src/components/Attributes/AttributeListItem.tsx b/src/components/Attributes/AttributeListItem.tsx index bf852c421..73b026ca4 100644 --- a/src/components/Attributes/AttributeListItem.tsx +++ b/src/components/Attributes/AttributeListItem.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { PageErrorWithAttributesFragment, ProductErrorWithAttributesFragment, diff --git a/src/components/Attributes/AttributeRow.tsx b/src/components/Attributes/AttributeRow.tsx index 26347e9d4..6a386d2b7 100644 --- a/src/components/Attributes/AttributeRow.tsx +++ b/src/components/Attributes/AttributeRow.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { inputTypeMessages } from "@dashboard/attributes/components/AttributeDetails/messages"; import { BasicAttributeRow } from "@dashboard/components/Attributes/BasicAttributeRow"; import ExtendedAttributeRow from "@dashboard/components/Attributes/ExtendedAttributeRow"; diff --git a/src/components/Attributes/SwatchRow.tsx b/src/components/Attributes/SwatchRow.tsx index 47b39be81..5b765f70f 100644 --- a/src/components/Attributes/SwatchRow.tsx +++ b/src/components/Attributes/SwatchRow.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { BasicAttributeRow } from "@dashboard/components/Attributes/BasicAttributeRow"; import { getErrorMessage, diff --git a/src/components/Attributes/utils.ts b/src/components/Attributes/utils.ts index de6104a66..fdaf5dffb 100644 --- a/src/components/Attributes/utils.ts +++ b/src/components/Attributes/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { AttributeInput } from "@dashboard/components/Attributes/Attributes"; import { FileChoiceType } from "@dashboard/components/FileUploadField"; import { MultiAutocompleteChoiceType } from "@dashboard/components/MultiAutocompleteSelectField"; diff --git a/src/components/AutocompleteSelectMenu/AutocompleteSelectMenu.tsx b/src/components/AutocompleteSelectMenu/AutocompleteSelectMenu.tsx index ddcb278df..5923bd131 100644 --- a/src/components/AutocompleteSelectMenu/AutocompleteSelectMenu.tsx +++ b/src/components/AutocompleteSelectMenu/AutocompleteSelectMenu.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { buttonMessages } from "@dashboard/intl"; import { CircularProgress, @@ -37,9 +38,8 @@ const validationError: Error = new Error( "Values supplied to AutocompleteSelectMenu should be unique", ); -const DebounceAutocomplete: React.ComponentType> = Debounce; +const DebounceAutocomplete: React.ComponentType> = + Debounce; const useStyles = makeStyles( theme => ({ diff --git a/src/components/CardMenu/CardMenu.tsx b/src/components/CardMenu/CardMenu.tsx index a143518d1..7e248a624 100644 --- a/src/components/CardMenu/CardMenu.tsx +++ b/src/components/CardMenu/CardMenu.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { CircularProgress, ClickAwayListener, diff --git a/src/components/ChannelsAvailabilityCard/Channel/ChannelAvailabilityItemContent.tsx b/src/components/ChannelsAvailabilityCard/Channel/ChannelAvailabilityItemContent.tsx index 987f5b095..7e5cee546 100644 --- a/src/components/ChannelsAvailabilityCard/Channel/ChannelAvailabilityItemContent.tsx +++ b/src/components/ChannelsAvailabilityCard/Channel/ChannelAvailabilityItemContent.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ChannelData } from "@dashboard/channels/utils"; import useCurrentDate from "@dashboard/hooks/useCurrentDate"; import useDateLocalize from "@dashboard/hooks/useDateLocalize"; diff --git a/src/components/ChannelsAvailabilityCard/Channel/ChannelAvailabilityItemWrapper.tsx b/src/components/ChannelsAvailabilityCard/Channel/ChannelAvailabilityItemWrapper.tsx index c12953bcb..51263fff5 100644 --- a/src/components/ChannelsAvailabilityCard/Channel/ChannelAvailabilityItemWrapper.tsx +++ b/src/components/ChannelsAvailabilityCard/Channel/ChannelAvailabilityItemWrapper.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ChannelData } from "@dashboard/channels/utils"; import Label from "@dashboard/orders/components/OrderHistory/Label"; import { Accordion, Text } from "@saleor/macaw-ui/next"; diff --git a/src/components/ChannelsAvailabilityCard/ChannelsAvailabilityCard.tsx b/src/components/ChannelsAvailabilityCard/ChannelsAvailabilityCard.tsx index 44f53b5f8..f22cb6b19 100644 --- a/src/components/ChannelsAvailabilityCard/ChannelsAvailabilityCard.tsx +++ b/src/components/ChannelsAvailabilityCard/ChannelsAvailabilityCard.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Channel as ChannelList, ChannelData } from "@dashboard/channels/utils"; import { PermissionEnum } from "@dashboard/graphql"; import useDateLocalize from "@dashboard/hooks/useDateLocalize"; diff --git a/src/components/ChannelsAvailabilityCard/utils.ts b/src/components/ChannelsAvailabilityCard/utils.ts index da43e1e73..902569024 100644 --- a/src/components/ChannelsAvailabilityCard/utils.ts +++ b/src/components/ChannelsAvailabilityCard/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ChannelData } from "@dashboard/channels/utils"; import { LocalizeDate } from "@dashboard/hooks/useDateLocalize"; import { IntlShape } from "react-intl"; diff --git a/src/components/ChannelsAvailabilityDialog/ChannelsAvailabilityDialog.tsx b/src/components/ChannelsAvailabilityDialog/ChannelsAvailabilityDialog.tsx index 9cd9a037d..19f4a43b7 100644 --- a/src/components/ChannelsAvailabilityDialog/ChannelsAvailabilityDialog.tsx +++ b/src/components/ChannelsAvailabilityDialog/ChannelsAvailabilityDialog.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Channel } from "@dashboard/channels/utils"; import ActionDialog from "@dashboard/components/ActionDialog"; import { ConfirmButtonTransitionState } from "@dashboard/components/ConfirmButton"; diff --git a/src/components/ChannelsAvailabilityDropdown/ChannelsAvailabilityDropdown.tsx b/src/components/ChannelsAvailabilityDropdown/ChannelsAvailabilityDropdown.tsx index 637fb39d6..8a3a5155b 100644 --- a/src/components/ChannelsAvailabilityDropdown/ChannelsAvailabilityDropdown.tsx +++ b/src/components/ChannelsAvailabilityDropdown/ChannelsAvailabilityDropdown.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Card, Popper } from "@material-ui/core"; import React from "react"; import { useIntl } from "react-intl"; diff --git a/src/components/ChannelsAvailabilityDropdown/utils.ts b/src/components/ChannelsAvailabilityDropdown/utils.ts index 8813eb17f..bdd28c6f0 100644 --- a/src/components/ChannelsAvailabilityDropdown/utils.ts +++ b/src/components/ChannelsAvailabilityDropdown/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { CollectionFragment } from "@dashboard/graphql"; import { PillColor } from "@saleor/macaw-ui"; import { MessageDescriptor } from "react-intl"; diff --git a/src/components/ChannelsAvailabilityMenuContent/ChannelsAvailabilityMenuContent.tsx b/src/components/ChannelsAvailabilityMenuContent/ChannelsAvailabilityMenuContent.tsx index d276c051b..89af3263e 100644 --- a/src/components/ChannelsAvailabilityMenuContent/ChannelsAvailabilityMenuContent.tsx +++ b/src/components/ChannelsAvailabilityMenuContent/ChannelsAvailabilityMenuContent.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import HorizontalSpacer from "@dashboard/components/HorizontalSpacer"; import { CollectionFragment } from "@dashboard/graphql"; import ScrollableContent from "@dashboard/plugins/components/PluginsList/PluginAvailabilityStatusPopup/ScrollableContent"; diff --git a/src/components/Checkbox/Checkbox.tsx b/src/components/Checkbox/Checkbox.tsx index 74c8664ef..dd2abed88 100644 --- a/src/components/Checkbox/Checkbox.tsx +++ b/src/components/Checkbox/Checkbox.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import MuiCheckbox, { CheckboxProps as MuiCheckboxProps, } from "@material-ui/core/Checkbox"; diff --git a/src/components/ColorPicker/ColorPicker.tsx b/src/components/ColorPicker/ColorPicker.tsx index c0daba2e5..e521ee729 100644 --- a/src/components/ColorPicker/ColorPicker.tsx +++ b/src/components/ColorPicker/ColorPicker.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import HorizontalSpacer from "@dashboard/components/HorizontalSpacer"; import { UseFormResult } from "@dashboard/hooks/useForm"; import { RequireOnlyOne } from "@dashboard/misc"; diff --git a/src/components/ColumnPicker/ColumnPicker.tsx b/src/components/ColumnPicker/ColumnPicker.tsx index f7dbf2b23..60462f98d 100644 --- a/src/components/ColumnPicker/ColumnPicker.tsx +++ b/src/components/ColumnPicker/ColumnPicker.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FormChange } from "@dashboard/hooks/useForm"; import useStateFromProps from "@dashboard/hooks/useStateFromProps"; import { FetchMoreProps } from "@dashboard/types"; diff --git a/src/components/CompanyAddressInput/CompanyAddressForm.tsx b/src/components/CompanyAddressInput/CompanyAddressForm.tsx index 3edea84d9..078a97e2a 100644 --- a/src/components/CompanyAddressInput/CompanyAddressForm.tsx +++ b/src/components/CompanyAddressInput/CompanyAddressForm.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import FormSpacer from "@dashboard/components/FormSpacer"; import Grid from "@dashboard/components/Grid"; import SingleAutocompleteSelectField, { diff --git a/src/components/ConfirmButton/ConfirmButton.test.tsx b/src/components/ConfirmButton/ConfirmButton.test.tsx index 7ab78718b..7bf9ac7e7 100644 --- a/src/components/ConfirmButton/ConfirmButton.test.tsx +++ b/src/components/ConfirmButton/ConfirmButton.test.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { fireEvent, render, diff --git a/src/components/ControlledCheckbox.tsx b/src/components/ControlledCheckbox.tsx index dca08c152..59d5c1157 100644 --- a/src/components/ControlledCheckbox.tsx +++ b/src/components/ControlledCheckbox.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Checkbox, FormControlLabel } from "@material-ui/core"; import React from "react"; diff --git a/src/components/ControlledSwitch.tsx b/src/components/ControlledSwitch.tsx index e6843a2d5..93304aa4a 100644 --- a/src/components/ControlledSwitch.tsx +++ b/src/components/ControlledSwitch.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FormControlLabel, Switch } from "@material-ui/core"; import { makeStyles } from "@saleor/macaw-ui"; import React from "react"; diff --git a/src/components/CountryList/CountryList.tsx b/src/components/CountryList/CountryList.tsx index 4b0e9819a..fc9ab13f1 100644 --- a/src/components/CountryList/CountryList.tsx +++ b/src/components/CountryList/CountryList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Button } from "@dashboard/components/Button"; import CardTitle from "@dashboard/components/CardTitle"; import ResponsiveTable from "@dashboard/components/ResponsiveTable"; diff --git a/src/components/Datagrid/components/FullScreenContainer.tsx b/src/components/Datagrid/components/FullScreenContainer.tsx index 39e2759c9..a3251e9a6 100644 --- a/src/components/Datagrid/components/FullScreenContainer.tsx +++ b/src/components/Datagrid/components/FullScreenContainer.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useTheme } from "@saleor/macaw-ui"; import React, { CSSProperties, FC, PropsWithChildren } from "react"; import ReactDOM from "react-dom"; diff --git a/src/components/Datagrid/customCells/DropdownCell.tsx b/src/components/Datagrid/customCells/DropdownCell.tsx index bc99df1bc..a98553590 100644 --- a/src/components/Datagrid/customCells/DropdownCell.tsx +++ b/src/components/Datagrid/customCells/DropdownCell.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { CustomCell, CustomRenderer, diff --git a/src/components/Datagrid/customCells/Money/MoneyDiscountedCell.tsx b/src/components/Datagrid/customCells/Money/MoneyDiscountedCell.tsx index bbc850d68..b7251e517 100644 --- a/src/components/Datagrid/customCells/Money/MoneyDiscountedCell.tsx +++ b/src/components/Datagrid/customCells/Money/MoneyDiscountedCell.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Locale } from "@dashboard/components/Locale"; import OrderDiscountCommonModal from "@dashboard/orders/components/OrderDiscountCommonModal/OrderDiscountCommonModal"; import { diff --git a/src/components/Datagrid/customCells/NumberCell.tsx b/src/components/Datagrid/customCells/NumberCell.tsx index 6e5b5a040..7ab1b5717 100644 --- a/src/components/Datagrid/customCells/NumberCell.tsx +++ b/src/components/Datagrid/customCells/NumberCell.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { CustomCell, CustomRenderer, diff --git a/src/components/Datagrid/hooks/useColumnsDefault.ts b/src/components/Datagrid/hooks/useColumnsDefault.ts index 2b5516dc0..66d38316c 100644 --- a/src/components/Datagrid/hooks/useColumnsDefault.ts +++ b/src/components/Datagrid/hooks/useColumnsDefault.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import useStateFromProps from "@dashboard/hooks/useStateFromProps"; import { addAtIndex, removeAtIndex } from "@dashboard/utils/lists"; import { GridColumn } from "@glideapps/glide-data-grid"; diff --git a/src/components/Datagrid/hooks/useDatagridChange.test.tsx b/src/components/Datagrid/hooks/useDatagridChange.test.tsx index 7da3c2d60..85e15e613 100644 --- a/src/components/Datagrid/hooks/useDatagridChange.test.tsx +++ b/src/components/Datagrid/hooks/useDatagridChange.test.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { act, renderHook } from "@testing-library/react-hooks"; import React from "react"; diff --git a/src/components/Datagrid/hooks/useDatagridChange.ts b/src/components/Datagrid/hooks/useDatagridChange.ts index c9b629cbe..4ef172f0b 100644 --- a/src/components/Datagrid/hooks/useDatagridChange.ts +++ b/src/components/Datagrid/hooks/useDatagridChange.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { updateAtIndex } from "@dashboard/utils/lists"; import { EditableGridCell, Item } from "@glideapps/glide-data-grid"; import { diff --git a/src/components/Datagrid/hooks/usePortalClasses.ts b/src/components/Datagrid/hooks/usePortalClasses.ts index 5211840a3..06e634e0c 100644 --- a/src/components/Datagrid/hooks/usePortalClasses.ts +++ b/src/components/Datagrid/hooks/usePortalClasses.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useEffect } from "react"; /** diff --git a/src/components/Datagrid/hooks/usePressEscKey.tsx b/src/components/Datagrid/hooks/usePressEscKey.tsx index 829950293..931d562d7 100644 --- a/src/components/Datagrid/hooks/usePressEscKey.tsx +++ b/src/components/Datagrid/hooks/usePressEscKey.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useEffect } from "react"; export const usePressEscKey = (callback?: () => void) => { diff --git a/src/components/Datagrid/hooks/useScrollRight.ts b/src/components/Datagrid/hooks/useScrollRight.ts index 73b30a86f..6ef65359a 100644 --- a/src/components/Datagrid/hooks/useScrollRight.ts +++ b/src/components/Datagrid/hooks/useScrollRight.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import throttle from "lodash/throttle"; import { useEffect, useState } from "react"; diff --git a/src/components/Datagrid/utils.ts b/src/components/Datagrid/utils.ts index bcb0295d9..f42633d26 100644 --- a/src/components/Datagrid/utils.ts +++ b/src/components/Datagrid/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { DataEditorProps } from "@glideapps/glide-data-grid"; import { ColumnPickerProps } from "../ColumnPicker"; diff --git a/src/components/Date/Date.test.tsx b/src/components/Date/Date.test.tsx index a68590e27..9de899729 100644 --- a/src/components/Date/Date.test.tsx +++ b/src/components/Date/Date.test.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ThemeProvider } from "@saleor/macaw-ui"; import { render, screen } from "@testing-library/react"; import React from "react"; diff --git a/src/components/Date/DateContext.tsx b/src/components/Date/DateContext.tsx index 5e404caa0..706313faa 100644 --- a/src/components/Date/DateContext.tsx +++ b/src/components/Date/DateContext.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import React from "react"; export const DateContext = React.createContext(undefined); diff --git a/src/components/Date/DateProvider.tsx b/src/components/Date/DateProvider.tsx index 8a21b00b3..ee2c27700 100644 --- a/src/components/Date/DateProvider.tsx +++ b/src/components/Date/DateProvider.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import React from "react"; import { Provider } from "./DateContext"; diff --git a/src/components/Date/DateTime.tsx b/src/components/Date/DateTime.tsx index 9cc3822aa..35c4251b1 100644 --- a/src/components/Date/DateTime.tsx +++ b/src/components/Date/DateTime.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Tooltip } from "@saleor/macaw-ui/next"; import moment from "moment-timezone"; import React from "react"; diff --git a/src/components/DateTimeField/DateTimeField.tsx b/src/components/DateTimeField/DateTimeField.tsx index 9ed6d7e00..8b57aa986 100644 --- a/src/components/DateTimeField/DateTimeField.tsx +++ b/src/components/DateTimeField/DateTimeField.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { getErrorMessage } from "@dashboard/components/Attributes/utils"; import { PageErrorWithAttributesFragment, diff --git a/src/components/DateTimeTimezoneField.tsx b/src/components/DateTimeTimezoneField.tsx index 2eaef736a..7de12f29d 100644 --- a/src/components/DateTimeTimezoneField.tsx +++ b/src/components/DateTimeTimezoneField.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { commonMessages } from "@dashboard/intl"; import { DateTime, joinDateTime, splitDateTime } from "@dashboard/misc"; import { TextField } from "@material-ui/core"; diff --git a/src/components/Debounce.tsx b/src/components/Debounce.tsx index 6189ba60c..5f3f626ad 100644 --- a/src/components/Debounce.tsx +++ b/src/components/Debounce.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import React from "react"; export interface DebounceProps { diff --git a/src/components/DevModePanel/DevModePanel.tsx b/src/components/DevModePanel/DevModePanel.tsx index 290526faa..12cb2312f 100644 --- a/src/components/DevModePanel/DevModePanel.tsx +++ b/src/components/DevModePanel/DevModePanel.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useDashboardTheme } from "@dashboard/components/GraphiQL/styles"; import { createGraphiQLFetcher } from "@graphiql/toolkit"; import { Dialog, DialogContent } from "@material-ui/core"; diff --git a/src/components/DevModePanel/DevModeProvider.tsx b/src/components/DevModePanel/DevModeProvider.tsx index 25ddc90c0..f0cbae563 100644 --- a/src/components/DevModePanel/DevModeProvider.tsx +++ b/src/components/DevModePanel/DevModeProvider.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import React, { useState } from "react"; import { DevModeContext } from "./hooks"; diff --git a/src/components/DevModePanel/useDevModeKeyTrigger.ts b/src/components/DevModePanel/useDevModeKeyTrigger.ts index 2eb74d2fb..e1714c4b0 100644 --- a/src/components/DevModePanel/useDevModeKeyTrigger.ts +++ b/src/components/DevModePanel/useDevModeKeyTrigger.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useEffect } from "react"; type DevModeKeyTriggerCallback = ({ shift }: { shift: boolean }) => void; diff --git a/src/components/Dropzone.tsx b/src/components/Dropzone.tsx index 804532431..81e5e18c7 100644 --- a/src/components/Dropzone.tsx +++ b/src/components/Dropzone.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore /* tslint:disable:no-submodule-imports */ import Dropzone from "react-dropzone/dist/index"; export default Dropzone; diff --git a/src/components/DryRun/DryRun.tsx b/src/components/DryRun/DryRun.tsx index 3fd576d5e..fd89fcb2c 100644 --- a/src/components/DryRun/DryRun.tsx +++ b/src/components/DryRun/DryRun.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import Grid from "@dashboard/components/Grid"; import { useStyles } from "@dashboard/custom-apps/components/WebhookEvents/styles"; import { diff --git a/src/components/DryRun/utils.ts b/src/components/DryRun/utils.ts index 2338f06e5..8e53e9e16 100644 --- a/src/components/DryRun/utils.ts +++ b/src/components/DryRun/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { getWebhookTypes } from "@dashboard/custom-apps/components/WebhookEvents/utils"; import { WebhookEventTypeAsyncEnum } from "@dashboard/graphql"; import { InlineFragmentNode, ObjectFieldNode, parse, visit } from "graphql"; diff --git a/src/components/DryRunItemsList/DryRunItemsList.test.tsx b/src/components/DryRunItemsList/DryRunItemsList.test.tsx index f5c3718b9..9fc4b45ce 100644 --- a/src/components/DryRunItemsList/DryRunItemsList.test.tsx +++ b/src/components/DryRunItemsList/DryRunItemsList.test.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { MockedProvider, MockedResponse } from "@apollo/client/testing"; import { ThemeProvider } from "@saleor/macaw-ui"; import { productsMocks } from "@test/mocks/products"; diff --git a/src/components/DryRunItemsList/DryRunItemsList.tsx b/src/components/DryRunItemsList/DryRunItemsList.tsx index f55c32f40..7afd40362 100644 --- a/src/components/DryRunItemsList/DryRunItemsList.tsx +++ b/src/components/DryRunItemsList/DryRunItemsList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import Skeleton from "@dashboard/components/Skeleton"; import { useStyles } from "@dashboard/custom-apps/components/WebhookEvents/styles"; import { useQuery } from "@dashboard/hooks/graphql"; diff --git a/src/components/DryRunItemsList/utils.ts b/src/components/DryRunItemsList/utils.ts index 7be28c704..715226f70 100644 --- a/src/components/DryRunItemsList/utils.ts +++ b/src/components/DryRunItemsList/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { AppsListDocument, AppsListQuery, diff --git a/src/components/ErrorPage/ErrorPage.tsx b/src/components/ErrorPage/ErrorPage.tsx index daff778dc..034a9af43 100644 --- a/src/components/ErrorPage/ErrorPage.tsx +++ b/src/components/ErrorPage/ErrorPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import notFoundImage from "@assets/images/what.svg"; import useAppState from "@dashboard/hooks/useAppState"; import useNavigator from "@dashboard/hooks/useNavigator"; diff --git a/src/components/FileUploadField/FileUploadField.tsx b/src/components/FileUploadField/FileUploadField.tsx index f15011964..c3b07d485 100644 --- a/src/components/FileUploadField/FileUploadField.tsx +++ b/src/components/FileUploadField/FileUploadField.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FileFragment } from "@dashboard/graphql"; import { commonMessages } from "@dashboard/intl"; import { Box, Button, Text, TrashBinIcon } from "@saleor/macaw-ui/next"; diff --git a/src/components/Filter/Filter.tsx b/src/components/Filter/Filter.tsx index b93dc0227..9f8154ce7 100644 --- a/src/components/Filter/Filter.tsx +++ b/src/components/Filter/Filter.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ClickAwayListener, Grow, Popper, Typography } from "@material-ui/core"; import { alpha } from "@material-ui/core/styles"; import { Button, makeStyles } from "@saleor/macaw-ui"; diff --git a/src/components/Filter/FilterAutocompleteField.tsx b/src/components/Filter/FilterAutocompleteField.tsx index 2831d5e72..720a76b1d 100644 --- a/src/components/Filter/FilterAutocompleteField.tsx +++ b/src/components/Filter/FilterAutocompleteField.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { toggle } from "@dashboard/utils/lists"; import { FormControlLabel, TextField, Typography } from "@material-ui/core"; import { makeStyles } from "@saleor/macaw-ui"; @@ -105,9 +106,8 @@ const FilterAutocompleteField: React.FC = ({ const isValueChecked = (displayValue: MultiAutocompleteChoiceType) => filter.value.includes(displayValue.value); - const filteredValuesChecked = initialFieldDisplayValues.filter( - isValueChecked, - ); + const filteredValuesChecked = + initialFieldDisplayValues.filter(isValueChecked); const filteredValuesUnchecked = fieldDisplayValues.filter( displayValue => !isValueChecked(displayValue), diff --git a/src/components/Filter/FilterContent/FilterContent.tsx b/src/components/Filter/FilterContent/FilterContent.tsx index 69fbce55e..607137599 100644 --- a/src/components/Filter/FilterContent/FilterContent.tsx +++ b/src/components/Filter/FilterContent/FilterContent.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import CollectionWithDividers from "@dashboard/components/CollectionWithDividers"; import useStateFromProps from "@dashboard/hooks/useStateFromProps"; import { makeStyles, Paper, Typography } from "@material-ui/core"; diff --git a/src/components/Filter/FilterContent/FilterContentBody.tsx b/src/components/Filter/FilterContent/FilterContentBody.tsx index 2ec368835..de9be69bd 100644 --- a/src/components/Filter/FilterContent/FilterContentBody.tsx +++ b/src/components/Filter/FilterContent/FilterContentBody.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FilterDateTimeField } from "@dashboard/components/Filter/FilterContent/FilterDateTimeField"; import { FilterNumericField } from "@dashboard/components/Filter/FilterContent/FilterNumericField"; import { FilterSingleSelectField } from "@dashboard/components/Filter/FilterContent/FilterSingleSelectField"; diff --git a/src/components/Filter/FilterContent/FilterDateTimeField.tsx b/src/components/Filter/FilterContent/FilterDateTimeField.tsx index 70c83c9ea..33a5f8ffc 100644 --- a/src/components/Filter/FilterContent/FilterDateTimeField.tsx +++ b/src/components/Filter/FilterContent/FilterDateTimeField.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FieldType, FilterFieldBaseProps } from "@dashboard/components/Filter"; import Arrow from "@dashboard/components/Filter/Arrow"; import { splitDateTime } from "@dashboard/misc"; diff --git a/src/components/Filter/FilterContent/FilterErrorsList.tsx b/src/components/Filter/FilterContent/FilterErrorsList.tsx index 919f0013c..533a4260c 100644 --- a/src/components/Filter/FilterContent/FilterErrorsList.tsx +++ b/src/components/Filter/FilterContent/FilterErrorsList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import InlineAlert from "@dashboard/components/Alert/InlineAlert"; import errorTracker from "@dashboard/services/errorTracking"; import { Typography } from "@material-ui/core"; diff --git a/src/components/Filter/FilterContent/FilterSingleSelectField.tsx b/src/components/Filter/FilterContent/FilterSingleSelectField.tsx index 1e6f1824a..1116796c9 100644 --- a/src/components/Filter/FilterContent/FilterSingleSelectField.tsx +++ b/src/components/Filter/FilterContent/FilterSingleSelectField.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FilterFieldBaseProps, FilterType } from "@dashboard/components/Filter"; import { getIsFilterMultipleChoices, @@ -11,10 +12,9 @@ import SingleSelectField from "../../SingleSelectField/SingleSelectField"; type FilterSingleSelectFieldProps = FilterFieldBaseProps; -export const FilterSingleSelectField: React.FC = ({ - filter, - onFilterPropertyChange, -}) => { +export const FilterSingleSelectField: React.FC< + FilterSingleSelectFieldProps +> = ({ filter, onFilterPropertyChange }) => { const classes = useCommonStyles({}); const intl = useIntl(); diff --git a/src/components/Filter/FilterContent/utils.ts b/src/components/Filter/FilterContent/utils.ts index e5704e41d..5dcbaa548 100644 --- a/src/components/Filter/FilterContent/utils.ts +++ b/src/components/Filter/FilterContent/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { SingleAutocompleteChoiceType } from "@dashboard/components/SingleAutocompleteSelectField"; import { joinDateTime, splitDateTime } from "@dashboard/misc"; import { makeStyles } from "@saleor/macaw-ui"; diff --git a/src/components/Filter/FilterOptionField.tsx b/src/components/Filter/FilterOptionField.tsx index 183942d5a..c91a94021 100644 --- a/src/components/Filter/FilterOptionField.tsx +++ b/src/components/Filter/FilterOptionField.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { toggle } from "@dashboard/utils/lists"; import { FormControlLabel, Radio } from "@material-ui/core"; import { makeStyles } from "@saleor/macaw-ui"; @@ -21,10 +22,9 @@ const useStyles = makeStyles( { name: "FilterOptionField" }, ); -const FilterOptionField: React.FC> = ({ filter, onFilterPropertyChange, ...rest }) => { +const FilterOptionField: React.FC< + FilterFieldBaseProps +> = ({ filter, onFilterPropertyChange, ...rest }) => { const classes = useStyles({}); const handleSelect = (value: string) => onFilterPropertyChange({ diff --git a/src/components/Filter/reducer.ts b/src/components/Filter/reducer.ts index c0ebc3520..56965c5a6 100644 --- a/src/components/Filter/reducer.ts +++ b/src/components/Filter/reducer.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { update } from "@dashboard/utils/lists"; import { FieldType, IFilter, IFilterElementMutableDataGeneric } from "./types"; diff --git a/src/components/Filter/useFilter.ts b/src/components/Filter/useFilter.ts index 4c4343a10..7f08b86d0 100644 --- a/src/components/Filter/useFilter.ts +++ b/src/components/Filter/useFilter.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useEffect, useReducer } from "react"; import reduceFilter, { FilterReducerAction } from "./reducer"; diff --git a/src/components/Filter/utils.ts b/src/components/Filter/utils.ts index a1941404f..c7dc5050f 100644 --- a/src/components/Filter/utils.ts +++ b/src/components/Filter/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import compact from "lodash/compact"; import { diff --git a/src/components/FilterCard/FilterCard.tsx b/src/components/FilterCard/FilterCard.tsx index 37d3ff2b0..3e479cc23 100644 --- a/src/components/FilterCard/FilterCard.tsx +++ b/src/components/FilterCard/FilterCard.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Card, CardContent, CardHeader } from "@material-ui/core"; import RefreshIcon from "@material-ui/icons/Refresh"; import { IconButton } from "@saleor/macaw-ui"; diff --git a/src/components/Form/ExitFormDialogProvider.tsx b/src/components/Form/ExitFormDialogProvider.tsx index 665062391..c802e9aed 100644 --- a/src/components/Form/ExitFormDialogProvider.tsx +++ b/src/components/Form/ExitFormDialogProvider.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import React from "react"; import ExitFormDialog from "./ExitFormDialog"; @@ -18,13 +19,8 @@ export const ExitFormDialogContext = React.createContext({ }); const ExitFormDialogProvider = ({ children }) => { - const { - handleClose, - handleLeave, - providerData, - showDialog, - shouldBlockNav, - } = useExitFormDialogProvider(); + const { handleClose, handleLeave, providerData, showDialog, shouldBlockNav } = + useExitFormDialogProvider(); useBeforeUnload(e => { // If form is dirty and user does a refresh, diff --git a/src/components/Form/Form.tsx b/src/components/Form/Form.tsx index 5e26d2438..55a429acb 100644 --- a/src/components/Form/Form.tsx +++ b/src/components/Form/Form.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import useForm, { SubmitPromise, UseFormResult, diff --git a/src/components/Form/useExitFormDialog.test.tsx b/src/components/Form/useExitFormDialog.test.tsx index b1eed0824..ddb8405b3 100644 --- a/src/components/Form/useExitFormDialog.test.tsx +++ b/src/components/Form/useExitFormDialog.test.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import useForm, { SubmitPromise } from "@dashboard/hooks/useForm"; import { act, renderHook } from "@testing-library/react-hooks"; import React from "react"; diff --git a/src/components/Form/useExitFormDialog.ts b/src/components/Form/useExitFormDialog.ts index 1e8cca680..26607c250 100644 --- a/src/components/Form/useExitFormDialog.ts +++ b/src/components/Form/useExitFormDialog.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import React, { useContext, useRef } from "react"; import { ExitFormDialogContext } from "./ExitFormDialogProvider"; diff --git a/src/components/Form/useExitFormDialogProvider.tsx b/src/components/Form/useExitFormDialogProvider.tsx index d0e9a0ac3..34a5a5f74 100644 --- a/src/components/Form/useExitFormDialogProvider.tsx +++ b/src/components/Form/useExitFormDialogProvider.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { SubmitPromise } from "@dashboard/hooks/useForm"; import { useEffect, useRef, useState } from "react"; import { useHistory } from "react-router"; diff --git a/src/components/GraphiQL/GraphiQL.tsx b/src/components/GraphiQL/GraphiQL.tsx index 9b88255c5..5bed65255 100644 --- a/src/components/GraphiQL/GraphiQL.tsx +++ b/src/components/GraphiQL/GraphiQL.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { WebhookFormData } from "@dashboard/custom-apps/components/WebhookDetailsPage"; import { CopyIcon, diff --git a/src/components/ImageUpload/ImageUpload.tsx b/src/components/ImageUpload/ImageUpload.tsx index db67884d7..f09621261 100644 --- a/src/components/ImageUpload/ImageUpload.tsx +++ b/src/components/ImageUpload/ImageUpload.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Typography } from "@material-ui/core"; import { alpha } from "@material-ui/core/styles"; import { ImageIcon, makeStyles } from "@saleor/macaw-ui"; diff --git a/src/components/LanguageSwitch/LanguageSwitch.tsx b/src/components/LanguageSwitch/LanguageSwitch.tsx index 8f5dbf98a..15be11458 100644 --- a/src/components/LanguageSwitch/LanguageSwitch.tsx +++ b/src/components/LanguageSwitch/LanguageSwitch.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { LanguageCodeEnum, LanguageFragment } from "@dashboard/graphql"; import { Card, diff --git a/src/components/Link.tsx b/src/components/Link.tsx index a866f52fb..66800eb3f 100644 --- a/src/components/Link.tsx +++ b/src/components/Link.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { isExternalURL } from "@dashboard/utils/urls"; import { Typography } from "@material-ui/core"; import { TypographyProps } from "@material-ui/core/Typography"; diff --git a/src/components/LinkChoice/LinkChoice.tsx b/src/components/LinkChoice/LinkChoice.tsx index d22fc45ea..329fd99ca 100644 --- a/src/components/LinkChoice/LinkChoice.tsx +++ b/src/components/LinkChoice/LinkChoice.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FormChange } from "@dashboard/hooks/useForm"; import ArrowDropdown from "@dashboard/icons/ArrowDropdown"; import { ClickAwayListener, MenuItem, Paper, Popper } from "@material-ui/core"; diff --git a/src/components/Locale/Locale.tsx b/src/components/Locale/Locale.tsx index aa51ad371..2688000f7 100644 --- a/src/components/Locale/Locale.tsx +++ b/src/components/Locale/Locale.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import useLocalStorage from "@dashboard/hooks/useLocalStorage"; import React from "react"; import { IntlProvider, ReactIntlErrorCode } from "react-intl"; diff --git a/src/components/Metadata/Metadata.tsx b/src/components/Metadata/Metadata.tsx index 3eb489352..309cfe1c8 100644 --- a/src/components/Metadata/Metadata.tsx +++ b/src/components/Metadata/Metadata.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { MetadataInput } from "@dashboard/graphql"; import { ChangeEvent } from "@dashboard/hooks/useForm"; import { removeAtIndex, updateAtIndex } from "@dashboard/utils/lists"; diff --git a/src/components/Metadata/utils.ts b/src/components/Metadata/utils.ts index 9ad3c6423..7f373d6d4 100644 --- a/src/components/Metadata/utils.ts +++ b/src/components/Metadata/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ChangeEvent } from "@dashboard/hooks/useForm"; import { EventData, EventDataAction, EventDataField } from "./types"; diff --git a/src/components/MoneyRange/utils.test.ts b/src/components/MoneyRange/utils.test.ts index 8b67bbe0d..ad335be68 100644 --- a/src/components/MoneyRange/utils.test.ts +++ b/src/components/MoneyRange/utils.test.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { IMoney } from "@dashboard/utils/intl"; import { IntlShape } from "react-intl"; diff --git a/src/components/MultiAutocompleteSelectField/MultiAutocompleteSelectField.tsx b/src/components/MultiAutocompleteSelectField/MultiAutocompleteSelectField.tsx index 38ca9222d..a538f0599 100644 --- a/src/components/MultiAutocompleteSelectField/MultiAutocompleteSelectField.tsx +++ b/src/components/MultiAutocompleteSelectField/MultiAutocompleteSelectField.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import Debounce, { DebounceProps } from "@dashboard/components/Debounce"; import { FetchMoreProps } from "@dashboard/types"; import { @@ -42,11 +43,12 @@ export interface MultiAutocompleteSelectFieldProps popperPlacement?: PopperPlacementType; } -const DebounceAutocomplete: React.ComponentType> = Debounce; +const DebounceAutocomplete: React.ComponentType> = + Debounce; -const MultiAutocompleteSelectFieldComponent: React.FC = props => { +const MultiAutocompleteSelectFieldComponent: React.FC< + MultiAutocompleteSelectFieldProps +> = props => { const { add, allowCustomValues, @@ -260,12 +262,9 @@ const MultiAutocompleteSelectFieldComponent: React.FC = ({ - choices, - fetchChoices, - testId, - ...props -}) => { +const MultiAutocompleteSelectField: React.FC< + MultiAutocompleteSelectFieldProps +> = ({ choices, fetchChoices, testId, ...props }) => { const [query, setQuery] = React.useState(""); if (fetchChoices) { diff --git a/src/components/MultiAutocompleteSelectField/MultiAutocompleteSelectFieldContent.tsx b/src/components/MultiAutocompleteSelectField/MultiAutocompleteSelectFieldContent.tsx index fd3297f67..5275d488e 100644 --- a/src/components/MultiAutocompleteSelectField/MultiAutocompleteSelectFieldContent.tsx +++ b/src/components/MultiAutocompleteSelectField/MultiAutocompleteSelectFieldContent.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import chevronDown from "@assets/images/ChevronDown.svg"; import Checkbox from "@dashboard/components/Checkbox"; import HorizontalSpacer from "@dashboard/components/HorizontalSpacer"; diff --git a/src/components/MultiSelectField/MultiSelectField.tsx b/src/components/MultiSelectField/MultiSelectField.tsx index 89e4e5ec2..28b0fdefa 100644 --- a/src/components/MultiSelectField/MultiSelectField.tsx +++ b/src/components/MultiSelectField/MultiSelectField.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FilledInput, FormControl, diff --git a/src/components/Navigator/Navigator.tsx b/src/components/Navigator/Navigator.tsx index 112fb0610..887af97c4 100644 --- a/src/components/Navigator/Navigator.tsx +++ b/src/components/Navigator/Navigator.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import useLocalStorage from "@dashboard/hooks/useLocalStorage"; import useNotifier from "@dashboard/hooks/useNotifier"; import { Divider, Fade, Modal, Paper } from "@material-ui/core"; diff --git a/src/components/Navigator/NavigatorInput.tsx b/src/components/Navigator/NavigatorInput.tsx index f0d2ce15a..8a7653869 100644 --- a/src/components/Navigator/NavigatorInput.tsx +++ b/src/components/Navigator/NavigatorInput.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { makeStyles, SearchLargeIcon } from "@saleor/macaw-ui"; import React from "react"; import { useIntl } from "react-intl"; diff --git a/src/components/Navigator/modes/catalog.ts b/src/components/Navigator/modes/catalog.ts index 20670665a..8f149ed0e 100644 --- a/src/components/Navigator/modes/catalog.ts +++ b/src/components/Navigator/modes/catalog.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { categoryUrl } from "@dashboard/categories/urls"; import { collectionUrl } from "@dashboard/collections/urls"; import { SearchCatalogQuery } from "@dashboard/graphql"; diff --git a/src/components/Navigator/modes/customers.ts b/src/components/Navigator/modes/customers.ts index 8237f69aa..e3c1abaa2 100644 --- a/src/components/Navigator/modes/customers.ts +++ b/src/components/Navigator/modes/customers.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { customerUrl } from "@dashboard/customers/urls"; import { SearchCustomersQuery } from "@dashboard/graphql"; import { UseNavigatorResult } from "@dashboard/hooks/useNavigator"; diff --git a/src/components/Navigator/modes/orders.ts b/src/components/Navigator/modes/orders.ts index a9ca8318c..b3e616eca 100644 --- a/src/components/Navigator/modes/orders.ts +++ b/src/components/Navigator/modes/orders.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { CheckIfOrderExistsQuery } from "@dashboard/graphql"; import { UseNavigatorResult } from "@dashboard/hooks/useNavigator"; import { maybe, transformOrderStatus } from "@dashboard/misc"; diff --git a/src/components/Navigator/modes/types.ts b/src/components/Navigator/modes/types.ts index c22cf1cf1..baec02315 100644 --- a/src/components/Navigator/modes/types.ts +++ b/src/components/Navigator/modes/types.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { CheckIfOrderExistsQuery, SearchCatalogQuery, diff --git a/src/components/Navigator/modes/utils.ts b/src/components/Navigator/modes/utils.ts index b3119ef31..1192b9a0c 100644 --- a/src/components/Navigator/modes/utils.ts +++ b/src/components/Navigator/modes/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { QuickSearchAction, QuickSearchActionInput, diff --git a/src/components/Navigator/useQuickSearch.ts b/src/components/Navigator/useQuickSearch.ts index bd58cb8ec..2a3c447f9 100644 --- a/src/components/Navigator/useQuickSearch.ts +++ b/src/components/Navigator/useQuickSearch.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { DEFAULT_INITIAL_SEARCH_DATA } from "@dashboard/config"; import { useOrderDraftCreateMutation } from "@dashboard/graphql"; import { ChangeEvent, FormChange } from "@dashboard/hooks/useForm"; diff --git a/src/components/NavigatorButton/NavigatorButton.tsx b/src/components/NavigatorButton/NavigatorButton.tsx index 3c6f506d3..a26a4d1ab 100644 --- a/src/components/NavigatorButton/NavigatorButton.tsx +++ b/src/components/NavigatorButton/NavigatorButton.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { triangle } from "@dashboard/styles/mixins"; import { Grow, Paper, Popper } from "@material-ui/core"; import { IconButtonProps } from "@material-ui/core/IconButton"; diff --git a/src/components/OverflowTooltip/useOverflow.ts b/src/components/OverflowTooltip/useOverflow.ts index 92aae795c..b8b66c161 100644 --- a/src/components/OverflowTooltip/useOverflow.ts +++ b/src/components/OverflowTooltip/useOverflow.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import React from "react"; interface OverflowConfig { diff --git a/src/components/PhoneField/PhoneField.tsx b/src/components/PhoneField/PhoneField.tsx index ae14d4402..dba7d278a 100644 --- a/src/components/PhoneField/PhoneField.tsx +++ b/src/components/PhoneField/PhoneField.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import SingleSelectField from "@dashboard/components/SingleSelectField"; import { TextField } from "@material-ui/core"; import { makeStyles } from "@saleor/macaw-ui"; diff --git a/src/components/Pill/Pill.tsx b/src/components/Pill/Pill.tsx index 98564f73e..6e9536262 100644 --- a/src/components/Pill/Pill.tsx +++ b/src/components/Pill/Pill.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { getStatusColor } from "@dashboard/misc"; import { makeStyles, Pill as MacawuiPill, PillProps } from "@saleor/macaw-ui"; import { useTheme, vars } from "@saleor/macaw-ui/next"; diff --git a/src/components/PriceField/PriceField.tsx b/src/components/PriceField/PriceField.tsx index 866a01350..5c53eae87 100644 --- a/src/components/PriceField/PriceField.tsx +++ b/src/components/PriceField/PriceField.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { InputAdornment, InputLabelProps, TextField } from "@material-ui/core"; import { InputProps } from "@material-ui/core/Input"; import { makeStyles } from "@saleor/macaw-ui"; diff --git a/src/components/RadioGroupField/RadioGroupField.tsx b/src/components/RadioGroupField/RadioGroupField.tsx index 6974f1943..3cdba5666 100644 --- a/src/components/RadioGroupField/RadioGroupField.tsx +++ b/src/components/RadioGroupField/RadioGroupField.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FormControl, FormControlLabel, diff --git a/src/components/RadioSwitchField/RadioSwitchField.tsx b/src/components/RadioSwitchField/RadioSwitchField.tsx index 7402d0a9b..8e20c59d7 100644 --- a/src/components/RadioSwitchField/RadioSwitchField.tsx +++ b/src/components/RadioSwitchField/RadioSwitchField.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FormControl, FormControlLabel, diff --git a/src/components/RequirePermissions.tsx b/src/components/RequirePermissions.tsx index 96345a2a8..47c4f2daa 100644 --- a/src/components/RequirePermissions.tsx +++ b/src/components/RequirePermissions.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useUserPermissions } from "@dashboard/auth/hooks/useUserPermissions"; import { PermissionEnum, UserPermissionFragment } from "@dashboard/graphql"; import React from "react"; diff --git a/src/components/RichTextEditor/RichTextEditor.tsx b/src/components/RichTextEditor/RichTextEditor.tsx index b551fd079..fadcdb761 100644 --- a/src/components/RichTextEditor/RichTextEditor.tsx +++ b/src/components/RichTextEditor/RichTextEditor.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { LogLevels } from "@editorjs/editorjs"; import { FormControl, FormHelperText, InputLabel } from "@material-ui/core"; import { useId } from "@reach/auto-id"; diff --git a/src/components/RichTextEditor/RichTextEditorLoading.tsx b/src/components/RichTextEditor/RichTextEditorLoading.tsx index 910a5b43d..c68d92818 100644 --- a/src/components/RichTextEditor/RichTextEditorLoading.tsx +++ b/src/components/RichTextEditor/RichTextEditorLoading.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import React from "react"; import RichTextEditor, { RichTextEditorProps } from "./RichTextEditor"; diff --git a/src/components/RichTextEditor/consts.ts b/src/components/RichTextEditor/consts.ts index eab229798..66cb42a3a 100644 --- a/src/components/RichTextEditor/consts.ts +++ b/src/components/RichTextEditor/consts.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import strikethroughIcon from "@dashboard/icons/StrikethroughIcon"; import { ToolConstructable, ToolSettings } from "@editorjs/editorjs"; import Embed from "@editorjs/embed"; diff --git a/src/components/RowNumberSelect/RowNumberSelect.tsx b/src/components/RowNumberSelect/RowNumberSelect.tsx index 6861767a3..dabbcd45f 100644 --- a/src/components/RowNumberSelect/RowNumberSelect.tsx +++ b/src/components/RowNumberSelect/RowNumberSelect.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { MenuItem, Select } from "@material-ui/core"; import { makeStyles } from "@saleor/macaw-ui"; import React from "react"; diff --git a/src/components/SaveFilterTabDialog/SaveFilterTabDialog.tsx b/src/components/SaveFilterTabDialog/SaveFilterTabDialog.tsx index e4b01e4e6..f8dcd2540 100644 --- a/src/components/SaveFilterTabDialog/SaveFilterTabDialog.tsx +++ b/src/components/SaveFilterTabDialog/SaveFilterTabDialog.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ConfirmButtonTransitionState } from "@dashboard/components/ConfirmButton"; import { buttonMessages } from "@dashboard/intl"; import { diff --git a/src/components/SeoForm/SeoForm.tsx b/src/components/SeoForm/SeoForm.tsx index 65cfa0cbf..4b19dda7f 100644 --- a/src/components/SeoForm/SeoForm.tsx +++ b/src/components/SeoForm/SeoForm.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { CollectionErrorFragment, PageErrorFragment, diff --git a/src/components/Shop/index.tsx b/src/components/Shop/index.tsx index 1e048ca78..cd4a97a84 100644 --- a/src/components/Shop/index.tsx +++ b/src/components/Shop/index.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import appleTouchIcon from "@assets/favicons/apple-touch-icon.png"; import favicon16 from "@assets/favicons/favicon-16x16.png"; import favicon32 from "@assets/favicons/favicon-32x32.png"; diff --git a/src/components/Shop/queries.ts b/src/components/Shop/queries.ts index 40e9025e8..dee9de278 100644 --- a/src/components/Shop/queries.ts +++ b/src/components/Shop/queries.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { gql } from "@apollo/client"; import { RefreshLimitsQuery, diff --git a/src/components/Sidebar/menu/ItemGroup.tsx b/src/components/Sidebar/menu/ItemGroup.tsx index b7d9c258d..84923e431 100644 --- a/src/components/Sidebar/menu/ItemGroup.tsx +++ b/src/components/Sidebar/menu/ItemGroup.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Box, List, sprinkles, Text } from "@saleor/macaw-ui/next"; import React from "react"; import { Link } from "react-router-dom"; diff --git a/src/components/Sidebar/menu/SingleItem.tsx b/src/components/Sidebar/menu/SingleItem.tsx index 36cba6882..5211bfe74 100644 --- a/src/components/Sidebar/menu/SingleItem.tsx +++ b/src/components/Sidebar/menu/SingleItem.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { extensionMountPoints, useExtensions, diff --git a/src/components/Sidebar/menu/useMenuStructure.tsx b/src/components/Sidebar/menu/useMenuStructure.tsx index 110246f49..17c47621b 100644 --- a/src/components/Sidebar/menu/useMenuStructure.tsx +++ b/src/components/Sidebar/menu/useMenuStructure.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { extensionMountPoints, useExtensions, diff --git a/src/components/Sidebar/menu/utils.ts b/src/components/Sidebar/menu/utils.ts index c8f4d5a57..3685f20bf 100644 --- a/src/components/Sidebar/menu/utils.ts +++ b/src/components/Sidebar/menu/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Extension } from "@dashboard/apps/hooks/useExtensions"; import { AppUrls } from "@dashboard/apps/urls"; import { AppExtensionMountEnum } from "@dashboard/graphql"; diff --git a/src/components/Sidebar/user/Controls.tsx b/src/components/Sidebar/user/Controls.tsx index 981a8b495..063b91a79 100644 --- a/src/components/Sidebar/user/Controls.tsx +++ b/src/components/Sidebar/user/Controls.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useUser } from "@dashboard/auth"; import { staffMemberDetailsUrl } from "@dashboard/staff/urls"; import { useTheme } from "@dashboard/theme"; diff --git a/src/components/SingleAutocompleteSelectField/SingleAutocompleteSelectField.tsx b/src/components/SingleAutocompleteSelectField/SingleAutocompleteSelectField.tsx index c694675cf..8a064384b 100644 --- a/src/components/SingleAutocompleteSelectField/SingleAutocompleteSelectField.tsx +++ b/src/components/SingleAutocompleteSelectField/SingleAutocompleteSelectField.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ExtendedFormHelperTextProps } from "@dashboard/channels/components/ChannelForm/types"; import { FetchMoreProps } from "@dashboard/types"; import { diff --git a/src/components/SingleAutocompleteSelectField/SingleAutocompleteSelectFieldContent.tsx b/src/components/SingleAutocompleteSelectField/SingleAutocompleteSelectFieldContent.tsx index c43243c32..ef56a3cf6 100644 --- a/src/components/SingleAutocompleteSelectField/SingleAutocompleteSelectFieldContent.tsx +++ b/src/components/SingleAutocompleteSelectField/SingleAutocompleteSelectFieldContent.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import chevronDown from "@assets/images/ChevronDown.svg"; import useElementScroll, { isScrolledToBottom, diff --git a/src/components/SingleSelectField/SingleSelectField.tsx b/src/components/SingleSelectField/SingleSelectField.tsx index ce9de4ce2..b1f046aa6 100644 --- a/src/components/SingleSelectField/SingleSelectField.tsx +++ b/src/components/SingleSelectField/SingleSelectField.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FormControl, FormHelperText, diff --git a/src/components/SortableTable/SortableTableBody.tsx b/src/components/SortableTable/SortableTableBody.tsx index 63e3dc90d..ce73e8f69 100644 --- a/src/components/SortableTable/SortableTableBody.tsx +++ b/src/components/SortableTable/SortableTableBody.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ReorderAction } from "@dashboard/types"; import { TableBody } from "@material-ui/core"; import { TableBodyProps } from "@material-ui/core/TableBody"; @@ -29,10 +30,9 @@ const useStyles = makeStyles( { name: "SortableTableBody" }, ); -const SortableTableBody: React.FC> = props => { +const SortableTableBody: React.FC< + Omit +> = props => { const classes = useStyles({}); return ( diff --git a/src/components/SortableTable/SortableTableRow.tsx b/src/components/SortableTable/SortableTableRow.tsx index 51d5ccba1..6588558d9 100644 --- a/src/components/SortableTable/SortableTableRow.tsx +++ b/src/components/SortableTable/SortableTableRow.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TableRowProps } from "@material-ui/core"; import React from "react"; import { SortableElement, SortableElementProps } from "react-sortable-hoc"; @@ -7,16 +8,15 @@ import SortableHandle from "./SortableHandle"; type SortableTableRowTypesUnion = "link" | "row"; -type SortableTableRowProps< - T extends SortableTableRowTypesUnion -> = T extends "link" ? TableRowLinkProps : TableRowProps; +type SortableTableRowProps = + T extends "link" ? TableRowLinkProps : TableRowProps; -const SortableTableRow = (SortableElement(({ children, ...props }) => ( +const SortableTableRow = SortableElement(({ children, ...props }) => ( {children} -)) as unknown) as ( +)) as unknown as ( props: SortableElementProps & SortableTableRowProps, ) => JSX.Element; diff --git a/src/components/TableHead/TableHead.tsx b/src/components/TableHead/TableHead.tsx index 841a4b948..dc4255288 100644 --- a/src/components/TableHead/TableHead.tsx +++ b/src/components/TableHead/TableHead.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import TableRowLink from "@dashboard/components/TableRowLink"; import { TableCell, diff --git a/src/components/TablePagination/TablePaginationActions.tsx b/src/components/TablePagination/TablePaginationActions.tsx index 33ee1fc25..57bc669f3 100644 --- a/src/components/TablePagination/TablePaginationActions.tsx +++ b/src/components/TablePagination/TablePaginationActions.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { isDarkTheme } from "@dashboard/misc"; import { alpha } from "@material-ui/core/styles"; import ArrowLeft from "@material-ui/icons/ArrowLeft"; @@ -61,7 +62,9 @@ export interface TablePaginationActionsProps { onPreviousPage(event); } -export const TablePaginationActions: React.FC = props => { +export const TablePaginationActions: React.FC< + TablePaginationActionsProps +> = props => { const { backIconButtonProps, className, diff --git a/src/components/TablePagination/TablePaginationWithContext.tsx b/src/components/TablePagination/TablePaginationWithContext.tsx index 1568cc0c0..d223fb348 100644 --- a/src/components/TablePagination/TablePaginationWithContext.tsx +++ b/src/components/TablePagination/TablePaginationWithContext.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { usePaginatorContext } from "@dashboard/hooks/usePaginator"; import React from "react"; diff --git a/src/components/TextFieldWithChoice/TextFieldWithChoice.tsx b/src/components/TextFieldWithChoice/TextFieldWithChoice.tsx index da177e4d7..1983477b1 100644 --- a/src/components/TextFieldWithChoice/TextFieldWithChoice.tsx +++ b/src/components/TextFieldWithChoice/TextFieldWithChoice.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ClickAwayListener, Grow, diff --git a/src/components/Timeline/Timeline.tsx b/src/components/Timeline/Timeline.tsx index ab838a865..19e6abc31 100644 --- a/src/components/Timeline/Timeline.tsx +++ b/src/components/Timeline/Timeline.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useUser } from "@dashboard/auth"; import { Button } from "@dashboard/components/Button"; import { getUserInitials } from "@dashboard/misc"; diff --git a/src/components/Timeline/TimelineNote.tsx b/src/components/Timeline/TimelineNote.tsx index 90069d439..ecc71546b 100644 --- a/src/components/Timeline/TimelineNote.tsx +++ b/src/components/Timeline/TimelineNote.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useUser } from "@dashboard/auth"; import { getUserInitials } from "@dashboard/misc"; import { Card, CardContent, Typography } from "@material-ui/core"; diff --git a/src/components/Timezone/Timezone.tsx b/src/components/Timezone/Timezone.tsx index 9697795d4..adc7350e5 100644 --- a/src/components/Timezone/Timezone.tsx +++ b/src/components/Timezone/Timezone.tsx @@ -1,10 +1,9 @@ +// @ts-strict-ignore import React from "react"; export const TimezoneContext = React.createContext(undefined); -const { - Consumer: TimezoneConsumer, - Provider: TimezoneProvider, -} = TimezoneContext; +const { Consumer: TimezoneConsumer, Provider: TimezoneProvider } = + TimezoneContext; export { TimezoneConsumer, TimezoneProvider }; export default TimezoneContext; diff --git a/src/components/TypeDeleteWarningDialog/TypeDeleteWarningDialog.tsx b/src/components/TypeDeleteWarningDialog/TypeDeleteWarningDialog.tsx index 06a5b3f5d..99c14a376 100644 --- a/src/components/TypeDeleteWarningDialog/TypeDeleteWarningDialog.tsx +++ b/src/components/TypeDeleteWarningDialog/TypeDeleteWarningDialog.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ConfirmButtonTransitionState } from "@dashboard/components/ConfirmButton"; import { getById } from "@dashboard/misc"; import ModalTitle from "@dashboard/orders/components/OrderDiscountCommonModal/ModalTitle"; diff --git a/src/components/VisibilityCard/VisibilityCard.tsx b/src/components/VisibilityCard/VisibilityCard.tsx index 2bb1fc54a..ce18d070d 100644 --- a/src/components/VisibilityCard/VisibilityCard.tsx +++ b/src/components/VisibilityCard/VisibilityCard.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import CardTitle from "@dashboard/components/CardTitle"; import ControlledCheckbox from "@dashboard/components/ControlledCheckbox"; import Hr from "@dashboard/components/Hr"; @@ -113,20 +114,19 @@ export const VisibilityCard: React.FC = props => { date: localizeDate(date), }); - const handleRadioFieldChange = (type: keyof DateFields) => ( - e: ChangeEvent, - ) => { - const { value } = e.target; - if (!value) { - onChange({ - target: { - name: type, - value: null, - }, - }); - } - return onChange(e); - }; + const handleRadioFieldChange = + (type: keyof DateFields) => (e: ChangeEvent) => { + const { value } = e.target; + if (!value) { + onChange({ + target: { + name: type, + value: null, + }, + }); + } + return onChange(e); + }; return ( diff --git a/src/components/messages/Container.tsx b/src/components/messages/Container.tsx index c45cece2c..aa4240014 100644 --- a/src/components/messages/Container.tsx +++ b/src/components/messages/Container.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import React from "react"; import { useStyles } from "./styles"; diff --git a/src/components/messages/MessageManagerProvider.tsx b/src/components/messages/MessageManagerProvider.tsx index 933bdf12d..80a5d7775 100644 --- a/src/components/messages/MessageManagerProvider.tsx +++ b/src/components/messages/MessageManagerProvider.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { DEFAULT_NOTIFICATION_SHOW_TIME } from "@dashboard/config"; import { commonMessages } from "@dashboard/intl"; import { Notification } from "@saleor/macaw-ui"; diff --git a/src/components/messages/Transition.tsx b/src/components/messages/Transition.tsx index 10ebc963b..393282296 100644 --- a/src/components/messages/Transition.tsx +++ b/src/components/messages/Transition.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import React from "react"; import { Transition as MessageManagerTransition } from "react-transition-group"; diff --git a/src/components/messages/index.ts b/src/components/messages/index.ts index 891b15ef2..3256f9bc0 100644 --- a/src/components/messages/index.ts +++ b/src/components/messages/index.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { createContext } from "react"; export type Status = "success" | "error" | "info" | "warning"; diff --git a/src/config.ts b/src/config.ts index 662110ec5..6518d8dd6 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import packageInfo from "../package.json"; import { SearchVariables } from "./hooks/makeSearch"; import { ListSettings, ListViews, Pagination } from "./types"; diff --git a/src/configuration/ConfigurationPage.stories.tsx b/src/configuration/ConfigurationPage.stories.tsx index c0a5cbec1..f35ef6f46 100644 --- a/src/configuration/ConfigurationPage.stories.tsx +++ b/src/configuration/ConfigurationPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { createConfigurationMenu } from "@dashboard/configuration"; import { UserFragment } from "@dashboard/graphql"; import { staffMember } from "@dashboard/staff/fixtures"; diff --git a/src/configuration/ConfigurationPage.tsx b/src/configuration/ConfigurationPage.tsx index 3c68bb2cc..f46bb934f 100644 --- a/src/configuration/ConfigurationPage.tsx +++ b/src/configuration/ConfigurationPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import { DetailPageLayout } from "@dashboard/components/Layouts"; import { UserFragment } from "@dashboard/graphql"; diff --git a/src/configuration/index.tsx b/src/configuration/index.tsx index 7a0306c80..1a4f2004b 100644 --- a/src/configuration/index.tsx +++ b/src/configuration/index.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { attributeListUrl } from "@dashboard/attributes/urls"; import { useUser } from "@dashboard/auth"; import { channelsListUrl } from "@dashboard/channels/urls"; diff --git a/src/configuration/utils.ts b/src/configuration/utils.ts index 96352b8e1..812eb59fb 100644 --- a/src/configuration/utils.ts +++ b/src/configuration/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { hasAnyPermissions } from "@dashboard/auth/misc"; import { PermissionEnum, UserFragment } from "@dashboard/graphql"; import { IntlShape } from "react-intl"; diff --git a/src/containers/AppState/reducer.ts b/src/containers/AppState/reducer.ts index b46bbac42..314975b72 100644 --- a/src/containers/AppState/reducer.ts +++ b/src/containers/AppState/reducer.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import IAppState, { AppError } from "./state"; export type AppStateReducerActionType = "displayError" | "displayLoader"; diff --git a/src/containers/BackgroundTasks/BackgroundTasksProvider.test.tsx b/src/containers/BackgroundTasks/BackgroundTasksProvider.test.tsx index 64ee0917d..a0bef0402 100644 --- a/src/containers/BackgroundTasks/BackgroundTasksProvider.test.tsx +++ b/src/containers/BackgroundTasks/BackgroundTasksProvider.test.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { createMockClient } from "@apollo/client/testing"; import { JobStatusEnum } from "@dashboard/graphql"; import { renderHook } from "@testing-library/react-hooks"; diff --git a/src/containers/BackgroundTasks/BackgroundTasksProvider.tsx b/src/containers/BackgroundTasks/BackgroundTasksProvider.tsx index 4de5ed306..de4621e63 100644 --- a/src/containers/BackgroundTasks/BackgroundTasksProvider.tsx +++ b/src/containers/BackgroundTasks/BackgroundTasksProvider.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ApolloClient, useApolloClient } from "@apollo/client"; import { IMessageContext } from "@dashboard/components/messages"; import useNotifier from "@dashboard/hooks/useNotifier"; diff --git a/src/containers/BackgroundTasks/context.ts b/src/containers/BackgroundTasks/context.ts index 13f49e3ba..e8eb91c6d 100644 --- a/src/containers/BackgroundTasks/context.ts +++ b/src/containers/BackgroundTasks/context.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { createContext } from "react"; import { BackgroundTasksContextType } from "./types"; diff --git a/src/containers/BackgroundTasks/tasks.ts b/src/containers/BackgroundTasks/tasks.ts index 098137585..b8ff2296a 100644 --- a/src/containers/BackgroundTasks/tasks.ts +++ b/src/containers/BackgroundTasks/tasks.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ApolloQueryResult } from "@apollo/client"; import { IMessageContext } from "@dashboard/components/messages"; import { diff --git a/src/containers/ServiceWorker/ServiceWorker.tsx b/src/containers/ServiceWorker/ServiceWorker.tsx index 5a7f5c29a..c985f97c8 100644 --- a/src/containers/ServiceWorker/ServiceWorker.tsx +++ b/src/containers/ServiceWorker/ServiceWorker.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { SW_INTERVAL } from "@dashboard/config"; import useNotifier from "@dashboard/hooks/useNotifier"; import React from "react"; diff --git a/src/custom-apps/components/CustomAppCreatePage/CustomAppCreatePage.tsx b/src/custom-apps/components/CustomAppCreatePage/CustomAppCreatePage.tsx index 38bcbfedf..b8778b1b9 100644 --- a/src/custom-apps/components/CustomAppCreatePage/CustomAppCreatePage.tsx +++ b/src/custom-apps/components/CustomAppCreatePage/CustomAppCreatePage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import AccountPermissions from "@dashboard/components/AccountPermissions"; import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import { ConfirmButtonTransitionState } from "@dashboard/components/ConfirmButton"; diff --git a/src/custom-apps/components/CustomAppDetailsPage/CustomAppDetailsPage.tsx b/src/custom-apps/components/CustomAppDetailsPage/CustomAppDetailsPage.tsx index 8093691d7..36c6f13fe 100644 --- a/src/custom-apps/components/CustomAppDetailsPage/CustomAppDetailsPage.tsx +++ b/src/custom-apps/components/CustomAppDetailsPage/CustomAppDetailsPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import AccountPermissions from "@dashboard/components/AccountPermissions"; import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import CardSpacer from "@dashboard/components/CardSpacer"; diff --git a/src/custom-apps/components/CustomAppInformation/CustomAppInformation.tsx b/src/custom-apps/components/CustomAppInformation/CustomAppInformation.tsx index ead8cfac2..db5974601 100644 --- a/src/custom-apps/components/CustomAppInformation/CustomAppInformation.tsx +++ b/src/custom-apps/components/CustomAppInformation/CustomAppInformation.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import CardTitle from "@dashboard/components/CardTitle"; import { AppErrorFragment } from "@dashboard/graphql"; import { FormChange } from "@dashboard/hooks/useForm"; diff --git a/src/custom-apps/components/CustomAppTokens/CustomAppTokens.tsx b/src/custom-apps/components/CustomAppTokens/CustomAppTokens.tsx index 958e0eb9c..b3fda02d5 100644 --- a/src/custom-apps/components/CustomAppTokens/CustomAppTokens.tsx +++ b/src/custom-apps/components/CustomAppTokens/CustomAppTokens.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Button } from "@dashboard/components/Button"; import CardTitle from "@dashboard/components/CardTitle"; import ResponsiveTable from "@dashboard/components/ResponsiveTable"; diff --git a/src/custom-apps/components/PermissionAlert/utils.ts b/src/custom-apps/components/PermissionAlert/utils.ts index 303e1d455..825c3c984 100644 --- a/src/custom-apps/components/PermissionAlert/utils.ts +++ b/src/custom-apps/components/PermissionAlert/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { gql } from "@apollo/client"; import { FieldNode, parse, SelectionNode, visit } from "graphql"; diff --git a/src/custom-apps/components/TokenCreateDialog/TokenCreateDialog.tsx b/src/custom-apps/components/TokenCreateDialog/TokenCreateDialog.tsx index 494ef2015..7968618cd 100644 --- a/src/custom-apps/components/TokenCreateDialog/TokenCreateDialog.tsx +++ b/src/custom-apps/components/TokenCreateDialog/TokenCreateDialog.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import BackButton from "@dashboard/components/BackButton"; import { Button } from "@dashboard/components/Button"; import CardSpacer from "@dashboard/components/CardSpacer"; diff --git a/src/custom-apps/components/WebhookDetailsPage/WebhookDetailsPage.stories.tsx b/src/custom-apps/components/WebhookDetailsPage/WebhookDetailsPage.stories.tsx index 933929904..950634e1a 100644 --- a/src/custom-apps/components/WebhookDetailsPage/WebhookDetailsPage.stories.tsx +++ b/src/custom-apps/components/WebhookDetailsPage/WebhookDetailsPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { WebhookErrorCode } from "@dashboard/graphql"; import React from "react"; diff --git a/src/custom-apps/components/WebhookEvents/WebhookEvents.tsx b/src/custom-apps/components/WebhookEvents/WebhookEvents.tsx index c5c9bcbe9..6e7cc2746 100644 --- a/src/custom-apps/components/WebhookEvents/WebhookEvents.tsx +++ b/src/custom-apps/components/WebhookEvents/WebhookEvents.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import CardTitle from "@dashboard/components/CardTitle"; import Grid from "@dashboard/components/Grid"; import Hr from "@dashboard/components/Hr"; diff --git a/src/custom-apps/components/WebhookHeaders/WebhookHeadersTableBody.tsx b/src/custom-apps/components/WebhookHeaders/WebhookHeadersTableBody.tsx index 6be1f7be2..6e04a0a66 100644 --- a/src/custom-apps/components/WebhookHeaders/WebhookHeadersTableBody.tsx +++ b/src/custom-apps/components/WebhookHeaders/WebhookHeadersTableBody.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import TableRowLink from "@dashboard/components/TableRowLink"; import { FormChange } from "@dashboard/hooks/useForm"; import { removeAtIndex, updateAtIndex } from "@dashboard/utils/lists"; diff --git a/src/custom-apps/components/WebhookSubscriptionQuery/WebhookSubscriptionQuery.tsx b/src/custom-apps/components/WebhookSubscriptionQuery/WebhookSubscriptionQuery.tsx index ca4d539b9..781239924 100644 --- a/src/custom-apps/components/WebhookSubscriptionQuery/WebhookSubscriptionQuery.tsx +++ b/src/custom-apps/components/WebhookSubscriptionQuery/WebhookSubscriptionQuery.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import "graphiql/graphiql.min.css"; import CardTitle from "@dashboard/components/CardTitle"; diff --git a/src/custom-apps/handlers.ts b/src/custom-apps/handlers.ts index 2ddf94c8c..f446e6264 100644 --- a/src/custom-apps/handlers.ts +++ b/src/custom-apps/handlers.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { WebhookEventTypeAsyncEnum, WebhookEventTypeSyncEnum, diff --git a/src/custom-apps/index.tsx b/src/custom-apps/index.tsx index 9dd286500..58ebd6326 100644 --- a/src/custom-apps/index.tsx +++ b/src/custom-apps/index.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { WindowTitle } from "@dashboard/components/WindowTitle"; import { sectionNames } from "@dashboard/intl"; import { parse as parseQs } from "qs"; diff --git a/src/custom-apps/views/CustomAppCreate/CustomAppCreate.tsx b/src/custom-apps/views/CustomAppCreate/CustomAppCreate.tsx index 3392e2624..f2d46ef15 100644 --- a/src/custom-apps/views/CustomAppCreate/CustomAppCreate.tsx +++ b/src/custom-apps/views/CustomAppCreate/CustomAppCreate.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { WindowTitle } from "@dashboard/components/WindowTitle"; import { CustomAppUrls } from "@dashboard/custom-apps/urls"; import { AppCreateMutation, useAppCreateMutation } from "@dashboard/graphql"; diff --git a/src/custom-apps/views/CustomAppDetails/CustomAppDetails.tsx b/src/custom-apps/views/CustomAppDetails/CustomAppDetails.tsx index 6cb10534a..33ae8939c 100644 --- a/src/custom-apps/views/CustomAppDetails/CustomAppDetails.tsx +++ b/src/custom-apps/views/CustomAppDetails/CustomAppDetails.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import AppActivateDialog from "@dashboard/apps/components/AppActivateDialog"; import AppDeactivateDialog from "@dashboard/apps/components/AppDeactivateDialog"; import { appMessages } from "@dashboard/apps/messages"; diff --git a/src/custom-apps/views/CustomAppList.tsx b/src/custom-apps/views/CustomAppList.tsx index b418053b8..1f77ab587 100644 --- a/src/custom-apps/views/CustomAppList.tsx +++ b/src/custom-apps/views/CustomAppList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useApolloClient } from "@apollo/client"; import AppDeleteDialog from "@dashboard/apps/components/AppDeleteDialog"; import { EXTENSION_LIST_QUERY } from "@dashboard/apps/queries"; diff --git a/src/customers/components/CustomerAddress/CustomerAddress.tsx b/src/customers/components/CustomerAddress/CustomerAddress.tsx index 0ccc5625b..61d48e6c0 100644 --- a/src/customers/components/CustomerAddress/CustomerAddress.tsx +++ b/src/customers/components/CustomerAddress/CustomerAddress.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import AddressFormatter from "@dashboard/components/AddressFormatter"; import CardMenu from "@dashboard/components/CardMenu"; import CardTitle from "@dashboard/components/CardTitle"; diff --git a/src/customers/components/CustomerAddressChoiceCard/CustomerAddressChoiceCard.tsx b/src/customers/components/CustomerAddressChoiceCard/CustomerAddressChoiceCard.tsx index 60689bcd7..cf6d48b6d 100644 --- a/src/customers/components/CustomerAddressChoiceCard/CustomerAddressChoiceCard.tsx +++ b/src/customers/components/CustomerAddressChoiceCard/CustomerAddressChoiceCard.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import AddressFormatter from "@dashboard/components/AddressFormatter"; import { AddressFragment } from "@dashboard/graphql"; import { commonMessages } from "@dashboard/intl"; @@ -17,7 +18,9 @@ export interface CustomerAddressChoiceCardProps { onEditClick?: () => void; } -const CustomerAddressChoiceCard: React.FC = props => { +const CustomerAddressChoiceCard: React.FC< + CustomerAddressChoiceCardProps +> = props => { const { address, selected, editable, onSelect, onEditClick } = props; const classes = useStyles(props); diff --git a/src/customers/components/CustomerAddressListPage/CustomerAddressListPage.stories.tsx b/src/customers/components/CustomerAddressListPage/CustomerAddressListPage.stories.tsx index 0ea7b4dff..0099b27e3 100644 --- a/src/customers/components/CustomerAddressListPage/CustomerAddressListPage.stories.tsx +++ b/src/customers/components/CustomerAddressListPage/CustomerAddressListPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import React from "react"; import { customer } from "../../fixtures"; diff --git a/src/customers/components/CustomerAddressListPage/CustomerAddressListPage.tsx b/src/customers/components/CustomerAddressListPage/CustomerAddressListPage.tsx index 8f8c34379..0afe27efe 100644 --- a/src/customers/components/CustomerAddressListPage/CustomerAddressListPage.tsx +++ b/src/customers/components/CustomerAddressListPage/CustomerAddressListPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import { Button } from "@dashboard/components/Button"; import { ListPageLayout } from "@dashboard/components/Layouts"; diff --git a/src/customers/components/CustomerAddresses/CustomerAddresses.tsx b/src/customers/components/CustomerAddresses/CustomerAddresses.tsx index 65946a9af..4717cde15 100644 --- a/src/customers/components/CustomerAddresses/CustomerAddresses.tsx +++ b/src/customers/components/CustomerAddresses/CustomerAddresses.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import AddressFormatter from "@dashboard/components/AddressFormatter"; import { Button } from "@dashboard/components/Button"; import CardTitle from "@dashboard/components/CardTitle"; diff --git a/src/customers/components/CustomerCreateAddress/CustomerCreateAddress.tsx b/src/customers/components/CustomerCreateAddress/CustomerCreateAddress.tsx index 5b8687862..915fc9243 100644 --- a/src/customers/components/CustomerCreateAddress/CustomerCreateAddress.tsx +++ b/src/customers/components/CustomerCreateAddress/CustomerCreateAddress.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import AddressEdit from "@dashboard/components/AddressEdit"; import CardTitle from "@dashboard/components/CardTitle"; import { FormSpacer } from "@dashboard/components/FormSpacer"; diff --git a/src/customers/components/CustomerCreateDetails/CustomerCreateDetails.tsx b/src/customers/components/CustomerCreateDetails/CustomerCreateDetails.tsx index a35ba417f..de125b2d2 100644 --- a/src/customers/components/CustomerCreateDetails/CustomerCreateDetails.tsx +++ b/src/customers/components/CustomerCreateDetails/CustomerCreateDetails.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import CardTitle from "@dashboard/components/CardTitle"; import { AccountErrorFragment } from "@dashboard/graphql"; import { commonMessages } from "@dashboard/intl"; diff --git a/src/customers/components/CustomerCreateNote/CustomerCreateNote.tsx b/src/customers/components/CustomerCreateNote/CustomerCreateNote.tsx index 2f158bbd7..520f5b09d 100644 --- a/src/customers/components/CustomerCreateNote/CustomerCreateNote.tsx +++ b/src/customers/components/CustomerCreateNote/CustomerCreateNote.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import CardTitle from "@dashboard/components/CardTitle"; import { FormSpacer } from "@dashboard/components/FormSpacer"; import { AccountErrorFragment } from "@dashboard/graphql"; diff --git a/src/customers/components/CustomerCreatePage/CustomerCreatePage.stories.tsx b/src/customers/components/CustomerCreatePage/CustomerCreatePage.stories.tsx index b435fd7cc..920b03a77 100644 --- a/src/customers/components/CustomerCreatePage/CustomerCreatePage.stories.tsx +++ b/src/customers/components/CustomerCreatePage/CustomerCreatePage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { AccountErrorCode } from "@dashboard/graphql"; import React from "react"; diff --git a/src/customers/components/CustomerCreatePage/CustomerCreatePage.tsx b/src/customers/components/CustomerCreatePage/CustomerCreatePage.tsx index 88f94a727..3ace6d105 100644 --- a/src/customers/components/CustomerCreatePage/CustomerCreatePage.tsx +++ b/src/customers/components/CustomerCreatePage/CustomerCreatePage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { createCountryHandler } from "@dashboard/components/AddressEdit/createCountryHandler"; import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import { CardSpacer } from "@dashboard/components/CardSpacer"; diff --git a/src/customers/components/CustomerDetails/CustomerDetails.tsx b/src/customers/components/CustomerDetails/CustomerDetails.tsx index f314eecd0..2a2c12589 100644 --- a/src/customers/components/CustomerDetails/CustomerDetails.tsx +++ b/src/customers/components/CustomerDetails/CustomerDetails.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import CardTitle from "@dashboard/components/CardTitle"; import { ControlledCheckbox } from "@dashboard/components/ControlledCheckbox"; import Skeleton from "@dashboard/components/Skeleton"; diff --git a/src/customers/components/CustomerDetailsPage/CustomerDetailsPage.stories.tsx b/src/customers/components/CustomerDetailsPage/CustomerDetailsPage.stories.tsx index 79e930f98..ebfa91279 100644 --- a/src/customers/components/CustomerDetailsPage/CustomerDetailsPage.stories.tsx +++ b/src/customers/components/CustomerDetailsPage/CustomerDetailsPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { AccountErrorCode } from "@dashboard/graphql"; import React from "react"; diff --git a/src/customers/components/CustomerDetailsPage/CustomerDetailsPage.tsx b/src/customers/components/CustomerDetailsPage/CustomerDetailsPage.tsx index dddadbe65..c9b3c614e 100644 --- a/src/customers/components/CustomerDetailsPage/CustomerDetailsPage.tsx +++ b/src/customers/components/CustomerDetailsPage/CustomerDetailsPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { extensionMountPoints, mapToMenuItemsForCustomerDetails, diff --git a/src/customers/components/CustomerInfo/CustomerInfo.tsx b/src/customers/components/CustomerInfo/CustomerInfo.tsx index 7f7cc220e..6fde9fb52 100644 --- a/src/customers/components/CustomerInfo/CustomerInfo.tsx +++ b/src/customers/components/CustomerInfo/CustomerInfo.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import CardTitle from "@dashboard/components/CardTitle"; import Grid from "@dashboard/components/Grid"; import Hr from "@dashboard/components/Hr"; diff --git a/src/customers/components/CustomerList/CustomerList.tsx b/src/customers/components/CustomerList/CustomerList.tsx index f19a07314..2d069eeec 100644 --- a/src/customers/components/CustomerList/CustomerList.tsx +++ b/src/customers/components/CustomerList/CustomerList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useUserPermissions } from "@dashboard/auth/hooks/useUserPermissions"; import Checkbox from "@dashboard/components/Checkbox"; import RequirePermissions, { diff --git a/src/customers/components/CustomerListPage/CustomerListPage.stories.tsx b/src/customers/components/CustomerListPage/CustomerListPage.stories.tsx index 9e23915af..dcc654e15 100644 --- a/src/customers/components/CustomerListPage/CustomerListPage.stories.tsx +++ b/src/customers/components/CustomerListPage/CustomerListPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { filterPageProps, listActionsProps, diff --git a/src/customers/components/CustomerListPage/CustomerListPage.tsx b/src/customers/components/CustomerListPage/CustomerListPage.tsx index 36ee09b91..e3758dd08 100644 --- a/src/customers/components/CustomerListPage/CustomerListPage.tsx +++ b/src/customers/components/CustomerListPage/CustomerListPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { extensionMountPoints, mapToMenuItems, diff --git a/src/customers/components/CustomerListPage/filters.ts b/src/customers/components/CustomerListPage/filters.ts index 1de8f5d78..4c41b686c 100644 --- a/src/customers/components/CustomerListPage/filters.ts +++ b/src/customers/components/CustomerListPage/filters.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { IFilter } from "@dashboard/components/Filter"; import { hasPermissions } from "@dashboard/components/RequirePermissions"; import { PermissionEnum, UserFragment } from "@dashboard/graphql"; diff --git a/src/customers/components/CustomerOrders/CustomerOrders.tsx b/src/customers/components/CustomerOrders/CustomerOrders.tsx index ae1d8534f..0691d80ca 100644 --- a/src/customers/components/CustomerOrders/CustomerOrders.tsx +++ b/src/customers/components/CustomerOrders/CustomerOrders.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Button } from "@dashboard/components/Button"; import CardTitle from "@dashboard/components/CardTitle"; import { DateTime } from "@dashboard/components/Date"; diff --git a/src/customers/fixtures.ts b/src/customers/fixtures.ts index 969c14375..ce0ab5ef1 100644 --- a/src/customers/fixtures.ts +++ b/src/customers/fixtures.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { CustomerAddressesQuery, CustomerDetailsQuery, diff --git a/src/customers/providers/CustomerDetailsProvider.tsx b/src/customers/providers/CustomerDetailsProvider.tsx index ede5e05be..a51847b18 100644 --- a/src/customers/providers/CustomerDetailsProvider.tsx +++ b/src/customers/providers/CustomerDetailsProvider.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { CustomerDetailsQuery, useCustomerDetailsQuery, @@ -13,14 +14,12 @@ interface CustomerDetailsConsumerProps { loading: boolean | null; } -export const CustomerDetailsContext = createContext< - CustomerDetailsConsumerProps ->(null); +export const CustomerDetailsContext = + createContext(null); -export const CustomerDetailsProvider: React.FC = ({ - children, - id, -}) => { +export const CustomerDetailsProvider: React.FC< + CustomerDetailsProviderProps +> = ({ children, id }) => { const { data, loading } = useCustomerDetailsQuery({ displayLoader: true, variables: { diff --git a/src/customers/views/CustomerAddresses.tsx b/src/customers/views/CustomerAddresses.tsx index 90872350f..5b7c00cbe 100644 --- a/src/customers/views/CustomerAddresses.tsx +++ b/src/customers/views/CustomerAddresses.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import ActionDialog from "@dashboard/components/ActionDialog"; import { WindowTitle } from "@dashboard/components/WindowTitle"; import { @@ -55,46 +56,40 @@ const CustomerAddresses: React.FC = ({ }, }); - const [ - createCustomerAddress, - createCustomerAddressOpts, - ] = useCreateCustomerAddressMutation({ - onCompleted: data => { - if (data.addressCreate.errors.length === 0) { - closeModal(); - } - }, - }); + const [createCustomerAddress, createCustomerAddressOpts] = + useCreateCustomerAddressMutation({ + onCompleted: data => { + if (data.addressCreate.errors.length === 0) { + closeModal(); + } + }, + }); - const [ - updateCustomerAddress, - updateCustomerAddressOpts, - ] = useUpdateCustomerAddressMutation({ - onCompleted: data => { - if (data.addressUpdate.errors.length === 0) { - closeModal(); - notify({ - status: "success", - text: intl.formatMessage(commonMessages.savedChanges), - }); - } - }, - }); + const [updateCustomerAddress, updateCustomerAddressOpts] = + useUpdateCustomerAddressMutation({ + onCompleted: data => { + if (data.addressUpdate.errors.length === 0) { + closeModal(); + notify({ + status: "success", + text: intl.formatMessage(commonMessages.savedChanges), + }); + } + }, + }); - const [ - removeCustomerAddress, - removeCustomerAddressOpts, - ] = useRemoveCustomerAddressMutation({ - onCompleted: data => { - if (data.addressDelete.errors.length === 0) { - closeModal(); - notify({ - status: "success", - text: intl.formatMessage(commonMessages.savedChanges), - }); - } - }, - }); + const [removeCustomerAddress, removeCustomerAddressOpts] = + useRemoveCustomerAddressMutation({ + onCompleted: data => { + if (data.addressDelete.errors.length === 0) { + closeModal(); + notify({ + status: "success", + text: intl.formatMessage(commonMessages.savedChanges), + }); + } + }, + }); const customerData = useCustomerAddressesQuery({ displayLoader: true, diff --git a/src/customers/views/CustomerCreate.tsx b/src/customers/views/CustomerCreate.tsx index 165ef3a4d..fe17f67ff 100644 --- a/src/customers/views/CustomerCreate.tsx +++ b/src/customers/views/CustomerCreate.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { WindowTitle } from "@dashboard/components/WindowTitle"; import { useCreateCustomerMutation, diff --git a/src/customers/views/CustomerDetails.tsx b/src/customers/views/CustomerDetails.tsx index 6988eabc3..c70501c40 100644 --- a/src/customers/views/CustomerDetails.tsx +++ b/src/customers/views/CustomerDetails.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import ActionDialog from "@dashboard/components/ActionDialog"; import NotFoundPage from "@dashboard/components/NotFoundPage"; import { WindowTitle } from "@dashboard/components/WindowTitle"; diff --git a/src/customers/views/CustomerList/CustomerList.tsx b/src/customers/views/CustomerList/CustomerList.tsx index 1060f4928..f56efea9b 100644 --- a/src/customers/views/CustomerList/CustomerList.tsx +++ b/src/customers/views/CustomerList/CustomerList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import ActionDialog from "@dashboard/components/ActionDialog"; import DeleteFilterTabDialog from "@dashboard/components/DeleteFilterTabDialog"; import SaveFilterTabDialog, { @@ -84,17 +85,14 @@ export const CustomerList: React.FC = ({ params }) => { const currentTab = getFiltersCurrentTab(params, tabs); - const [ - changeFilters, - resetFilters, - handleSearchChange, - ] = createFilterHandlers({ - cleanupFn: reset, - createUrl: customerListUrl, - getFilterQueryParam, - navigate, - params, - }); + const [changeFilters, resetFilters, handleSearchChange] = + createFilterHandlers({ + cleanupFn: reset, + createUrl: customerListUrl, + getFilterQueryParam, + navigate, + params, + }); const [openModal, closeModal] = createDialogActionHandlers< CustomerListUrlDialog, @@ -128,22 +126,20 @@ export const CustomerList: React.FC = ({ params }) => { queryString: params, }); - const [ - bulkRemoveCustomers, - bulkRemoveCustomersOpts, - ] = useBulkRemoveCustomersMutation({ - onCompleted: data => { - if (data.customerBulkDelete.errors.length === 0) { - notify({ - status: "success", - text: intl.formatMessage(commonMessages.savedChanges), - }); - reset(); - refetch(); - closeModal(); - } - }, - }); + const [bulkRemoveCustomers, bulkRemoveCustomersOpts] = + useBulkRemoveCustomersMutation({ + onCompleted: data => { + if (data.customerBulkDelete.errors.length === 0) { + notify({ + status: "success", + text: intl.formatMessage(commonMessages.savedChanges), + }); + reset(); + refetch(); + closeModal(); + } + }, + }); const handleSort = createSortHandler(navigate, customerListUrl, params); diff --git a/src/customers/views/CustomerList/filters.ts b/src/customers/views/CustomerList/filters.ts index 3865691a7..22f90a952 100644 --- a/src/customers/views/CustomerList/filters.ts +++ b/src/customers/views/CustomerList/filters.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FilterElement } from "@dashboard/components/Filter"; import { CustomerFilterKeys, @@ -91,16 +92,10 @@ export function getFilterQueryParam( } } -export const { - deleteFilterTab, - getFilterTabs, - saveFilterTab, -} = createFilterTabUtils(CUSTOMER_FILTERS_KEY); +export const { deleteFilterTab, getFilterTabs, saveFilterTab } = + createFilterTabUtils(CUSTOMER_FILTERS_KEY); -export const { - areFiltersApplied, - getActiveFilters, - getFiltersCurrentTab, -} = createFilterUtils( - CustomerListUrlFiltersEnum, -); +export const { areFiltersApplied, getActiveFilters, getFiltersCurrentTab } = + createFilterUtils( + CustomerListUrlFiltersEnum, + ); diff --git a/src/customers/views/CustomerList/sort.ts b/src/customers/views/CustomerList/sort.ts index 40c4f6dfa..5122ba244 100644 --- a/src/customers/views/CustomerList/sort.ts +++ b/src/customers/views/CustomerList/sort.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { CustomerListUrlSortField } from "@dashboard/customers/urls"; import { UserSortField } from "@dashboard/graphql"; import { createGetSortQueryVariables } from "@dashboard/utils/sort"; @@ -17,6 +18,5 @@ export function getSortQueryField( } } -export const getSortQueryVariables = createGetSortQueryVariables( - getSortQueryField, -); +export const getSortQueryVariables = + createGetSortQueryVariables(getSortQueryField); diff --git a/src/discounts/components/DiscountCategories/DiscountCategories.tsx b/src/discounts/components/DiscountCategories/DiscountCategories.tsx index 39b5785c0..03906e513 100644 --- a/src/discounts/components/DiscountCategories/DiscountCategories.tsx +++ b/src/discounts/components/DiscountCategories/DiscountCategories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { categoryUrl } from "@dashboard/categories/urls"; import { Button } from "@dashboard/components/Button"; import CardTitle from "@dashboard/components/CardTitle"; diff --git a/src/discounts/components/DiscountCollections/DiscountCollections.tsx b/src/discounts/components/DiscountCollections/DiscountCollections.tsx index c164624d2..13aafecef 100644 --- a/src/discounts/components/DiscountCollections/DiscountCollections.tsx +++ b/src/discounts/components/DiscountCollections/DiscountCollections.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { collectionUrl } from "@dashboard/collections/urls"; import { Button } from "@dashboard/components/Button"; import CardTitle from "@dashboard/components/CardTitle"; diff --git a/src/discounts/components/DiscountCountrySelectDialog/DiscountCountrySelectDialog.tsx b/src/discounts/components/DiscountCountrySelectDialog/DiscountCountrySelectDialog.tsx index 0b0cc2787..8af139f0e 100644 --- a/src/discounts/components/DiscountCountrySelectDialog/DiscountCountrySelectDialog.tsx +++ b/src/discounts/components/DiscountCountrySelectDialog/DiscountCountrySelectDialog.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import BackButton from "@dashboard/components/BackButton"; import Checkbox from "@dashboard/components/Checkbox"; import { diff --git a/src/discounts/components/DiscountProducts/DiscountProducts.tsx b/src/discounts/components/DiscountProducts/DiscountProducts.tsx index 5b08755fd..d1e2502ee 100644 --- a/src/discounts/components/DiscountProducts/DiscountProducts.tsx +++ b/src/discounts/components/DiscountProducts/DiscountProducts.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Button } from "@dashboard/components/Button"; import CardTitle from "@dashboard/components/CardTitle"; import { ChannelsAvailabilityDropdown } from "@dashboard/components/ChannelsAvailabilityDropdown"; diff --git a/src/discounts/components/DiscountVariants/DiscountVariants.tsx b/src/discounts/components/DiscountVariants/DiscountVariants.tsx index d8c2f5872..acb804a3b 100644 --- a/src/discounts/components/DiscountVariants/DiscountVariants.tsx +++ b/src/discounts/components/DiscountVariants/DiscountVariants.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Button } from "@dashboard/components/Button"; import CardTitle from "@dashboard/components/CardTitle"; import Checkbox from "@dashboard/components/Checkbox"; diff --git a/src/discounts/components/SaleCreatePage/SaleCreatePage.stories.tsx b/src/discounts/components/SaleCreatePage/SaleCreatePage.stories.tsx index 44f72e9f6..2422ac7d1 100644 --- a/src/discounts/components/SaleCreatePage/SaleCreatePage.stories.tsx +++ b/src/discounts/components/SaleCreatePage/SaleCreatePage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { channelsList } from "@dashboard/channels/fixtures"; import { createSaleChannels } from "@dashboard/channels/utils"; import { DiscountErrorCode } from "@dashboard/graphql"; diff --git a/src/discounts/components/SaleDetailsPage/SaleDetailsPage.stories.tsx b/src/discounts/components/SaleDetailsPage/SaleDetailsPage.stories.tsx index afd29ed3e..104185a19 100644 --- a/src/discounts/components/SaleDetailsPage/SaleDetailsPage.stories.tsx +++ b/src/discounts/components/SaleDetailsPage/SaleDetailsPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { channelsList } from "@dashboard/channels/fixtures"; import { createSaleChannels } from "@dashboard/channels/utils"; import { sale } from "@dashboard/discounts/fixtures"; diff --git a/src/discounts/components/SaleDetailsPage/SaleDetailsPage.tsx b/src/discounts/components/SaleDetailsPage/SaleDetailsPage.tsx index f004338fe..f5a08c1b8 100644 --- a/src/discounts/components/SaleDetailsPage/SaleDetailsPage.tsx +++ b/src/discounts/components/SaleDetailsPage/SaleDetailsPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ChannelSaleData, validateSalePrice } from "@dashboard/channels/utils"; import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import CardSpacer from "@dashboard/components/CardSpacer"; diff --git a/src/discounts/components/SaleList/SaleList.tsx b/src/discounts/components/SaleList/SaleList.tsx index 33d74b4d3..b6ab9faa5 100644 --- a/src/discounts/components/SaleList/SaleList.tsx +++ b/src/discounts/components/SaleList/SaleList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import Checkbox from "@dashboard/components/Checkbox"; import Date from "@dashboard/components/Date"; import Money from "@dashboard/components/Money"; diff --git a/src/discounts/components/SaleListPage/SaleListPage.stories.tsx b/src/discounts/components/SaleListPage/SaleListPage.stories.tsx index b118bff29..1a386057c 100644 --- a/src/discounts/components/SaleListPage/SaleListPage.stories.tsx +++ b/src/discounts/components/SaleListPage/SaleListPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { saleList } from "@dashboard/discounts/fixtures"; import { SaleListUrlSortField } from "@dashboard/discounts/urls"; import { diff --git a/src/discounts/components/SaleListPage/SaleListPage.tsx b/src/discounts/components/SaleListPage/SaleListPage.tsx index dbdfc1d2e..2cfeb37cf 100644 --- a/src/discounts/components/SaleListPage/SaleListPage.tsx +++ b/src/discounts/components/SaleListPage/SaleListPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import { Button } from "@dashboard/components/Button"; import { getByName } from "@dashboard/components/Filter/utils"; diff --git a/src/discounts/components/SaleValue/SaleValue.tsx b/src/discounts/components/SaleValue/SaleValue.tsx index 34c2fd6e2..957ef931b 100644 --- a/src/discounts/components/SaleValue/SaleValue.tsx +++ b/src/discounts/components/SaleValue/SaleValue.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import CardTitle from "@dashboard/components/CardTitle"; import ResponsiveTable from "@dashboard/components/ResponsiveTable"; import Skeleton from "@dashboard/components/Skeleton"; diff --git a/src/discounts/components/VoucherCreatePage/VoucherCreatePage.stories.tsx b/src/discounts/components/VoucherCreatePage/VoucherCreatePage.stories.tsx index 463a3730d..4ba4436fe 100644 --- a/src/discounts/components/VoucherCreatePage/VoucherCreatePage.stories.tsx +++ b/src/discounts/components/VoucherCreatePage/VoucherCreatePage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { channelsList } from "@dashboard/channels/fixtures"; import { createVoucherChannels } from "@dashboard/channels/utils"; import { DiscountErrorCode } from "@dashboard/graphql"; diff --git a/src/discounts/components/VoucherDetailsPage/VoucherDetailsPage.stories.tsx b/src/discounts/components/VoucherDetailsPage/VoucherDetailsPage.stories.tsx index c08b471f8..8fb82e562 100644 --- a/src/discounts/components/VoucherDetailsPage/VoucherDetailsPage.stories.tsx +++ b/src/discounts/components/VoucherDetailsPage/VoucherDetailsPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { channelsList } from "@dashboard/channels/fixtures"; import { createChannelsDataWithDiscountPrice } from "@dashboard/channels/utils"; import { listActionsProps, pageListProps } from "@dashboard/fixtures"; diff --git a/src/discounts/components/VoucherDetailsPage/VoucherDetailsPage.tsx b/src/discounts/components/VoucherDetailsPage/VoucherDetailsPage.tsx index cca2d34c2..7e10057e9 100644 --- a/src/discounts/components/VoucherDetailsPage/VoucherDetailsPage.tsx +++ b/src/discounts/components/VoucherDetailsPage/VoucherDetailsPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ChannelVoucherData } from "@dashboard/channels/utils"; import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import CardSpacer from "@dashboard/components/CardSpacer"; diff --git a/src/discounts/components/VoucherList/VoucherList.tsx b/src/discounts/components/VoucherList/VoucherList.tsx index 6361a9588..3437beb88 100644 --- a/src/discounts/components/VoucherList/VoucherList.tsx +++ b/src/discounts/components/VoucherList/VoucherList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import Checkbox from "@dashboard/components/Checkbox"; import Date from "@dashboard/components/Date"; import Money from "@dashboard/components/Money"; diff --git a/src/discounts/components/VoucherListPage/VoucherListPage.stories.tsx b/src/discounts/components/VoucherListPage/VoucherListPage.stories.tsx index 664f200bf..a4b857b0f 100644 --- a/src/discounts/components/VoucherListPage/VoucherListPage.stories.tsx +++ b/src/discounts/components/VoucherListPage/VoucherListPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { voucherList } from "@dashboard/discounts/fixtures"; import { VoucherListUrlSortField } from "@dashboard/discounts/urls"; import { diff --git a/src/discounts/components/VoucherListPage/VoucherListPage.tsx b/src/discounts/components/VoucherListPage/VoucherListPage.tsx index c3932eef2..a87733662 100644 --- a/src/discounts/components/VoucherListPage/VoucherListPage.tsx +++ b/src/discounts/components/VoucherListPage/VoucherListPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import { Button } from "@dashboard/components/Button"; import { getByName } from "@dashboard/components/Filter/utils"; diff --git a/src/discounts/components/VoucherRequirements/VoucherRequirements.tsx b/src/discounts/components/VoucherRequirements/VoucherRequirements.tsx index 7b7b135b2..0eca6f88d 100644 --- a/src/discounts/components/VoucherRequirements/VoucherRequirements.tsx +++ b/src/discounts/components/VoucherRequirements/VoucherRequirements.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import CardTitle from "@dashboard/components/CardTitle"; import { FormSpacer } from "@dashboard/components/FormSpacer"; import PriceField from "@dashboard/components/PriceField"; diff --git a/src/discounts/components/VoucherValue/VoucherValue.tsx b/src/discounts/components/VoucherValue/VoucherValue.tsx index 15fccad61..f8c7b2e16 100644 --- a/src/discounts/components/VoucherValue/VoucherValue.tsx +++ b/src/discounts/components/VoucherValue/VoucherValue.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import CardTitle from "@dashboard/components/CardTitle"; import ControlledCheckbox from "@dashboard/components/ControlledCheckbox"; import { FormSpacer } from "@dashboard/components/FormSpacer"; diff --git a/src/discounts/handlers.ts b/src/discounts/handlers.ts index a974fef0c..cfffb4f7b 100644 --- a/src/discounts/handlers.ts +++ b/src/discounts/handlers.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ChannelVoucherData, validateSalePrice, @@ -174,17 +175,18 @@ export function createSaleUpdateHandler( const invalidChannelListings = channelListings ?.filter(channel => validateSalePrice(formData, channel)) .map(channel => channel.id); - const localErrors: DiscountErrorFragment[] = !!invalidChannelListings?.length - ? [ - { - __typename: "DiscountError", - code: DiscountErrorCode.INVALID, - field: "value", - channels: invalidChannelListings, - message: "Invalid discount value", - }, - ] - : []; + const localErrors: DiscountErrorFragment[] = + !!invalidChannelListings?.length + ? [ + { + __typename: "DiscountError", + code: DiscountErrorCode.INVALID, + field: "value", + channels: invalidChannelListings, + message: "Invalid discount value", + }, + ] + : []; setLocalErrors(localErrors); @@ -206,17 +208,18 @@ export function createVoucherUpdateHandler( const invalidChannelListings = channelListings ?.filter(channel => validateVoucherPrice(formData, channel)) .map(channel => channel.id); - const localErrors: DiscountErrorFragment[] = !!invalidChannelListings?.length - ? [ - { - __typename: "DiscountError", - code: DiscountErrorCode.INVALID, - field: "discountValue", - channels: invalidChannelListings, - message: "Invalid discount value", - }, - ] - : []; + const localErrors: DiscountErrorFragment[] = + !!invalidChannelListings?.length + ? [ + { + __typename: "DiscountError", + code: DiscountErrorCode.INVALID, + field: "discountValue", + channels: invalidChannelListings, + message: "Invalid discount value", + }, + ] + : []; setLocalErrors(localErrors); diff --git a/src/discounts/views/SaleCreate/SaleCreate.tsx b/src/discounts/views/SaleCreate/SaleCreate.tsx index 7ac9ea8e8..e2316c0fa 100644 --- a/src/discounts/views/SaleCreate/SaleCreate.tsx +++ b/src/discounts/views/SaleCreate/SaleCreate.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ChannelsAction } from "@dashboard/channels/urls"; import { createSortedSaleData } from "@dashboard/channels/utils"; import useAppChannel from "@dashboard/components/AppLayout/AppChannelContext"; diff --git a/src/discounts/views/SaleCreate/handlers.ts b/src/discounts/views/SaleCreate/handlers.ts index 334f8e24c..6f901518f 100644 --- a/src/discounts/views/SaleCreate/handlers.ts +++ b/src/discounts/views/SaleCreate/handlers.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FetchResult } from "@apollo/client"; import { FormData } from "@dashboard/discounts/components/SaleCreatePage"; import { getSaleChannelsVariables } from "@dashboard/discounts/handlers"; diff --git a/src/discounts/views/SaleDetails/SaleDetails.tsx b/src/discounts/views/SaleDetails/SaleDetails.tsx index 22e86ffae..ebd09ebd2 100644 --- a/src/discounts/views/SaleDetails/SaleDetails.tsx +++ b/src/discounts/views/SaleDetails/SaleDetails.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ChannelSaleData, createChannelsDataWithSaleDiscountPrice, diff --git a/src/discounts/views/SaleDetails/handlers.ts b/src/discounts/views/SaleDetails/handlers.ts index 0545e6cd4..db11686af 100644 --- a/src/discounts/views/SaleDetails/handlers.ts +++ b/src/discounts/views/SaleDetails/handlers.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FetchResult } from "@apollo/client"; import { ChannelSaleFormData, diff --git a/src/discounts/views/SaleList/SaleList.tsx b/src/discounts/views/SaleList/SaleList.tsx index a61c8abb7..d14bfb1b2 100644 --- a/src/discounts/views/SaleList/SaleList.tsx +++ b/src/discounts/views/SaleList/SaleList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import ActionDialog from "@dashboard/components/ActionDialog"; import useAppChannel from "@dashboard/components/AppLayout/AppChannelContext"; import DeleteFilterTabDialog from "@dashboard/components/DeleteFilterTabDialog"; diff --git a/src/discounts/views/SaleList/filters.ts b/src/discounts/views/SaleList/filters.ts index bd2f14c2a..92766fc82 100644 --- a/src/discounts/views/SaleList/filters.ts +++ b/src/discounts/views/SaleList/filters.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FilterElement, FilterElementRegular, @@ -120,17 +121,11 @@ export function getFilterQueryParam( } } -export const { - deleteFilterTab, - getFilterTabs, - saveFilterTab, -} = createFilterTabUtils(SALE_FILTERS_KEY); +export const { deleteFilterTab, getFilterTabs, saveFilterTab } = + createFilterTabUtils(SALE_FILTERS_KEY); -export const { - areFiltersApplied, - getActiveFilters, - getFiltersCurrentTab, -} = createFilterUtils({ - ...SaleListUrlFiltersEnum, - ...SaleListUrlFiltersWithMultipleValues, -}); +export const { areFiltersApplied, getActiveFilters, getFiltersCurrentTab } = + createFilterUtils({ + ...SaleListUrlFiltersEnum, + ...SaleListUrlFiltersWithMultipleValues, + }); diff --git a/src/discounts/views/SaleList/sort.ts b/src/discounts/views/SaleList/sort.ts index bdda0e6b4..ed40356d8 100644 --- a/src/discounts/views/SaleList/sort.ts +++ b/src/discounts/views/SaleList/sort.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { SaleListUrlSortField } from "@dashboard/discounts/urls"; import { SaleSortField } from "@dashboard/graphql"; import { createGetSortQueryVariables } from "@dashboard/utils/sort"; @@ -38,6 +39,5 @@ export function getSortQueryField(sort: SaleListUrlSortField): SaleSortField { } } -export const getSortQueryVariables = createGetSortQueryVariables( - getSortQueryField, -); +export const getSortQueryVariables = + createGetSortQueryVariables(getSortQueryField); diff --git a/src/discounts/views/VoucherCreate/VoucherCreate.tsx b/src/discounts/views/VoucherCreate/VoucherCreate.tsx index b5b9be6b0..b488eb975 100644 --- a/src/discounts/views/VoucherCreate/VoucherCreate.tsx +++ b/src/discounts/views/VoucherCreate/VoucherCreate.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ChannelsAction } from "@dashboard/channels/urls"; import { ChannelVoucherData, @@ -47,9 +48,8 @@ export const VoucherCreateView: React.FC = ({ params }) => { >(navigate, params => voucherAddUrl(params), params); const { availableChannels } = useAppChannel(false); - const allChannels: ChannelVoucherData[] = createSortedVoucherData( - availableChannels, - ); + const allChannels: ChannelVoucherData[] = + createSortedVoucherData(availableChannels); const { channelListElements, @@ -69,10 +69,8 @@ export const VoucherCreateView: React.FC = ({ params }) => { { formId: VOUCHER_CREATE_FORM_ID }, ); - const [ - updateChannels, - updateChannelsOpts, - ] = useVoucherChannelListingUpdateMutation({}); + const [updateChannels, updateChannelsOpts] = + useVoucherChannelListingUpdateMutation({}); const [voucherCreate, voucherCreateOpts] = useVoucherCreateMutation({ onCompleted: data => { diff --git a/src/discounts/views/VoucherCreate/handlers.ts b/src/discounts/views/VoucherCreate/handlers.ts index 96d562bd9..1f24361fc 100644 --- a/src/discounts/views/VoucherCreate/handlers.ts +++ b/src/discounts/views/VoucherCreate/handlers.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FetchResult } from "@apollo/client"; import { VoucherDetailsPageFormData } from "@dashboard/discounts/components/VoucherDetailsPage"; import { getChannelsVariables } from "@dashboard/discounts/handlers"; diff --git a/src/discounts/views/VoucherDetails/VoucherDetails.tsx b/src/discounts/views/VoucherDetails/VoucherDetails.tsx index 739b883b1..74482eba4 100644 --- a/src/discounts/views/VoucherDetails/VoucherDetails.tsx +++ b/src/discounts/views/VoucherDetails/VoucherDetails.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ChannelVoucherData, createChannelsDataWithDiscountPrice, @@ -166,10 +167,8 @@ export const VoucherDetails: React.FC = ({ { formId: VOUCHER_UPDATE_FORM_ID }, ); - const [ - updateChannels, - updateChannelsOpts, - ] = useVoucherChannelListingUpdateMutation({}); + const [updateChannels, updateChannelsOpts] = + useVoucherChannelListingUpdateMutation({}); const notifySaved = () => notify({ @@ -195,30 +194,26 @@ export const VoucherDetails: React.FC = ({ }, }); - const [ - voucherCataloguesRemove, - voucherCataloguesRemoveOpts, - ] = useVoucherCataloguesRemoveMutation({ - onCompleted: data => { - if (data.voucherCataloguesRemove.errors.length === 0) { - notifySaved(); - closeModal(); - reset(); - } - }, - }); + const [voucherCataloguesRemove, voucherCataloguesRemoveOpts] = + useVoucherCataloguesRemoveMutation({ + onCompleted: data => { + if (data.voucherCataloguesRemove.errors.length === 0) { + notifySaved(); + closeModal(); + reset(); + } + }, + }); - const [ - voucherCataloguesAdd, - voucherCataloguesAddOpts, - ] = useVoucherCataloguesAddMutation({ - onCompleted: data => { - if (data.voucherCataloguesAdd.errors.length === 0) { - notifySaved(); - closeModal(); - } - }, - }); + const [voucherCataloguesAdd, voucherCataloguesAddOpts] = + useVoucherCataloguesAddMutation({ + onCompleted: data => { + if (data.voucherCataloguesAdd.errors.length === 0) { + notifySaved(); + closeModal(); + } + }, + }); const canOpenBulkActionDialog = maybe(() => params.ids.length > 0); diff --git a/src/discounts/views/VoucherDetails/handlers.ts b/src/discounts/views/VoucherDetails/handlers.ts index 65237f424..32580c870 100644 --- a/src/discounts/views/VoucherDetails/handlers.ts +++ b/src/discounts/views/VoucherDetails/handlers.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FetchResult } from "@apollo/client"; import { ChannelVoucherData } from "@dashboard/channels/utils"; import { VoucherDetailsPageFormData } from "@dashboard/discounts/components/VoucherDetailsPage"; diff --git a/src/discounts/views/VoucherList/VoucherList.tsx b/src/discounts/views/VoucherList/VoucherList.tsx index 44172e307..de03dac92 100644 --- a/src/discounts/views/VoucherList/VoucherList.tsx +++ b/src/discounts/views/VoucherList/VoucherList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import ActionDialog from "@dashboard/components/ActionDialog"; import useAppChannel from "@dashboard/components/AppLayout/AppChannelContext"; import DeleteFilterTabDialog from "@dashboard/components/DeleteFilterTabDialog"; @@ -99,17 +100,14 @@ export const VoucherList: React.FC = ({ params }) => { const currentTab = getFiltersCurrentTab(params, tabs); - const [ - changeFilters, - resetFilters, - handleSearchChange, - ] = createFilterHandlers({ - cleanupFn: reset, - createUrl: voucherListUrl, - getFilterQueryParam, - navigate, - params, - }); + const [changeFilters, resetFilters, handleSearchChange] = + createFilterHandlers({ + cleanupFn: reset, + createUrl: voucherListUrl, + getFilterQueryParam, + navigate, + params, + }); useEffect(() => { if (!canBeSorted(params.sort, !!selectedChannel)) { @@ -151,22 +149,20 @@ export const VoucherList: React.FC = ({ params }) => { queryString: params, }); - const [ - voucherBulkDelete, - voucherBulkDeleteOpts, - ] = useVoucherBulkDeleteMutation({ - onCompleted: data => { - if (data.voucherBulkDelete.errors.length === 0) { - notify({ - status: "success", - text: intl.formatMessage(commonMessages.savedChanges), - }); - reset(); - closeModal(); - refetch(); - } - }, - }); + const [voucherBulkDelete, voucherBulkDeleteOpts] = + useVoucherBulkDeleteMutation({ + onCompleted: data => { + if (data.voucherBulkDelete.errors.length === 0) { + notify({ + status: "success", + text: intl.formatMessage(commonMessages.savedChanges), + }); + reset(); + closeModal(); + refetch(); + } + }, + }); const onVoucherBulkDelete = () => voucherBulkDelete({ diff --git a/src/discounts/views/VoucherList/filters.ts b/src/discounts/views/VoucherList/filters.ts index bfc1a0593..4bbf045dc 100644 --- a/src/discounts/views/VoucherList/filters.ts +++ b/src/discounts/views/VoucherList/filters.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FilterElement, FilterElementRegular, @@ -150,17 +151,11 @@ export function getFilterQueryParam( } } -export const { - deleteFilterTab, - getFilterTabs, - saveFilterTab, -} = createFilterTabUtils(VOUCHER_FILTERS_KEY); +export const { deleteFilterTab, getFilterTabs, saveFilterTab } = + createFilterTabUtils(VOUCHER_FILTERS_KEY); -export const { - areFiltersApplied, - getActiveFilters, - getFiltersCurrentTab, -} = createFilterUtils({ - ...VoucherListUrlFiltersEnum, - ...VoucherListUrlFiltersWithMultipleValues, -}); +export const { areFiltersApplied, getActiveFilters, getFiltersCurrentTab } = + createFilterUtils({ + ...VoucherListUrlFiltersEnum, + ...VoucherListUrlFiltersWithMultipleValues, + }); diff --git a/src/discounts/views/VoucherList/sort.ts b/src/discounts/views/VoucherList/sort.ts index f0be420aa..e6609ef45 100644 --- a/src/discounts/views/VoucherList/sort.ts +++ b/src/discounts/views/VoucherList/sort.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { VoucherListUrlSortField } from "@dashboard/discounts/urls"; import { VoucherSortField } from "@dashboard/graphql"; import { createGetSortQueryVariables } from "@dashboard/utils/sort"; @@ -46,6 +47,5 @@ export function getSortQueryField( } } -export const getSortQueryVariables = createGetSortQueryVariables( - getSortQueryField, -); +export const getSortQueryVariables = + createGetSortQueryVariables(getSortQueryField); diff --git a/src/fixtures.ts b/src/fixtures.ts index cca3e70d2..b39b0cccc 100644 --- a/src/fixtures.ts +++ b/src/fixtures.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { PermissionEnum, ShopInfoQuery, diff --git a/src/giftCards/GiftCardBulkCreateDialog/GiftCardBulkCreateDialog.tsx b/src/giftCards/GiftCardBulkCreateDialog/GiftCardBulkCreateDialog.tsx index c8a0c5a72..36d1ca1c6 100644 --- a/src/giftCards/GiftCardBulkCreateDialog/GiftCardBulkCreateDialog.tsx +++ b/src/giftCards/GiftCardBulkCreateDialog/GiftCardBulkCreateDialog.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { IMessage } from "@dashboard/components/messages"; import { GiftCardBulkCreateInput, diff --git a/src/giftCards/GiftCardBulkCreateDialog/GiftCardBulkCreateDialogForm.tsx b/src/giftCards/GiftCardBulkCreateDialog/GiftCardBulkCreateDialogForm.tsx index d24d4101f..bc6a5e4e5 100644 --- a/src/giftCards/GiftCardBulkCreateDialog/GiftCardBulkCreateDialogForm.tsx +++ b/src/giftCards/GiftCardBulkCreateDialog/GiftCardBulkCreateDialogForm.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import DialogButtons from "@dashboard/components/ActionDialog/DialogButtons"; import CardSpacer from "@dashboard/components/CardSpacer"; import { ConfirmButtonTransitionState } from "@dashboard/components/ConfirmButton"; diff --git a/src/giftCards/GiftCardBulkCreateDialog/utils.ts b/src/giftCards/GiftCardBulkCreateDialog/utils.ts index 6ddead870..a26445669 100644 --- a/src/giftCards/GiftCardBulkCreateDialog/utils.ts +++ b/src/giftCards/GiftCardBulkCreateDialog/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { GiftCardErrorCode, GiftCardErrorFragment } from "@dashboard/graphql"; import reduce from "lodash/reduce"; diff --git a/src/giftCards/GiftCardCreateDialog/GiftCardCreateDialogContent.tsx b/src/giftCards/GiftCardCreateDialog/GiftCardCreateDialogContent.tsx index 592db1e02..ecd44b38e 100644 --- a/src/giftCards/GiftCardCreateDialog/GiftCardCreateDialogContent.tsx +++ b/src/giftCards/GiftCardCreateDialog/GiftCardCreateDialogContent.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { GiftCardCreateInput, useChannelCurrenciesQuery, diff --git a/src/giftCards/GiftCardCreateDialog/GiftCardCreateDialogForm.tsx b/src/giftCards/GiftCardCreateDialog/GiftCardCreateDialogForm.tsx index 25d072ba2..2b9822d68 100644 --- a/src/giftCards/GiftCardCreateDialog/GiftCardCreateDialogForm.tsx +++ b/src/giftCards/GiftCardCreateDialog/GiftCardCreateDialogForm.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import DialogButtons from "@dashboard/components/ActionDialog/DialogButtons"; import CardSpacer from "@dashboard/components/CardSpacer"; import { ConfirmButtonTransitionState } from "@dashboard/components/ConfirmButton"; diff --git a/src/giftCards/GiftCardCreateDialog/GiftCardCreateMoneyInput.tsx b/src/giftCards/GiftCardCreateDialog/GiftCardCreateMoneyInput.tsx index 1053c0780..743a3baae 100644 --- a/src/giftCards/GiftCardCreateDialog/GiftCardCreateMoneyInput.tsx +++ b/src/giftCards/GiftCardCreateDialog/GiftCardCreateMoneyInput.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import TextWithSelectField from "@dashboard/components/TextWithSelectField"; import { useChannelCurrenciesQuery } from "@dashboard/graphql"; import { ChangeEvent, FormChange } from "@dashboard/hooks/useForm"; diff --git a/src/giftCards/GiftCardCreateDialog/GiftCardCustomerSelectField.tsx b/src/giftCards/GiftCardCreateDialog/GiftCardCustomerSelectField.tsx index 16a348f96..1fa7c64e1 100644 --- a/src/giftCards/GiftCardCreateDialog/GiftCardCustomerSelectField.tsx +++ b/src/giftCards/GiftCardCreateDialog/GiftCardCustomerSelectField.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import SingleAutocompleteSelectField from "@dashboard/components/SingleAutocompleteSelectField"; import { DEFAULT_INITIAL_SEARCH_DATA } from "@dashboard/config"; import { commonMessages } from "@dashboard/intl"; @@ -16,11 +17,9 @@ export interface GiftCardCustomerSelectFieldProps { disabled?: boolean; } -const GiftCardCustomerSelectField: React.FC = ({ - selectedCustomer, - setSelectedCustomer, - disabled = false, -}) => { +const GiftCardCustomerSelectField: React.FC< + GiftCardCustomerSelectFieldProps +> = ({ selectedCustomer, setSelectedCustomer, disabled = false }) => { const intl = useIntl(); const { loadMore, search, result } = useCustomerSearch({ diff --git a/src/giftCards/GiftCardCreateDialog/utils.ts b/src/giftCards/GiftCardCreateDialog/utils.ts index 45676e4fc..7706dc365 100644 --- a/src/giftCards/GiftCardCreateDialog/utils.ts +++ b/src/giftCards/GiftCardCreateDialog/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { IMessage } from "@dashboard/components/messages"; import { GiftCardCreateMutation, TimePeriodTypeEnum } from "@dashboard/graphql"; import commonErrorMessages from "@dashboard/utils/errors/common"; diff --git a/src/giftCards/GiftCardExportDialogContent/GiftCardExportDialogContent.tsx b/src/giftCards/GiftCardExportDialogContent/GiftCardExportDialogContent.tsx index a8b1e9a73..1b582e932 100644 --- a/src/giftCards/GiftCardExportDialogContent/GiftCardExportDialogContent.tsx +++ b/src/giftCards/GiftCardExportDialogContent/GiftCardExportDialogContent.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ConfirmButton } from "@dashboard/components/ConfirmButton"; import { Task } from "@dashboard/containers/BackgroundTasks/types"; import { diff --git a/src/giftCards/GiftCardSettings/GiftCardExpirySettingsCard/GiftCardExpirySettingsCard.tsx b/src/giftCards/GiftCardSettings/GiftCardExpirySettingsCard/GiftCardExpirySettingsCard.tsx index d44be0f1b..43f33742e 100644 --- a/src/giftCards/GiftCardSettings/GiftCardExpirySettingsCard/GiftCardExpirySettingsCard.tsx +++ b/src/giftCards/GiftCardSettings/GiftCardExpirySettingsCard/GiftCardExpirySettingsCard.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import CardTitle from "@dashboard/components/CardTitle"; import GiftCardSettingsExpirySelect, { GiftCardSettingsExpirySelectProps, diff --git a/src/giftCards/GiftCardSettings/GiftCardSettingsPage.tsx b/src/giftCards/GiftCardSettings/GiftCardSettingsPage.tsx index 8439fb484..61ebcfc55 100644 --- a/src/giftCards/GiftCardSettings/GiftCardSettingsPage.tsx +++ b/src/giftCards/GiftCardSettings/GiftCardSettingsPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import Form from "@dashboard/components/Form"; import { Grid } from "@dashboard/components/Grid"; diff --git a/src/giftCards/GiftCardSettings/messages.ts b/src/giftCards/GiftCardSettings/messages.ts index ed2f3aedf..0b98241f9 100644 --- a/src/giftCards/GiftCardSettings/messages.ts +++ b/src/giftCards/GiftCardSettings/messages.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { GiftCardSettingsErrorFragment } from "@dashboard/graphql"; import { getCommonFormFieldErrorMessage } from "@dashboard/utils/errors/common"; import { defineMessages, IntlShape } from "react-intl"; diff --git a/src/giftCards/GiftCardUpdate/GiftCardHistory/GiftCardHistory.tsx b/src/giftCards/GiftCardUpdate/GiftCardHistory/GiftCardHistory.tsx index 31e511744..ff32c8509 100644 --- a/src/giftCards/GiftCardUpdate/GiftCardHistory/GiftCardHistory.tsx +++ b/src/giftCards/GiftCardUpdate/GiftCardHistory/GiftCardHistory.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import Form from "@dashboard/components/Form"; import Hr from "@dashboard/components/Hr"; import Skeleton from "@dashboard/components/Skeleton"; diff --git a/src/giftCards/GiftCardUpdate/GiftCardHistory/GiftCardTimelineEvent.tsx b/src/giftCards/GiftCardUpdate/GiftCardHistory/GiftCardTimelineEvent.tsx index 936f2d75c..1a5334656 100644 --- a/src/giftCards/GiftCardUpdate/GiftCardHistory/GiftCardTimelineEvent.tsx +++ b/src/giftCards/GiftCardUpdate/GiftCardHistory/GiftCardTimelineEvent.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { AppPaths } from "@dashboard/apps/urls"; import Link from "@dashboard/components/Link"; import { TimelineEvent } from "@dashboard/components/Timeline"; diff --git a/src/giftCards/GiftCardUpdate/GiftCardHistory/styles.ts b/src/giftCards/GiftCardUpdate/GiftCardHistory/styles.ts index 0f2e487f3..55e5645b3 100644 --- a/src/giftCards/GiftCardUpdate/GiftCardHistory/styles.ts +++ b/src/giftCards/GiftCardUpdate/GiftCardHistory/styles.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { makeStyles } from "@saleor/macaw-ui"; import { vars } from "@saleor/macaw-ui/next"; diff --git a/src/giftCards/GiftCardUpdate/GiftCardResendCodeDialog/GiftCardResendCodeDialog.tsx b/src/giftCards/GiftCardUpdate/GiftCardResendCodeDialog/GiftCardResendCodeDialog.tsx index 17a79a3f0..9819ff520 100644 --- a/src/giftCards/GiftCardUpdate/GiftCardResendCodeDialog/GiftCardResendCodeDialog.tsx +++ b/src/giftCards/GiftCardUpdate/GiftCardResendCodeDialog/GiftCardResendCodeDialog.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import ActionDialog from "@dashboard/components/ActionDialog"; import { useChannelsSearch } from "@dashboard/components/ChannelsAvailabilityDialog/utils"; import ControlledCheckbox from "@dashboard/components/ControlledCheckbox"; diff --git a/src/giftCards/GiftCardUpdate/GiftCardResendCodeDialog/utils.ts b/src/giftCards/GiftCardUpdate/GiftCardResendCodeDialog/utils.ts index ff81ab750..54a89f50c 100644 --- a/src/giftCards/GiftCardUpdate/GiftCardResendCodeDialog/utils.ts +++ b/src/giftCards/GiftCardUpdate/GiftCardResendCodeDialog/utils.ts @@ -1,10 +1,11 @@ +// @ts-strict-ignore import { UserError } from "@dashboard/types"; import { FormErrors, getFormErrors } from "@dashboard/utils/errors"; import { useEffect, useState } from "react"; export function useDialogFormReset< TError extends UserError, - TKey extends string + TKey extends string, >({ reset, apiErrors, diff --git a/src/giftCards/GiftCardUpdate/GiftCardUpdateBalanceDialog/GiftCardUpdateBalanceDialog.tsx b/src/giftCards/GiftCardUpdate/GiftCardUpdateBalanceDialog/GiftCardUpdateBalanceDialog.tsx index 7e4991bc5..3751eb757 100644 --- a/src/giftCards/GiftCardUpdate/GiftCardUpdateBalanceDialog/GiftCardUpdateBalanceDialog.tsx +++ b/src/giftCards/GiftCardUpdate/GiftCardUpdateBalanceDialog/GiftCardUpdateBalanceDialog.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import ActionDialog from "@dashboard/components/ActionDialog"; import CardSpacer from "@dashboard/components/CardSpacer"; import { IMessage } from "@dashboard/components/messages"; @@ -40,30 +41,28 @@ const GiftCardUpdateBalanceDialog: React.FC = ({ balanceAmount: amount, }; - const [ - updateGiftCardBalance, - updateGiftCardBalanceOpts, - ] = useGiftCardUpdateMutation({ - onCompleted: data => { - const errors = data?.giftCardUpdate?.errors; + const [updateGiftCardBalance, updateGiftCardBalanceOpts] = + useGiftCardUpdateMutation({ + onCompleted: data => { + const errors = data?.giftCardUpdate?.errors; - const notifierData: IMessage = !!errors?.length - ? { - status: "error", - text: intl.formatMessage(commonErrorMessages.unknownError), - } - : { - status: "success", - text: intl.formatMessage(messages.updatedSuccessAlertTitle), - }; + const notifierData: IMessage = !!errors?.length + ? { + status: "error", + text: intl.formatMessage(commonErrorMessages.unknownError), + } + : { + status: "success", + text: intl.formatMessage(messages.updatedSuccessAlertTitle), + }; - notify(notifierData); + notify(notifierData); - if (!errors.length) { - onClose(); - } - }, - }); + if (!errors.length) { + onClose(); + } + }, + }); const handleSubmit = async ({ balanceAmount, diff --git a/src/giftCards/GiftCardUpdate/GiftCardUpdateDetailsCard/GiftCardUpdateDetailsBalanceSection.tsx b/src/giftCards/GiftCardUpdate/GiftCardUpdateDetailsCard/GiftCardUpdateDetailsBalanceSection.tsx index e5bbb7ed6..82413308a 100644 --- a/src/giftCards/GiftCardUpdate/GiftCardUpdateDetailsCard/GiftCardUpdateDetailsBalanceSection.tsx +++ b/src/giftCards/GiftCardUpdate/GiftCardUpdateDetailsCard/GiftCardUpdateDetailsBalanceSection.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import CardSpacer from "@dashboard/components/CardSpacer"; import HorizontalSpacer from "@dashboard/components/HorizontalSpacer"; import Money from "@dashboard/components/Money"; diff --git a/src/giftCards/GiftCardUpdate/GiftCardUpdateInfoCard/GiftCardUpdateInfoCardContent.tsx b/src/giftCards/GiftCardUpdate/GiftCardUpdateInfoCard/GiftCardUpdateInfoCardContent.tsx index 136c7672b..f3f363b06 100644 --- a/src/giftCards/GiftCardUpdate/GiftCardUpdateInfoCard/GiftCardUpdateInfoCardContent.tsx +++ b/src/giftCards/GiftCardUpdate/GiftCardUpdateInfoCard/GiftCardUpdateInfoCardContent.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { AppUrls } from "@dashboard/apps/urls"; import CardSpacer from "@dashboard/components/CardSpacer"; import Link from "@dashboard/components/Link"; diff --git a/src/giftCards/GiftCardUpdate/GiftCardUpdatePageHeader/GiftCardEnableDisableSection.tsx b/src/giftCards/GiftCardUpdate/GiftCardUpdatePageHeader/GiftCardEnableDisableSection.tsx index c4fb9f84b..8dcf0dee7 100644 --- a/src/giftCards/GiftCardUpdate/GiftCardUpdatePageHeader/GiftCardEnableDisableSection.tsx +++ b/src/giftCards/GiftCardUpdate/GiftCardUpdatePageHeader/GiftCardEnableDisableSection.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { commonMessages } from "@dashboard/intl"; import { ConfirmButton } from "@saleor/macaw-ui"; import React from "react"; @@ -14,13 +15,10 @@ const GiftCardEnableDisableSection: React.FC = () => { giftCard: { id, isActive, isExpired }, } = useGiftCardDetails(); - const { - giftCardActivate, - giftCardDeactivate, - currentOpts, - } = useGiftCardActivateToggle({ - isActive, - }); + const { giftCardActivate, giftCardDeactivate, currentOpts } = + useGiftCardActivateToggle({ + isActive, + }); const handleClick = () => isActive diff --git a/src/giftCards/GiftCardUpdate/messages.ts b/src/giftCards/GiftCardUpdate/messages.ts index d918c91be..6b83c6326 100644 --- a/src/giftCards/GiftCardUpdate/messages.ts +++ b/src/giftCards/GiftCardUpdate/messages.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { GiftCardErrorCode, GiftCardErrorFragment } from "@dashboard/graphql"; import commonErrorMessages, { getCommonFormFieldErrorMessage, diff --git a/src/giftCards/GiftCardUpdate/providers/GiftCardDetailsProvider/GiftCardDetailsProvider.tsx b/src/giftCards/GiftCardUpdate/providers/GiftCardDetailsProvider/GiftCardDetailsProvider.tsx index db5d13f86..26c4a63a2 100644 --- a/src/giftCards/GiftCardUpdate/providers/GiftCardDetailsProvider/GiftCardDetailsProvider.tsx +++ b/src/giftCards/GiftCardUpdate/providers/GiftCardDetailsProvider/GiftCardDetailsProvider.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { GiftCardDetailsQuery, useGiftCardDetailsQuery, @@ -17,9 +18,8 @@ export interface GiftCardDetailsConsumerProps { loading: boolean; } -export const GiftCardDetailsContext = createContext< - GiftCardDetailsConsumerProps ->(null); +export const GiftCardDetailsContext = + createContext(null); const GiftCardDetailsProvider: React.FC = ({ children, diff --git a/src/giftCards/GiftCardUpdate/providers/GiftCardDetailsProvider/utils.ts b/src/giftCards/GiftCardUpdate/providers/GiftCardDetailsProvider/utils.ts index 8fd2b76c2..cfbb4020e 100644 --- a/src/giftCards/GiftCardUpdate/providers/GiftCardDetailsProvider/utils.ts +++ b/src/giftCards/GiftCardUpdate/providers/GiftCardDetailsProvider/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import moment from "moment"; import { ExtendedGiftCard, GiftCardBase } from "./types"; diff --git a/src/giftCards/GiftCardUpdate/providers/GiftCardUpdateDialogsProvider/GiftCardUpdateDialogsProvider.tsx b/src/giftCards/GiftCardUpdate/providers/GiftCardUpdateDialogsProvider/GiftCardUpdateDialogsProvider.tsx index 1ccc6ced5..b87cb7f6a 100644 --- a/src/giftCards/GiftCardUpdate/providers/GiftCardUpdateDialogsProvider/GiftCardUpdateDialogsProvider.tsx +++ b/src/giftCards/GiftCardUpdate/providers/GiftCardUpdateDialogsProvider/GiftCardUpdateDialogsProvider.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import GiftCardUpdatePageDeleteDialog from "@dashboard/giftCards/components/GiftCardDeleteDialog/GiftCardUpdatePageDeleteDialog"; import { giftCardsListPath, giftCardUrl } from "@dashboard/giftCards/urls"; import useNavigator from "@dashboard/hooks/useNavigator"; @@ -25,24 +26,18 @@ export interface GiftCardUpdateDialogsConsumerProps { openResendCodeDialog: () => void; } -export const GiftCardUpdateDialogsContext = createContext< - GiftCardUpdateDialogsConsumerProps ->(null); +export const GiftCardUpdateDialogsContext = + createContext(null); -const GiftCardUpdateDialogsProvider: React.FC = ({ - children, - params, - id, -}) => { +const GiftCardUpdateDialogsProvider: React.FC< + GiftCardUpdateDialogsProviderProps +> = ({ children, params, id }) => { const navigate = useNavigator(); const { loading: loadingGiftCard } = useGiftCardDetails(); - const { - SET_BALANCE, - DELETE, - RESEND_CODE, - } = GiftCardUpdatePageActionParamsEnum; + const { SET_BALANCE, DELETE, RESEND_CODE } = + GiftCardUpdatePageActionParamsEnum; const [openDialog, onClose] = createDialogActionHandlers< GiftCardUpdatePageActionParamsEnum, diff --git a/src/giftCards/GiftCardUpdate/providers/GiftCardUpdateFormProvider/GiftCardUpdateFormProvider.tsx b/src/giftCards/GiftCardUpdate/providers/GiftCardUpdateFormProvider/GiftCardUpdateFormProvider.tsx index eefa91383..3840fec1f 100644 --- a/src/giftCards/GiftCardUpdate/providers/GiftCardUpdateFormProvider/GiftCardUpdateFormProvider.tsx +++ b/src/giftCards/GiftCardUpdate/providers/GiftCardUpdateFormProvider/GiftCardUpdateFormProvider.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { MetadataFormData } from "@dashboard/components/Metadata"; import { giftCardUpdateFormMessages } from "@dashboard/giftCards/GiftCardsList/messages"; import { @@ -44,14 +45,11 @@ export interface GiftCardUpdateFormErrors { handlers: { changeMetadata: FormChange }; } -export type GiftCardUpdateFormConsumerProps = UseFormResult< - GiftCardUpdateFormData -> & - GiftCardUpdateFormConsumerData; +export type GiftCardUpdateFormConsumerProps = + UseFormResult & GiftCardUpdateFormConsumerData; -export const GiftCardUpdateFormContext = createContext< - GiftCardUpdateFormConsumerProps ->(null); +export const GiftCardUpdateFormContext = + createContext(null); const getGiftCardTagsAddRemoveData = ( initTags: string[], diff --git a/src/giftCards/GiftCardUpdate/queries.ts b/src/giftCards/GiftCardUpdate/queries.ts index fb9d5ad36..d3c250347 100644 --- a/src/giftCards/GiftCardUpdate/queries.ts +++ b/src/giftCards/GiftCardUpdate/queries.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { gql } from "@apollo/client"; import { getOperationAST } from "graphql"; @@ -12,5 +13,5 @@ export const giftCardDetails = gql` } `; -export const GIFT_CARD_DETAILS_QUERY = getOperationAST(giftCardDetails).name - .value; +export const GIFT_CARD_DETAILS_QUERY = + getOperationAST(giftCardDetails).name.value; diff --git a/src/giftCards/GiftCardsList/GiftCardListSearchAndFilters/GiftCardListSearchAndFilters.tsx b/src/giftCards/GiftCardsList/GiftCardListSearchAndFilters/GiftCardListSearchAndFilters.tsx index 6853fedcf..2040fb2f0 100644 --- a/src/giftCards/GiftCardsList/GiftCardListSearchAndFilters/GiftCardListSearchAndFilters.tsx +++ b/src/giftCards/GiftCardsList/GiftCardListSearchAndFilters/GiftCardListSearchAndFilters.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import DeleteFilterTabDialog from "@dashboard/components/DeleteFilterTabDialog"; import FilterBar from "@dashboard/components/FilterBar"; import SaveFilterTabDialog, { diff --git a/src/giftCards/GiftCardsList/GiftCardListSearchAndFilters/filters.ts b/src/giftCards/GiftCardsList/GiftCardListSearchAndFilters/filters.ts index c9f3bd07b..76ef84dbe 100644 --- a/src/giftCards/GiftCardsList/GiftCardListSearchAndFilters/filters.ts +++ b/src/giftCards/GiftCardsList/GiftCardListSearchAndFilters/filters.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FilterElement, IFilter } from "@dashboard/components/Filter"; import { GiftCardFilterInput, @@ -336,19 +337,13 @@ export function createFilterStructure( ]; } -export const { - deleteFilterTab, - getFilterTabs, - saveFilterTab, -} = createFilterTabUtils(GIFT_CARD_FILTERS_KEY); +export const { deleteFilterTab, getFilterTabs, saveFilterTab } = + createFilterTabUtils(GIFT_CARD_FILTERS_KEY); -export const { - areFiltersApplied, - getActiveFilters, - getFiltersCurrentTab, -} = createFilterUtils( - GiftCardListUrlFiltersEnum, -); +export const { areFiltersApplied, getActiveFilters, getFiltersCurrentTab } = + createFilterUtils( + GiftCardListUrlFiltersEnum, + ); export function getFilterVariables({ status, diff --git a/src/giftCards/GiftCardsList/GiftCardsListHeader/GiftCardsListHeaderAlert.tsx b/src/giftCards/GiftCardsList/GiftCardsListHeader/GiftCardsListHeaderAlert.tsx index 78c362e50..f57486a2e 100644 --- a/src/giftCards/GiftCardsList/GiftCardsListHeader/GiftCardsListHeaderAlert.tsx +++ b/src/giftCards/GiftCardsList/GiftCardsListHeader/GiftCardsListHeaderAlert.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useGiftCardProductsCountQuery } from "@dashboard/graphql"; import useLocalStorage from "@dashboard/hooks/useLocalStorage"; import { Alert } from "@saleor/macaw-ui"; diff --git a/src/giftCards/GiftCardsList/GiftCardsListTable/GiftCardsListTable.tsx b/src/giftCards/GiftCardsList/GiftCardsListTable/GiftCardsListTable.tsx index 2434c0e6f..7c121e653 100644 --- a/src/giftCards/GiftCardsList/GiftCardsListTable/GiftCardsListTable.tsx +++ b/src/giftCards/GiftCardsList/GiftCardsListTable/GiftCardsListTable.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import Checkbox from "@dashboard/components/Checkbox"; import DeleteIconButton from "@dashboard/components/DeleteIconButton"; import HorizontalSpacer from "@dashboard/components/HorizontalSpacer"; diff --git a/src/giftCards/GiftCardsList/GiftCardsListTable/GiftCardsListTableFooter.tsx b/src/giftCards/GiftCardsList/GiftCardsListTable/GiftCardsListTableFooter.tsx index 94fc39f8a..aea7120ec 100644 --- a/src/giftCards/GiftCardsList/GiftCardsListTable/GiftCardsListTableFooter.tsx +++ b/src/giftCards/GiftCardsList/GiftCardsListTable/GiftCardsListTableFooter.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import TablePagination from "@dashboard/components/TablePagination"; import TableRowLink from "@dashboard/components/TableRowLink"; import usePaginator from "@dashboard/hooks/usePaginator"; diff --git a/src/giftCards/GiftCardsList/GiftCardsListTable/GiftCardsListTableHeader/BulkEnableDisableSection.tsx b/src/giftCards/GiftCardsList/GiftCardsListTable/GiftCardsListTableHeader/BulkEnableDisableSection.tsx index ae9bd3571..ad5cfa73e 100644 --- a/src/giftCards/GiftCardsList/GiftCardsListTable/GiftCardsListTableHeader/BulkEnableDisableSection.tsx +++ b/src/giftCards/GiftCardsList/GiftCardsListTable/GiftCardsListTableHeader/BulkEnableDisableSection.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ConfirmButton } from "@dashboard/components/ConfirmButton"; import { IMessage } from "@dashboard/components/messages"; import { diff --git a/src/giftCards/GiftCardsList/GiftCardsListTable/GiftCardsListTableHeader/GiftCardsListTableHeader.tsx b/src/giftCards/GiftCardsList/GiftCardsListTable/GiftCardsListTableHeader/GiftCardsListTableHeader.tsx index b2a97f295..9019fb846 100644 --- a/src/giftCards/GiftCardsList/GiftCardsListTable/GiftCardsListTableHeader/GiftCardsListTableHeader.tsx +++ b/src/giftCards/GiftCardsList/GiftCardsListTable/GiftCardsListTableHeader/GiftCardsListTableHeader.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import DeleteIconButton from "@dashboard/components/DeleteIconButton"; import TableCellHeader, { TableCellHeaderArrowDirection, @@ -40,13 +41,8 @@ const GiftCardsListTableHeader: React.FC = ({ const intl = useIntl(); const classes = useStyles({}); - const { - giftCards, - numberOfColumns, - loading, - toggleAll, - listElements, - } = useGiftCardList(); + const { giftCards, numberOfColumns, loading, toggleAll, listElements } = + useGiftCardList(); const { openDeleteDialog } = useGiftCardListDialogs(); const { onSort, sort } = useGiftCardList(); diff --git a/src/giftCards/GiftCardsList/providers/GiftCardListDialogsProvider/GiftCardListDialogsProvider.tsx b/src/giftCards/GiftCardsList/providers/GiftCardListDialogsProvider/GiftCardListDialogsProvider.tsx index 2ed8cd4ca..147204d1d 100644 --- a/src/giftCards/GiftCardsList/providers/GiftCardListDialogsProvider/GiftCardListDialogsProvider.tsx +++ b/src/giftCards/GiftCardsList/providers/GiftCardListDialogsProvider/GiftCardListDialogsProvider.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import GiftCardListPageDeleteDialog from "@dashboard/giftCards/components/GiftCardDeleteDialog/GiftCardListPageDeleteDialog"; import GiftCardBulkCreateDialog from "@dashboard/giftCards/GiftCardBulkCreateDialog"; import GiftCardCreateDialogContent from "@dashboard/giftCards/GiftCardCreateDialog"; @@ -30,17 +31,15 @@ export interface GiftCardListDialogsConsumerProps { id: string; } -export const GiftCardListDialogsContext = createContext< - GiftCardListDialogsConsumerProps ->(null); +export const GiftCardListDialogsContext = + createContext(null); export const useGiftCardListDialogs = () => useContext(GiftCardListDialogsContext); -const GiftCardListDialogsProvider: React.FC = ({ - children, - params, -}) => { +const GiftCardListDialogsProvider: React.FC< + GiftCardListDialogsProviderProps +> = ({ children, params }) => { const navigate = useNavigator(); const id = params?.id; diff --git a/src/giftCards/GiftCardsList/providers/GiftCardListProvider/GiftCardListProvider.tsx b/src/giftCards/GiftCardsList/providers/GiftCardListProvider/GiftCardListProvider.tsx index 36df322d4..72c29fc21 100644 --- a/src/giftCards/GiftCardsList/providers/GiftCardListProvider/GiftCardListProvider.tsx +++ b/src/giftCards/GiftCardsList/providers/GiftCardListProvider/GiftCardListProvider.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ApolloError } from "@apollo/client"; import { ExtendedGiftCard } from "@dashboard/giftCards/GiftCardUpdate/providers/GiftCardDetailsProvider/types"; import { getExtendedGiftCard } from "@dashboard/giftCards/GiftCardUpdate/providers/GiftCardDetailsProvider/utils"; @@ -58,9 +59,8 @@ export interface GiftCardsListConsumerProps selectedItemsCount: number; } -export const GiftCardsListContext = createContext( - null, -); +export const GiftCardsListContext = + createContext(null); export const useGiftCardList = () => useContext(GiftCardsListContext); @@ -75,9 +75,8 @@ export const GiftCardsListProvider: React.FC = ({ [], ); - const { updateListSettings, settings } = useListSettings< - GiftCardListColummns - >(ListViews.GIFT_CARD_LIST); + const { updateListSettings, settings } = + useListSettings(ListViews.GIFT_CARD_LIST); usePaginationReset(giftCardListUrl, params, settings.rowNumber); diff --git a/src/giftCards/GiftCardsList/providers/GiftCardListProvider/sort.ts b/src/giftCards/GiftCardsList/providers/GiftCardListProvider/sort.ts index 82c0558ff..d98c22f54 100644 --- a/src/giftCards/GiftCardsList/providers/GiftCardListProvider/sort.ts +++ b/src/giftCards/GiftCardsList/providers/GiftCardListProvider/sort.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { GiftCardSortField } from "@dashboard/graphql"; import { createGetSortQueryVariables } from "@dashboard/utils/sort"; @@ -18,6 +19,5 @@ export const getSortQueryField = ( } }; -export const getSortQueryVariables = createGetSortQueryVariables( - getSortQueryField, -); +export const getSortQueryVariables = + createGetSortQueryVariables(getSortQueryField); diff --git a/src/giftCards/GiftCardsList/queries.ts b/src/giftCards/GiftCardsList/queries.ts index ee130c69a..0a785fe25 100644 --- a/src/giftCards/GiftCardsList/queries.ts +++ b/src/giftCards/GiftCardsList/queries.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { gql } from "@apollo/client"; import { getOperationAST } from "graphql"; diff --git a/src/giftCards/components/GiftCardCustomerCard/CustomerGiftCardsCard.tsx b/src/giftCards/components/GiftCardCustomerCard/CustomerGiftCardsCard.tsx index 3a69e457a..e87f15b01 100644 --- a/src/giftCards/components/GiftCardCustomerCard/CustomerGiftCardsCard.tsx +++ b/src/giftCards/components/GiftCardCustomerCard/CustomerGiftCardsCard.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Button } from "@dashboard/components/Button"; import CardTitle from "@dashboard/components/CardTitle"; import CollectionWithDividers from "@dashboard/components/CollectionWithDividers"; diff --git a/src/giftCards/components/GiftCardCustomerCard/queries.ts b/src/giftCards/components/GiftCardCustomerCard/queries.ts index 874c593d2..ca75415c7 100644 --- a/src/giftCards/components/GiftCardCustomerCard/queries.ts +++ b/src/giftCards/components/GiftCardCustomerCard/queries.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { gql } from "@apollo/client"; import { getOperationAST } from "graphql"; diff --git a/src/giftCards/components/GiftCardDeleteDialog/GiftCardDeleteDialogContent.tsx b/src/giftCards/components/GiftCardDeleteDialog/GiftCardDeleteDialogContent.tsx index dfddd5f60..900b5c223 100644 --- a/src/giftCards/components/GiftCardDeleteDialog/GiftCardDeleteDialogContent.tsx +++ b/src/giftCards/components/GiftCardDeleteDialog/GiftCardDeleteDialogContent.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import ActionDialog, { ActionDialogProps, } from "@dashboard/components/ActionDialog"; @@ -25,9 +26,8 @@ type DeleteDialogContentGiftCard = Pick< >; export interface GiftCardDeleteDialogContentProps< - TGiftCard extends DeleteDialogContentGiftCard -> - extends Pick< + TGiftCard extends DeleteDialogContentGiftCard, +> extends Pick< ActionDialogProps, "open" | "onClose" | "onConfirm" | "confirmButtonState" >, @@ -43,7 +43,7 @@ export interface GiftCardDeleteDialogContentProps< } function GiftCardDeleteDialogContent< - TGiftCard extends DeleteDialogContentGiftCard + TGiftCard extends DeleteDialogContentGiftCard, >({ id, open, diff --git a/src/giftCards/components/GiftCardDeleteDialog/GiftCardUpdatePageDeleteDialog.tsx b/src/giftCards/components/GiftCardDeleteDialog/GiftCardUpdatePageDeleteDialog.tsx index 58891c0e4..1a1120a25 100644 --- a/src/giftCards/components/GiftCardDeleteDialog/GiftCardUpdatePageDeleteDialog.tsx +++ b/src/giftCards/components/GiftCardDeleteDialog/GiftCardUpdatePageDeleteDialog.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { GIFT_CARD_LIST_QUERY } from "@dashboard/giftCards/GiftCardsList/queries"; import useGiftCardDetails from "@dashboard/giftCards/GiftCardUpdate/providers/GiftCardDetailsProvider/hooks/useGiftCardDetails"; import { DialogProps } from "@dashboard/types"; @@ -10,11 +11,9 @@ type GiftCardUpdatePageDeleteDialogProps = DialogProps & { onDelete: () => void; }; -const GiftCardUpdatePageDeleteDialog: React.FC = ({ - onClose, - open, - onDelete, -}) => { +const GiftCardUpdatePageDeleteDialog: React.FC< + GiftCardUpdatePageDeleteDialogProps +> = ({ onClose, open, onDelete }) => { const { giftCard } = useGiftCardDetails(); const { onDeleteGiftCard, deleteGiftCardOpts } = useGiftCardSingleDelete({ diff --git a/src/giftCards/components/GiftCardDeleteDialog/useGiftCardBulkDelete.tsx b/src/giftCards/components/GiftCardDeleteDialog/useGiftCardBulkDelete.tsx index f3da2b491..e107e9db2 100644 --- a/src/giftCards/components/GiftCardDeleteDialog/useGiftCardBulkDelete.tsx +++ b/src/giftCards/components/GiftCardDeleteDialog/useGiftCardBulkDelete.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useGiftCardList } from "@dashboard/giftCards/GiftCardsList/providers/GiftCardListProvider"; import { BulkDeleteGiftCardMutation, @@ -31,33 +32,31 @@ const useGiftCardBulkDelete = ({ reset: resetSelectedItems, } = useGiftCardList(); - const [ - bulkDeleteGiftCard, - bulkDeleteGiftCardOpts, - ] = useBulkDeleteGiftCardMutation({ - onCompleted: data => { - const errors = data?.giftCardBulkDelete?.errors; + const [bulkDeleteGiftCard, bulkDeleteGiftCardOpts] = + useBulkDeleteGiftCardMutation({ + onCompleted: data => { + const errors = data?.giftCardBulkDelete?.errors; + + if (!errors.length) { + notify({ + status: "success", + text: intl.formatMessage(messages.deleteSuccessAlertText, { + selectedItemsCount, + }), + }); + + onClose(); + resetSelectedItems(); + return; + } - if (!errors.length) { notify({ - status: "success", - text: intl.formatMessage(messages.deleteSuccessAlertText, { - selectedItemsCount, - }), + status: "error", + text: intl.formatMessage(commonErrorMessages.unknownError), }); - - onClose(); - resetSelectedItems(); - return; - } - - notify({ - status: "error", - text: intl.formatMessage(commonErrorMessages.unknownError), - }); - }, - refetchQueries, - }); + }, + refetchQueries, + }); const onBulkDeleteGiftCards = () => bulkDeleteGiftCard({ variables: { ids: listElements } }); diff --git a/src/giftCards/components/GiftCardDeleteDialog/useGiftCardSingleDelete.tsx b/src/giftCards/components/GiftCardDeleteDialog/useGiftCardSingleDelete.tsx index 63fe1a628..0c7fe16f7 100644 --- a/src/giftCards/components/GiftCardDeleteDialog/useGiftCardSingleDelete.tsx +++ b/src/giftCards/components/GiftCardDeleteDialog/useGiftCardSingleDelete.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { getGiftCardErrorMessage } from "@dashboard/giftCards/GiftCardUpdate/messages"; import { DeleteGiftCardMutation, diff --git a/src/home/components/HomeActivityCard/HomeActivityCard.tsx b/src/home/components/HomeActivityCard/HomeActivityCard.tsx index 7d02e4ffa..9b695cf89 100644 --- a/src/home/components/HomeActivityCard/HomeActivityCard.tsx +++ b/src/home/components/HomeActivityCard/HomeActivityCard.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import CardTitle from "@dashboard/components/CardTitle"; import { DateTime } from "@dashboard/components/Date"; import Skeleton from "@dashboard/components/Skeleton"; diff --git a/src/home/components/HomeActivityCard/activityMessages.ts b/src/home/components/HomeActivityCard/activityMessages.ts index 695250eb3..e41d49f79 100644 --- a/src/home/components/HomeActivityCard/activityMessages.ts +++ b/src/home/components/HomeActivityCard/activityMessages.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { HomeQuery, OrderEventsEnum } from "@dashboard/graphql"; import { defineMessages, IntlShape } from "react-intl"; diff --git a/src/home/components/HomePage/HomePage.stories.tsx b/src/home/components/HomePage/HomePage.stories.tsx index 0439b298e..37a5bf7e8 100644 --- a/src/home/components/HomePage/HomePage.stories.tsx +++ b/src/home/components/HomePage/HomePage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import placeholderImage from "@assets/images/placeholder60x60.png"; import { adminUserPermissions } from "@dashboard/fixtures"; import { PermissionEnum } from "@dashboard/graphql"; diff --git a/src/home/components/HomePage/HomePage.tsx b/src/home/components/HomePage/HomePage.tsx index 00cad9fb8..582615d60 100644 --- a/src/home/components/HomePage/HomePage.tsx +++ b/src/home/components/HomePage/HomePage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import CardSpacer from "@dashboard/components/CardSpacer"; import { DetailPageLayout } from "@dashboard/components/Layouts"; diff --git a/src/home/components/HomeProductListCard/HomeProductListCard.tsx b/src/home/components/HomeProductListCard/HomeProductListCard.tsx index 9c0e7e053..d25fc0527 100644 --- a/src/home/components/HomeProductListCard/HomeProductListCard.tsx +++ b/src/home/components/HomeProductListCard/HomeProductListCard.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import CardTitle from "@dashboard/components/CardTitle"; import Money from "@dashboard/components/Money"; import ResponsiveTable from "@dashboard/components/ResponsiveTable"; diff --git a/src/home/fixtures.ts b/src/home/fixtures.ts index e80f05b25..2b05581de 100644 --- a/src/home/fixtures.ts +++ b/src/home/fixtures.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { HomeQuery, OrderEventsEnum } from "@dashboard/graphql"; export const shop: (placeholderImage: string) => HomeQuery = ( diff --git a/src/home/views/index.tsx b/src/home/views/index.tsx index 0d6da7c13..a6ae32418 100644 --- a/src/home/views/index.tsx +++ b/src/home/views/index.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useUser } from "@dashboard/auth"; import { channelsListUrl } from "@dashboard/channels/urls"; import useAppChannel from "@dashboard/components/AppLayout/AppChannelContext"; diff --git a/src/hooks/makeMutation.ts b/src/hooks/makeMutation.ts index 880be8790..3c850f882 100644 --- a/src/hooks/makeMutation.ts +++ b/src/hooks/makeMutation.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ApolloError, MutationFunction, diff --git a/src/hooks/makeQuery.ts b/src/hooks/makeQuery.ts index d1167443d..4c7b9fee1 100644 --- a/src/hooks/makeQuery.ts +++ b/src/hooks/makeQuery.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ApolloError, ApolloQueryResult, @@ -55,7 +56,7 @@ export interface LoadMore { export type LazyQueryHookOptions< TData = any, - TVariables = OperationVariables + TVariables = OperationVariables, > = BaseLazyQueryHookOptions; export type UseQueryResult = QueryResult & diff --git a/src/hooks/makeSearch.ts b/src/hooks/makeSearch.ts index e0e4800e9..8ecb52c12 100644 --- a/src/hooks/makeSearch.ts +++ b/src/hooks/makeSearch.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { QueryResult } from "@apollo/client"; import { DocumentNode } from "graphql"; import { useState } from "react"; diff --git a/src/hooks/makeTopLevelSearch/makeTopLevelSearch.ts b/src/hooks/makeTopLevelSearch/makeTopLevelSearch.ts index b79216ad7..82db71ea4 100644 --- a/src/hooks/makeTopLevelSearch/makeTopLevelSearch.ts +++ b/src/hooks/makeTopLevelSearch/makeTopLevelSearch.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { PageInfoFragment } from "@dashboard/graphql"; import { DocumentNode } from "graphql"; @@ -18,7 +19,7 @@ export interface ResultSearchData { function makeTopLevelSearch< TData extends SearchData, - TVariables extends SearchVariables + TVariables extends SearchVariables, >(query: DocumentNode): UseSearchHook { return makeSearch(query, result => { if (result?.data?.search?.pageInfo?.hasNextPage) { diff --git a/src/hooks/useAddressValidation.ts b/src/hooks/useAddressValidation.ts index 28abf74ec..878b3a7b5 100644 --- a/src/hooks/useAddressValidation.ts +++ b/src/hooks/useAddressValidation.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { AddressTypeInput } from "@dashboard/customers/types"; import { AccountErrorCode, diff --git a/src/hooks/useChannelsSearchWithLoadMore.ts b/src/hooks/useChannelsSearchWithLoadMore.ts index a73b20d92..66bbc2ff5 100644 --- a/src/hooks/useChannelsSearchWithLoadMore.ts +++ b/src/hooks/useChannelsSearchWithLoadMore.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useBaseChannelsQuery } from "@dashboard/graphql"; import chunk from "lodash/chunk"; import compact from "lodash/compact"; diff --git a/src/hooks/useClipboard.ts b/src/hooks/useClipboard.ts index db792690a..3bb094ae1 100644 --- a/src/hooks/useClipboard.ts +++ b/src/hooks/useClipboard.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useEffect, useRef, useState } from "react"; function useClipboard(): [boolean, (text: string) => void] { diff --git a/src/hooks/useDebounce.ts b/src/hooks/useDebounce.ts index 413b18b54..481dbde4e 100644 --- a/src/hooks/useDebounce.ts +++ b/src/hooks/useDebounce.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useEffect, useRef } from "react"; export type UseDebounceFn = (...args: T[]) => void; diff --git a/src/hooks/useElementScroll.ts b/src/hooks/useElementScroll.ts index e6b14a3b8..0a1264d42 100644 --- a/src/hooks/useElementScroll.ts +++ b/src/hooks/useElementScroll.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import throttle from "lodash/throttle"; import { MutableRefObject, useEffect, useState } from "react"; diff --git a/src/hooks/useFilterHandlers.test.ts b/src/hooks/useFilterHandlers.test.ts index e026ed956..cdb55fc57 100644 --- a/src/hooks/useFilterHandlers.test.ts +++ b/src/hooks/useFilterHandlers.test.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { renderHook } from "@testing-library/react-hooks"; import { useFilterHandlers } from "./useFilterHandlers"; diff --git a/src/hooks/useFilterHandlers.ts b/src/hooks/useFilterHandlers.ts index 2cbbe2180..9c8740472 100644 --- a/src/hooks/useFilterHandlers.ts +++ b/src/hooks/useFilterHandlers.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { IFilter } from "@dashboard/components/Filter"; import { ActiveTab, Pagination, Search, Sort } from "@dashboard/types"; import { diff --git a/src/hooks/useForm.ts b/src/hooks/useForm.ts index 3eba96d85..122637f28 100644 --- a/src/hooks/useForm.ts +++ b/src/hooks/useForm.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { CheckIfSaveIsDisabledFnType, FormId, diff --git a/src/hooks/useFormset.ts b/src/hooks/useFormset.ts index 459c3703d..88fa87d03 100644 --- a/src/hooks/useFormset.ts +++ b/src/hooks/useFormset.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { removeAtIndex } from "@dashboard/utils/lists"; import useStateFromProps from "./useStateFromProps"; diff --git a/src/hooks/useHandleFormSubmit.ts b/src/hooks/useHandleFormSubmit.ts index 962d0018f..73b451f82 100644 --- a/src/hooks/useHandleFormSubmit.ts +++ b/src/hooks/useHandleFormSubmit.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FormId, useExitFormDialog } from "@dashboard/components/Form"; import { MessageContext } from "@dashboard/components/messages"; import { SubmitPromise } from "@dashboard/hooks/useForm"; diff --git a/src/hooks/useInterval.ts b/src/hooks/useInterval.ts index 8bd21aef1..b01193602 100644 --- a/src/hooks/useInterval.ts +++ b/src/hooks/useInterval.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useEffect, useRef } from "react"; function useInterval(callback: () => void, delay: number | null) { diff --git a/src/hooks/useListSettings.ts b/src/hooks/useListSettings.ts index 737df9f38..c73c6cc82 100644 --- a/src/hooks/useListSettings.ts +++ b/src/hooks/useListSettings.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import useLocalStorage from "@dashboard/hooks/useLocalStorage"; import merge from "lodash/merge"; diff --git a/src/hooks/useLocalPaginator.ts b/src/hooks/useLocalPaginator.ts index c64390105..acd52e283 100644 --- a/src/hooks/useLocalPaginator.ts +++ b/src/hooks/useLocalPaginator.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useEffect, useState } from "react"; export interface PageInfo { @@ -62,9 +63,8 @@ export function useSectionLocalPaginationState( section: string, ): [PaginationState, (paginationState: PaginationState) => void] { const [paginationSection, setPaginationSection] = useState(section); - const [paginationState, setPaginationState] = useLocalPaginationState( - paginateBy, - ); + const [paginationState, setPaginationState] = + useLocalPaginationState(paginateBy); const fallbackPaginationState = { first: paginateBy, diff --git a/src/hooks/useLocalStorage.ts b/src/hooks/useLocalStorage.ts index 19d48282f..e6c5a8197 100644 --- a/src/hooks/useLocalStorage.ts +++ b/src/hooks/useLocalStorage.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Dispatch, SetStateAction, useState } from "react"; export type UseLocalStorage = [T, Dispatch>]; @@ -48,7 +49,7 @@ export default function useLocalStorage( // Casting to T (which should resolve to string) because JSON.parse would // throw an error if "foo" was passed, but properly casting "true" or "1" // to their respective types - result = (item as unknown) as T; + result = item as unknown as T; } return getValue(result, initialValue); diff --git a/src/hooks/useMultiAutocomplete.ts b/src/hooks/useMultiAutocomplete.ts index f6333cc51..a296be094 100644 --- a/src/hooks/useMultiAutocomplete.ts +++ b/src/hooks/useMultiAutocomplete.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { MultiAutocompleteChoiceType } from "@dashboard/components/MultiAutocompleteSelectField"; import { maybe } from "@dashboard/misc"; diff --git a/src/hooks/useOnSetDefaultVariant.ts b/src/hooks/useOnSetDefaultVariant.ts index 80dc8d939..7618b8d94 100644 --- a/src/hooks/useOnSetDefaultVariant.ts +++ b/src/hooks/useOnSetDefaultVariant.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Node, useProductVariantSetDefaultMutation } from "@dashboard/graphql"; import useNotifier from "@dashboard/hooks/useNotifier"; import { getProductErrorMessage } from "@dashboard/utils/errors"; @@ -18,11 +19,12 @@ function useOnSetDefaultVariant(productId: string, variant: Node) { }), ); } else { - const defaultVariant = data.productVariantSetDefault.product.variants.find( - variant => - variant.id === - data.productVariantSetDefault.product.defaultVariant.id, - ); + const defaultVariant = + data.productVariantSetDefault.product.variants.find( + variant => + variant.id === + data.productVariantSetDefault.product.defaultVariant.id, + ); if (defaultVariant) { notify({ status: "success", diff --git a/src/hooks/usePreventHistoryBack.ts b/src/hooks/usePreventHistoryBack.ts index 24d3b5b2b..432c1958a 100644 --- a/src/hooks/usePreventHistoryBack.ts +++ b/src/hooks/usePreventHistoryBack.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import React, { useRef } from "react"; /** diff --git a/src/hooks/useSortRedirects.ts b/src/hooks/useSortRedirects.ts index dee4edb2c..2669cbffc 100644 --- a/src/hooks/useSortRedirects.ts +++ b/src/hooks/useSortRedirects.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import useNavigator from "@dashboard/hooks/useNavigator"; import { Sort } from "@dashboard/types"; import { useEffect, useRef } from "react"; diff --git a/src/hooks/useWizard.ts b/src/hooks/useWizard.ts index e7ee9ff8a..ef0289c27 100644 --- a/src/hooks/useWizard.ts +++ b/src/hooks/useWizard.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useState } from "react"; export interface UseWizardActions { diff --git a/src/index.tsx b/src/index.tsx index 2e28e8dcc..45d952328 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import "@saleor/macaw-ui/next/style"; import "./index.css"; diff --git a/src/misc.ts b/src/misc.ts index 4f752d5c5..e70208372 100644 --- a/src/misc.ts +++ b/src/misc.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FetchResult, MutationFunction, MutationResult } from "@apollo/client"; import { AddressInput, diff --git a/src/navigation/components/MenuDetailsPage/MenuDetailsPage.stories.tsx b/src/navigation/components/MenuDetailsPage/MenuDetailsPage.stories.tsx index e4b0353fb..8d9e23ada 100644 --- a/src/navigation/components/MenuDetailsPage/MenuDetailsPage.stories.tsx +++ b/src/navigation/components/MenuDetailsPage/MenuDetailsPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { MenuErrorCode } from "@dashboard/graphql"; import { menu } from "@dashboard/navigation/fixtures"; import React from "react"; diff --git a/src/navigation/components/MenuDetailsPage/MenuDetailsPage.tsx b/src/navigation/components/MenuDetailsPage/MenuDetailsPage.tsx index ed61345de..c470db1ad 100644 --- a/src/navigation/components/MenuDetailsPage/MenuDetailsPage.tsx +++ b/src/navigation/components/MenuDetailsPage/MenuDetailsPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Backlink } from "@dashboard/components/Backlink"; import CardSpacer from "@dashboard/components/CardSpacer"; import { ConfirmButtonTransitionState } from "@dashboard/components/ConfirmButton"; diff --git a/src/navigation/components/MenuDetailsPage/tree.test.ts b/src/navigation/components/MenuDetailsPage/tree.test.ts index 1cd9ffec1..857c970c8 100644 --- a/src/navigation/components/MenuDetailsPage/tree.test.ts +++ b/src/navigation/components/MenuDetailsPage/tree.test.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { RecursiveMenuItem } from "@dashboard/navigation/types"; import { menu } from "../../fixtures"; diff --git a/src/navigation/components/MenuDetailsPage/tree.ts b/src/navigation/components/MenuDetailsPage/tree.ts index 6c616452d..3a511ae21 100644 --- a/src/navigation/components/MenuDetailsPage/tree.ts +++ b/src/navigation/components/MenuDetailsPage/tree.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { RecursiveMenuItem } from "@dashboard/navigation/types"; import { TreeOperation } from "../MenuItems"; diff --git a/src/navigation/components/MenuItemDialog/MenuItemDialog.tsx b/src/navigation/components/MenuItemDialog/MenuItemDialog.tsx index 5ebfaa2b0..4b2c49d61 100644 --- a/src/navigation/components/MenuItemDialog/MenuItemDialog.tsx +++ b/src/navigation/components/MenuItemDialog/MenuItemDialog.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import AutocompleteSelectMenu from "@dashboard/components/AutocompleteSelectMenu"; import BackButton from "@dashboard/components/BackButton"; import { diff --git a/src/navigation/components/MenuItems/MenuItems.tsx b/src/navigation/components/MenuItems/MenuItems.tsx index 51a959676..3d31239ea 100644 --- a/src/navigation/components/MenuItems/MenuItems.tsx +++ b/src/navigation/components/MenuItems/MenuItems.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import CardTitle from "@dashboard/components/CardTitle"; import Skeleton from "@dashboard/components/Skeleton"; import { buttonMessages } from "@dashboard/intl"; diff --git a/src/navigation/components/MenuItems/tree.test.ts b/src/navigation/components/MenuItems/tree.test.ts index 4af363f4d..88e3abcd6 100644 --- a/src/navigation/components/MenuItems/tree.test.ts +++ b/src/navigation/components/MenuItems/tree.test.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { addNodeUnderParent, find, diff --git a/src/navigation/components/MenuItems/tree.ts b/src/navigation/components/MenuItems/tree.ts index c8a74c0cf..f96aec426 100644 --- a/src/navigation/components/MenuItems/tree.ts +++ b/src/navigation/components/MenuItems/tree.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { RecursiveMenuItem } from "@dashboard/navigation/types"; import { getPatch } from "fast-array-diff"; import { TreeItem } from "react-sortable-tree"; diff --git a/src/navigation/components/MenuList/MenuList.tsx b/src/navigation/components/MenuList/MenuList.tsx index 1a14e4fae..a6105762f 100644 --- a/src/navigation/components/MenuList/MenuList.tsx +++ b/src/navigation/components/MenuList/MenuList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import Checkbox from "@dashboard/components/Checkbox"; import IconButtonTableCell from "@dashboard/components/IconButtonTableCell"; import ResponsiveTable from "@dashboard/components/ResponsiveTable"; diff --git a/src/navigation/components/MenuListPage/MenuListPage.stories.tsx b/src/navigation/components/MenuListPage/MenuListPage.stories.tsx index 6bc19c3b2..0dfca28eb 100644 --- a/src/navigation/components/MenuListPage/MenuListPage.stories.tsx +++ b/src/navigation/components/MenuListPage/MenuListPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { listActionsProps, pageListProps, diff --git a/src/navigation/views/MenuDetails/index.tsx b/src/navigation/views/MenuDetails/index.tsx index 40f15a0d7..edd68f32e 100644 --- a/src/navigation/views/MenuDetails/index.tsx +++ b/src/navigation/views/MenuDetails/index.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import ActionDialog from "@dashboard/components/ActionDialog"; import { DEFAULT_INITIAL_SEARCH_DATA } from "@dashboard/config"; import { diff --git a/src/navigation/views/MenuDetails/successHandlers.ts b/src/navigation/views/MenuDetails/successHandlers.ts index 5e36aa21e..1906e699b 100644 --- a/src/navigation/views/MenuDetails/successHandlers.ts +++ b/src/navigation/views/MenuDetails/successHandlers.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { MenuDeleteMutation, MenuItemCreateMutation, diff --git a/src/navigation/views/MenuList/MenuList.tsx b/src/navigation/views/MenuList/MenuList.tsx index 002c4c1e2..bf03d5d13 100644 --- a/src/navigation/views/MenuList/MenuList.tsx +++ b/src/navigation/views/MenuList/MenuList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import ActionDialog from "@dashboard/components/ActionDialog"; import { Button } from "@dashboard/components/Button"; import { diff --git a/src/navigation/views/MenuList/sort.ts b/src/navigation/views/MenuList/sort.ts index 58c782982..c3901e0ef 100644 --- a/src/navigation/views/MenuList/sort.ts +++ b/src/navigation/views/MenuList/sort.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { MenuSortField } from "@dashboard/graphql"; import { MenuListUrlSortField } from "@dashboard/navigation/urls"; import { createGetSortQueryVariables } from "@dashboard/utils/sort"; @@ -13,6 +14,5 @@ export function getSortQueryField(sort: MenuListUrlSortField): MenuSortField { } } -export const getSortQueryVariables = createGetSortQueryVariables( - getSortQueryField, -); +export const getSortQueryVariables = + createGetSortQueryVariables(getSortQueryField); diff --git a/src/orders/components/OrderAddTransaction/OrderAddTransaction.test.tsx b/src/orders/components/OrderAddTransaction/OrderAddTransaction.test.tsx index eef0598af..e21a14a17 100644 --- a/src/orders/components/OrderAddTransaction/OrderAddTransaction.test.tsx +++ b/src/orders/components/OrderAddTransaction/OrderAddTransaction.test.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { order } from "@dashboard/orders/fixtures"; import Wrapper from "@test/wrapper"; import { render, screen } from "@testing-library/react"; diff --git a/src/orders/components/OrderAddressFields/OrderAddressFields.tsx b/src/orders/components/OrderAddressFields/OrderAddressFields.tsx index 1430b925d..a626bd31a 100644 --- a/src/orders/components/OrderAddressFields/OrderAddressFields.tsx +++ b/src/orders/components/OrderAddressFields/OrderAddressFields.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ConfirmButtonTransitionState } from "@dashboard/components/ConfirmButton"; import { AddressFragment, diff --git a/src/orders/components/OrderCardTitle/utils.ts b/src/orders/components/OrderCardTitle/utils.ts index e9c26a502..7108b2aac 100644 --- a/src/orders/components/OrderCardTitle/utils.ts +++ b/src/orders/components/OrderCardTitle/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import camelCase from "lodash/camelCase"; import { orderTitleMessages } from "./messages"; diff --git a/src/orders/components/OrderChangeWarehouseDialog/OrderChangeWarehouseDialog.tsx b/src/orders/components/OrderChangeWarehouseDialog/OrderChangeWarehouseDialog.tsx index ead32f316..9c4d92734 100644 --- a/src/orders/components/OrderChangeWarehouseDialog/OrderChangeWarehouseDialog.tsx +++ b/src/orders/components/OrderChangeWarehouseDialog/OrderChangeWarehouseDialog.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import Debounce from "@dashboard/components/Debounce"; import Skeleton from "@dashboard/components/Skeleton"; import TableRowLink from "@dashboard/components/TableRowLink"; diff --git a/src/orders/components/OrderCustomer/OrderCustomer.tsx b/src/orders/components/OrderCustomer/OrderCustomer.tsx index 0de0aa52b..41ab1d586 100644 --- a/src/orders/components/OrderCustomer/OrderCustomer.tsx +++ b/src/orders/components/OrderCustomer/OrderCustomer.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import AddressFormatter from "@dashboard/components/AddressFormatter"; import { Button } from "@dashboard/components/Button"; import CardTitle from "@dashboard/components/CardTitle"; diff --git a/src/orders/components/OrderCustomerAddressesEditDialog/OrderCustomerAddressEdit.tsx b/src/orders/components/OrderCustomerAddressesEditDialog/OrderCustomerAddressEdit.tsx index 12bdd6be5..e36a3a8f3 100644 --- a/src/orders/components/OrderCustomerAddressesEditDialog/OrderCustomerAddressEdit.tsx +++ b/src/orders/components/OrderCustomerAddressesEditDialog/OrderCustomerAddressEdit.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import AddressEdit from "@dashboard/components/AddressEdit"; import CardSpacer from "@dashboard/components/CardSpacer"; import FormSpacer from "@dashboard/components/FormSpacer"; @@ -37,7 +38,9 @@ export interface OrderCustomerAddressEditProps { showCard?: boolean; } -const OrderCustomerAddressEdit: React.FC = props => { +const OrderCustomerAddressEdit: React.FC< + OrderCustomerAddressEditProps +> = props => { const { loading, customerAddresses, diff --git a/src/orders/components/OrderCustomerAddressesEditDialog/OrderCustomerAddressesEditDialog.tsx b/src/orders/components/OrderCustomerAddressesEditDialog/OrderCustomerAddressesEditDialog.tsx index 84d79f903..f13e4f2cb 100644 --- a/src/orders/components/OrderCustomerAddressesEditDialog/OrderCustomerAddressesEditDialog.tsx +++ b/src/orders/components/OrderCustomerAddressesEditDialog/OrderCustomerAddressesEditDialog.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import Checkbox from "@dashboard/components/Checkbox"; import { ConfirmButton, diff --git a/src/orders/components/OrderCustomerAddressesEditDialog/OrderCustomerAddressesSearch.tsx b/src/orders/components/OrderCustomerAddressesEditDialog/OrderCustomerAddressesSearch.tsx index 733fa6886..99721cd5e 100644 --- a/src/orders/components/OrderCustomerAddressesEditDialog/OrderCustomerAddressesSearch.tsx +++ b/src/orders/components/OrderCustomerAddressesEditDialog/OrderCustomerAddressesSearch.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ConfirmButton, ConfirmButtonTransitionState, diff --git a/src/orders/components/OrderCustomerAddressesEditDialog/form.tsx b/src/orders/components/OrderCustomerAddressesEditDialog/form.tsx index 02aa4e2c5..13929f42c 100644 --- a/src/orders/components/OrderCustomerAddressesEditDialog/form.tsx +++ b/src/orders/components/OrderCustomerAddressesEditDialog/form.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useExitFormDialog } from "@dashboard/components/Form/useExitFormDialog"; import { SingleAutocompleteChoiceType } from "@dashboard/components/SingleAutocompleteSelectField"; import { AddressTypeInput } from "@dashboard/customers/types"; @@ -201,12 +202,9 @@ function useOrderCustomerAddressesEditForm( }; } -const OrderCustomerAddressesEditForm: React.FC = ({ - children, - initial, - onSubmit, - ...rest -}) => { +const OrderCustomerAddressesEditForm: React.FC< + OrderCustomerAddressesEditFormProps +> = ({ children, initial, onSubmit, ...rest }) => { const props = useOrderCustomerAddressesEditForm( initial || {}, onSubmit, diff --git a/src/orders/components/OrderCustomerChangeDialog/OrderCustomerChangeDialog.tsx b/src/orders/components/OrderCustomerChangeDialog/OrderCustomerChangeDialog.tsx index 3d6fcdf31..e04bb3bbf 100644 --- a/src/orders/components/OrderCustomerChangeDialog/OrderCustomerChangeDialog.tsx +++ b/src/orders/components/OrderCustomerChangeDialog/OrderCustomerChangeDialog.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ConfirmButton } from "@dashboard/components/ConfirmButton"; import FormSpacer from "@dashboard/components/FormSpacer"; import { buttonMessages } from "@dashboard/intl"; diff --git a/src/orders/components/OrderDetailsDatagrid/OrderDetailsDatagrid.tsx b/src/orders/components/OrderDetailsDatagrid/OrderDetailsDatagrid.tsx index 645d2d0a0..b03936fe8 100644 --- a/src/orders/components/OrderDetailsDatagrid/OrderDetailsDatagrid.tsx +++ b/src/orders/components/OrderDetailsDatagrid/OrderDetailsDatagrid.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import ColumnPicker from "@dashboard/components/ColumnPicker"; import Datagrid from "@dashboard/components/Datagrid/Datagrid"; import { useColumnsDefault } from "@dashboard/components/Datagrid/hooks/useColumnsDefault"; diff --git a/src/orders/components/OrderDetailsDatagrid/datagrid.ts b/src/orders/components/OrderDetailsDatagrid/datagrid.ts index 28769f4ec..1204a0ecc 100644 --- a/src/orders/components/OrderDetailsDatagrid/datagrid.ts +++ b/src/orders/components/OrderDetailsDatagrid/datagrid.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { loadingCell, moneyCell, diff --git a/src/orders/components/OrderDetailsPage/OrderDetailsPage.stories.tsx b/src/orders/components/OrderDetailsPage/OrderDetailsPage.stories.tsx index b3e19c69b..d8d27a589 100644 --- a/src/orders/components/OrderDetailsPage/OrderDetailsPage.stories.tsx +++ b/src/orders/components/OrderDetailsPage/OrderDetailsPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FulfillmentStatus, OrderStatus, diff --git a/src/orders/components/OrderDetailsPage/OrderDetailsPage.tsx b/src/orders/components/OrderDetailsPage/OrderDetailsPage.tsx index 9b47ac4bc..fa3aff956 100644 --- a/src/orders/components/OrderDetailsPage/OrderDetailsPage.tsx +++ b/src/orders/components/OrderDetailsPage/OrderDetailsPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { extensionMountPoints, mapToMenuItemsForOrderDetails, diff --git a/src/orders/components/OrderDetailsPage/OrderDetailsPageTransactions.stories.tsx b/src/orders/components/OrderDetailsPage/OrderDetailsPageTransactions.stories.tsx index 289967251..9ce49bcc9 100644 --- a/src/orders/components/OrderDetailsPage/OrderDetailsPageTransactions.stories.tsx +++ b/src/orders/components/OrderDetailsPage/OrderDetailsPageTransactions.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { GiftCardEventsEnum, OrderDetailsFragment, diff --git a/src/orders/components/OrderDetailsPage/utils.ts b/src/orders/components/OrderDetailsPage/utils.ts index c981d7831..b35ab10ed 100644 --- a/src/orders/components/OrderDetailsPage/utils.ts +++ b/src/orders/components/OrderDetailsPage/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { MetadataIdSchema } from "@dashboard/components/Metadata"; import { OrderDetailsFragment } from "@dashboard/graphql"; import { ChangeEvent } from "@dashboard/hooks/useForm"; diff --git a/src/orders/components/OrderDiscountCommonModal/OrderDiscountCommonModal.tsx b/src/orders/components/OrderDiscountCommonModal/OrderDiscountCommonModal.tsx index 21552a88d..a3090355e 100644 --- a/src/orders/components/OrderDiscountCommonModal/OrderDiscountCommonModal.tsx +++ b/src/orders/components/OrderDiscountCommonModal/OrderDiscountCommonModal.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import DialogButtons from "@dashboard/components/ActionDialog/DialogButtons"; import CardSpacer from "@dashboard/components/CardSpacer"; import { diff --git a/src/orders/components/OrderDraftDetails/OrderDraftDetails.tsx b/src/orders/components/OrderDraftDetails/OrderDraftDetails.tsx index 4f5799f22..155e44602 100644 --- a/src/orders/components/OrderDraftDetails/OrderDraftDetails.tsx +++ b/src/orders/components/OrderDraftDetails/OrderDraftDetails.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Button } from "@dashboard/components/Button"; import CardTitle from "@dashboard/components/CardTitle"; import { diff --git a/src/orders/components/OrderDraftDetailsDatagrid/OrderDraftDetailsDatagrid.tsx b/src/orders/components/OrderDraftDetailsDatagrid/OrderDraftDetailsDatagrid.tsx index 699b2dfc8..cdfd9fde6 100644 --- a/src/orders/components/OrderDraftDetailsDatagrid/OrderDraftDetailsDatagrid.tsx +++ b/src/orders/components/OrderDraftDetailsDatagrid/OrderDraftDetailsDatagrid.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import ColumnPicker from "@dashboard/components/ColumnPicker"; import Datagrid from "@dashboard/components/Datagrid/Datagrid"; import { useColumnsDefault } from "@dashboard/components/Datagrid/hooks/useColumnsDefault"; diff --git a/src/orders/components/OrderDraftDetailsDatagrid/datagrid.ts b/src/orders/components/OrderDraftDetailsDatagrid/datagrid.ts index d8e260b7e..766d78d09 100644 --- a/src/orders/components/OrderDraftDetailsDatagrid/datagrid.ts +++ b/src/orders/components/OrderDraftDetailsDatagrid/datagrid.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { moneyCell, moneyDiscountedCell, diff --git a/src/orders/components/OrderDraftDetailsSummary/OrderDraftDetailsSummary.tsx b/src/orders/components/OrderDraftDetailsSummary/OrderDraftDetailsSummary.tsx index 4d76fe542..522740b19 100644 --- a/src/orders/components/OrderDraftDetailsSummary/OrderDraftDetailsSummary.tsx +++ b/src/orders/components/OrderDraftDetailsSummary/OrderDraftDetailsSummary.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import HorizontalSpacer from "@dashboard/components/HorizontalSpacer"; import Link from "@dashboard/components/Link"; import Money from "@dashboard/components/Money"; diff --git a/src/orders/components/OrderDraftList/OrderDraftList.tsx b/src/orders/components/OrderDraftList/OrderDraftList.tsx index 491a606cb..e2a765978 100644 --- a/src/orders/components/OrderDraftList/OrderDraftList.tsx +++ b/src/orders/components/OrderDraftList/OrderDraftList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import Checkbox from "@dashboard/components/Checkbox"; import { DateTime } from "@dashboard/components/Date"; import Money from "@dashboard/components/Money"; diff --git a/src/orders/components/OrderDraftListPage/OrderDraftListPage.stories.tsx b/src/orders/components/OrderDraftListPage/OrderDraftListPage.stories.tsx index 83b0b789c..ab1828ec3 100644 --- a/src/orders/components/OrderDraftListPage/OrderDraftListPage.stories.tsx +++ b/src/orders/components/OrderDraftListPage/OrderDraftListPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { filterPageProps, limits, diff --git a/src/orders/components/OrderDraftListPage/OrderDraftListPage.tsx b/src/orders/components/OrderDraftListPage/OrderDraftListPage.tsx index 93474f168..33c41cdd6 100644 --- a/src/orders/components/OrderDraftListPage/OrderDraftListPage.tsx +++ b/src/orders/components/OrderDraftListPage/OrderDraftListPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { LimitsInfo } from "@dashboard/components/AppLayout/LimitsInfo"; import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import { Button } from "@dashboard/components/Button"; diff --git a/src/orders/components/OrderDraftPage/OrderDraftAlert.tsx b/src/orders/components/OrderDraftPage/OrderDraftAlert.tsx index 0b6fbc068..4f347bcb2 100644 --- a/src/orders/components/OrderDraftPage/OrderDraftAlert.tsx +++ b/src/orders/components/OrderDraftPage/OrderDraftAlert.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ChannelUsabilityDataQuery, OrderDetailsFragment, diff --git a/src/orders/components/OrderDraftPage/OrderDraftPage.stories.tsx b/src/orders/components/OrderDraftPage/OrderDraftPage.stories.tsx index ba31f72e2..ed8ce17ad 100644 --- a/src/orders/components/OrderDraftPage/OrderDraftPage.stories.tsx +++ b/src/orders/components/OrderDraftPage/OrderDraftPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import placeholderImage from "@assets/images/placeholder60x60.png"; import { fetchMoreProps } from "@dashboard/fixtures"; import { OrderErrorCode, OrderErrorFragment } from "@dashboard/graphql"; diff --git a/src/orders/components/OrderDraftPage/OrderDraftPage.tsx b/src/orders/components/OrderDraftPage/OrderDraftPage.tsx index 9d073f7d3..9947cc494 100644 --- a/src/orders/components/OrderDraftPage/OrderDraftPage.tsx +++ b/src/orders/components/OrderDraftPage/OrderDraftPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import CardMenu from "@dashboard/components/CardMenu"; import CardSpacer from "@dashboard/components/CardSpacer"; diff --git a/src/orders/components/OrderDraftPage/storybook.utils.tsx b/src/orders/components/OrderDraftPage/storybook.utils.tsx index 7da9fd4ac..4247e4385 100644 --- a/src/orders/components/OrderDraftPage/storybook.utils.tsx +++ b/src/orders/components/OrderDraftPage/storybook.utils.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore /* eslint-disable @typescript-eslint/no-empty-function */ import { OrderDetailsQuery } from "@dashboard/graphql"; import { @@ -20,16 +21,17 @@ export const getDiscountsProvidersWrapper = ( }; const MockOrderDiscountProvider = ({ children }) => { - const mockedOrderDiscountProviderValues: OrderDiscountContextConsumerProps = { - ...mockedCommonDiscountProviderValues, - orderDiscountAddStatus: "default", - orderDiscountRemoveStatus: "default", - orderDiscount: null, - addOrderDiscount: () => {}, - removeOrderDiscount: () => {}, - discountedPrice: order.total.gross, - undiscountedPrice: order.undiscountedTotal.gross, - }; + const mockedOrderDiscountProviderValues: OrderDiscountContextConsumerProps = + { + ...mockedCommonDiscountProviderValues, + orderDiscountAddStatus: "default", + orderDiscountRemoveStatus: "default", + orderDiscount: null, + addOrderDiscount: () => {}, + removeOrderDiscount: () => {}, + discountedPrice: order.total.gross, + undiscountedPrice: order.undiscountedTotal.gross, + }; return ( @@ -39,17 +41,18 @@ export const getDiscountsProvidersWrapper = ( }; const MockOrderLineDiscountProvider = ({ children }) => { - const mockedOrderDiscountProviderValues = (): OrderLineDiscountContextConsumerProps => ({ - ...mockedCommonDiscountProviderValues, - addOrderLineDiscount: () => {}, - removeOrderLineDiscount: () => {}, - orderLineDiscount: null, - orderLineDiscountUpdateStatus: "default", - orderLineDiscountRemoveStatus: "default", - totalDiscountedPrice: order.lines[0].totalPrice.gross, - unitUndiscountedPrice: order.lines[0].undiscountedUnitPrice.gross, - unitDiscountedPrice: order.lines[0].unitPrice.gross, - }); + const mockedOrderDiscountProviderValues = + (): OrderLineDiscountContextConsumerProps => ({ + ...mockedCommonDiscountProviderValues, + addOrderLineDiscount: () => {}, + removeOrderLineDiscount: () => {}, + orderLineDiscount: null, + orderLineDiscountUpdateStatus: "default", + orderLineDiscountRemoveStatus: "default", + totalDiscountedPrice: order.lines[0].totalPrice.gross, + unitUndiscountedPrice: order.lines[0].undiscountedUnitPrice.gross, + unitDiscountedPrice: order.lines[0].unitPrice.gross, + }); return ( = props => { +const OrderFulfillStockExceededDialogLine: React.FC< + OrderFulfillStockExceededDialogLineProps +> = props => { const { line: genericLine, warehouseId, formsetData } = props; const classes = useStyles(props); diff --git a/src/orders/components/OrderFulfilledProductsCard/ActionButtons.tsx b/src/orders/components/OrderFulfilledProductsCard/ActionButtons.tsx index 9c93fb3b1..366b1b292 100644 --- a/src/orders/components/OrderFulfilledProductsCard/ActionButtons.tsx +++ b/src/orders/components/OrderFulfilledProductsCard/ActionButtons.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Button } from "@dashboard/components/Button"; import { FulfillmentStatus } from "@dashboard/graphql"; import { buttonMessages, commonMessages } from "@dashboard/intl"; diff --git a/src/orders/components/OrderFulfilledProductsCard/OrderFulfilledProductsCard.tsx b/src/orders/components/OrderFulfilledProductsCard/OrderFulfilledProductsCard.tsx index 646291e1c..64995251a 100644 --- a/src/orders/components/OrderFulfilledProductsCard/OrderFulfilledProductsCard.tsx +++ b/src/orders/components/OrderFulfilledProductsCard/OrderFulfilledProductsCard.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FulfillmentStatus, OrderDetailsFragment } from "@dashboard/graphql"; import TrashIcon from "@dashboard/icons/Trash"; import { orderHasTransactions } from "@dashboard/orders/types"; diff --git a/src/orders/components/OrderFulfillmentCancelDialog/OrderFulfillmentCancelDialog.tsx b/src/orders/components/OrderFulfillmentCancelDialog/OrderFulfillmentCancelDialog.tsx index 03661af60..3eb4c6b6c 100644 --- a/src/orders/components/OrderFulfillmentCancelDialog/OrderFulfillmentCancelDialog.tsx +++ b/src/orders/components/OrderFulfillmentCancelDialog/OrderFulfillmentCancelDialog.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import BackButton from "@dashboard/components/BackButton"; import { ConfirmButton, diff --git a/src/orders/components/OrderFulfillmentTrackingDialog/OrderFulfillmentTrackingDialog.tsx b/src/orders/components/OrderFulfillmentTrackingDialog/OrderFulfillmentTrackingDialog.tsx index 176830b2c..a6829df0a 100644 --- a/src/orders/components/OrderFulfillmentTrackingDialog/OrderFulfillmentTrackingDialog.tsx +++ b/src/orders/components/OrderFulfillmentTrackingDialog/OrderFulfillmentTrackingDialog.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import BackButton from "@dashboard/components/BackButton"; import { ConfirmButton, diff --git a/src/orders/components/OrderGrantRefundPage/OrderGrantRefundPage.stories.tsx b/src/orders/components/OrderGrantRefundPage/OrderGrantRefundPage.stories.tsx index 824b1f848..ed26745e0 100644 --- a/src/orders/components/OrderGrantRefundPage/OrderGrantRefundPage.stories.tsx +++ b/src/orders/components/OrderGrantRefundPage/OrderGrantRefundPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import placeholderImage from "@assets/images/placeholder60x60.png"; import { FulfillmentStatus } from "@dashboard/graphql"; import React from "react"; diff --git a/src/orders/components/OrderGrantRefundPage/OrderGrantRefundPage.tsx b/src/orders/components/OrderGrantRefundPage/OrderGrantRefundPage.tsx index 7bff30638..171dea62e 100644 --- a/src/orders/components/OrderGrantRefundPage/OrderGrantRefundPage.tsx +++ b/src/orders/components/OrderGrantRefundPage/OrderGrantRefundPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import CardSpacer from "@dashboard/components/CardSpacer"; import { ConfirmButtonTransitionState } from "@dashboard/components/ConfirmButton"; diff --git a/src/orders/components/OrderGrantRefundPage/components/ProductCard.tsx b/src/orders/components/OrderGrantRefundPage/components/ProductCard.tsx index 1de180324..19babbcf8 100644 --- a/src/orders/components/OrderGrantRefundPage/components/ProductCard.tsx +++ b/src/orders/components/OrderGrantRefundPage/components/ProductCard.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Button } from "@dashboard/components/Button"; import CardTitle from "@dashboard/components/CardTitle"; import TableCellAvatar from "@dashboard/components/TableCellAvatar"; diff --git a/src/orders/components/OrderGrantRefundPage/reducer.ts b/src/orders/components/OrderGrantRefundPage/reducer.ts index 9e5598784..82bf28354 100644 --- a/src/orders/components/OrderGrantRefundPage/reducer.ts +++ b/src/orders/components/OrderGrantRefundPage/reducer.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { OrderDetailsGrantRefundFragment } from "@dashboard/graphql"; import { exhaustiveCheck } from "@dashboard/utils/ts"; diff --git a/src/orders/components/OrderGrantedRefunds/OrderGrantedRefunds.tsx b/src/orders/components/OrderGrantedRefunds/OrderGrantedRefunds.tsx index 8bc70ef96..d476e051f 100644 --- a/src/orders/components/OrderGrantedRefunds/OrderGrantedRefunds.tsx +++ b/src/orders/components/OrderGrantedRefunds/OrderGrantedRefunds.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Button } from "@dashboard/components/Button"; import CardTitle from "@dashboard/components/CardTitle"; import EventTime from "@dashboard/components/EventTime"; diff --git a/src/orders/components/OrderHistory/ExtendedDiscountTimelineEvent/ExtendedDiscountTimelineEvent.tsx b/src/orders/components/OrderHistory/ExtendedDiscountTimelineEvent/ExtendedDiscountTimelineEvent.tsx index 6c0a6c52e..b0668490d 100644 --- a/src/orders/components/OrderHistory/ExtendedDiscountTimelineEvent/ExtendedDiscountTimelineEvent.tsx +++ b/src/orders/components/OrderHistory/ExtendedDiscountTimelineEvent/ExtendedDiscountTimelineEvent.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import CardSpacer from "@dashboard/components/CardSpacer"; import HorizontalSpacer from "@dashboard/components/HorizontalSpacer"; import { TimelineEvent } from "@dashboard/components/Timeline"; diff --git a/src/orders/components/OrderHistory/ExtendedDiscountTimelineEvent/MoneySection.tsx b/src/orders/components/OrderHistory/ExtendedDiscountTimelineEvent/MoneySection.tsx index 019df69dd..7ad12d551 100644 --- a/src/orders/components/OrderHistory/ExtendedDiscountTimelineEvent/MoneySection.tsx +++ b/src/orders/components/OrderHistory/ExtendedDiscountTimelineEvent/MoneySection.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import HorizontalSpacer from "@dashboard/components/HorizontalSpacer"; import { DiscountValueTypeEnum, MoneyFragment } from "@dashboard/graphql"; import { Typography } from "@material-ui/core"; diff --git a/src/orders/components/OrderHistory/ExtendedTimelineEvent.tsx b/src/orders/components/OrderHistory/ExtendedTimelineEvent.tsx index 89fe174da..17ecb8ad2 100644 --- a/src/orders/components/OrderHistory/ExtendedTimelineEvent.tsx +++ b/src/orders/components/OrderHistory/ExtendedTimelineEvent.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import Money from "@dashboard/components/Money"; import { TimelineEvent } from "@dashboard/components/Timeline"; import { OrderEventFragment, OrderEventsEnum } from "@dashboard/graphql"; diff --git a/src/orders/components/OrderHistory/LinkedTimelineEvent.tsx b/src/orders/components/OrderHistory/LinkedTimelineEvent.tsx index ff5671d4f..3114b24c6 100644 --- a/src/orders/components/OrderHistory/LinkedTimelineEvent.tsx +++ b/src/orders/components/OrderHistory/LinkedTimelineEvent.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TimelineEvent } from "@dashboard/components/Timeline"; import { TitleElement } from "@dashboard/components/Timeline/TimelineEventHeader"; import { OrderEventFragment, OrderEventsEnum } from "@dashboard/graphql"; diff --git a/src/orders/components/OrderHistory/OrderHistory.tsx b/src/orders/components/OrderHistory/OrderHistory.tsx index 4bc86a27b..0141d73f0 100644 --- a/src/orders/components/OrderHistory/OrderHistory.tsx +++ b/src/orders/components/OrderHistory/OrderHistory.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import Form from "@dashboard/components/Form"; import Hr from "@dashboard/components/Hr"; import Skeleton from "@dashboard/components/Skeleton"; diff --git a/src/orders/components/OrderHistory/messages.ts b/src/orders/components/OrderHistory/messages.ts index a32c9388b..d2f68fc37 100644 --- a/src/orders/components/OrderHistory/messages.ts +++ b/src/orders/components/OrderHistory/messages.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { OrderEventFragment, OrderEventsEmailsEnum, diff --git a/src/orders/components/OrderHistory/utils.tsx b/src/orders/components/OrderHistory/utils.tsx index 1fdda1d87..200bf062f 100644 --- a/src/orders/components/OrderHistory/utils.tsx +++ b/src/orders/components/OrderHistory/utils.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { OrderEventFragment, OrderEventsEnum } from "@dashboard/graphql"; import { getFullName } from "@dashboard/misc"; import { orderUrl } from "@dashboard/orders/urls"; diff --git a/src/orders/components/OrderInvoiceList/OrderInvoiceList.tsx b/src/orders/components/OrderInvoiceList/OrderInvoiceList.tsx index 47941762a..1c98cd215 100644 --- a/src/orders/components/OrderInvoiceList/OrderInvoiceList.tsx +++ b/src/orders/components/OrderInvoiceList/OrderInvoiceList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Button } from "@dashboard/components/Button"; import CardTitle from "@dashboard/components/CardTitle"; import Date from "@dashboard/components/Date"; diff --git a/src/orders/components/OrderList/OrderList.tsx b/src/orders/components/OrderList/OrderList.tsx index 4d657a330..d782c18c3 100644 --- a/src/orders/components/OrderList/OrderList.tsx +++ b/src/orders/components/OrderList/OrderList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { DateTime } from "@dashboard/components/Date"; import Money from "@dashboard/components/Money"; import { Pill } from "@dashboard/components/Pill"; diff --git a/src/orders/components/OrderListDatagrid/OrderListDatagrid.tsx b/src/orders/components/OrderListDatagrid/OrderListDatagrid.tsx index f1836769a..b59c9a2a2 100644 --- a/src/orders/components/OrderListDatagrid/OrderListDatagrid.tsx +++ b/src/orders/components/OrderListDatagrid/OrderListDatagrid.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import ColumnPicker from "@dashboard/components/ColumnPicker"; import Datagrid from "@dashboard/components/Datagrid/Datagrid"; import { useColumnsDefault } from "@dashboard/components/Datagrid/hooks/useColumnsDefault"; diff --git a/src/orders/components/OrderListDatagrid/datagrid.ts b/src/orders/components/OrderListDatagrid/datagrid.ts index c5bd49daf..b9b879002 100644 --- a/src/orders/components/OrderListDatagrid/datagrid.ts +++ b/src/orders/components/OrderListDatagrid/datagrid.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { moneyCell, readonlyTextCell, diff --git a/src/orders/components/OrderListDatagrid/uitls.test.ts b/src/orders/components/OrderListDatagrid/uitls.test.ts index ae08d997a..ced41ad4c 100644 --- a/src/orders/components/OrderListDatagrid/uitls.test.ts +++ b/src/orders/components/OrderListDatagrid/uitls.test.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { OrderListQuery } from "@dashboard/graphql"; import { OrderListUrlSortField } from "@dashboard/orders/urls"; import { RelayToFlat } from "@dashboard/types"; diff --git a/src/orders/components/OrderListDatagrid/utils.ts b/src/orders/components/OrderListDatagrid/utils.ts index 3f34fc54e..da60e6665 100644 --- a/src/orders/components/OrderListDatagrid/utils.ts +++ b/src/orders/components/OrderListDatagrid/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { OrderListQuery } from "@dashboard/graphql"; import { OrderListUrlSortField } from "@dashboard/orders/urls"; import { RelayToFlat } from "@dashboard/types"; diff --git a/src/orders/components/OrderListPage/OrderListPage.stories.tsx b/src/orders/components/OrderListPage/OrderListPage.stories.tsx index 85e43dd85..271bec5e4 100644 --- a/src/orders/components/OrderListPage/OrderListPage.stories.tsx +++ b/src/orders/components/OrderListPage/OrderListPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { filterPageProps, limits, diff --git a/src/orders/components/OrderListPage/OrderListPage.tsx b/src/orders/components/OrderListPage/OrderListPage.tsx index 0c920bcd1..a9faf8194 100644 --- a/src/orders/components/OrderListPage/OrderListPage.tsx +++ b/src/orders/components/OrderListPage/OrderListPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { extensionMountPoints, mapToMenuItems, diff --git a/src/orders/components/OrderManualTransactionDialog/OrderManualTransactionDialog.tsx b/src/orders/components/OrderManualTransactionDialog/OrderManualTransactionDialog.tsx index a85200222..6a2004de3 100644 --- a/src/orders/components/OrderManualTransactionDialog/OrderManualTransactionDialog.tsx +++ b/src/orders/components/OrderManualTransactionDialog/OrderManualTransactionDialog.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import BackButton from "@dashboard/components/BackButton"; import { commonMessages } from "@dashboard/intl"; import { DialogProps } from "@dashboard/types"; diff --git a/src/orders/components/OrderManualTransactionForm/components/DescriptionField.tsx b/src/orders/components/OrderManualTransactionForm/components/DescriptionField.tsx index ced112504..64871d1b3 100644 --- a/src/orders/components/OrderManualTransactionForm/components/DescriptionField.tsx +++ b/src/orders/components/OrderManualTransactionForm/components/DescriptionField.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TextField, TextFieldProps } from "@material-ui/core"; import React from "react"; diff --git a/src/orders/components/OrderManualTransactionForm/components/ErrorText.tsx b/src/orders/components/OrderManualTransactionForm/components/ErrorText.tsx index 7d8a466c3..9a6732840 100644 --- a/src/orders/components/OrderManualTransactionForm/components/ErrorText.tsx +++ b/src/orders/components/OrderManualTransactionForm/components/ErrorText.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Typography, TypographyProps } from "@material-ui/core"; import React from "react"; diff --git a/src/orders/components/OrderManualTransactionForm/components/Form.test.tsx b/src/orders/components/OrderManualTransactionForm/components/Form.test.tsx index 34bbfd904..06c5fa9a8 100644 --- a/src/orders/components/OrderManualTransactionForm/components/Form.test.tsx +++ b/src/orders/components/OrderManualTransactionForm/components/Form.test.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { fireEvent, render } from "@testing-library/react"; import React from "react"; diff --git a/src/orders/components/OrderManualTransactionForm/components/Form.tsx b/src/orders/components/OrderManualTransactionForm/components/Form.tsx index fbc65b8ab..e95129565 100644 --- a/src/orders/components/OrderManualTransactionForm/components/Form.tsx +++ b/src/orders/components/OrderManualTransactionForm/components/Form.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import React from "react"; import { useManualTransactionContext } from "../context"; diff --git a/src/orders/components/OrderManualTransactionForm/components/PriceInputField.tsx b/src/orders/components/OrderManualTransactionForm/components/PriceInputField.tsx index c62734244..9140f49d3 100644 --- a/src/orders/components/OrderManualTransactionForm/components/PriceInputField.tsx +++ b/src/orders/components/OrderManualTransactionForm/components/PriceInputField.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import PriceField, { PriceFieldProps } from "@dashboard/components/PriceField"; import React from "react"; diff --git a/src/orders/components/OrderManualTransactionForm/components/PspReferenceField.tsx b/src/orders/components/OrderManualTransactionForm/components/PspReferenceField.tsx index ea20df5d2..ccf20150e 100644 --- a/src/orders/components/OrderManualTransactionForm/components/PspReferenceField.tsx +++ b/src/orders/components/OrderManualTransactionForm/components/PspReferenceField.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TextField, TextFieldProps } from "@material-ui/core"; import React from "react"; diff --git a/src/orders/components/OrderManualTransactionForm/components/SubmitButton.tsx b/src/orders/components/OrderManualTransactionForm/components/SubmitButton.tsx index 3b434d3f7..7cc43583c 100644 --- a/src/orders/components/OrderManualTransactionForm/components/SubmitButton.tsx +++ b/src/orders/components/OrderManualTransactionForm/components/SubmitButton.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ConfirmButton, ConfirmButtonProps, diff --git a/src/orders/components/OrderPayment/utils.ts b/src/orders/components/OrderPayment/utils.ts index 1670da3c3..51eb24f80 100644 --- a/src/orders/components/OrderPayment/utils.ts +++ b/src/orders/components/OrderPayment/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { subtractMoney } from "@dashboard/components/Money"; import { GiftCardEventsEnum, diff --git a/src/orders/components/OrderPaymentDialog/OrderPaymentDialog.tsx b/src/orders/components/OrderPaymentDialog/OrderPaymentDialog.tsx index 3d7deaa5a..bad707fe7 100644 --- a/src/orders/components/OrderPaymentDialog/OrderPaymentDialog.tsx +++ b/src/orders/components/OrderPaymentDialog/OrderPaymentDialog.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import BackButton from "@dashboard/components/BackButton"; import { ConfirmButton, diff --git a/src/orders/components/OrderPaymentOrTransaction/OrderPaymentOrTransaction.test.tsx b/src/orders/components/OrderPaymentOrTransaction/OrderPaymentOrTransaction.test.tsx index 9318ff0dd..45ebb2ac8 100644 --- a/src/orders/components/OrderPaymentOrTransaction/OrderPaymentOrTransaction.test.tsx +++ b/src/orders/components/OrderPaymentOrTransaction/OrderPaymentOrTransaction.test.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { MarkAsPaidStrategyEnum } from "@dashboard/graphql"; import { order as orderFixture, diff --git a/src/orders/components/OrderPaymentOrTransaction/OrderPaymentOrTransaction.tsx b/src/orders/components/OrderPaymentOrTransaction/OrderPaymentOrTransaction.tsx index 76fec2a7a..fe98bbccd 100644 --- a/src/orders/components/OrderPaymentOrTransaction/OrderPaymentOrTransaction.tsx +++ b/src/orders/components/OrderPaymentOrTransaction/OrderPaymentOrTransaction.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import CardSpacer from "@dashboard/components/CardSpacer"; import { OrderDetailsFragment, diff --git a/src/orders/components/OrderPaymentOrTransaction/OrderTransactionsWrapper.tsx b/src/orders/components/OrderPaymentOrTransaction/OrderTransactionsWrapper.tsx index e0d92045a..28361ca28 100644 --- a/src/orders/components/OrderPaymentOrTransaction/OrderTransactionsWrapper.tsx +++ b/src/orders/components/OrderPaymentOrTransaction/OrderTransactionsWrapper.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import CardSpacer from "@dashboard/components/CardSpacer"; import { OrderDetailsFragment, diff --git a/src/orders/components/OrderPaymentOrTransaction/utils.test.ts b/src/orders/components/OrderPaymentOrTransaction/utils.test.ts index fae725bb4..eea6fb1a2 100644 --- a/src/orders/components/OrderPaymentOrTransaction/utils.test.ts +++ b/src/orders/components/OrderPaymentOrTransaction/utils.test.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { order as orderFixture, payments } from "@dashboard/orders/fixtures"; import { getFilteredPayments } from "./utils"; diff --git a/src/orders/components/OrderPaymentOrTransaction/utils.ts b/src/orders/components/OrderPaymentOrTransaction/utils.ts index 633ba5039..7a44e9165 100644 --- a/src/orders/components/OrderPaymentOrTransaction/utils.ts +++ b/src/orders/components/OrderPaymentOrTransaction/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { OrderDetailsFragment } from "@dashboard/graphql"; /** Returns paymetns from order that were used to pay for the order */ diff --git a/src/orders/components/OrderPaymentSummaryCard/OrderPaymentSummaryCard.tsx b/src/orders/components/OrderPaymentSummaryCard/OrderPaymentSummaryCard.tsx index 93bed411a..84c89e454 100644 --- a/src/orders/components/OrderPaymentSummaryCard/OrderPaymentSummaryCard.tsx +++ b/src/orders/components/OrderPaymentSummaryCard/OrderPaymentSummaryCard.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Button } from "@dashboard/components/Button"; import CardTitle from "@dashboard/components/CardTitle"; import { Pill } from "@dashboard/components/Pill"; diff --git a/src/orders/components/OrderPaymentSummaryCard/components/PaymentsSummary/utils.test.ts b/src/orders/components/OrderPaymentSummaryCard/components/PaymentsSummary/utils.test.ts index 5398f3d76..33bcd8de8 100644 --- a/src/orders/components/OrderPaymentSummaryCard/components/PaymentsSummary/utils.test.ts +++ b/src/orders/components/OrderPaymentSummaryCard/components/PaymentsSummary/utils.test.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { order as orderFixture, prepareMoney, diff --git a/src/orders/components/OrderPaymentVoidDialog/OrderPaymentVoidDialog.tsx b/src/orders/components/OrderPaymentVoidDialog/OrderPaymentVoidDialog.tsx index 2292faf5f..dc36a37c9 100644 --- a/src/orders/components/OrderPaymentVoidDialog/OrderPaymentVoidDialog.tsx +++ b/src/orders/components/OrderPaymentVoidDialog/OrderPaymentVoidDialog.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import BackButton from "@dashboard/components/BackButton"; import { ConfirmButton, diff --git a/src/orders/components/OrderPriceLabel/OrderPriceLabel.tsx b/src/orders/components/OrderPriceLabel/OrderPriceLabel.tsx index e04b65391..4d32345d5 100644 --- a/src/orders/components/OrderPriceLabel/OrderPriceLabel.tsx +++ b/src/orders/components/OrderPriceLabel/OrderPriceLabel.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import DiscountedPrice from "@dashboard/components/DiscountedPrice/DiscountedPrice"; import Money from "@dashboard/components/Money"; import { SearchOrderVariantQuery } from "@dashboard/graphql"; diff --git a/src/orders/components/OrderProductAddDialog/OrderProductAddDialog.tsx b/src/orders/components/OrderProductAddDialog/OrderProductAddDialog.tsx index 69f2b3da7..6023a13c3 100644 --- a/src/orders/components/OrderProductAddDialog/OrderProductAddDialog.tsx +++ b/src/orders/components/OrderProductAddDialog/OrderProductAddDialog.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import BackButton from "@dashboard/components/BackButton"; import Checkbox from "@dashboard/components/Checkbox"; import { diff --git a/src/orders/components/OrderProductAddDialog/utils.ts b/src/orders/components/OrderProductAddDialog/utils.ts index 5a4e2defe..90c5f3a1a 100644 --- a/src/orders/components/OrderProductAddDialog/utils.ts +++ b/src/orders/components/OrderProductAddDialog/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { SearchOrderVariantQuery } from "@dashboard/graphql"; type SetVariantsAction = ( diff --git a/src/orders/components/OrderProductsCardElements/OrderProductsTableRow.tsx b/src/orders/components/OrderProductsCardElements/OrderProductsTableRow.tsx index 13748b243..74a900656 100644 --- a/src/orders/components/OrderProductsCardElements/OrderProductsTableRow.tsx +++ b/src/orders/components/OrderProductsCardElements/OrderProductsTableRow.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import Money from "@dashboard/components/Money"; import Skeleton from "@dashboard/components/Skeleton"; import TableCellAvatar from "@dashboard/components/TableCellAvatar"; diff --git a/src/orders/components/OrderRefundFulfilledProducts/OrderRefundFulfilledProducts.tsx b/src/orders/components/OrderRefundFulfilledProducts/OrderRefundFulfilledProducts.tsx index f8db38117..5614c8814 100644 --- a/src/orders/components/OrderRefundFulfilledProducts/OrderRefundFulfilledProducts.tsx +++ b/src/orders/components/OrderRefundFulfilledProducts/OrderRefundFulfilledProducts.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Button } from "@dashboard/components/Button"; import CardTitle from "@dashboard/components/CardTitle"; import Money from "@dashboard/components/Money"; diff --git a/src/orders/components/OrderRefundPage/OrderRefundPage.stories.tsx b/src/orders/components/OrderRefundPage/OrderRefundPage.stories.tsx index 48a0d165c..b0b821649 100644 --- a/src/orders/components/OrderRefundPage/OrderRefundPage.stories.tsx +++ b/src/orders/components/OrderRefundPage/OrderRefundPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import placeholderImage from "@assets/images/placeholder60x60.png"; import React from "react"; diff --git a/src/orders/components/OrderRefundPage/OrderRefundPage.tsx b/src/orders/components/OrderRefundPage/OrderRefundPage.tsx index c183ee696..2db4311c7 100644 --- a/src/orders/components/OrderRefundPage/OrderRefundPage.tsx +++ b/src/orders/components/OrderRefundPage/OrderRefundPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import CardSpacer from "@dashboard/components/CardSpacer"; import { DetailPageLayout } from "@dashboard/components/Layouts"; diff --git a/src/orders/components/OrderRefundPage/form.tsx b/src/orders/components/OrderRefundPage/form.tsx index 6b5bb42fa..be78ed35b 100644 --- a/src/orders/components/OrderRefundPage/form.tsx +++ b/src/orders/components/OrderRefundPage/form.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useExitFormDialog } from "@dashboard/components/Form/useExitFormDialog"; import { OrderRefundDataQuery } from "@dashboard/graphql"; import useForm, { diff --git a/src/orders/components/OrderRefundReturnAmount/OrderRefundReturnAmount.tsx b/src/orders/components/OrderRefundReturnAmount/OrderRefundReturnAmount.tsx index fe28c5633..f9ed6463f 100644 --- a/src/orders/components/OrderRefundReturnAmount/OrderRefundReturnAmount.tsx +++ b/src/orders/components/OrderRefundReturnAmount/OrderRefundReturnAmount.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Button } from "@dashboard/components/Button"; import CardSpacer from "@dashboard/components/CardSpacer"; import CardTitle from "@dashboard/components/CardTitle"; diff --git a/src/orders/components/OrderRefundReturnAmount/OrderRefundReturnAmountValues.tsx b/src/orders/components/OrderRefundReturnAmount/OrderRefundReturnAmountValues.tsx index f46a10d57..4905933d8 100644 --- a/src/orders/components/OrderRefundReturnAmount/OrderRefundReturnAmountValues.tsx +++ b/src/orders/components/OrderRefundReturnAmount/OrderRefundReturnAmountValues.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import Money from "@dashboard/components/Money"; import Skeleton from "@dashboard/components/Skeleton"; import { IMoney } from "@dashboard/utils/intl"; diff --git a/src/orders/components/OrderRefundReturnAmount/RefundAmountInput.tsx b/src/orders/components/OrderRefundReturnAmount/RefundAmountInput.tsx index 52b67cb15..59ef0c8c9 100644 --- a/src/orders/components/OrderRefundReturnAmount/RefundAmountInput.tsx +++ b/src/orders/components/OrderRefundReturnAmount/RefundAmountInput.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import PriceField from "@dashboard/components/PriceField"; import { OrderErrorFragment } from "@dashboard/graphql"; import { getFormErrors } from "@dashboard/utils/errors"; diff --git a/src/orders/components/OrderRefundReturnAmount/utils.ts b/src/orders/components/OrderRefundReturnAmount/utils.ts index 66c1dedaf..636a0757d 100644 --- a/src/orders/components/OrderRefundReturnAmount/utils.ts +++ b/src/orders/components/OrderRefundReturnAmount/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { OrderDetailsFragment } from "@dashboard/graphql"; import { FormsetData } from "@dashboard/hooks/useFormset"; import { OrderRefundSharedType } from "@dashboard/orders/types"; diff --git a/src/orders/components/OrderRefundUnfulfilledProducts/OrderRefundUnfulfilledProducts.tsx b/src/orders/components/OrderRefundUnfulfilledProducts/OrderRefundUnfulfilledProducts.tsx index e19bd2026..512b8681b 100644 --- a/src/orders/components/OrderRefundUnfulfilledProducts/OrderRefundUnfulfilledProducts.tsx +++ b/src/orders/components/OrderRefundUnfulfilledProducts/OrderRefundUnfulfilledProducts.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Button } from "@dashboard/components/Button"; import CardTitle from "@dashboard/components/CardTitle"; import Money from "@dashboard/components/Money"; diff --git a/src/orders/components/OrderReturnPage/OrderReturnPage.tsx b/src/orders/components/OrderReturnPage/OrderReturnPage.tsx index e552fe767..572319c58 100644 --- a/src/orders/components/OrderReturnPage/OrderReturnPage.tsx +++ b/src/orders/components/OrderReturnPage/OrderReturnPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import CardSpacer from "@dashboard/components/CardSpacer"; import { ConfirmButtonTransitionState } from "@dashboard/components/ConfirmButton"; diff --git a/src/orders/components/OrderReturnPage/OrderReturnRefundItemsCard/ReturnItemsCard.tsx b/src/orders/components/OrderReturnPage/OrderReturnRefundItemsCard/ReturnItemsCard.tsx index 068477c1b..b70a57537 100644 --- a/src/orders/components/OrderReturnPage/OrderReturnRefundItemsCard/ReturnItemsCard.tsx +++ b/src/orders/components/OrderReturnPage/OrderReturnRefundItemsCard/ReturnItemsCard.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import Money from "@dashboard/components/Money"; import Skeleton from "@dashboard/components/Skeleton"; import TableCellAvatar from "@dashboard/components/TableCellAvatar"; diff --git a/src/orders/components/OrderReturnPage/components/ItemsCard/ItemsCard.tsx b/src/orders/components/OrderReturnPage/components/ItemsCard/ItemsCard.tsx index 71c6fb8c1..e5a96e0ff 100644 --- a/src/orders/components/OrderReturnPage/components/ItemsCard/ItemsCard.tsx +++ b/src/orders/components/OrderReturnPage/components/ItemsCard/ItemsCard.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import Money from "@dashboard/components/Money"; import Skeleton from "@dashboard/components/Skeleton"; import TableCellAvatar from "@dashboard/components/TableCellAvatar"; diff --git a/src/orders/components/OrderReturnPage/form.tsx b/src/orders/components/OrderReturnPage/form.tsx index 370f6c5b7..7498954e5 100644 --- a/src/orders/components/OrderReturnPage/form.tsx +++ b/src/orders/components/OrderReturnPage/form.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useExitFormDialog } from "@dashboard/components/Form/useExitFormDialog"; import { FulfillmentStatus, OrderDetailsFragment } from "@dashboard/graphql"; import useForm, { diff --git a/src/orders/components/OrderReturnPage/utils.tsx b/src/orders/components/OrderReturnPage/utils.tsx index 942fecb0b..2ea1bba22 100644 --- a/src/orders/components/OrderReturnPage/utils.tsx +++ b/src/orders/components/OrderReturnPage/utils.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FulfillmentStatus, OrderDetailsFragment } from "@dashboard/graphql"; import { getById } from "@dashboard/misc"; import { Node } from "@dashboard/types"; diff --git a/src/orders/components/OrderSendRefundPage/OrderSendRefund.stories.tsx b/src/orders/components/OrderSendRefundPage/OrderSendRefund.stories.tsx index 2b4d2d8e9..d2eba4897 100644 --- a/src/orders/components/OrderSendRefundPage/OrderSendRefund.stories.tsx +++ b/src/orders/components/OrderSendRefundPage/OrderSendRefund.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import React from "react"; import { order as orderFixture, prepareMoney } from "../../fixtures"; diff --git a/src/orders/components/OrderSendRefundPage/components/TransactionCard.tsx b/src/orders/components/OrderSendRefundPage/components/TransactionCard.tsx index 2c556dccb..0ea197003 100644 --- a/src/orders/components/OrderSendRefundPage/components/TransactionCard.tsx +++ b/src/orders/components/OrderSendRefundPage/components/TransactionCard.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ConfirmButton } from "@dashboard/components/ConfirmButton"; import PriceField from "@dashboard/components/PriceField"; import { diff --git a/src/orders/components/OrderSettingsPage/OrderSettingsPage.stories.tsx b/src/orders/components/OrderSettingsPage/OrderSettingsPage.stories.tsx index fe402d919..f584f7984 100644 --- a/src/orders/components/OrderSettingsPage/OrderSettingsPage.stories.tsx +++ b/src/orders/components/OrderSettingsPage/OrderSettingsPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { orderSettings as orderSettingsFixture, shopOrderSettings as shopOrderSettingsFixture, diff --git a/src/orders/components/OrderSettingsPage/OrderSettingsPage.tsx b/src/orders/components/OrderSettingsPage/OrderSettingsPage.tsx index c82cb656e..60b0076f3 100644 --- a/src/orders/components/OrderSettingsPage/OrderSettingsPage.tsx +++ b/src/orders/components/OrderSettingsPage/OrderSettingsPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import { ConfirmButtonTransitionState } from "@dashboard/components/ConfirmButton"; import { DetailPageLayout } from "@dashboard/components/Layouts"; diff --git a/src/orders/components/OrderShippingMethodEditDialog/OrderShippingMethodEditDialog.tsx b/src/orders/components/OrderShippingMethodEditDialog/OrderShippingMethodEditDialog.tsx index f1478aced..1682c365c 100644 --- a/src/orders/components/OrderShippingMethodEditDialog/OrderShippingMethodEditDialog.tsx +++ b/src/orders/components/OrderShippingMethodEditDialog/OrderShippingMethodEditDialog.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import BackButton from "@dashboard/components/BackButton"; import { ConfirmButton, diff --git a/src/orders/components/OrderSummaryCard/OrderSummaryCard.tsx b/src/orders/components/OrderSummaryCard/OrderSummaryCard.tsx index 3a4a3f3ff..3a3a99ce3 100644 --- a/src/orders/components/OrderSummaryCard/OrderSummaryCard.tsx +++ b/src/orders/components/OrderSummaryCard/OrderSummaryCard.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import CardTitle from "@dashboard/components/CardTitle"; import { OrderDetailsFragment, OrderDiscountType } from "@dashboard/graphql"; import { Card, CardContent } from "@material-ui/core"; diff --git a/src/orders/components/OrderSummaryCard/utils.ts b/src/orders/components/OrderSummaryCard/utils.ts index 54c8414ab..7a953a84c 100644 --- a/src/orders/components/OrderSummaryCard/utils.ts +++ b/src/orders/components/OrderSummaryCard/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { subtractMoney } from "@dashboard/components/Money"; import { GiftCardEventsEnum, OrderDetailsFragment } from "@dashboard/graphql"; import { getOrderCharged } from "@dashboard/orders/utils/data"; diff --git a/src/orders/components/OrderTransaction.stories.tsx b/src/orders/components/OrderTransaction.stories.tsx index 386f5730a..951e95d56 100644 --- a/src/orders/components/OrderTransaction.stories.tsx +++ b/src/orders/components/OrderTransaction.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TransactionActionEnum, TransactionEventTypeEnum, diff --git a/src/orders/components/OrderTransaction/OrderTransaction.tsx b/src/orders/components/OrderTransaction/OrderTransaction.tsx index 61b7f90c4..aee81b917 100644 --- a/src/orders/components/OrderTransaction/OrderTransaction.tsx +++ b/src/orders/components/OrderTransaction/OrderTransaction.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TransactionActionEnum, TransactionItemFragment, diff --git a/src/orders/components/OrderTransaction/components/TransactionEvents/TransactionEvents.tsx b/src/orders/components/OrderTransaction/components/TransactionEvents/TransactionEvents.tsx index 17ec5dd74..ea64b06b1 100644 --- a/src/orders/components/OrderTransaction/components/TransactionEvents/TransactionEvents.tsx +++ b/src/orders/components/OrderTransaction/components/TransactionEvents/TransactionEvents.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TransactionEventFragment } from "@dashboard/graphql"; import { renderCollection } from "@dashboard/misc"; import { TransactionFakeEvent } from "@dashboard/orders/types"; diff --git a/src/orders/components/OrderTransaction/components/TransactionEvents/components/EventCreatedBy.test.tsx b/src/orders/components/OrderTransaction/components/TransactionEvents/components/EventCreatedBy.test.tsx index 27d06a4ef..d21859a12 100644 --- a/src/orders/components/OrderTransaction/components/TransactionEvents/components/EventCreatedBy.test.tsx +++ b/src/orders/components/OrderTransaction/components/TransactionEvents/components/EventCreatedBy.test.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { appAvatar } from "@dashboard/apps/fixtures"; import { AppPaths } from "@dashboard/apps/urls"; import { staffMemberAvatar } from "@dashboard/staff/fixtures"; diff --git a/src/orders/components/OrderTransaction/components/TransactionEvents/components/EventCreatedBy.tsx b/src/orders/components/OrderTransaction/components/TransactionEvents/components/EventCreatedBy.tsx index ad57e3e38..20d176735 100644 --- a/src/orders/components/OrderTransaction/components/TransactionEvents/components/EventCreatedBy.tsx +++ b/src/orders/components/OrderTransaction/components/TransactionEvents/components/EventCreatedBy.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { AppUrls } from "@dashboard/apps/urls"; import { AppAvatarFragment, diff --git a/src/orders/components/OrderTransaction/components/TransactionEvents/components/EventItem.test.tsx b/src/orders/components/OrderTransaction/components/TransactionEvents/components/EventItem.test.tsx index a3093fda6..c38f72a58 100644 --- a/src/orders/components/OrderTransaction/components/TransactionEvents/components/EventItem.test.tsx +++ b/src/orders/components/OrderTransaction/components/TransactionEvents/components/EventItem.test.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { transactionEvent } from "@dashboard/orders/fixtures"; import Wrapper from "@test/wrapper"; import { render, screen } from "@testing-library/react"; diff --git a/src/orders/components/OrderTransaction/components/TransactionEvents/components/EventStatus.tsx b/src/orders/components/OrderTransaction/components/TransactionEvents/components/EventStatus.tsx index 54bf87117..a1d5fef88 100644 --- a/src/orders/components/OrderTransaction/components/TransactionEvents/components/EventStatus.tsx +++ b/src/orders/components/OrderTransaction/components/TransactionEvents/components/EventStatus.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Pill } from "@dashboard/components/Pill"; import { TransactionEventStatus } from "@dashboard/orders/types"; import React from "react"; diff --git a/src/orders/components/OrderTransaction/components/TransactionEvents/components/EventType.tsx b/src/orders/components/OrderTransaction/components/TransactionEvents/components/EventType.tsx index cb623c798..d1d9e26c4 100644 --- a/src/orders/components/OrderTransaction/components/TransactionEvents/components/EventType.tsx +++ b/src/orders/components/OrderTransaction/components/TransactionEvents/components/EventType.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { transactionEventTypeMap } from "@dashboard/orders/messages"; import { TransactionEventType } from "@dashboard/orders/types"; import { makeStyles } from "@saleor/macaw-ui"; diff --git a/src/orders/components/OrderTransaction/components/TransactionEvents/components/PspReference.tsx b/src/orders/components/OrderTransaction/components/TransactionEvents/components/PspReference.tsx index 751adb8cf..c4531a9ae 100644 --- a/src/orders/components/OrderTransaction/components/TransactionEvents/components/PspReference.tsx +++ b/src/orders/components/OrderTransaction/components/TransactionEvents/components/PspReference.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import OverflowTooltip from "@dashboard/components/OverflowTooltip"; import useClipboard from "@dashboard/hooks/useClipboard"; import { commonMessages } from "@dashboard/intl"; diff --git a/src/orders/components/OrderTransaction/utils.test.ts b/src/orders/components/OrderTransaction/utils.test.ts index 594198e2f..2274d84dc 100644 --- a/src/orders/components/OrderTransaction/utils.test.ts +++ b/src/orders/components/OrderTransaction/utils.test.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TransactionEventFragment } from "@dashboard/graphql"; import { TransactionFakeEvent, diff --git a/src/orders/components/OrderTransaction/utils.ts b/src/orders/components/OrderTransaction/utils.ts index 97b0b85ea..a63a40a39 100644 --- a/src/orders/components/OrderTransaction/utils.ts +++ b/src/orders/components/OrderTransaction/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TransactionActionEnum, TransactionEventFragment, diff --git a/src/orders/components/OrderTransactionGiftCard/OrderTransactionGiftCard.tsx b/src/orders/components/OrderTransactionGiftCard/OrderTransactionGiftCard.tsx index 272020904..8dc7f2180 100644 --- a/src/orders/components/OrderTransactionGiftCard/OrderTransactionGiftCard.tsx +++ b/src/orders/components/OrderTransactionGiftCard/OrderTransactionGiftCard.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import Skeleton from "@dashboard/components/Skeleton"; import { OrderDetailsFragment, diff --git a/src/orders/components/OrderTransactionGiftCard/utils.ts b/src/orders/components/OrderTransactionGiftCard/utils.ts index 733185295..5dd96f618 100644 --- a/src/orders/components/OrderTransactionGiftCard/utils.ts +++ b/src/orders/components/OrderTransactionGiftCard/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { GiftCardEventsEnum, OrderGiftCardFragment } from "@dashboard/graphql"; export const getUsedInGiftCardEvents = ( diff --git a/src/orders/components/OrderTransactionPayment/OrderTransactionPayment.tsx b/src/orders/components/OrderTransactionPayment/OrderTransactionPayment.tsx index 68b990e82..6eaab0e79 100644 --- a/src/orders/components/OrderTransactionPayment/OrderTransactionPayment.tsx +++ b/src/orders/components/OrderTransactionPayment/OrderTransactionPayment.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { OrderPaymentFragment, PaymentGatewayFragment, diff --git a/src/orders/components/OrderTransactionPayment/utils.ts b/src/orders/components/OrderTransactionPayment/utils.ts index e3e8d583c..b11d234c0 100644 --- a/src/orders/components/OrderTransactionPayment/utils.ts +++ b/src/orders/components/OrderTransactionPayment/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { OrderAction, OrderPaymentFragment, diff --git a/src/orders/fixtures.ts b/src/orders/fixtures.ts index f22cedae5..401c32a10 100644 --- a/src/orders/fixtures.ts +++ b/src/orders/fixtures.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { AppAvatarFragment, ChannelUsabilityDataQuery, diff --git a/src/orders/utils/data.test.ts b/src/orders/utils/data.test.ts index 55cdb11b1..6c62a6274 100644 --- a/src/orders/utils/data.test.ts +++ b/src/orders/utils/data.test.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FulfillmentStatus, OrderDetailsFragment, diff --git a/src/orders/utils/data.ts b/src/orders/utils/data.ts index d0d1290a4..15a3d2315 100644 --- a/src/orders/utils/data.ts +++ b/src/orders/utils/data.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { subtractMoney } from "@dashboard/components/Money"; import { AddressFragment, diff --git a/src/orders/views/OrderDetails/OrderDetails.tsx b/src/orders/views/OrderDetails/OrderDetails.tsx index 57f03c96f..13384f9a0 100644 --- a/src/orders/views/OrderDetails/OrderDetails.tsx +++ b/src/orders/views/OrderDetails/OrderDetails.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useApolloClient } from "@apollo/client"; import { MetadataIdSchema } from "@dashboard/components/Metadata"; import NotFoundPage from "@dashboard/components/NotFoundPage"; diff --git a/src/orders/views/OrderDetails/OrderDetailsMessages.tsx b/src/orders/views/OrderDetails/OrderDetailsMessages.tsx index 262a6c07e..0bb98134b 100644 --- a/src/orders/views/OrderDetails/OrderDetailsMessages.tsx +++ b/src/orders/views/OrderDetails/OrderDetailsMessages.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { handleNestedMutationErrors } from "@dashboard/auth"; import { formatMoney } from "@dashboard/components/Money"; import messages from "@dashboard/containers/BackgroundTasks/messages"; diff --git a/src/orders/views/OrderDetails/OrderDraftDetails/index.tsx b/src/orders/views/OrderDetails/OrderDraftDetails/index.tsx index 5dbcd81d1..8078cefd6 100644 --- a/src/orders/views/OrderDetails/OrderDraftDetails/index.tsx +++ b/src/orders/views/OrderDetails/OrderDraftDetails/index.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { WindowTitle } from "@dashboard/components/WindowTitle"; import { DEFAULT_INITIAL_SEARCH_DATA } from "@dashboard/config"; import { diff --git a/src/orders/views/OrderDetails/OrderNormalDetails/index.tsx b/src/orders/views/OrderDetails/OrderNormalDetails/index.tsx index 730da2e2f..c369741eb 100644 --- a/src/orders/views/OrderDetails/OrderNormalDetails/index.tsx +++ b/src/orders/views/OrderDetails/OrderNormalDetails/index.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { WindowTitle } from "@dashboard/components/WindowTitle"; import { CreateManualTransactionCaptureMutation, diff --git a/src/orders/views/OrderDetails/OrderUnconfirmedDetails/index.tsx b/src/orders/views/OrderDetails/OrderUnconfirmedDetails/index.tsx index 92e01b918..9e8ecf27f 100644 --- a/src/orders/views/OrderDetails/OrderUnconfirmedDetails/index.tsx +++ b/src/orders/views/OrderDetails/OrderUnconfirmedDetails/index.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { WindowTitle } from "@dashboard/components/WindowTitle"; import { DEFAULT_INITIAL_SEARCH_DATA } from "@dashboard/config"; import { diff --git a/src/orders/views/OrderDraftList/OrderDraftList.tsx b/src/orders/views/OrderDraftList/OrderDraftList.tsx index af2cf81f1..11dab5ae6 100644 --- a/src/orders/views/OrderDraftList/OrderDraftList.tsx +++ b/src/orders/views/OrderDraftList/OrderDraftList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import ChannelPickerDialog from "@dashboard/channels/components/ChannelPickerDialog"; import ActionDialog from "@dashboard/components/ActionDialog"; import useAppChannel from "@dashboard/components/AppLayout/AppChannelContext"; @@ -69,25 +70,23 @@ export const OrderDraftList: React.FC = ({ params }) => { const intl = useIntl(); - const [ - orderDraftBulkDelete, - orderDraftBulkDeleteOpts, - ] = useOrderDraftBulkCancelMutation({ - onCompleted: data => { - if (data.draftOrderBulkDelete.errors.length === 0) { - notify({ - status: "success", - text: intl.formatMessage({ - id: "ra2O4j", - defaultMessage: "Deleted draft orders", - }), - }); - refetch(); - reset(); - closeModal(); - } - }, - }); + const [orderDraftBulkDelete, orderDraftBulkDeleteOpts] = + useOrderDraftBulkCancelMutation({ + onCompleted: data => { + if (data.draftOrderBulkDelete.errors.length === 0) { + notify({ + status: "success", + text: intl.formatMessage({ + id: "ra2O4j", + defaultMessage: "Deleted draft orders", + }), + }); + refetch(); + reset(); + closeModal(); + } + }, + }); const [createOrder] = useOrderDraftCreateMutation({ onCompleted: data => { @@ -113,17 +112,14 @@ export const OrderDraftList: React.FC = ({ params }) => { const currentTab = getFiltersCurrentTab(params, tabs); - const [ - changeFilters, - resetFilters, - handleSearchChange, - ] = createFilterHandlers({ - cleanupFn: reset, - createUrl: orderDraftListUrl, - getFilterQueryParam, - navigate, - params, - }); + const [changeFilters, resetFilters, handleSearchChange] = + createFilterHandlers({ + cleanupFn: reset, + createUrl: orderDraftListUrl, + getFilterQueryParam, + navigate, + params, + }); const [openModal, closeModal] = createDialogActionHandlers< OrderDraftListUrlDialog, diff --git a/src/orders/views/OrderDraftList/filters.ts b/src/orders/views/OrderDraftList/filters.ts index bc00c5bb6..bc10888cf 100644 --- a/src/orders/views/OrderDraftList/filters.ts +++ b/src/orders/views/OrderDraftList/filters.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FilterElement } from "@dashboard/components/Filter"; import { OrderDraftFilterInput } from "@dashboard/graphql"; import { maybe } from "@dashboard/misc"; @@ -79,16 +80,10 @@ export function getFilterQueryParam( } } -export const { - deleteFilterTab, - getFilterTabs, - saveFilterTab, -} = createFilterTabUtils(ORDER_DRAFT_FILTERS_KEY); +export const { deleteFilterTab, getFilterTabs, saveFilterTab } = + createFilterTabUtils(ORDER_DRAFT_FILTERS_KEY); -export const { - areFiltersApplied, - getActiveFilters, - getFiltersCurrentTab, -} = createFilterUtils( - OrderDraftListUrlFiltersEnum, -); +export const { areFiltersApplied, getActiveFilters, getFiltersCurrentTab } = + createFilterUtils( + OrderDraftListUrlFiltersEnum, + ); diff --git a/src/orders/views/OrderDraftList/sort.ts b/src/orders/views/OrderDraftList/sort.ts index b427c7680..62e7e16ed 100644 --- a/src/orders/views/OrderDraftList/sort.ts +++ b/src/orders/views/OrderDraftList/sort.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { OrderSortField } from "@dashboard/graphql"; import { OrderDraftListUrlSortField } from "@dashboard/orders/urls"; import { createGetSortQueryVariables } from "@dashboard/utils/sort"; @@ -17,6 +18,5 @@ export function getSortQueryField( } } -export const getSortQueryVariables = createGetSortQueryVariables( - getSortQueryField, -); +export const getSortQueryVariables = + createGetSortQueryVariables(getSortQueryField); diff --git a/src/orders/views/OrderEditGrantRefund/OrderEditGrantRefund.tsx b/src/orders/views/OrderEditGrantRefund/OrderEditGrantRefund.tsx index f5d599eec..305557056 100644 --- a/src/orders/views/OrderEditGrantRefund/OrderEditGrantRefund.tsx +++ b/src/orders/views/OrderEditGrantRefund/OrderEditGrantRefund.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import NotFoundPage from "@dashboard/components/NotFoundPage"; import { WindowTitle } from "@dashboard/components/WindowTitle"; import { diff --git a/src/orders/views/OrderFulfill/OrderFulfill.tsx b/src/orders/views/OrderFulfill/OrderFulfill.tsx index 8d58a1600..f0b4777e7 100644 --- a/src/orders/views/OrderFulfill/OrderFulfill.tsx +++ b/src/orders/views/OrderFulfill/OrderFulfill.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { handleNestedMutationErrors } from "@dashboard/auth"; import { WindowTitle } from "@dashboard/components/WindowTitle"; import { @@ -36,10 +37,8 @@ const OrderFulfill: React.FC = ({ orderId, params }) => { OrderFulfillUrlQueryParams >(navigate, params => orderFulfillUrl(orderId, params), params); - const { - data: settings, - loading: settingsLoading, - } = useOrderFulfillSettingsQuery({}); + const { data: settings, loading: settingsLoading } = + useOrderFulfillSettingsQuery({}); const { data, loading } = useOrderFulfillDataQuery({ displayLoader: true, diff --git a/src/orders/views/OrderGrantRefund/OrderGrantRefund.tsx b/src/orders/views/OrderGrantRefund/OrderGrantRefund.tsx index c1b2ea5fd..3503af275 100644 --- a/src/orders/views/OrderGrantRefund/OrderGrantRefund.tsx +++ b/src/orders/views/OrderGrantRefund/OrderGrantRefund.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { WindowTitle } from "@dashboard/components/WindowTitle"; import { useOrderDetailsGrantRefundQuery, diff --git a/src/orders/views/OrderList/OrderList.tsx b/src/orders/views/OrderList/OrderList.tsx index 3aed773dc..8a576edbb 100644 --- a/src/orders/views/OrderList/OrderList.tsx +++ b/src/orders/views/OrderList/OrderList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import ChannelPickerDialog from "@dashboard/channels/components/ChannelPickerDialog"; import useAppChannel from "@dashboard/components/AppLayout/AppChannelContext"; import DeleteFilterTabDialog from "@dashboard/components/DeleteFilterTabDialog"; diff --git a/src/orders/views/OrderList/filters.ts b/src/orders/views/OrderList/filters.ts index fc210f83d..1b105f3f2 100644 --- a/src/orders/views/OrderList/filters.ts +++ b/src/orders/views/OrderList/filters.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { MultiAutocompleteChoiceType } from "@dashboard/components/MultiAutocompleteSelectField"; import { OrderFilterInput, diff --git a/src/orders/views/OrderList/sort.ts b/src/orders/views/OrderList/sort.ts index cbc7f6dfa..7f378fde7 100644 --- a/src/orders/views/OrderList/sort.ts +++ b/src/orders/views/OrderList/sort.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { OrderSortField } from "@dashboard/graphql"; import { OrderListUrlSortField } from "@dashboard/orders/urls"; import { createGetSortQueryVariables } from "@dashboard/utils/sort"; diff --git a/src/orders/views/OrderRefund/OrderRefund.tsx b/src/orders/views/OrderRefund/OrderRefund.tsx index 8aecf46d2..bc07537d8 100644 --- a/src/orders/views/OrderRefund/OrderRefund.tsx +++ b/src/orders/views/OrderRefund/OrderRefund.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useOrderFulfillmentRefundProductsMutation, useOrderRefundDataQuery, diff --git a/src/orders/views/OrderReturn/OrderReturn.tsx b/src/orders/views/OrderReturn/OrderReturn.tsx index 9981f8537..c90afb4ef 100644 --- a/src/orders/views/OrderReturn/OrderReturn.tsx +++ b/src/orders/views/OrderReturn/OrderReturn.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { OrderErrorCode, useFulfillmentReturnProductsMutation, diff --git a/src/orders/views/OrderReturn/utils.tsx b/src/orders/views/OrderReturn/utils.tsx index 56daa75a6..63474f151 100644 --- a/src/orders/views/OrderReturn/utils.tsx +++ b/src/orders/views/OrderReturn/utils.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { OrderDetailsFragment, OrderReturnFulfillmentLineInput, diff --git a/src/orders/views/OrderSendRefund/OrderSendRefund.tsx b/src/orders/views/OrderSendRefund/OrderSendRefund.tsx index a93596e7a..106718423 100644 --- a/src/orders/views/OrderSendRefund/OrderSendRefund.tsx +++ b/src/orders/views/OrderSendRefund/OrderSendRefund.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { OrderDetailsDocument, useCreateManualTransactionRefundMutation, diff --git a/src/orders/views/OrderSettings.tsx b/src/orders/views/OrderSettings.tsx index 642c72832..25828d8ad 100644 --- a/src/orders/views/OrderSettings.tsx +++ b/src/orders/views/OrderSettings.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useOrderSettingsQuery, useOrderSettingsUpdateMutation, @@ -17,25 +18,23 @@ export const OrderSettings: React.FC = () => { const { data, loading } = useOrderSettingsQuery({}); - const [ - orderSettingsUpdate, - orderSettingsUpdateOpts, - ] = useOrderSettingsUpdateMutation({ - onCompleted: ({ orderSettingsUpdate: { errors } }) => { - if (!errors.length) { - notify({ - status: "success", - text: intl.formatMessage(commonMessages.savedChanges), - }); - return; - } + const [orderSettingsUpdate, orderSettingsUpdateOpts] = + useOrderSettingsUpdateMutation({ + onCompleted: ({ orderSettingsUpdate: { errors } }) => { + if (!errors.length) { + notify({ + status: "success", + text: intl.formatMessage(commonMessages.savedChanges), + }); + return; + } - notify({ - status: "error", - text: intl.formatMessage(commonMessages.somethingWentWrong), - }); - }, - }); + notify({ + status: "error", + text: intl.formatMessage(commonMessages.somethingWentWrong), + }); + }, + }); const handleSubmit = async ({ automaticallyConfirmAllNewOrders, diff --git a/src/pageTypes/components/PageTypeAttributes/PageTypeAttributes.tsx b/src/pageTypes/components/PageTypeAttributes/PageTypeAttributes.tsx index 48e3f2de8..db5944645 100644 --- a/src/pageTypes/components/PageTypeAttributes/PageTypeAttributes.tsx +++ b/src/pageTypes/components/PageTypeAttributes/PageTypeAttributes.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { attributeUrl } from "@dashboard/attributes/urls"; import { Button } from "@dashboard/components/Button"; import CardTitle from "@dashboard/components/CardTitle"; diff --git a/src/pageTypes/components/PageTypeCreatePage/PageTypeCreatePage.tsx b/src/pageTypes/components/PageTypeCreatePage/PageTypeCreatePage.tsx index 62d62897f..b08db89bb 100644 --- a/src/pageTypes/components/PageTypeCreatePage/PageTypeCreatePage.tsx +++ b/src/pageTypes/components/PageTypeCreatePage/PageTypeCreatePage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import { ConfirmButtonTransitionState } from "@dashboard/components/ConfirmButton"; import Form from "@dashboard/components/Form"; diff --git a/src/pageTypes/components/PageTypeDetails/PageTypeDetails.tsx b/src/pageTypes/components/PageTypeDetails/PageTypeDetails.tsx index 3e69604a9..02cb87407 100644 --- a/src/pageTypes/components/PageTypeDetails/PageTypeDetails.tsx +++ b/src/pageTypes/components/PageTypeDetails/PageTypeDetails.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import CardTitle from "@dashboard/components/CardTitle"; import { PageErrorFragment } from "@dashboard/graphql"; import { commonMessages } from "@dashboard/intl"; diff --git a/src/pageTypes/components/PageTypeDetailsPage/PageTypeDetailsPage.stories.tsx b/src/pageTypes/components/PageTypeDetailsPage/PageTypeDetailsPage.stories.tsx index 23c2997ff..90aad8218 100644 --- a/src/pageTypes/components/PageTypeDetailsPage/PageTypeDetailsPage.stories.tsx +++ b/src/pageTypes/components/PageTypeDetailsPage/PageTypeDetailsPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { listActionsProps } from "@dashboard/fixtures"; import { PageErrorCode } from "@dashboard/graphql"; import React from "react"; diff --git a/src/pageTypes/components/PageTypeDetailsPage/PageTypeDetailsPage.tsx b/src/pageTypes/components/PageTypeDetailsPage/PageTypeDetailsPage.tsx index 40b725347..05fc32dc5 100644 --- a/src/pageTypes/components/PageTypeDetailsPage/PageTypeDetailsPage.tsx +++ b/src/pageTypes/components/PageTypeDetailsPage/PageTypeDetailsPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import { ConfirmButtonTransitionState } from "@dashboard/components/ConfirmButton"; import Form from "@dashboard/components/Form"; diff --git a/src/pageTypes/components/PageTypeList/PageTypeList.tsx b/src/pageTypes/components/PageTypeList/PageTypeList.tsx index 83d5faa8f..92667ffb7 100644 --- a/src/pageTypes/components/PageTypeList/PageTypeList.tsx +++ b/src/pageTypes/components/PageTypeList/PageTypeList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import Checkbox from "@dashboard/components/Checkbox"; import ResponsiveTable from "@dashboard/components/ResponsiveTable"; import Skeleton from "@dashboard/components/Skeleton"; diff --git a/src/pageTypes/hooks/usePageTypeDelete/usePageTypeDelete.tsx b/src/pageTypes/hooks/usePageTypeDelete/usePageTypeDelete.tsx index 826e84c42..555b5ec36 100644 --- a/src/pageTypes/hooks/usePageTypeDelete/usePageTypeDelete.tsx +++ b/src/pageTypes/hooks/usePageTypeDelete/usePageTypeDelete.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { PageCountQueryVariables, usePageCountQuery } from "@dashboard/graphql"; import { pageListUrl } from "@dashboard/pages/urls"; import { @@ -10,7 +11,7 @@ import * as messages from "./messages"; import { UseTypeDeleteData, UseTypeDeleteProps } from "./types"; type UsePageTypeDeleteProps< - T = PageTypeListUrlQueryParams | PageTypeUrlQueryParams + T = PageTypeListUrlQueryParams | PageTypeUrlQueryParams, > = UseTypeDeleteProps; function usePageTypeDelete({ @@ -22,16 +23,15 @@ function usePageTypeDelete({ const isDeleteDialogOpen = params.action === "remove"; - const pagesAssignedToSelectedTypesQueryVars = React.useMemo< - PageCountQueryVariables - >( - () => ({ - filter: { - pageTypes, - }, - }), - [pageTypes], - ); + const pagesAssignedToSelectedTypesQueryVars = + React.useMemo( + () => ({ + filter: { + pageTypes, + }, + }), + [pageTypes], + ); const shouldSkipPageListQuery = !pageTypes.length || !isDeleteDialogOpen; diff --git a/src/pageTypes/views/PageTypeCreate.tsx b/src/pageTypes/views/PageTypeCreate.tsx index 1ec4a93f9..0452936be 100644 --- a/src/pageTypes/views/PageTypeCreate.tsx +++ b/src/pageTypes/views/PageTypeCreate.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { WindowTitle } from "@dashboard/components/WindowTitle"; import { usePageTypeCreateMutation, diff --git a/src/pageTypes/views/PageTypeDetails.tsx b/src/pageTypes/views/PageTypeDetails.tsx index c762f742c..0e3be95b2 100644 --- a/src/pageTypes/views/PageTypeDetails.tsx +++ b/src/pageTypes/views/PageTypeDetails.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import AssignAttributeDialog from "@dashboard/components/AssignAttributeDialog"; import AttributeUnassignDialog from "@dashboard/components/AttributeUnassignDialog"; import BulkAttributeUnassignDialog from "@dashboard/components/BulkAttributeUnassignDialog"; @@ -89,21 +90,19 @@ export const PageTypeDetails: React.FC = ({ }, }, ); - const [ - unassignAttribute, - unassignAttributeOpts, - ] = useUnassignPageAttributeMutation({ - onCompleted: data => { - if (data.pageAttributeUnassign.errors.length === 0) { - notify({ - status: "success", - text: intl.formatMessage(commonMessages.savedChanges), - }); - closeModal(); - attributeListActions.reset(); - } - }, - }); + const [unassignAttribute, unassignAttributeOpts] = + useUnassignPageAttributeMutation({ + onCompleted: data => { + if (data.pageAttributeUnassign.errors.length === 0) { + notify({ + status: "success", + text: intl.formatMessage(commonMessages.savedChanges), + }); + closeModal(); + attributeListActions.reset(); + } + }, + }); const [reorderAttribute] = usePageTypeAttributeReorderMutation({ onCompleted: data => { if (data.pageTypeReorderAttributes.errors.length === 0) { diff --git a/src/pageTypes/views/PageTypeList/PageTypeList.tsx b/src/pageTypes/views/PageTypeList/PageTypeList.tsx index 821deae9d..1de88b790 100644 --- a/src/pageTypes/views/PageTypeList/PageTypeList.tsx +++ b/src/pageTypes/views/PageTypeList/PageTypeList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import DeleteFilterTabDialog from "@dashboard/components/DeleteFilterTabDialog"; import SaveFilterTabDialog, { SaveFilterTabDialogFormData, @@ -127,28 +128,26 @@ export const PageTypeList: React.FC = ({ params }) => { const handleSort = createSortHandler(navigate, pageTypeListUrl, params); - const [ - pageTypeBulkDelete, - pageTypeBulkDeleteOpts, - ] = usePageTypeBulkDeleteMutation({ - onCompleted: data => { - if (data.pageTypeBulkDelete.errors.length === 0) { - notify({ - status: "success", - text: intl.formatMessage(commonMessages.savedChanges), - }); - reset(); - refetch(); - navigate( - pageTypeListUrl({ - ...params, - action: undefined, - ids: undefined, - }), - ); - } - }, - }); + const [pageTypeBulkDelete, pageTypeBulkDeleteOpts] = + usePageTypeBulkDeleteMutation({ + onCompleted: data => { + if (data.pageTypeBulkDelete.errors.length === 0) { + notify({ + status: "success", + text: intl.formatMessage(commonMessages.savedChanges), + }); + reset(); + refetch(); + navigate( + pageTypeListUrl({ + ...params, + action: undefined, + ids: undefined, + }), + ); + } + }, + }); const hanldePageTypeBulkDelete = () => pageTypeBulkDelete({ diff --git a/src/pageTypes/views/PageTypeList/sort.ts b/src/pageTypes/views/PageTypeList/sort.ts index 830eb41bd..8933aa373 100644 --- a/src/pageTypes/views/PageTypeList/sort.ts +++ b/src/pageTypes/views/PageTypeList/sort.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { PageTypeSortField } from "@dashboard/graphql"; import { PageTypeListUrlSortField } from "@dashboard/pageTypes/urls"; import { createGetSortQueryVariables } from "@dashboard/utils/sort"; @@ -13,6 +14,5 @@ export function getSortQueryField( } } -export const getSortQueryVariables = createGetSortQueryVariables( - getSortQueryField, -); +export const getSortQueryVariables = + createGetSortQueryVariables(getSortQueryField); diff --git a/src/pages/components/PageDetailsPage/PageDetailsPage.stories.tsx b/src/pages/components/PageDetailsPage/PageDetailsPage.stories.tsx index a1b6a3c20..39f772dbb 100644 --- a/src/pages/components/PageDetailsPage/PageDetailsPage.stories.tsx +++ b/src/pages/components/PageDetailsPage/PageDetailsPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { fetchMoreProps } from "@dashboard/fixtures"; import { PageErrorCode } from "@dashboard/graphql"; import { PageData } from "@dashboard/pages/components/PageDetailsPage/form"; diff --git a/src/pages/components/PageDetailsPage/PageDetailsPage.tsx b/src/pages/components/PageDetailsPage/PageDetailsPage.tsx index 7a3fdb0a0..87844e4a9 100644 --- a/src/pages/components/PageDetailsPage/PageDetailsPage.tsx +++ b/src/pages/components/PageDetailsPage/PageDetailsPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { getReferenceAttributeEntityTypeFromAttribute, mergeAttributeValues, diff --git a/src/pages/components/PageDetailsPage/form.tsx b/src/pages/components/PageDetailsPage/form.tsx index 05e64c54b..ca62be77b 100644 --- a/src/pages/components/PageDetailsPage/form.tsx +++ b/src/pages/components/PageDetailsPage/form.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { getAttributesDisplayData, getRichTextAttributesFromMap, @@ -138,13 +139,14 @@ function usePageForm( ): UsePageUpdateFormOutput { const pageExists = page !== null; - const { handleChange, triggerChange, data: formData, formId } = useForm( - getInitialFormData(pageExists, page), - undefined, - { - confirmLeave: true, - }, - ); + const { + handleChange, + triggerChange, + data: formData, + formId, + } = useForm(getInitialFormData(pageExists, page), undefined, { + confirmLeave: true, + }); const [validationErrors, setValidationErrors] = useState< PageErrorWithAttributesFragment[] >([]); @@ -166,13 +168,10 @@ function usePageForm( }); const attributesWithNewFileValue = useFormset([]); - const { - setExitDialogSubmitRef, - setIsSubmitDisabled, - setIsDirty, - } = useExitFormDialog({ - formId, - }); + const { setExitDialogSubmitRef, setIsSubmitDisabled, setIsDirty } = + useExitFormDialog({ + formId, + }); const richText = useRichText({ initial: pageExists ? page?.content : null, diff --git a/src/pages/components/PageInfo/PageInfo.tsx b/src/pages/components/PageInfo/PageInfo.tsx index cb24d9e19..ab56d2998 100644 --- a/src/pages/components/PageInfo/PageInfo.tsx +++ b/src/pages/components/PageInfo/PageInfo.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import CardTitle from "@dashboard/components/CardTitle"; import FormSpacer from "@dashboard/components/FormSpacer"; import RichTextEditor from "@dashboard/components/RichTextEditor"; @@ -36,12 +37,8 @@ const PageInfo: React.FC = props => { const classes = useStyles(props); const intl = useIntl(); - const { - defaultValue, - editorRef, - isReadyForMount, - handleChange, - } = useRichTextContext(); + const { defaultValue, editorRef, isReadyForMount, handleChange } = + useRichTextContext(); const formErrors = getFormErrors(["title", "content"], errors); return ( diff --git a/src/pages/components/PageList/PageList.tsx b/src/pages/components/PageList/PageList.tsx index b8b991e8b..0e3513bd5 100644 --- a/src/pages/components/PageList/PageList.tsx +++ b/src/pages/components/PageList/PageList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import Checkbox from "@dashboard/components/Checkbox"; import { Pill } from "@dashboard/components/Pill"; import ResponsiveTable from "@dashboard/components/ResponsiveTable"; diff --git a/src/pages/components/PageListPage/PageListPage.stories.tsx b/src/pages/components/PageListPage/PageListPage.stories.tsx index c8d571946..0532b2fdb 100644 --- a/src/pages/components/PageListPage/PageListPage.stories.tsx +++ b/src/pages/components/PageListPage/PageListPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { listActionsProps, pageListProps, diff --git a/src/pages/components/PageListPage/PageListSearchAndFilters.tsx b/src/pages/components/PageListPage/PageListSearchAndFilters.tsx index ee97c4dec..2fe49a6e8 100644 --- a/src/pages/components/PageListPage/PageListSearchAndFilters.tsx +++ b/src/pages/components/PageListPage/PageListSearchAndFilters.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import DeleteFilterTabDialog from "@dashboard/components/DeleteFilterTabDialog"; import FilterBar from "@dashboard/components/FilterBar"; import SaveFilterTabDialog, { diff --git a/src/pages/components/PageListPage/filters.ts b/src/pages/components/PageListPage/filters.ts index f0bfea2af..5c00315be 100644 --- a/src/pages/components/PageListPage/filters.ts +++ b/src/pages/components/PageListPage/filters.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FilterElement, IFilter } from "@dashboard/components/Filter"; import { SearchWithFetchMoreProps } from "@dashboard/giftCards/GiftCardsList/GiftCardListSearchAndFilters/types"; import { SearchPageTypesQuery } from "@dashboard/graphql"; @@ -112,16 +113,10 @@ export type PageListUrlQueryParams = Pagination & ActiveTab & Search; -export const { - deleteFilterTab, - getFilterTabs, - saveFilterTab, -} = createFilterTabUtils(PAGES_FILTERS_KEY); +export const { deleteFilterTab, getFilterTabs, saveFilterTab } = + createFilterTabUtils(PAGES_FILTERS_KEY); -export const { - areFiltersApplied, - getActiveFilters, - getFiltersCurrentTab, -} = createFilterUtils( - PageListUrlFiltersWithMultipleValues, -); +export const { areFiltersApplied, getActiveFilters, getFiltersCurrentTab } = + createFilterUtils( + PageListUrlFiltersWithMultipleValues, + ); diff --git a/src/pages/components/PageOrganizeContent/PageOrganizeContent.tsx b/src/pages/components/PageOrganizeContent/PageOrganizeContent.tsx index bdf16dc93..9b2be4770 100644 --- a/src/pages/components/PageOrganizeContent/PageOrganizeContent.tsx +++ b/src/pages/components/PageOrganizeContent/PageOrganizeContent.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import CardTitle from "@dashboard/components/CardTitle"; import SingleAutocompleteSelectField, { SingleAutocompleteChoiceType, diff --git a/src/pages/components/PageTypePickerDialog/PageTypePickerDialog.tsx b/src/pages/components/PageTypePickerDialog/PageTypePickerDialog.tsx index ff6a1f117..dec56fc3f 100644 --- a/src/pages/components/PageTypePickerDialog/PageTypePickerDialog.tsx +++ b/src/pages/components/PageTypePickerDialog/PageTypePickerDialog.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import ActionDialog from "@dashboard/components/ActionDialog"; import { ConfirmButtonTransitionState } from "@dashboard/components/ConfirmButton"; import SingleAutocompleteSelectField, { diff --git a/src/pages/utils/data.ts b/src/pages/utils/data.ts index dc185294f..14999f891 100644 --- a/src/pages/utils/data.ts +++ b/src/pages/utils/data.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { getSelectedAttributeValues, mergeChoicesWithValues, diff --git a/src/pages/utils/handlers.ts b/src/pages/utils/handlers.ts index 4121e1fb3..63e65fa37 100644 --- a/src/pages/utils/handlers.ts +++ b/src/pages/utils/handlers.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FormChange } from "@dashboard/hooks/useForm"; export function createPageTypeSelectHandler( diff --git a/src/pages/views/PageCreate.tsx b/src/pages/views/PageCreate.tsx index 0d3edc47e..037e49afa 100644 --- a/src/pages/views/PageCreate.tsx +++ b/src/pages/views/PageCreate.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { getAttributesAfterFileAttributesUpdate } from "@dashboard/attributes/utils/data"; import { handleUploadMultipleFiles, @@ -181,8 +182,9 @@ export const PageCreate: React.FC = ({ params }) => { onFetchMore: loadMoreProducts, }; const fetchMoreAttributeValues = { - hasMore: !!searchAttributeValuesOpts.data?.attribute?.choices?.pageInfo - ?.hasNextPage, + hasMore: + !!searchAttributeValuesOpts.data?.attribute?.choices?.pageInfo + ?.hasNextPage, loading: !!searchAttributeValuesOpts.loading, onFetchMore: loadMoreAttributeValues, }; diff --git a/src/pages/views/PageDetails.tsx b/src/pages/views/PageDetails.tsx index fe0a92a11..027513545 100644 --- a/src/pages/views/PageDetails.tsx +++ b/src/pages/views/PageDetails.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { getAttributesAfterFileAttributesUpdate, mergeAttributeValueDeleteErrors, @@ -93,10 +94,8 @@ export const PageDetails: React.FC = ({ id, params }) => { const [pageUpdate, pageUpdateOpts] = usePageUpdateMutation({}); - const [ - deleteAttributeValue, - deleteAttributeValueOpts, - ] = useAttributeValueDeleteMutation({}); + const [deleteAttributeValue, deleteAttributeValueOpts] = + useAttributeValueDeleteMutation({}); const [pageRemove, pageRemoveOpts] = usePageRemoveMutation({ onCompleted: data => { @@ -128,11 +127,12 @@ export const PageDetails: React.FC = ({ id, params }) => { variables => uploadFile({ variables }), ); - const deleteAttributeValuesResult = await handleDeleteMultipleAttributeValues( - data.attributesWithNewFileValue, - pageDetails?.data?.page?.attributes, - variables => deleteAttributeValue({ variables }), - ); + const deleteAttributeValuesResult = + await handleDeleteMultipleAttributeValues( + data.attributesWithNewFileValue, + pageDetails?.data?.page?.attributes, + variables => deleteAttributeValue({ variables }), + ); const updatedFileAttributes = getAttributesAfterFileAttributesUpdate( data.attributesWithNewFileValue, @@ -203,8 +203,9 @@ export const PageDetails: React.FC = ({ id, params }) => { onFetchMore: loadMoreProducts, }; const fetchMoreAttributeValues = { - hasMore: !!searchAttributeValuesOpts.data?.attribute?.choices?.pageInfo - ?.hasNextPage, + hasMore: + !!searchAttributeValuesOpts.data?.attribute?.choices?.pageInfo + ?.hasNextPage, loading: !!searchAttributeValuesOpts.loading, onFetchMore: loadMoreAttributeValues, }; diff --git a/src/pages/views/PageList/PageList.tsx b/src/pages/views/PageList/PageList.tsx index 51dce0dba..0828ae94d 100644 --- a/src/pages/views/PageList/PageList.tsx +++ b/src/pages/views/PageList/PageList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import ActionDialog from "@dashboard/components/ActionDialog"; import { Button } from "@dashboard/components/Button"; import { DEFAULT_INITIAL_SEARCH_DATA } from "@dashboard/config"; diff --git a/src/pages/views/PageList/sort.ts b/src/pages/views/PageList/sort.ts index fcfb8c0ce..99cfe8158 100644 --- a/src/pages/views/PageList/sort.ts +++ b/src/pages/views/PageList/sort.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { PageFilterInput, PageSortField } from "@dashboard/graphql"; import { PageListUrlFilters, @@ -27,6 +28,5 @@ export function getFilterVariables( }; } -export const getSortQueryVariables = createGetSortQueryVariables( - getSortQueryField, -); +export const getSortQueryVariables = + createGetSortQueryVariables(getSortQueryField); diff --git a/src/permissionGroups/components/AssignMembersDialog/AssignMembersDialog.tsx b/src/permissionGroups/components/AssignMembersDialog/AssignMembersDialog.tsx index 2ff37d6e6..72f2a2715 100644 --- a/src/permissionGroups/components/AssignMembersDialog/AssignMembersDialog.tsx +++ b/src/permissionGroups/components/AssignMembersDialog/AssignMembersDialog.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import BackButton from "@dashboard/components/BackButton"; import CardSpacer from "@dashboard/components/CardSpacer"; import { diff --git a/src/permissionGroups/components/PermissionGroupCreatePage/PermissionGroupCreatePage.stories.tsx b/src/permissionGroups/components/PermissionGroupCreatePage/PermissionGroupCreatePage.stories.tsx index 442b60ede..dc2d696fb 100644 --- a/src/permissionGroups/components/PermissionGroupCreatePage/PermissionGroupCreatePage.stories.tsx +++ b/src/permissionGroups/components/PermissionGroupCreatePage/PermissionGroupCreatePage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { permissions } from "@dashboard/fixtures"; import React from "react"; diff --git a/src/permissionGroups/components/PermissionGroupCreatePage/PermissionGroupCreatePage.tsx b/src/permissionGroups/components/PermissionGroupCreatePage/PermissionGroupCreatePage.tsx index c28f45ef0..e93a76eec 100644 --- a/src/permissionGroups/components/PermissionGroupCreatePage/PermissionGroupCreatePage.tsx +++ b/src/permissionGroups/components/PermissionGroupCreatePage/PermissionGroupCreatePage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import AccountPermissions from "@dashboard/components/AccountPermissions"; import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import { Backlink } from "@dashboard/components/Backlink"; diff --git a/src/permissionGroups/components/PermissionGroupDetailsPage/PermissionGroupDetailsPage.stories.tsx b/src/permissionGroups/components/PermissionGroupDetailsPage/PermissionGroupDetailsPage.stories.tsx index 2c9c78bca..a80511b55 100644 --- a/src/permissionGroups/components/PermissionGroupDetailsPage/PermissionGroupDetailsPage.stories.tsx +++ b/src/permissionGroups/components/PermissionGroupDetailsPage/PermissionGroupDetailsPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { permissions } from "@dashboard/fixtures"; import React from "react"; diff --git a/src/permissionGroups/components/PermissionGroupDetailsPage/PermissionGroupDetailsPage.tsx b/src/permissionGroups/components/PermissionGroupDetailsPage/PermissionGroupDetailsPage.tsx index 6c0b95cbd..85a6eab07 100644 --- a/src/permissionGroups/components/PermissionGroupDetailsPage/PermissionGroupDetailsPage.tsx +++ b/src/permissionGroups/components/PermissionGroupDetailsPage/PermissionGroupDetailsPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import AccountPermissions from "@dashboard/components/AccountPermissions"; import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import { ConfirmButtonTransitionState } from "@dashboard/components/ConfirmButton"; diff --git a/src/permissionGroups/components/PermissionGroupInfo/PermissionGroupInfo.tsx b/src/permissionGroups/components/PermissionGroupInfo/PermissionGroupInfo.tsx index f27895221..26c95e0b8 100644 --- a/src/permissionGroups/components/PermissionGroupInfo/PermissionGroupInfo.tsx +++ b/src/permissionGroups/components/PermissionGroupInfo/PermissionGroupInfo.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import CardTitle from "@dashboard/components/CardTitle"; import { PermissionGroupErrorFragment } from "@dashboard/graphql"; import { FormChange } from "@dashboard/hooks/useForm"; diff --git a/src/permissionGroups/components/PermissionGroupList/PermissionGroupList.tsx b/src/permissionGroups/components/PermissionGroupList/PermissionGroupList.tsx index d1b5a26ce..204bb99e9 100644 --- a/src/permissionGroups/components/PermissionGroupList/PermissionGroupList.tsx +++ b/src/permissionGroups/components/PermissionGroupList/PermissionGroupList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import ResponsiveTable from "@dashboard/components/ResponsiveTable"; import Skeleton from "@dashboard/components/Skeleton"; import { TableButtonWrapper } from "@dashboard/components/TableButtonWrapper/TableButtonWrapper"; diff --git a/src/permissionGroups/components/PermissionGroupListPage/PermissionGroupListPage.stories.tsx b/src/permissionGroups/components/PermissionGroupListPage/PermissionGroupListPage.stories.tsx index 2ec527154..5995e52f0 100644 --- a/src/permissionGroups/components/PermissionGroupListPage/PermissionGroupListPage.stories.tsx +++ b/src/permissionGroups/components/PermissionGroupListPage/PermissionGroupListPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { listActionsProps, pageListProps, diff --git a/src/permissionGroups/components/PermissionGroupMemberList/PermissionGroupMemberList.tsx b/src/permissionGroups/components/PermissionGroupMemberList/PermissionGroupMemberList.tsx index 1795f71c0..59950fdc4 100644 --- a/src/permissionGroups/components/PermissionGroupMemberList/PermissionGroupMemberList.tsx +++ b/src/permissionGroups/components/PermissionGroupMemberList/PermissionGroupMemberList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Button } from "@dashboard/components/Button"; import CardTitle from "@dashboard/components/CardTitle"; import Checkbox from "@dashboard/components/Checkbox"; diff --git a/src/permissionGroups/fixtures.ts b/src/permissionGroups/fixtures.ts index b948fddf1..0aee4d82d 100644 --- a/src/permissionGroups/fixtures.ts +++ b/src/permissionGroups/fixtures.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import avatarImg from "@assets/images/avatars/avatar.png"; import { PermissionEnum, diff --git a/src/permissionGroups/sort.ts b/src/permissionGroups/sort.ts index 1f4d98032..dcc9f35a4 100644 --- a/src/permissionGroups/sort.ts +++ b/src/permissionGroups/sort.ts @@ -1,26 +1,26 @@ +// @ts-strict-ignore import { StaffMemberFragment } from "@dashboard/graphql"; import { getUserName } from "@dashboard/misc"; import { MembersListUrlSortField } from "./urls"; -export const sortMembers = (sort: string, asc: boolean) => ( - a: StaffMemberFragment, - b: StaffMemberFragment, -) => { - let valueA; - let valueB; - switch (sort) { - case MembersListUrlSortField.name: - valueA = getUserName(a); - valueB = getUserName(b); - break; - case MembersListUrlSortField.email: - valueA = a.email; - valueB = b.email; - break; - } +export const sortMembers = + (sort: string, asc: boolean) => + (a: StaffMemberFragment, b: StaffMemberFragment) => { + let valueA; + let valueB; + switch (sort) { + case MembersListUrlSortField.name: + valueA = getUserName(a); + valueB = getUserName(b); + break; + case MembersListUrlSortField.email: + valueA = a.email; + valueB = b.email; + break; + } - return asc - ? ("" + valueA).localeCompare(valueB) - : ("" + valueA).localeCompare(valueB) * -1; -}; + return asc + ? ("" + valueA).localeCompare(valueB) + : ("" + valueA).localeCompare(valueB) * -1; + }; diff --git a/src/permissionGroups/utils.ts b/src/permissionGroups/utils.ts index 7ea8d4a42..cfa12ee0c 100644 --- a/src/permissionGroups/utils.ts +++ b/src/permissionGroups/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { PermissionFragment, PermissionGroupDetailsFragment, diff --git a/src/permissionGroups/views/PermissionGroupCreate/PermissionGroupCreate.tsx b/src/permissionGroups/views/PermissionGroupCreate/PermissionGroupCreate.tsx index ec6733abd..ee3a918ac 100644 --- a/src/permissionGroups/views/PermissionGroupCreate/PermissionGroupCreate.tsx +++ b/src/permissionGroups/views/PermissionGroupCreate/PermissionGroupCreate.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useUser } from "@dashboard/auth"; import { WindowTitle } from "@dashboard/components/WindowTitle"; import { usePermissionGroupCreateMutation } from "@dashboard/graphql"; @@ -21,25 +22,23 @@ const PermissionGroupCreateView: React.FC = () => { const shop = useShop(); const user = useUser(); - const [ - createPermissionGroup, - createPermissionGroupResult, - ] = usePermissionGroupCreateMutation({ - onCompleted: data => { - if (data?.permissionGroupCreate?.errors.length === 0) { - notify({ - status: "success", - text: intl.formatMessage({ - id: "eUjFjW", - defaultMessage: "Permission group created", - }), - }); - navigate( - permissionGroupDetailsUrl(data.permissionGroupCreate.group.id), - ); - } - }, - }); + const [createPermissionGroup, createPermissionGroupResult] = + usePermissionGroupCreateMutation({ + onCompleted: data => { + if (data?.permissionGroupCreate?.errors.length === 0) { + notify({ + status: "success", + text: intl.formatMessage({ + id: "eUjFjW", + defaultMessage: "Permission group created", + }), + }); + navigate( + permissionGroupDetailsUrl(data.permissionGroupCreate.group.id), + ); + } + }, + }); const errors = createPermissionGroupResult?.data?.permissionGroupCreate?.errors || []; diff --git a/src/permissionGroups/views/PermissionGroupDetails/PermissionGroupDetails.tsx b/src/permissionGroups/views/PermissionGroupDetails/PermissionGroupDetails.tsx index 0e461689b..eaf0482bb 100644 --- a/src/permissionGroups/views/PermissionGroupDetails/PermissionGroupDetails.tsx +++ b/src/permissionGroups/views/PermissionGroupDetails/PermissionGroupDetails.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useUser } from "@dashboard/auth"; import { Button } from "@dashboard/components/Button"; import { DEFAULT_INITIAL_SEARCH_DATA } from "@dashboard/config"; @@ -61,7 +62,11 @@ export const PermissionGroupDetails: React.FC = ({ data?.permissionGroup.users, ); - const { search, result: searchResult, loadMore } = useStaffMemberSearch({ + const { + search, + result: searchResult, + loadMore, + } = useStaffMemberSearch({ variables: DEFAULT_INITIAL_SEARCH_DATA, }); @@ -69,25 +74,23 @@ export const PermissionGroupDetails: React.FC = ({ params.ids, ); - const [ - permissionGroupUpdate, - permissionGroupUpdateResult, - ] = usePermissionGroupUpdateMutation({ - onCompleted: data => { - if (data.permissionGroupUpdate.errors.length === 0) { - notify({ - status: "success", - text: intl.formatMessage(commonMessages.savedChanges), - }); - refetch(); - closeModal(); - } else if ( - data.permissionGroupUpdate.errors.some(e => e.field === "removeUsers") - ) { - openModal("unassignError"); - } - }, - }); + const [permissionGroupUpdate, permissionGroupUpdateResult] = + usePermissionGroupUpdateMutation({ + onCompleted: data => { + if (data.permissionGroupUpdate.errors.length === 0) { + notify({ + status: "success", + text: intl.formatMessage(commonMessages.savedChanges), + }); + refetch(); + closeModal(); + } else if ( + data.permissionGroupUpdate.errors.some(e => e.field === "removeUsers") + ) { + openModal("unassignError"); + } + }, + }); const [openModal, closeModal] = createDialogActionHandlers< PermissionGroupDetailsUrlDialog, diff --git a/src/permissionGroups/views/PermissionGroupList/PermissionGroupList.tsx b/src/permissionGroups/views/PermissionGroupList/PermissionGroupList.tsx index e1a2af796..a218400ef 100644 --- a/src/permissionGroups/views/PermissionGroupList/PermissionGroupList.tsx +++ b/src/permissionGroups/views/PermissionGroupList/PermissionGroupList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { PermissionGroupErrorFragment, usePermissionGroupDeleteMutation, @@ -76,9 +77,8 @@ export const PermissionGroupList: React.FC = ({ >(navigate, permissionGroupListUrl, params); const permissionGroups = mapEdgesToItems(data?.permissionGroups); - const [deleteError, setDeleteError] = React.useState< - PermissionGroupErrorFragment - >(); + const [deleteError, setDeleteError] = + React.useState(); const [permissionGroupDelete] = usePermissionGroupDeleteMutation({ onCompleted: data => { diff --git a/src/permissionGroups/views/PermissionGroupList/sort.ts b/src/permissionGroups/views/PermissionGroupList/sort.ts index bafec9d00..db801732f 100644 --- a/src/permissionGroups/views/PermissionGroupList/sort.ts +++ b/src/permissionGroups/views/PermissionGroupList/sort.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { PermissionGroupSortField } from "@dashboard/graphql"; import { PermissionGroupListUrlSortField } from "@dashboard/permissionGroups/urls"; import { createGetSortQueryVariables } from "@dashboard/utils/sort"; @@ -13,6 +14,5 @@ export function getSortQueryField( } } -export const getSortQueryVariables = createGetSortQueryVariables( - getSortQueryField, -); +export const getSortQueryVariables = + createGetSortQueryVariables(getSortQueryField); diff --git a/src/plugins/components/PluginDetailsChannelsCard/PluginDetailsChannelsCardContent.tsx b/src/plugins/components/PluginDetailsChannelsCard/PluginDetailsChannelsCardContent.tsx index ba6df4c3c..77a31089b 100644 --- a/src/plugins/components/PluginDetailsChannelsCard/PluginDetailsChannelsCardContent.tsx +++ b/src/plugins/components/PluginDetailsChannelsCard/PluginDetailsChannelsCardContent.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import CollectionWithDividers from "@dashboard/components/CollectionWithDividers"; import Skeleton from "@dashboard/components/Skeleton"; import { PluginsDetailsFragment } from "@dashboard/graphql"; @@ -32,11 +33,9 @@ export interface PluginDetailsChannelsCardProps { plugin: PluginsDetailsFragment; } -const PluginDetailsChannelsCardContent: React.FC = ({ - plugin, - selectedChannelId, - setSelectedChannelId, -}) => { +const PluginDetailsChannelsCardContent: React.FC< + PluginDetailsChannelsCardProps +> = ({ plugin, selectedChannelId, setSelectedChannelId }) => { const classes = useStyles({}); if (!plugin) { diff --git a/src/plugins/components/PluginSecretFieldDialog/PluginSecretFieldDialog.tsx b/src/plugins/components/PluginSecretFieldDialog/PluginSecretFieldDialog.tsx index 6a44151b4..ef3c7f9a2 100644 --- a/src/plugins/components/PluginSecretFieldDialog/PluginSecretFieldDialog.tsx +++ b/src/plugins/components/PluginSecretFieldDialog/PluginSecretFieldDialog.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import BackButton from "@dashboard/components/BackButton"; import { ConfirmButton, diff --git a/src/plugins/components/PluginSettings/PluginSettings.tsx b/src/plugins/components/PluginSettings/PluginSettings.tsx index 12356c6eb..a1a0a0300 100644 --- a/src/plugins/components/PluginSettings/PluginSettings.tsx +++ b/src/plugins/components/PluginSettings/PluginSettings.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import CardTitle from "@dashboard/components/CardTitle"; import ControlledSwitch from "@dashboard/components/ControlledSwitch"; import { diff --git a/src/plugins/components/PluginsDetailsPage/PluginDetailsPage.stories.tsx b/src/plugins/components/PluginsDetailsPage/PluginDetailsPage.stories.tsx index f81aa0069..789822ed9 100644 --- a/src/plugins/components/PluginsDetailsPage/PluginDetailsPage.stories.tsx +++ b/src/plugins/components/PluginsDetailsPage/PluginDetailsPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { PluginErrorCode } from "@dashboard/graphql"; import React from "react"; diff --git a/src/plugins/components/PluginsDetailsPage/PluginsDetailsPage.tsx b/src/plugins/components/PluginsDetailsPage/PluginsDetailsPage.tsx index 114ae1bda..c35dbbdd6 100644 --- a/src/plugins/components/PluginsDetailsPage/PluginsDetailsPage.tsx +++ b/src/plugins/components/PluginsDetailsPage/PluginsDetailsPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import CardSpacer from "@dashboard/components/CardSpacer"; import { ConfirmButtonTransitionState } from "@dashboard/components/ConfirmButton"; diff --git a/src/plugins/components/PluginsList/PluginAvailabilityStatus.tsx b/src/plugins/components/PluginsList/PluginAvailabilityStatus.tsx index a55d62ae1..1f73e6948 100644 --- a/src/plugins/components/PluginsList/PluginAvailabilityStatus.tsx +++ b/src/plugins/components/PluginsList/PluginAvailabilityStatus.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Pill } from "@dashboard/components/Pill"; import { PluginBaseFragment } from "@dashboard/graphql"; import { isPluginGlobal } from "@dashboard/plugins/views/utils"; diff --git a/src/plugins/components/PluginsList/PluginAvailabilityStatusPopup/GlobalConfigPluginPopupBody.tsx b/src/plugins/components/PluginsList/PluginAvailabilityStatusPopup/GlobalConfigPluginPopupBody.tsx index 76124c191..5b0356099 100644 --- a/src/plugins/components/PluginsList/PluginAvailabilityStatusPopup/GlobalConfigPluginPopupBody.tsx +++ b/src/plugins/components/PluginsList/PluginAvailabilityStatusPopup/GlobalConfigPluginPopupBody.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import CardSpacer from "@dashboard/components/CardSpacer"; import { Pill } from "@dashboard/components/Pill"; import { PluginBaseFragment } from "@dashboard/graphql"; diff --git a/src/plugins/components/PluginsList/PluginAvailabilityStatusPopup/PluginAvailabilityStatusPopup.tsx b/src/plugins/components/PluginsList/PluginAvailabilityStatusPopup/PluginAvailabilityStatusPopup.tsx index cbfdc9dca..4cc80f7ab 100644 --- a/src/plugins/components/PluginsList/PluginAvailabilityStatusPopup/PluginAvailabilityStatusPopup.tsx +++ b/src/plugins/components/PluginsList/PluginAvailabilityStatusPopup/PluginAvailabilityStatusPopup.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import ChannelsAvailabilityMenuContent from "@dashboard/components/ChannelsAvailabilityMenuContent"; import { PluginBaseFragment } from "@dashboard/graphql"; import { isPluginGlobal } from "@dashboard/plugins/views/utils"; @@ -24,11 +25,9 @@ interface PluginAvailabilityStatusPopupProps { anchor: React.RefObject; } -const PluginAvailabilityStatusPopup: React.FC = ({ - plugin, - isOpen, - anchor, -}) => { +const PluginAvailabilityStatusPopup: React.FC< + PluginAvailabilityStatusPopupProps +> = ({ plugin, isOpen, anchor }) => { const classes = useStyles({}); const isGlobalPlugin = isPluginGlobal(plugin.globalConfiguration); diff --git a/src/plugins/components/PluginsList/PluginChannelConfigurationCell.tsx b/src/plugins/components/PluginsList/PluginChannelConfigurationCell.tsx index c0241c730..eb0086a75 100644 --- a/src/plugins/components/PluginsList/PluginChannelConfigurationCell.tsx +++ b/src/plugins/components/PluginsList/PluginChannelConfigurationCell.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { PluginBaseFragment } from "@dashboard/graphql"; import { isPluginGlobal } from "@dashboard/plugins/views/utils"; import { TableCell } from "@material-ui/core"; @@ -10,9 +11,9 @@ interface PluginChannelConfigurationCellProps { plugin: PluginBaseFragment; } -const PluginChannelConfigurationCell: React.FC = ({ - plugin, -}) => { +const PluginChannelConfigurationCell: React.FC< + PluginChannelConfigurationCellProps +> = ({ plugin }) => { const message = isPluginGlobal(plugin.globalConfiguration) ? messages.globalLabel : messages.channelLabel; diff --git a/src/plugins/components/PluginsList/PluginListTableHead.tsx b/src/plugins/components/PluginsList/PluginListTableHead.tsx index d0a18b8b5..55b89afea 100644 --- a/src/plugins/components/PluginsList/PluginListTableHead.tsx +++ b/src/plugins/components/PluginsList/PluginListTableHead.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import TableCellHeader from "@dashboard/components/TableCellHeader"; import { PluginListUrlSortField } from "@dashboard/plugins/urls"; import { SortPage } from "@dashboard/types"; diff --git a/src/plugins/components/PluginsListPage/PluginsListPage.tsx b/src/plugins/components/PluginsListPage/PluginsListPage.tsx index 2322bc477..7905f7f2b 100644 --- a/src/plugins/components/PluginsListPage/PluginsListPage.tsx +++ b/src/plugins/components/PluginsListPage/PluginsListPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import FilterBar from "@dashboard/components/FilterBar"; import { ListPageLayout } from "@dashboard/components/Layouts"; diff --git a/src/plugins/components/PluginsListPage/filters.ts b/src/plugins/components/PluginsListPage/filters.ts index 02ea7aeae..b7fb0359e 100644 --- a/src/plugins/components/PluginsListPage/filters.ts +++ b/src/plugins/components/PluginsListPage/filters.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { IFilter } from "@dashboard/components/Filter"; import { PluginConfigurationType } from "@dashboard/graphql"; import { sectionNames } from "@dashboard/intl"; diff --git a/src/plugins/utils.ts b/src/plugins/utils.ts index 656e6a8e3..5ba37e61c 100644 --- a/src/plugins/utils.ts +++ b/src/plugins/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ConfigurationItemFragment, ConfigurationTypeFieldEnum, diff --git a/src/plugins/views/PluginDetails.test.ts b/src/plugins/views/PluginDetails.test.ts index 47dfb6fc0..a3a976e41 100644 --- a/src/plugins/views/PluginDetails.test.ts +++ b/src/plugins/views/PluginDetails.test.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ConfigurationItemFragment, ConfigurationItemInput, diff --git a/src/plugins/views/PluginList/PluginList.tsx b/src/plugins/views/PluginList/PluginList.tsx index efd0042fc..e00b09e81 100644 --- a/src/plugins/views/PluginList/PluginList.tsx +++ b/src/plugins/views/PluginList/PluginList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import DeleteFilterTabDialog from "@dashboard/components/DeleteFilterTabDialog"; import SaveFilterTabDialog, { SaveFilterTabDialogFormData, @@ -68,16 +69,13 @@ export const PluginsList: React.FC = ({ params }) => { const currentTab = getFiltersCurrentTab(params, tabs); - const [ - changeFilters, - resetFilters, - handleSearchChange, - ] = createFilterHandlers({ - createUrl: pluginListUrl, - getFilterQueryParam, - navigate, - params, - }); + const [changeFilters, resetFilters, handleSearchChange] = + createFilterHandlers({ + createUrl: pluginListUrl, + getFilterQueryParam, + navigate, + params, + }); const [openModal, closeModal] = createDialogActionHandlers< PluginListUrlDialog, diff --git a/src/plugins/views/PluginList/filters.ts b/src/plugins/views/PluginList/filters.ts index 18b27b70d..c9121698c 100644 --- a/src/plugins/views/PluginList/filters.ts +++ b/src/plugins/views/PluginList/filters.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FilterElement, FilterElementRegular, @@ -117,16 +118,10 @@ export function getFilterQueryParam( } } -export const { - deleteFilterTab, - getFilterTabs, - saveFilterTab, -} = createFilterTabUtils(PLUGIN_FILTERS_KEY); +export const { deleteFilterTab, getFilterTabs, saveFilterTab } = + createFilterTabUtils(PLUGIN_FILTERS_KEY); -export const { - areFiltersApplied, - getActiveFilters, - getFiltersCurrentTab, -} = createFilterUtils( - PluginListUrlFiltersEnum, -); +export const { areFiltersApplied, getActiveFilters, getFiltersCurrentTab } = + createFilterUtils( + PluginListUrlFiltersEnum, + ); diff --git a/src/plugins/views/PluginList/sort.ts b/src/plugins/views/PluginList/sort.ts index 0ef252d28..492ece570 100644 --- a/src/plugins/views/PluginList/sort.ts +++ b/src/plugins/views/PluginList/sort.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { PluginSortField } from "@dashboard/graphql"; import { PluginListUrlSortField } from "@dashboard/plugins/urls"; import { createGetSortQueryVariables } from "@dashboard/utils/sort"; @@ -15,6 +16,5 @@ export function getSortQueryField( } } -export const getSortQueryVariables = createGetSortQueryVariables( - getSortQueryField, -); +export const getSortQueryVariables = + createGetSortQueryVariables(getSortQueryField); diff --git a/src/plugins/views/PluginsDetails.tsx b/src/plugins/views/PluginsDetails.tsx index 75df916fe..a22af8b39 100644 --- a/src/plugins/views/PluginsDetails.tsx +++ b/src/plugins/views/PluginsDetails.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import ActionDialog from "@dashboard/components/ActionDialog"; import { WindowTitle } from "@dashboard/components/WindowTitle"; import { diff --git a/src/productTypes/components/ProductTypeAttributes/ProductTypeAttributes.tsx b/src/productTypes/components/ProductTypeAttributes/ProductTypeAttributes.tsx index 863657412..e2287caaa 100644 --- a/src/productTypes/components/ProductTypeAttributes/ProductTypeAttributes.tsx +++ b/src/productTypes/components/ProductTypeAttributes/ProductTypeAttributes.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { attributeUrl } from "@dashboard/attributes/urls"; import { Button } from "@dashboard/components/Button"; import CardTitle from "@dashboard/components/CardTitle"; diff --git a/src/productTypes/components/ProductTypeCreatePage/ProductTypeCreatePage.stories.tsx b/src/productTypes/components/ProductTypeCreatePage/ProductTypeCreatePage.stories.tsx index 22161770a..bddbcd5fb 100644 --- a/src/productTypes/components/ProductTypeCreatePage/ProductTypeCreatePage.stories.tsx +++ b/src/productTypes/components/ProductTypeCreatePage/ProductTypeCreatePage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ProductTypeKindEnum, WeightUnitsEnum } from "@dashboard/graphql"; import { taxClasses } from "@dashboard/taxes/fixtures"; import React from "react"; diff --git a/src/productTypes/components/ProductTypeCreatePage/ProductTypeCreatePage.tsx b/src/productTypes/components/ProductTypeCreatePage/ProductTypeCreatePage.tsx index d6d49ba62..ced637d40 100644 --- a/src/productTypes/components/ProductTypeCreatePage/ProductTypeCreatePage.tsx +++ b/src/productTypes/components/ProductTypeCreatePage/ProductTypeCreatePage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import CardSpacer from "@dashboard/components/CardSpacer"; import { ConfirmButtonTransitionState } from "@dashboard/components/ConfirmButton"; diff --git a/src/productTypes/components/ProductTypeDetails/ProductTypeDetails.tsx b/src/productTypes/components/ProductTypeDetails/ProductTypeDetails.tsx index 7adcf7221..e09d4ec46 100644 --- a/src/productTypes/components/ProductTypeDetails/ProductTypeDetails.tsx +++ b/src/productTypes/components/ProductTypeDetails/ProductTypeDetails.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import CardTitle from "@dashboard/components/CardTitle"; import PreviewPill from "@dashboard/components/PreviewPill"; import RadioGroupField from "@dashboard/components/RadioGroupField"; diff --git a/src/productTypes/components/ProductTypeDetailsPage/ProductTypeDetailsPage.stories.tsx b/src/productTypes/components/ProductTypeDetailsPage/ProductTypeDetailsPage.stories.tsx index 32cd9875a..6ad76cf7c 100644 --- a/src/productTypes/components/ProductTypeDetailsPage/ProductTypeDetailsPage.stories.tsx +++ b/src/productTypes/components/ProductTypeDetailsPage/ProductTypeDetailsPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { listActionsProps } from "@dashboard/fixtures"; import { WeightUnitsEnum } from "@dashboard/graphql"; import { taxClasses } from "@dashboard/taxes/fixtures"; diff --git a/src/productTypes/components/ProductTypeDetailsPage/ProductTypeDetailsPage.tsx b/src/productTypes/components/ProductTypeDetailsPage/ProductTypeDetailsPage.tsx index 09f26eb55..c8b495542 100644 --- a/src/productTypes/components/ProductTypeDetailsPage/ProductTypeDetailsPage.tsx +++ b/src/productTypes/components/ProductTypeDetailsPage/ProductTypeDetailsPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import CardSpacer from "@dashboard/components/CardSpacer"; import { ConfirmButtonTransitionState } from "@dashboard/components/ConfirmButton"; diff --git a/src/productTypes/components/ProductTypeList/ProductTypeList.tsx b/src/productTypes/components/ProductTypeList/ProductTypeList.tsx index 745c1f31c..e988e6a42 100644 --- a/src/productTypes/components/ProductTypeList/ProductTypeList.tsx +++ b/src/productTypes/components/ProductTypeList/ProductTypeList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import Checkbox from "@dashboard/components/Checkbox"; import ResponsiveTable from "@dashboard/components/ResponsiveTable"; import Skeleton from "@dashboard/components/Skeleton"; diff --git a/src/productTypes/components/ProductTypeListPage/ProductTypeListPage.tsx b/src/productTypes/components/ProductTypeListPage/ProductTypeListPage.tsx index 16e9dbe83..c3a5ef5d8 100644 --- a/src/productTypes/components/ProductTypeListPage/ProductTypeListPage.tsx +++ b/src/productTypes/components/ProductTypeListPage/ProductTypeListPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import { Button } from "@dashboard/components/Button"; import FilterBar from "@dashboard/components/FilterBar"; diff --git a/src/productTypes/components/ProductTypeVariantAttributes/ProductTypeVariantAttributes.tsx b/src/productTypes/components/ProductTypeVariantAttributes/ProductTypeVariantAttributes.tsx index 31ae01102..831da9504 100644 --- a/src/productTypes/components/ProductTypeVariantAttributes/ProductTypeVariantAttributes.tsx +++ b/src/productTypes/components/ProductTypeVariantAttributes/ProductTypeVariantAttributes.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { attributeUrl } from "@dashboard/attributes/urls"; import { Button } from "@dashboard/components/Button"; import CardTitle from "@dashboard/components/CardTitle"; diff --git a/src/productTypes/fixtures.ts b/src/productTypes/fixtures.ts index 7dd5e5f22..d66f63bce 100644 --- a/src/productTypes/fixtures.ts +++ b/src/productTypes/fixtures.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { AttributeInputTypeEnum, AttributeTypeEnum, @@ -10,996 +11,1044 @@ import { } from "@dashboard/graphql"; import { RelayToFlat } from "@dashboard/types"; -export const attributes: ProductTypeQuery["productType"]["productAttributes"] = [ - { - node: { - __typename: "Attribute" as "Attribute", - entityType: null, - id: "UHJvZHVjdEF0dHJpYnV0ZTo5", - inputType: AttributeInputTypeEnum.DROPDOWN, - name: "Author", - slug: "author", - valueRequired: true, - unit: null, - choices: { - __typename: "AttributeValueCountableConnection" as "AttributeValueCountableConnection", - pageInfo: { - endCursor: "WyI4IiwgIjMiXQ==", - hasNextPage: false, - hasPreviousPage: false, - startCursor: "WyIwIiwgIjQ5Il0=", - __typename: "PageInfo" as "PageInfo", +export const attributes: ProductTypeQuery["productType"]["productAttributes"] = + [ + { + node: { + __typename: "Attribute" as "Attribute", + entityType: null, + id: "UHJvZHVjdEF0dHJpYnV0ZTo5", + inputType: AttributeInputTypeEnum.DROPDOWN, + name: "Author", + slug: "author", + valueRequired: true, + unit: null, + choices: { + __typename: + "AttributeValueCountableConnection" as "AttributeValueCountableConnection", + pageInfo: { + endCursor: "WyI4IiwgIjMiXQ==", + hasNextPage: false, + hasPreviousPage: false, + startCursor: "WyIwIiwgIjQ5Il0=", + __typename: "PageInfo" as "PageInfo", + }, + edges: [ + { + __typename: + "AttributeValueCountableEdge" as "AttributeValueCountableEdge", + cursor: "", + node: { + __typename: "AttributeValue" as "AttributeValue", + file: null, + id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjI0", + name: "John Doe", + reference: null, + slug: "john-doe", + sortOrder: 0, + type: "STRING", + value: "", + plainText: null, + richText: null, + boolean: null, + date: null, + dateTime: null, + }, + }, + { + __typename: + "AttributeValueCountableEdge" as "AttributeValueCountableEdge", + cursor: "", + node: { + __typename: "AttributeValue" as "AttributeValue", + file: null, + id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjI1", + name: "Milionare Pirate", + reference: null, + slug: "milionare-pirate", + sortOrder: 1, + type: "STRING", + value: "", + plainText: null, + richText: null, + boolean: null, + date: null, + dateTime: null, + }, + }, + ], }, - edges: [ - { - __typename: "AttributeValueCountableEdge" as "AttributeValueCountableEdge", - cursor: "", - node: { - __typename: "AttributeValue" as "AttributeValue", - file: null, - id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjI0", - name: "John Doe", - reference: null, - slug: "john-doe", - sortOrder: 0, - type: "STRING", - value: "", - plainText: null, - richText: null, - boolean: null, - date: null, - dateTime: null, - }, - }, - { - __typename: "AttributeValueCountableEdge" as "AttributeValueCountableEdge", - cursor: "", - node: { - __typename: "AttributeValue" as "AttributeValue", - file: null, - id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjI1", - name: "Milionare Pirate", - reference: null, - slug: "milionare-pirate", - sortOrder: 1, - type: "STRING", - value: "", - plainText: null, - richText: null, - boolean: null, - date: null, - dateTime: null, - }, - }, - ], }, }, - }, - { - node: { - __typename: "Attribute" as "Attribute", - entityType: null, - id: "UHJvZHVjdEF0dHJpYnV0ZTo2", - inputType: AttributeInputTypeEnum.DROPDOWN, - name: "Box Size", - slug: "box-size", - valueRequired: true, - unit: null, - choices: { - __typename: "AttributeValueCountableConnection" as "AttributeValueCountableConnection", - pageInfo: { - endCursor: "WyI4IiwgIjMiXQ==", - hasNextPage: false, - hasPreviousPage: false, - startCursor: "WyIwIiwgIjQ5Il0=", - __typename: "PageInfo" as "PageInfo", + { + node: { + __typename: "Attribute" as "Attribute", + entityType: null, + id: "UHJvZHVjdEF0dHJpYnV0ZTo2", + inputType: AttributeInputTypeEnum.DROPDOWN, + name: "Box Size", + slug: "box-size", + valueRequired: true, + unit: null, + choices: { + __typename: + "AttributeValueCountableConnection" as "AttributeValueCountableConnection", + pageInfo: { + endCursor: "WyI4IiwgIjMiXQ==", + hasNextPage: false, + hasPreviousPage: false, + startCursor: "WyIwIiwgIjQ5Il0=", + __typename: "PageInfo" as "PageInfo", + }, + edges: [ + { + __typename: + "AttributeValueCountableEdge" as "AttributeValueCountableEdge", + cursor: "", + node: { + __typename: "AttributeValue" as "AttributeValue", + file: null, + id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjE1", + name: "100g", + reference: null, + slug: "100g", + sortOrder: 0, + type: "STRING", + value: "", + plainText: null, + richText: null, + boolean: null, + date: null, + dateTime: null, + }, + }, + { + __typename: + "AttributeValueCountableEdge" as "AttributeValueCountableEdge", + cursor: "", + node: { + __typename: "AttributeValue" as "AttributeValue", + file: null, + id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjE2", + name: "250g", + reference: null, + slug: "250g", + sortOrder: 1, + type: "STRING", + value: "", + plainText: null, + richText: null, + boolean: null, + date: null, + dateTime: null, + }, + }, + { + __typename: + "AttributeValueCountableEdge" as "AttributeValueCountableEdge", + cursor: "", + node: { + __typename: "AttributeValue" as "AttributeValue", + file: null, + id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjE3", + name: "500g", + reference: null, + slug: "500g", + sortOrder: 2, + type: "STRING", + value: "", + plainText: null, + richText: null, + boolean: null, + date: null, + dateTime: null, + }, + }, + { + __typename: + "AttributeValueCountableEdge" as "AttributeValueCountableEdge", + cursor: "", + node: { + __typename: "AttributeValue" as "AttributeValue", + file: null, + id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjE4", + name: "1kg", + reference: null, + slug: "1kg", + sortOrder: 3, + type: "STRING", + value: "", + plainText: null, + richText: null, + boolean: null, + date: null, + dateTime: null, + }, + }, + ], }, - edges: [ - { - __typename: "AttributeValueCountableEdge" as "AttributeValueCountableEdge", - cursor: "", - node: { - __typename: "AttributeValue" as "AttributeValue", - file: null, - id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjE1", - name: "100g", - reference: null, - slug: "100g", - sortOrder: 0, - type: "STRING", - value: "", - plainText: null, - richText: null, - boolean: null, - date: null, - dateTime: null, - }, - }, - { - __typename: "AttributeValueCountableEdge" as "AttributeValueCountableEdge", - cursor: "", - node: { - __typename: "AttributeValue" as "AttributeValue", - file: null, - id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjE2", - name: "250g", - reference: null, - slug: "250g", - sortOrder: 1, - type: "STRING", - value: "", - plainText: null, - richText: null, - boolean: null, - date: null, - dateTime: null, - }, - }, - { - __typename: "AttributeValueCountableEdge" as "AttributeValueCountableEdge", - cursor: "", - node: { - __typename: "AttributeValue" as "AttributeValue", - file: null, - id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjE3", - name: "500g", - reference: null, - slug: "500g", - sortOrder: 2, - type: "STRING", - value: "", - plainText: null, - richText: null, - boolean: null, - date: null, - dateTime: null, - }, - }, - { - __typename: "AttributeValueCountableEdge" as "AttributeValueCountableEdge", - cursor: "", - node: { - __typename: "AttributeValue" as "AttributeValue", - file: null, - id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjE4", - name: "1kg", - reference: null, - slug: "1kg", - sortOrder: 3, - type: "STRING", - value: "", - plainText: null, - richText: null, - boolean: null, - date: null, - dateTime: null, - }, - }, - ], }, }, - }, - { - node: { - __typename: "Attribute" as "Attribute", - entityType: null, - id: "UHJvZHVjdEF0dHJpYnV0ZToz", - inputType: AttributeInputTypeEnum.DROPDOWN, - name: "Brand", - slug: "brand", - valueRequired: true, - unit: null, - choices: { - __typename: "AttributeValueCountableConnection" as "AttributeValueCountableConnection", - pageInfo: { - endCursor: "WyI4IiwgIjMiXQ==", - hasNextPage: false, - hasPreviousPage: false, - startCursor: "WyIwIiwgIjQ5Il0=", - __typename: "PageInfo" as "PageInfo", - }, - edges: [ - { - __typename: "AttributeValueCountableEdge" as "AttributeValueCountableEdge", - cursor: "", - node: { - __typename: "AttributeValue" as "AttributeValue", - file: null, - id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjY=", - name: "Saleor", - reference: null, - slug: "saleor", - sortOrder: 0, - type: "STRING", - value: "", - plainText: null, - richText: null, - boolean: null, - date: null, - dateTime: null, - }, + { + node: { + __typename: "Attribute" as "Attribute", + entityType: null, + id: "UHJvZHVjdEF0dHJpYnV0ZToz", + inputType: AttributeInputTypeEnum.DROPDOWN, + name: "Brand", + slug: "brand", + valueRequired: true, + unit: null, + choices: { + __typename: + "AttributeValueCountableConnection" as "AttributeValueCountableConnection", + pageInfo: { + endCursor: "WyI4IiwgIjMiXQ==", + hasNextPage: false, + hasPreviousPage: false, + startCursor: "WyIwIiwgIjQ5Il0=", + __typename: "PageInfo" as "PageInfo", }, - ], + edges: [ + { + __typename: + "AttributeValueCountableEdge" as "AttributeValueCountableEdge", + cursor: "", + node: { + __typename: "AttributeValue" as "AttributeValue", + file: null, + id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjY=", + name: "Saleor", + reference: null, + slug: "saleor", + sortOrder: 0, + type: "STRING", + value: "", + plainText: null, + richText: null, + boolean: null, + date: null, + dateTime: null, + }, + }, + ], + }, }, }, - }, - { - node: { - __typename: "Attribute" as "Attribute", - entityType: null, - id: "UHJvZHVjdEF0dHJpYnV0ZTo4", - inputType: AttributeInputTypeEnum.DROPDOWN, - name: "Candy Box Size", - slug: "candy-box-size", - valueRequired: true, - unit: null, - choices: { - __typename: "AttributeValueCountableConnection" as "AttributeValueCountableConnection", - pageInfo: { - endCursor: "WyI4IiwgIjMiXQ==", - hasNextPage: false, - hasPreviousPage: false, - startCursor: "WyIwIiwgIjQ5Il0=", - __typename: "PageInfo" as "PageInfo", + { + node: { + __typename: "Attribute" as "Attribute", + entityType: null, + id: "UHJvZHVjdEF0dHJpYnV0ZTo4", + inputType: AttributeInputTypeEnum.DROPDOWN, + name: "Candy Box Size", + slug: "candy-box-size", + valueRequired: true, + unit: null, + choices: { + __typename: + "AttributeValueCountableConnection" as "AttributeValueCountableConnection", + pageInfo: { + endCursor: "WyI4IiwgIjMiXQ==", + hasNextPage: false, + hasPreviousPage: false, + startCursor: "WyIwIiwgIjQ5Il0=", + __typename: "PageInfo" as "PageInfo", + }, + edges: [ + { + __typename: + "AttributeValueCountableEdge" as "AttributeValueCountableEdge", + cursor: "", + node: { + __typename: "AttributeValue" as "AttributeValue", + file: null, + id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjIx", + name: "100g", + reference: null, + slug: "100g", + sortOrder: 0, + type: "STRING", + value: "", + plainText: null, + richText: null, + boolean: null, + date: null, + dateTime: null, + }, + }, + { + __typename: + "AttributeValueCountableEdge" as "AttributeValueCountableEdge", + cursor: "", + node: { + __typename: "AttributeValue" as "AttributeValue", + file: null, + id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjIy", + name: "250g", + reference: null, + slug: "250g", + sortOrder: 1, + type: "STRING", + value: "", + plainText: null, + richText: null, + boolean: null, + date: null, + dateTime: null, + }, + }, + { + __typename: + "AttributeValueCountableEdge" as "AttributeValueCountableEdge", + cursor: "", + node: { + __typename: "AttributeValue" as "AttributeValue", + file: null, + id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjIz", + name: "500g", + reference: null, + slug: "500g", + sortOrder: 2, + type: "STRING", + value: "", + plainText: null, + richText: null, + boolean: null, + date: null, + dateTime: null, + }, + }, + ], }, - edges: [ - { - __typename: "AttributeValueCountableEdge" as "AttributeValueCountableEdge", - cursor: "", - node: { - __typename: "AttributeValue" as "AttributeValue", - file: null, - id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjIx", - name: "100g", - reference: null, - slug: "100g", - sortOrder: 0, - type: "STRING", - value: "", - plainText: null, - richText: null, - boolean: null, - date: null, - dateTime: null, - }, - }, - { - __typename: "AttributeValueCountableEdge" as "AttributeValueCountableEdge", - cursor: "", - node: { - __typename: "AttributeValue" as "AttributeValue", - file: null, - id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjIy", - name: "250g", - reference: null, - slug: "250g", - sortOrder: 1, - type: "STRING", - value: "", - plainText: null, - richText: null, - boolean: null, - date: null, - dateTime: null, - }, - }, - { - __typename: "AttributeValueCountableEdge" as "AttributeValueCountableEdge", - cursor: "", - node: { - __typename: "AttributeValue" as "AttributeValue", - file: null, - id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjIz", - name: "500g", - reference: null, - slug: "500g", - sortOrder: 2, - type: "STRING", - value: "", - plainText: null, - richText: null, - boolean: null, - date: null, - dateTime: null, - }, - }, - ], }, }, - }, - { - node: { - __typename: "Attribute" as "Attribute", - entityType: null, - id: "UHJvZHVjdEF0dHJpYnV0ZTo1", - inputType: AttributeInputTypeEnum.DROPDOWN, - name: "Coffee Genre", - slug: "coffee-genre", - valueRequired: true, - unit: null, - choices: { - __typename: "AttributeValueCountableConnection" as "AttributeValueCountableConnection", - pageInfo: { - endCursor: "WyI4IiwgIjMiXQ==", - hasNextPage: false, - hasPreviousPage: false, - startCursor: "WyIwIiwgIjQ5Il0=", - __typename: "PageInfo" as "PageInfo", + { + node: { + __typename: "Attribute" as "Attribute", + entityType: null, + id: "UHJvZHVjdEF0dHJpYnV0ZTo1", + inputType: AttributeInputTypeEnum.DROPDOWN, + name: "Coffee Genre", + slug: "coffee-genre", + valueRequired: true, + unit: null, + choices: { + __typename: + "AttributeValueCountableConnection" as "AttributeValueCountableConnection", + pageInfo: { + endCursor: "WyI4IiwgIjMiXQ==", + hasNextPage: false, + hasPreviousPage: false, + startCursor: "WyIwIiwgIjQ5Il0=", + __typename: "PageInfo" as "PageInfo", + }, + edges: [ + { + __typename: + "AttributeValueCountableEdge" as "AttributeValueCountableEdge", + cursor: "", + node: { + __typename: "AttributeValue" as "AttributeValue", + file: null, + id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjEz", + name: "Arabica", + reference: null, + slug: "arabica", + sortOrder: 0, + type: "STRING", + value: "", + plainText: null, + richText: null, + boolean: null, + date: null, + dateTime: null, + }, + }, + { + __typename: + "AttributeValueCountableEdge" as "AttributeValueCountableEdge", + cursor: "", + node: { + __typename: "AttributeValue" as "AttributeValue", + file: null, + id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjE0", + name: "Robusta", + reference: null, + slug: "robusta", + sortOrder: 1, + type: "STRING", + value: "", + plainText: null, + richText: null, + boolean: null, + date: null, + dateTime: null, + }, + }, + ], }, - edges: [ - { - __typename: "AttributeValueCountableEdge" as "AttributeValueCountableEdge", - cursor: "", - node: { - __typename: "AttributeValue" as "AttributeValue", - file: null, - id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjEz", - name: "Arabica", - reference: null, - slug: "arabica", - sortOrder: 0, - type: "STRING", - value: "", - plainText: null, - richText: null, - boolean: null, - date: null, - dateTime: null, - }, - }, - { - __typename: "AttributeValueCountableEdge" as "AttributeValueCountableEdge", - cursor: "", - node: { - __typename: "AttributeValue" as "AttributeValue", - file: null, - id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjE0", - name: "Robusta", - reference: null, - slug: "robusta", - sortOrder: 1, - type: "STRING", - value: "", - plainText: null, - richText: null, - boolean: null, - date: null, - dateTime: null, - }, - }, - ], }, }, - }, - { - node: { - __typename: "Attribute" as "Attribute", - entityType: null, - id: "UHJvZHVjdEF0dHJpYnV0ZToy", - inputType: AttributeInputTypeEnum.DROPDOWN, - name: "Collar", - slug: "collar", - valueRequired: true, - unit: null, - choices: { - __typename: "AttributeValueCountableConnection" as "AttributeValueCountableConnection", - pageInfo: { - endCursor: "WyI4IiwgIjMiXQ==", - hasNextPage: false, - hasPreviousPage: false, - startCursor: "WyIwIiwgIjQ5Il0=", - __typename: "PageInfo" as "PageInfo", + { + node: { + __typename: "Attribute" as "Attribute", + entityType: null, + id: "UHJvZHVjdEF0dHJpYnV0ZToy", + inputType: AttributeInputTypeEnum.DROPDOWN, + name: "Collar", + slug: "collar", + valueRequired: true, + unit: null, + choices: { + __typename: + "AttributeValueCountableConnection" as "AttributeValueCountableConnection", + pageInfo: { + endCursor: "WyI4IiwgIjMiXQ==", + hasNextPage: false, + hasPreviousPage: false, + startCursor: "WyIwIiwgIjQ5Il0=", + __typename: "PageInfo" as "PageInfo", + }, + edges: [ + { + __typename: + "AttributeValueCountableEdge" as "AttributeValueCountableEdge", + cursor: "", + node: { + __typename: "AttributeValue" as "AttributeValue", + file: null, + id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjM=", + name: "Round", + reference: null, + slug: "round", + sortOrder: 0, + type: "STRING", + value: "", + plainText: null, + richText: null, + boolean: null, + date: null, + dateTime: null, + }, + }, + { + __typename: + "AttributeValueCountableEdge" as "AttributeValueCountableEdge", + cursor: "", + node: { + __typename: "AttributeValue" as "AttributeValue", + file: null, + id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjQ=", + name: "V-Neck", + reference: null, + slug: "v-neck", + sortOrder: 1, + type: "STRING", + value: "", + plainText: null, + richText: null, + boolean: null, + date: null, + dateTime: null, + }, + }, + { + __typename: + "AttributeValueCountableEdge" as "AttributeValueCountableEdge", + cursor: "", + node: { + __typename: "AttributeValue" as "AttributeValue", + file: null, + id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjU=", + name: "Polo", + reference: null, + slug: "polo", + sortOrder: 2, + type: "STRING", + value: "", + plainText: null, + richText: null, + boolean: null, + date: null, + dateTime: null, + }, + }, + ], }, - edges: [ - { - __typename: "AttributeValueCountableEdge" as "AttributeValueCountableEdge", - cursor: "", - node: { - __typename: "AttributeValue" as "AttributeValue", - file: null, - id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjM=", - name: "Round", - reference: null, - slug: "round", - sortOrder: 0, - type: "STRING", - value: "", - plainText: null, - richText: null, - boolean: null, - date: null, - dateTime: null, - }, - }, - { - __typename: "AttributeValueCountableEdge" as "AttributeValueCountableEdge", - cursor: "", - node: { - __typename: "AttributeValue" as "AttributeValue", - file: null, - id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjQ=", - name: "V-Neck", - reference: null, - slug: "v-neck", - sortOrder: 1, - type: "STRING", - value: "", - plainText: null, - richText: null, - boolean: null, - date: null, - dateTime: null, - }, - }, - { - __typename: "AttributeValueCountableEdge" as "AttributeValueCountableEdge", - cursor: "", - node: { - __typename: "AttributeValue" as "AttributeValue", - file: null, - id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjU=", - name: "Polo", - reference: null, - slug: "polo", - sortOrder: 2, - type: "STRING", - value: "", - plainText: null, - richText: null, - boolean: null, - date: null, - dateTime: null, - }, - }, - ], }, }, - }, - { - node: { - __typename: "Attribute" as "Attribute", - entityType: null, - id: "UHJvZHVjdEF0dHJpYnV0ZTox", - inputType: AttributeInputTypeEnum.DROPDOWN, - name: "Color", - slug: "color", - valueRequired: true, - unit: null, - choices: { - __typename: "AttributeValueCountableConnection" as "AttributeValueCountableConnection", - pageInfo: { - endCursor: "WyI4IiwgIjMiXQ==", - hasNextPage: false, - hasPreviousPage: false, - startCursor: "WyIwIiwgIjQ5Il0=", - __typename: "PageInfo" as "PageInfo", + { + node: { + __typename: "Attribute" as "Attribute", + entityType: null, + id: "UHJvZHVjdEF0dHJpYnV0ZTox", + inputType: AttributeInputTypeEnum.DROPDOWN, + name: "Color", + slug: "color", + valueRequired: true, + unit: null, + choices: { + __typename: + "AttributeValueCountableConnection" as "AttributeValueCountableConnection", + pageInfo: { + endCursor: "WyI4IiwgIjMiXQ==", + hasNextPage: false, + hasPreviousPage: false, + startCursor: "WyIwIiwgIjQ5Il0=", + __typename: "PageInfo" as "PageInfo", + }, + edges: [ + { + __typename: + "AttributeValueCountableEdge" as "AttributeValueCountableEdge", + cursor: "", + node: { + __typename: "AttributeValue" as "AttributeValue", + file: null, + id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjE=", + name: "Blue", + reference: null, + slug: "blue", + sortOrder: 0, + type: "STRING", + value: "", + plainText: null, + richText: null, + boolean: null, + date: null, + dateTime: null, + }, + }, + { + __typename: + "AttributeValueCountableEdge" as "AttributeValueCountableEdge", + cursor: "", + node: { + __typename: "AttributeValue" as "AttributeValue", + file: null, + id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjI=", + name: "White", + reference: null, + slug: "white", + sortOrder: 1, + type: "STRING", + value: "", + plainText: null, + richText: null, + boolean: null, + date: null, + dateTime: null, + }, + }, + ], }, - edges: [ - { - __typename: "AttributeValueCountableEdge" as "AttributeValueCountableEdge", - cursor: "", - node: { - __typename: "AttributeValue" as "AttributeValue", - file: null, - id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjE=", - name: "Blue", - reference: null, - slug: "blue", - sortOrder: 0, - type: "STRING", - value: "", - plainText: null, - richText: null, - boolean: null, - date: null, - dateTime: null, - }, - }, - { - __typename: "AttributeValueCountableEdge" as "AttributeValueCountableEdge", - cursor: "", - node: { - __typename: "AttributeValue" as "AttributeValue", - file: null, - id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjI=", - name: "White", - reference: null, - slug: "white", - sortOrder: 1, - type: "STRING", - value: "", - plainText: null, - richText: null, - boolean: null, - date: null, - dateTime: null, - }, - }, - ], }, }, - }, - { - node: { - __typename: "Attribute" as "Attribute", - entityType: null, - id: "UHJvZHVjdEF0dHJpYnV0ZToxMg==", - inputType: AttributeInputTypeEnum.DROPDOWN, - name: "Cover", - slug: "cover", - valueRequired: true, - unit: null, - choices: { - __typename: "AttributeValueCountableConnection" as "AttributeValueCountableConnection", - pageInfo: { - endCursor: "WyI4IiwgIjMiXQ==", - hasNextPage: false, - hasPreviousPage: false, - startCursor: "WyIwIiwgIjQ5Il0=", - __typename: "PageInfo" as "PageInfo", + { + node: { + __typename: "Attribute" as "Attribute", + entityType: null, + id: "UHJvZHVjdEF0dHJpYnV0ZToxMg==", + inputType: AttributeInputTypeEnum.DROPDOWN, + name: "Cover", + slug: "cover", + valueRequired: true, + unit: null, + choices: { + __typename: + "AttributeValueCountableConnection" as "AttributeValueCountableConnection", + pageInfo: { + endCursor: "WyI4IiwgIjMiXQ==", + hasNextPage: false, + hasPreviousPage: false, + startCursor: "WyIwIiwgIjQ5Il0=", + __typename: "PageInfo" as "PageInfo", + }, + edges: [ + { + __typename: + "AttributeValueCountableEdge" as "AttributeValueCountableEdge", + cursor: "", + node: { + __typename: "AttributeValue" as "AttributeValue", + file: null, + id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjMw", + name: "Soft", + reference: null, + slug: "soft", + sortOrder: 0, + type: "STRING", + value: "", + plainText: null, + richText: null, + boolean: null, + date: null, + dateTime: null, + }, + }, + { + __typename: + "AttributeValueCountableEdge" as "AttributeValueCountableEdge", + cursor: "", + node: { + __typename: "AttributeValue" as "AttributeValue", + file: null, + id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjMx", + name: "Hard", + reference: null, + slug: "hard", + sortOrder: 1, + type: "STRING", + value: "", + plainText: null, + richText: null, + boolean: null, + date: null, + dateTime: null, + }, + }, + { + __typename: + "AttributeValueCountableEdge" as "AttributeValueCountableEdge", + cursor: "", + node: { + __typename: "AttributeValue" as "AttributeValue", + file: null, + id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjMy", + name: "Middle soft", + reference: null, + slug: "middle-soft", + sortOrder: 2, + type: "STRING", + value: "", + plainText: null, + richText: null, + boolean: null, + date: null, + dateTime: null, + }, + }, + { + __typename: + "AttributeValueCountableEdge" as "AttributeValueCountableEdge", + cursor: "", + node: { + __typename: "AttributeValue" as "AttributeValue", + file: null, + id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjMz", + name: "Middle hard", + reference: null, + slug: "middle-hard", + sortOrder: 3, + type: "STRING", + value: "", + plainText: null, + richText: null, + boolean: null, + date: null, + dateTime: null, + }, + }, + { + __typename: + "AttributeValueCountableEdge" as "AttributeValueCountableEdge", + cursor: "", + node: { + __typename: "AttributeValue" as "AttributeValue", + file: null, + id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjM0", + name: "Middle", + reference: null, + slug: "middle", + sortOrder: 4, + type: "STRING", + value: "", + plainText: null, + richText: null, + boolean: null, + date: null, + dateTime: null, + }, + }, + { + __typename: + "AttributeValueCountableEdge" as "AttributeValueCountableEdge", + cursor: "", + node: { + __typename: "AttributeValue" as "AttributeValue", + file: null, + id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjM1", + name: "Very hard", + reference: null, + slug: "very-hard", + sortOrder: 5, + type: "STRING", + value: "", + plainText: null, + richText: null, + boolean: null, + date: null, + dateTime: null, + }, + }, + ], }, - edges: [ - { - __typename: "AttributeValueCountableEdge" as "AttributeValueCountableEdge", - cursor: "", - node: { - __typename: "AttributeValue" as "AttributeValue", - file: null, - id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjMw", - name: "Soft", - reference: null, - slug: "soft", - sortOrder: 0, - type: "STRING", - value: "", - plainText: null, - richText: null, - boolean: null, - date: null, - dateTime: null, - }, - }, - { - __typename: "AttributeValueCountableEdge" as "AttributeValueCountableEdge", - cursor: "", - node: { - __typename: "AttributeValue" as "AttributeValue", - file: null, - id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjMx", - name: "Hard", - reference: null, - slug: "hard", - sortOrder: 1, - type: "STRING", - value: "", - plainText: null, - richText: null, - boolean: null, - date: null, - dateTime: null, - }, - }, - { - __typename: "AttributeValueCountableEdge" as "AttributeValueCountableEdge", - cursor: "", - node: { - __typename: "AttributeValue" as "AttributeValue", - file: null, - id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjMy", - name: "Middle soft", - reference: null, - slug: "middle-soft", - sortOrder: 2, - type: "STRING", - value: "", - plainText: null, - richText: null, - boolean: null, - date: null, - dateTime: null, - }, - }, - { - __typename: "AttributeValueCountableEdge" as "AttributeValueCountableEdge", - cursor: "", - node: { - __typename: "AttributeValue" as "AttributeValue", - file: null, - id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjMz", - name: "Middle hard", - reference: null, - slug: "middle-hard", - sortOrder: 3, - type: "STRING", - value: "", - plainText: null, - richText: null, - boolean: null, - date: null, - dateTime: null, - }, - }, - { - __typename: "AttributeValueCountableEdge" as "AttributeValueCountableEdge", - cursor: "", - node: { - __typename: "AttributeValue" as "AttributeValue", - file: null, - id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjM0", - name: "Middle", - reference: null, - slug: "middle", - sortOrder: 4, - type: "STRING", - value: "", - plainText: null, - richText: null, - boolean: null, - date: null, - dateTime: null, - }, - }, - { - __typename: "AttributeValueCountableEdge" as "AttributeValueCountableEdge", - cursor: "", - node: { - __typename: "AttributeValue" as "AttributeValue", - file: null, - id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjM1", - name: "Very hard", - reference: null, - slug: "very-hard", - sortOrder: 5, - type: "STRING", - value: "", - plainText: null, - richText: null, - boolean: null, - date: null, - dateTime: null, - }, - }, - ], }, }, - }, - { - node: { - __typename: "Attribute" as "Attribute", - entityType: null, - id: "UHJvZHVjdEF0dHJpYnV0ZTo3", - inputType: AttributeInputTypeEnum.DROPDOWN, - name: "Flavor", - slug: "flavor", - valueRequired: true, - unit: null, - choices: { - __typename: "AttributeValueCountableConnection" as "AttributeValueCountableConnection", - pageInfo: { - endCursor: "WyI4IiwgIjMiXQ==", - hasNextPage: false, - hasPreviousPage: false, - startCursor: "WyIwIiwgIjQ5Il0=", - __typename: "PageInfo" as "PageInfo", + { + node: { + __typename: "Attribute" as "Attribute", + entityType: null, + id: "UHJvZHVjdEF0dHJpYnV0ZTo3", + inputType: AttributeInputTypeEnum.DROPDOWN, + name: "Flavor", + slug: "flavor", + valueRequired: true, + unit: null, + choices: { + __typename: + "AttributeValueCountableConnection" as "AttributeValueCountableConnection", + pageInfo: { + endCursor: "WyI4IiwgIjMiXQ==", + hasNextPage: false, + hasPreviousPage: false, + startCursor: "WyIwIiwgIjQ5Il0=", + __typename: "PageInfo" as "PageInfo", + }, + edges: [ + { + __typename: + "AttributeValueCountableEdge" as "AttributeValueCountableEdge", + cursor: "", + node: { + __typename: "AttributeValue" as "AttributeValue", + file: null, + id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjE5", + name: "Sour", + reference: null, + slug: "sour", + sortOrder: 0, + type: "STRING", + value: "", + plainText: null, + richText: null, + boolean: null, + date: null, + dateTime: null, + }, + }, + { + __typename: + "AttributeValueCountableEdge" as "AttributeValueCountableEdge", + cursor: "", + node: { + __typename: "AttributeValue" as "AttributeValue", + file: null, + id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjIw", + name: "Sweet", + reference: null, + slug: "sweet", + sortOrder: 1, + type: "STRING", + value: "", + plainText: null, + richText: null, + boolean: null, + date: null, + dateTime: null, + }, + }, + ], }, - edges: [ - { - __typename: "AttributeValueCountableEdge" as "AttributeValueCountableEdge", - cursor: "", - node: { - __typename: "AttributeValue" as "AttributeValue", - file: null, - id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjE5", - name: "Sour", - reference: null, - slug: "sour", - sortOrder: 0, - type: "STRING", - value: "", - plainText: null, - richText: null, - boolean: null, - date: null, - dateTime: null, - }, - }, - { - __typename: "AttributeValueCountableEdge" as "AttributeValueCountableEdge", - cursor: "", - node: { - __typename: "AttributeValue" as "AttributeValue", - file: null, - id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjIw", - name: "Sweet", - reference: null, - slug: "sweet", - sortOrder: 1, - type: "STRING", - value: "", - plainText: null, - richText: null, - boolean: null, - date: null, - dateTime: null, - }, - }, - ], }, }, - }, - { - node: { - __typename: "Attribute" as "Attribute", - entityType: null, - id: "UHJvZHVjdEF0dHJpYnV0ZToxMQ==", - inputType: AttributeInputTypeEnum.DROPDOWN, - name: "Language", - slug: "language", - valueRequired: true, - unit: null, - choices: { - __typename: "AttributeValueCountableConnection" as "AttributeValueCountableConnection", - pageInfo: { - endCursor: "WyI4IiwgIjMiXQ==", - hasNextPage: false, - hasPreviousPage: false, - startCursor: "WyIwIiwgIjQ5Il0=", - __typename: "PageInfo" as "PageInfo", + { + node: { + __typename: "Attribute" as "Attribute", + entityType: null, + id: "UHJvZHVjdEF0dHJpYnV0ZToxMQ==", + inputType: AttributeInputTypeEnum.DROPDOWN, + name: "Language", + slug: "language", + valueRequired: true, + unit: null, + choices: { + __typename: + "AttributeValueCountableConnection" as "AttributeValueCountableConnection", + pageInfo: { + endCursor: "WyI4IiwgIjMiXQ==", + hasNextPage: false, + hasPreviousPage: false, + startCursor: "WyIwIiwgIjQ5Il0=", + __typename: "PageInfo" as "PageInfo", + }, + edges: [ + { + __typename: + "AttributeValueCountableEdge" as "AttributeValueCountableEdge", + cursor: "", + node: { + __typename: "AttributeValue" as "AttributeValue", + file: null, + id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjI4", + name: "English", + reference: null, + slug: "english", + sortOrder: 0, + type: "STRING", + value: "", + plainText: null, + richText: null, + boolean: null, + date: null, + dateTime: null, + }, + }, + { + __typename: + "AttributeValueCountableEdge" as "AttributeValueCountableEdge", + cursor: "", + node: { + __typename: "AttributeValue" as "AttributeValue", + file: null, + id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjI5", + name: "Pirate", + reference: null, + slug: "pirate", + sortOrder: 1, + type: "STRING", + value: "", + plainText: null, + richText: null, + boolean: null, + date: null, + dateTime: null, + }, + }, + ], }, - edges: [ - { - __typename: "AttributeValueCountableEdge" as "AttributeValueCountableEdge", - cursor: "", - node: { - __typename: "AttributeValue" as "AttributeValue", - file: null, - id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjI4", - name: "English", - reference: null, - slug: "english", - sortOrder: 0, - type: "STRING", - value: "", - plainText: null, - richText: null, - boolean: null, - date: null, - dateTime: null, - }, - }, - { - __typename: "AttributeValueCountableEdge" as "AttributeValueCountableEdge", - cursor: "", - node: { - __typename: "AttributeValue" as "AttributeValue", - file: null, - id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjI5", - name: "Pirate", - reference: null, - slug: "pirate", - sortOrder: 1, - type: "STRING", - value: "", - plainText: null, - richText: null, - boolean: null, - date: null, - dateTime: null, - }, - }, - ], }, }, - }, - { - node: { - __typename: "Attribute" as "Attribute", - entityType: null, - id: "UHJvZHVjdEF0dHJpYnV0ZToxMA==", - inputType: AttributeInputTypeEnum.DROPDOWN, - name: "Publisher", - slug: "publisher", - valueRequired: true, - unit: null, - choices: { - __typename: "AttributeValueCountableConnection" as "AttributeValueCountableConnection", - pageInfo: { - endCursor: "WyI4IiwgIjMiXQ==", - hasNextPage: false, - hasPreviousPage: false, - startCursor: "WyIwIiwgIjQ5Il0=", - __typename: "PageInfo" as "PageInfo", + { + node: { + __typename: "Attribute" as "Attribute", + entityType: null, + id: "UHJvZHVjdEF0dHJpYnV0ZToxMA==", + inputType: AttributeInputTypeEnum.DROPDOWN, + name: "Publisher", + slug: "publisher", + valueRequired: true, + unit: null, + choices: { + __typename: + "AttributeValueCountableConnection" as "AttributeValueCountableConnection", + pageInfo: { + endCursor: "WyI4IiwgIjMiXQ==", + hasNextPage: false, + hasPreviousPage: false, + startCursor: "WyIwIiwgIjQ5Il0=", + __typename: "PageInfo" as "PageInfo", + }, + edges: [ + { + __typename: + "AttributeValueCountableEdge" as "AttributeValueCountableEdge", + cursor: "", + node: { + __typename: "AttributeValue" as "AttributeValue", + file: null, + id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjI2", + name: "Mirumee Press", + reference: null, + slug: "mirumee-press", + sortOrder: 0, + type: "STRING", + value: "", + plainText: null, + richText: null, + boolean: null, + date: null, + dateTime: null, + }, + }, + { + __typename: + "AttributeValueCountableEdge" as "AttributeValueCountableEdge", + cursor: "", + node: { + __typename: "AttributeValue" as "AttributeValue", + file: null, + id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjI3", + name: "Saleor Publishing", + reference: null, + slug: "saleor-publishing", + sortOrder: 1, + type: "STRING", + value: "", + plainText: null, + richText: null, + boolean: null, + date: null, + dateTime: null, + }, + }, + ], }, - edges: [ - { - __typename: "AttributeValueCountableEdge" as "AttributeValueCountableEdge", - cursor: "", - node: { - __typename: "AttributeValue" as "AttributeValue", - file: null, - id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjI2", - name: "Mirumee Press", - reference: null, - slug: "mirumee-press", - sortOrder: 0, - type: "STRING", - value: "", - plainText: null, - richText: null, - boolean: null, - date: null, - dateTime: null, - }, - }, - { - __typename: "AttributeValueCountableEdge" as "AttributeValueCountableEdge", - cursor: "", - node: { - __typename: "AttributeValue" as "AttributeValue", - file: null, - id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjI3", - name: "Saleor Publishing", - reference: null, - slug: "saleor-publishing", - sortOrder: 1, - type: "STRING", - value: "", - plainText: null, - richText: null, - boolean: null, - date: null, - dateTime: null, - }, - }, - ], }, }, - }, - { - node: { - __typename: "Attribute" as "Attribute", - entityType: null, - id: "UHJvZHVjdEF0dHJpYnV0ZTo0", - inputType: AttributeInputTypeEnum.DROPDOWN, - name: "Size", - slug: "size", - valueRequired: true, - unit: null, - choices: { - __typename: "AttributeValueCountableConnection" as "AttributeValueCountableConnection", - pageInfo: { - endCursor: "WyI4IiwgIjMiXQ==", - hasNextPage: false, - hasPreviousPage: false, - startCursor: "WyIwIiwgIjQ5Il0=", - __typename: "PageInfo" as "PageInfo", + { + node: { + __typename: "Attribute" as "Attribute", + entityType: null, + id: "UHJvZHVjdEF0dHJpYnV0ZTo0", + inputType: AttributeInputTypeEnum.DROPDOWN, + name: "Size", + slug: "size", + valueRequired: true, + unit: null, + choices: { + __typename: + "AttributeValueCountableConnection" as "AttributeValueCountableConnection", + pageInfo: { + endCursor: "WyI4IiwgIjMiXQ==", + hasNextPage: false, + hasPreviousPage: false, + startCursor: "WyIwIiwgIjQ5Il0=", + __typename: "PageInfo" as "PageInfo", + }, + edges: [ + { + __typename: + "AttributeValueCountableEdge" as "AttributeValueCountableEdge", + cursor: "", + node: { + __typename: "AttributeValue" as "AttributeValue", + file: null, + id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjc=", + name: "XS", + reference: null, + slug: "xs", + sortOrder: 0, + type: "STRING", + value: "", + plainText: null, + richText: null, + boolean: null, + date: null, + dateTime: null, + }, + }, + { + __typename: + "AttributeValueCountableEdge" as "AttributeValueCountableEdge", + cursor: "", + node: { + __typename: "AttributeValue" as "AttributeValue", + file: null, + id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjg=", + name: "S", + reference: null, + slug: "s", + sortOrder: 1, + type: "STRING", + value: "", + plainText: null, + richText: null, + boolean: null, + date: null, + dateTime: null, + }, + }, + { + __typename: + "AttributeValueCountableEdge" as "AttributeValueCountableEdge", + cursor: "", + node: { + __typename: "AttributeValue" as "AttributeValue", + file: null, + id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjk=", + name: "M", + reference: null, + slug: "m", + sortOrder: 2, + type: "STRING", + value: "", + plainText: null, + richText: null, + boolean: null, + date: null, + dateTime: null, + }, + }, + { + __typename: + "AttributeValueCountableEdge" as "AttributeValueCountableEdge", + cursor: "", + node: { + __typename: "AttributeValue" as "AttributeValue", + file: null, + id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjEw", + name: "L", + reference: null, + slug: "l", + sortOrder: 3, + type: "STRING", + value: "", + plainText: null, + richText: null, + boolean: null, + date: null, + dateTime: null, + }, + }, + { + __typename: + "AttributeValueCountableEdge" as "AttributeValueCountableEdge", + cursor: "", + node: { + __typename: "AttributeValue" as "AttributeValue", + file: null, + id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjEx", + name: "XL", + reference: null, + slug: "xl", + sortOrder: 4, + type: "STRING", + value: "", + plainText: null, + richText: null, + boolean: null, + date: null, + dateTime: null, + }, + }, + { + __typename: + "AttributeValueCountableEdge" as "AttributeValueCountableEdge", + cursor: "", + node: { + __typename: "AttributeValue" as "AttributeValue", + file: null, + id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjEy", + name: "XXL", + reference: null, + slug: "xxl", + sortOrder: 5, + type: "STRING", + value: "", + plainText: null, + richText: null, + boolean: null, + date: null, + dateTime: null, + }, + }, + ], }, - edges: [ - { - __typename: "AttributeValueCountableEdge" as "AttributeValueCountableEdge", - cursor: "", - node: { - __typename: "AttributeValue" as "AttributeValue", - file: null, - id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjc=", - name: "XS", - reference: null, - slug: "xs", - sortOrder: 0, - type: "STRING", - value: "", - plainText: null, - richText: null, - boolean: null, - date: null, - dateTime: null, - }, - }, - { - __typename: "AttributeValueCountableEdge" as "AttributeValueCountableEdge", - cursor: "", - node: { - __typename: "AttributeValue" as "AttributeValue", - file: null, - id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjg=", - name: "S", - reference: null, - slug: "s", - sortOrder: 1, - type: "STRING", - value: "", - plainText: null, - richText: null, - boolean: null, - date: null, - dateTime: null, - }, - }, - { - __typename: "AttributeValueCountableEdge" as "AttributeValueCountableEdge", - cursor: "", - node: { - __typename: "AttributeValue" as "AttributeValue", - file: null, - id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjk=", - name: "M", - reference: null, - slug: "m", - sortOrder: 2, - type: "STRING", - value: "", - plainText: null, - richText: null, - boolean: null, - date: null, - dateTime: null, - }, - }, - { - __typename: "AttributeValueCountableEdge" as "AttributeValueCountableEdge", - cursor: "", - node: { - __typename: "AttributeValue" as "AttributeValue", - file: null, - id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjEw", - name: "L", - reference: null, - slug: "l", - sortOrder: 3, - type: "STRING", - value: "", - plainText: null, - richText: null, - boolean: null, - date: null, - dateTime: null, - }, - }, - { - __typename: "AttributeValueCountableEdge" as "AttributeValueCountableEdge", - cursor: "", - node: { - __typename: "AttributeValue" as "AttributeValue", - file: null, - id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjEx", - name: "XL", - reference: null, - slug: "xl", - sortOrder: 4, - type: "STRING", - value: "", - plainText: null, - richText: null, - boolean: null, - date: null, - dateTime: null, - }, - }, - { - __typename: "AttributeValueCountableEdge" as "AttributeValueCountableEdge", - cursor: "", - node: { - __typename: "AttributeValue" as "AttributeValue", - file: null, - id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjEy", - name: "XXL", - reference: null, - slug: "xxl", - sortOrder: 5, - type: "STRING", - value: "", - plainText: null, - richText: null, - boolean: null, - date: null, - dateTime: null, - }, - }, - ], }, }, - }, -].map(edge => edge.node); + ].map(edge => edge.node); export const productTypeSearch: ProductTypeQuery["productType"] = { __typename: "ProductType" as "ProductType", @@ -1014,10 +1063,10 @@ export const productTypeSearch: ProductTypeQuery["productType"] = { }, }; -export const productTypes: Array[0] & - ProductTypeListQuery["productTypes"]["edges"][0]["node"]> = [ +export const productTypes: Array< + RelayToFlat[0] & + ProductTypeListQuery["productTypes"]["edges"][0]["node"] +> = [ { __typename: "ProductType" as "ProductType", hasVariants: true, diff --git a/src/productTypes/hooks/useProductTypeDelete/useProductTypeDelete.tsx b/src/productTypes/hooks/useProductTypeDelete/useProductTypeDelete.tsx index 03c669ac0..1a8a73ca2 100644 --- a/src/productTypes/hooks/useProductTypeDelete/useProductTypeDelete.tsx +++ b/src/productTypes/hooks/useProductTypeDelete/useProductTypeDelete.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ProductCountQueryVariables, useProductCountQuery, @@ -16,7 +17,7 @@ import React from "react"; import * as messages from "./messages"; type UseProductTypeDeleteProps< - T = ProductTypeListUrlQueryParams | ProductTypeUrlQueryParams + T = ProductTypeListUrlQueryParams | ProductTypeUrlQueryParams, > = UseTypeDeleteProps; function useProductTypeDelete({ @@ -28,16 +29,15 @@ function useProductTypeDelete({ const isDeleteDialogOpen = params.action === "remove"; - const productsAssignedToSelectedTypesQueryVars = React.useMemo< - ProductCountQueryVariables - >( - () => ({ - filter: { - productTypes, - }, - }), - [productTypes], - ); + const productsAssignedToSelectedTypesQueryVars = + React.useMemo( + () => ({ + filter: { + productTypes, + }, + }), + [productTypes], + ); const shouldSkipProductListQuery = !productTypes.length || !isDeleteDialogOpen; diff --git a/src/productTypes/hooks/useProductTypeOperations.ts b/src/productTypes/hooks/useProductTypeOperations.ts index ebaf6aa78..a556c45c6 100644 --- a/src/productTypes/hooks/useProductTypeOperations.ts +++ b/src/productTypes/hooks/useProductTypeOperations.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { AssignProductAttributeMutation, ProductAttributeType, @@ -66,7 +67,8 @@ function useProductTypeOperations({ optimisticResponse: variables => ({ __typename: "Mutation", productTypeReorderAttributes: { - __typename: "ProductTypeReorderAttributes" as "ProductTypeReorderAttributes", + __typename: + "ProductTypeReorderAttributes" as "ProductTypeReorderAttributes", errors: [], productType: { ...productType, diff --git a/src/productTypes/views/ProductTypeCreate.tsx b/src/productTypes/views/ProductTypeCreate.tsx index c6506af29..e66162e43 100644 --- a/src/productTypes/views/ProductTypeCreate.tsx +++ b/src/productTypes/views/ProductTypeCreate.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { WindowTitle } from "@dashboard/components/WindowTitle"; import { ProductTypeKindEnum, @@ -50,23 +51,21 @@ export const ProductTypeCreate: React.FC = ({ const { taxClasses, fetchMoreTaxClasses } = useTaxClassFetchMore(); - const [ - createProductType, - createProductTypeOpts, - ] = useProductTypeCreateMutation({ - onCompleted: data => { - if (data.productTypeCreate.errors.length === 0) { - notify({ - status: "success", - text: intl.formatMessage({ - id: "paa4m0", - defaultMessage: "Successfully created product type", - }), - }); - navigate(productTypeUrl(data.productTypeCreate.productType.id)); - } - }, - }); + const [createProductType, createProductTypeOpts] = + useProductTypeCreateMutation({ + onCompleted: data => { + if (data.productTypeCreate.errors.length === 0) { + notify({ + status: "success", + text: intl.formatMessage({ + id: "paa4m0", + defaultMessage: "Successfully created product type", + }), + }); + navigate(productTypeUrl(data.productTypeCreate.productType.id)); + } + }, + }); const handleCreate = async (formData: ProductTypeForm) => { const result = await createProductType({ diff --git a/src/productTypes/views/ProductTypeList/ProductTypeList.tsx b/src/productTypes/views/ProductTypeList/ProductTypeList.tsx index fafcea5f8..c2283e0aa 100644 --- a/src/productTypes/views/ProductTypeList/ProductTypeList.tsx +++ b/src/productTypes/views/ProductTypeList/ProductTypeList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import DeleteFilterTabDialog from "@dashboard/components/DeleteFilterTabDialog"; import SaveFilterTabDialog, { SaveFilterTabDialogFormData, @@ -85,17 +86,14 @@ export const ProductTypeList: React.FC = ({ params }) => { const currentTab = getFiltersCurrentTab(params, tabs); - const [ - changeFilters, - resetFilters, - handleSearchChange, - ] = createFilterHandlers({ - cleanupFn: reset, - createUrl: productTypeListUrl, - getFilterQueryParam, - navigate, - params, - }); + const [changeFilters, resetFilters, handleSearchChange] = + createFilterHandlers({ + cleanupFn: reset, + createUrl: productTypeListUrl, + getFilterQueryParam, + navigate, + params, + }); const [openModal, closeModal] = createDialogActionHandlers< ProductTypeListUrlDialog, @@ -138,28 +136,26 @@ export const ProductTypeList: React.FC = ({ params }) => { const productTypesData = mapEdgesToItems(data?.productTypes); - const [ - productTypeBulkDelete, - productTypeBulkDeleteOpts, - ] = useProductTypeBulkDeleteMutation({ - onCompleted: data => { - if (data.productTypeBulkDelete.errors.length === 0) { - notify({ - status: "success", - text: intl.formatMessage(commonMessages.savedChanges), - }); - reset(); - refetch(); - navigate( - productTypeListUrl({ - ...params, - action: undefined, - ids: undefined, - }), - ); - } - }, - }); + const [productTypeBulkDelete, productTypeBulkDeleteOpts] = + useProductTypeBulkDeleteMutation({ + onCompleted: data => { + if (data.productTypeBulkDelete.errors.length === 0) { + notify({ + status: "success", + text: intl.formatMessage(commonMessages.savedChanges), + }); + reset(); + refetch(); + navigate( + productTypeListUrl({ + ...params, + action: undefined, + ids: undefined, + }), + ); + } + }, + }); const onProductTypeBulkDelete = () => productTypeBulkDelete({ diff --git a/src/productTypes/views/ProductTypeList/filters.ts b/src/productTypes/views/ProductTypeList/filters.ts index 0aca558ae..d03738eff 100644 --- a/src/productTypes/views/ProductTypeList/filters.ts +++ b/src/productTypes/views/ProductTypeList/filters.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FilterElement } from "@dashboard/components/Filter"; import { ProductTypeConfigurable, @@ -74,16 +75,10 @@ export function getFilterQueryParam( } } -export const { - deleteFilterTab, - getFilterTabs, - saveFilterTab, -} = createFilterTabUtils(PRODUCT_TYPE_FILTERS_KEY); +export const { deleteFilterTab, getFilterTabs, saveFilterTab } = + createFilterTabUtils(PRODUCT_TYPE_FILTERS_KEY); -export const { - areFiltersApplied, - getActiveFilters, - getFiltersCurrentTab, -} = createFilterUtils( - ProductTypeListUrlFiltersEnum, -); +export const { areFiltersApplied, getActiveFilters, getFiltersCurrentTab } = + createFilterUtils( + ProductTypeListUrlFiltersEnum, + ); diff --git a/src/productTypes/views/ProductTypeList/sort.ts b/src/productTypes/views/ProductTypeList/sort.ts index 64de40e21..8fbd20047 100644 --- a/src/productTypes/views/ProductTypeList/sort.ts +++ b/src/productTypes/views/ProductTypeList/sort.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ProductTypeSortField } from "@dashboard/graphql"; import { ProductTypeListUrlSortField } from "@dashboard/productTypes/urls"; import { createGetSortQueryVariables } from "@dashboard/utils/sort"; @@ -15,6 +16,5 @@ export function getSortQueryField( } } -export const getSortQueryVariables = createGetSortQueryVariables( - getSortQueryField, -); +export const getSortQueryVariables = + createGetSortQueryVariables(getSortQueryField); diff --git a/src/productTypes/views/ProductTypeUpdate/index.tsx b/src/productTypes/views/ProductTypeUpdate/index.tsx index b9068e811..31deb3526 100644 --- a/src/productTypes/views/ProductTypeUpdate/index.tsx +++ b/src/productTypes/views/ProductTypeUpdate/index.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import AssignAttributeDialog from "@dashboard/components/AssignAttributeDialog"; import AttributeUnassignDialog from "@dashboard/components/AttributeUnassignDialog"; import BulkAttributeUnassignDialog from "@dashboard/components/BulkAttributeUnassignDialog"; @@ -68,54 +69,48 @@ export const ProductTypeUpdate: React.FC = ({ formErrors: [], }); - const [ - updateProductType, - updateProductTypeOpts, - ] = useProductTypeUpdateMutation({ - onCompleted: updateData => { - if ( - !updateData.productTypeUpdate.errors || - updateData.productTypeUpdate.errors.length === 0 - ) { - notify({ - status: "success", - text: intl.formatMessage(commonMessages.savedChanges), - }); - } else if ( - updateData.productTypeUpdate.errors !== null && - updateData.productTypeUpdate.errors.length > 0 - ) { - setErrors(prevErrors => ({ - ...prevErrors, - formErrors: updateData.productTypeUpdate.errors, - })); - } - }, - }); - const [ - updateProductAttributes, - updateProductAttributesOpts, - ] = useProductAttributeAssignmentUpdateMutation({ - onCompleted: updateData => { - if ( - updateData.productAttributeAssignmentUpdate.errors !== null && - updateData.productAttributeAssignmentUpdate.errors.length > 0 - ) { - setErrors(prevErrors => ({ - ...prevErrors, - formErrors: updateData.productAttributeAssignmentUpdate.errors, - })); - } - }, - }); + const [updateProductType, updateProductTypeOpts] = + useProductTypeUpdateMutation({ + onCompleted: updateData => { + if ( + !updateData.productTypeUpdate.errors || + updateData.productTypeUpdate.errors.length === 0 + ) { + notify({ + status: "success", + text: intl.formatMessage(commonMessages.savedChanges), + }); + } else if ( + updateData.productTypeUpdate.errors !== null && + updateData.productTypeUpdate.errors.length > 0 + ) { + setErrors(prevErrors => ({ + ...prevErrors, + formErrors: updateData.productTypeUpdate.errors, + })); + } + }, + }); + const [updateProductAttributes, updateProductAttributesOpts] = + useProductAttributeAssignmentUpdateMutation({ + onCompleted: updateData => { + if ( + updateData.productAttributeAssignmentUpdate.errors !== null && + updateData.productAttributeAssignmentUpdate.errors.length > 0 + ) { + setErrors(prevErrors => ({ + ...prevErrors, + formErrors: updateData.productAttributeAssignmentUpdate.errors, + })); + } + }, + }); const [updateMetadata] = useUpdateMetadataMutation({}); const [updatePrivateMetadata] = useUpdatePrivateMetadataMutation({}); - const [ - selectedVariantAttributes, - setSelectedVariantAttributes, - ] = React.useState([]); + const [selectedVariantAttributes, setSelectedVariantAttributes] = + React.useState([]); const handleProductTypeUpdate = async (formData: ProductTypeForm) => { const operations = formData.variantAttributes.map(variantAttribute => ({ diff --git a/src/products/components/OrderDiscountProviders/OrderDiscountProvider.tsx b/src/products/components/OrderDiscountProviders/OrderDiscountProvider.tsx index 8b3f27ba8..873d368d7 100644 --- a/src/products/components/OrderDiscountProviders/OrderDiscountProvider.tsx +++ b/src/products/components/OrderDiscountProviders/OrderDiscountProvider.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ConfirmButtonTransitionState } from "@dashboard/components/ConfirmButton"; import { MoneyFragment, diff --git a/src/products/components/OrderDiscountProviders/OrderLineDiscountProvider.tsx b/src/products/components/OrderDiscountProviders/OrderLineDiscountProvider.tsx index d757ccb10..3b9b0019a 100644 --- a/src/products/components/OrderDiscountProviders/OrderLineDiscountProvider.tsx +++ b/src/products/components/OrderDiscountProviders/OrderLineDiscountProvider.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ConfirmButtonTransitionState } from "@dashboard/components/ConfirmButton"; import { MoneyFragment, diff --git a/src/products/components/OrderDiscountProviders/utils.ts b/src/products/components/OrderDiscountProviders/utils.ts index 5eeb0931f..c315ae646 100644 --- a/src/products/components/OrderDiscountProviders/utils.ts +++ b/src/products/components/OrderDiscountProviders/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { OrderDetailsFragment, OrderDetailsQuery, diff --git a/src/products/components/ProductCategoryAndCollectionsForm/ProductCategoryAndCollectionsForm.tsx b/src/products/components/ProductCategoryAndCollectionsForm/ProductCategoryAndCollectionsForm.tsx index 36901e048..c5a7a2d58 100644 --- a/src/products/components/ProductCategoryAndCollectionsForm/ProductCategoryAndCollectionsForm.tsx +++ b/src/products/components/ProductCategoryAndCollectionsForm/ProductCategoryAndCollectionsForm.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import FormSpacer from "@dashboard/components/FormSpacer"; import MultiSelectField from "@dashboard/components/MultiSelectField"; diff --git a/src/products/components/ProductCreatePage/ProductCreatePage.stories.tsx b/src/products/components/ProductCreatePage/ProductCreatePage.stories.tsx index c0a98403d..900b2bdf8 100644 --- a/src/products/components/ProductCreatePage/ProductCreatePage.stories.tsx +++ b/src/products/components/ProductCreatePage/ProductCreatePage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { channelsList } from "@dashboard/channels/fixtures"; import { createChannelsData } from "@dashboard/channels/utils"; import { ConfirmButtonTransitionState } from "@dashboard/components/ConfirmButton"; diff --git a/src/products/components/ProductCreatePage/ProductCreatePage.tsx b/src/products/components/ProductCreatePage/ProductCreatePage.tsx index 88f1a9739..a55b020f8 100644 --- a/src/products/components/ProductCreatePage/ProductCreatePage.tsx +++ b/src/products/components/ProductCreatePage/ProductCreatePage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { getReferenceAttributeEntityTypeFromAttribute, mergeAttributeValues, diff --git a/src/products/components/ProductCreatePage/form.tsx b/src/products/components/ProductCreatePage/form.tsx index a7a624d68..77cfaa46c 100644 --- a/src/products/components/ProductCreatePage/form.tsx +++ b/src/products/components/ProductCreatePage/form.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { getAttributesDisplayData, getRichTextAttributesFromMap, @@ -252,9 +253,8 @@ function useProductCreateForm( triggerChange, }); - const { - makeChangeHandler: makeMetadataChangeHandler, - } = useMetadataChangeTrigger(); + const { makeChangeHandler: makeMetadataChangeHandler } = + useMetadataChangeTrigger(); const handleCollectionSelect = createMultiAutocompleteSelectHandler( toggleValue, @@ -404,13 +404,10 @@ function useProductCreateForm( return errors; }; - const { - setExitDialogSubmitRef, - setIsSubmitDisabled, - setIsDirty, - } = useExitFormDialog({ - formId: PRODUCT_CREATE_FORM_ID, - }); + const { setExitDialogSubmitRef, setIsSubmitDisabled, setIsDirty } = + useExitFormDialog({ + formId: PRODUCT_CREATE_FORM_ID, + }); useEffect(() => setExitDialogSubmitRef(submit), [submit]); diff --git a/src/products/components/ProductDetailsForm/ProductDetailsForm.tsx b/src/products/components/ProductDetailsForm/ProductDetailsForm.tsx index 893de62fb..b3f034bb1 100644 --- a/src/products/components/ProductDetailsForm/ProductDetailsForm.tsx +++ b/src/products/components/ProductDetailsForm/ProductDetailsForm.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { DashboardCard } from "@dashboard/components/Card"; import RichTextEditor from "@dashboard/components/RichTextEditor"; import { RichTextEditorLoading } from "@dashboard/components/RichTextEditor/RichTextEditorLoading"; diff --git a/src/products/components/ProductExportDialog/ProductExportDialog.tsx b/src/products/components/ProductExportDialog/ProductExportDialog.tsx index 5dcd4ddfa..d48b0d6ab 100644 --- a/src/products/components/ProductExportDialog/ProductExportDialog.tsx +++ b/src/products/components/ProductExportDialog/ProductExportDialog.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Button } from "@dashboard/components/Button"; import { ConfirmButton, diff --git a/src/products/components/ProductExportDialog/ProductExportDialogInfo.tsx b/src/products/components/ProductExportDialog/ProductExportDialogInfo.tsx index fe68960a5..2635fafe4 100644 --- a/src/products/components/ProductExportDialog/ProductExportDialogInfo.tsx +++ b/src/products/components/ProductExportDialog/ProductExportDialogInfo.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import Accordion, { AccordionProps } from "@dashboard/components/Accordion"; import { useChannelsSearch } from "@dashboard/components/ChannelsAvailabilityDialog/utils"; import ChannelsAvailabilityDialogChannelsList from "@dashboard/components/ChannelsAvailabilityDialogChannelsList"; @@ -141,12 +142,14 @@ const Option: React.FC<{ ); }; -const FieldAccordion: React.FC void; - onToggleAll: (field: ProductFieldEnum[], setTo: boolean) => void; -}> = ({ data, fields, onChange, onToggleAll, ...props }) => { +const FieldAccordion: React.FC< + AccordionProps & { + data: ExportProductsInput; + fields: ProductFieldEnum[]; + onChange: (event: ChangeEvent) => void; + onToggleAll: (field: ProductFieldEnum[], setTo: boolean) => void; + } +> = ({ data, fields, onChange, onToggleAll, ...props }) => { const classes = useStyles({}); const getFieldLabel = useProductExportFieldMessages(); diff --git a/src/products/components/ProductListDatagrid/ProductListDatagrid.tsx b/src/products/components/ProductListDatagrid/ProductListDatagrid.tsx index 0d29e7eff..fce5f7a83 100644 --- a/src/products/components/ProductListDatagrid/ProductListDatagrid.tsx +++ b/src/products/components/ProductListDatagrid/ProductListDatagrid.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import ColumnPicker from "@dashboard/components/ColumnPicker"; import Datagrid from "@dashboard/components/Datagrid/Datagrid"; import { diff --git a/src/products/components/ProductListDatagrid/hooks/useColumnPickerColumns.test.ts b/src/products/components/ProductListDatagrid/hooks/useColumnPickerColumns.test.ts index 85649d07f..4a5799fd8 100644 --- a/src/products/components/ProductListDatagrid/hooks/useColumnPickerColumns.test.ts +++ b/src/products/components/ProductListDatagrid/hooks/useColumnPickerColumns.test.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ProductListColumns } from "@dashboard/config"; import { GridAttributesQuery, diff --git a/src/products/components/ProductListDatagrid/hooks/useColumnPickerColumns.ts b/src/products/components/ProductListDatagrid/hooks/useColumnPickerColumns.ts index 1a7f5bcd6..bddb15798 100644 --- a/src/products/components/ProductListDatagrid/hooks/useColumnPickerColumns.ts +++ b/src/products/components/ProductListDatagrid/hooks/useColumnPickerColumns.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { MultiAutocompleteChoiceType } from "@dashboard/components/MultiAutocompleteSelectField"; import { ProductListColumns } from "@dashboard/config"; import { diff --git a/src/products/components/ProductListDatagrid/hooks/useDatagridColumns.ts b/src/products/components/ProductListDatagrid/hooks/useDatagridColumns.ts index 85eb8b9aa..1bb672ace 100644 --- a/src/products/components/ProductListDatagrid/hooks/useDatagridColumns.ts +++ b/src/products/components/ProductListDatagrid/hooks/useDatagridColumns.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { AvailableColumn } from "@dashboard/components/Datagrid/types"; import { ProductListColumns } from "@dashboard/config"; import { GridAttributesQuery } from "@dashboard/graphql"; diff --git a/src/products/components/ProductListDatagrid/utils.ts b/src/products/components/ProductListDatagrid/utils.ts index f30ca61f3..dd790c489 100644 --- a/src/products/components/ProductListDatagrid/utils.ts +++ b/src/products/components/ProductListDatagrid/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { messages } from "@dashboard/components/ChannelsAvailabilityDropdown/messages"; import { getChannelAvailabilityLabel } from "@dashboard/components/ChannelsAvailabilityDropdown/utils"; import { diff --git a/src/products/components/ProductListDeleteButton/ProductListDeleteButton.test.tsx b/src/products/components/ProductListDeleteButton/ProductListDeleteButton.test.tsx index d2855f63a..6e53a2da0 100644 --- a/src/products/components/ProductListDeleteButton/ProductListDeleteButton.test.tsx +++ b/src/products/components/ProductListDeleteButton/ProductListDeleteButton.test.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { render, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import React from "react"; diff --git a/src/products/components/ProductListPage/ProductListPage.stories.tsx b/src/products/components/ProductListPage/ProductListPage.stories.tsx index f38196769..a40468778 100644 --- a/src/products/components/ProductListPage/ProductListPage.stories.tsx +++ b/src/products/components/ProductListPage/ProductListPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import placeholderImage from "@assets/images/placeholder255x255.png"; import { defaultListSettings } from "@dashboard/config"; import { diff --git a/src/products/components/ProductListPage/ProductListPage.tsx b/src/products/components/ProductListPage/ProductListPage.tsx index ff3bb93a3..840087d7d 100644 --- a/src/products/components/ProductListPage/ProductListPage.tsx +++ b/src/products/components/ProductListPage/ProductListPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { extensionMountPoints, mapToMenuItems, diff --git a/src/products/components/ProductListPage/filters.ts b/src/products/components/ProductListPage/filters.ts index 6a233311f..d44c1a8fa 100644 --- a/src/products/components/ProductListPage/filters.ts +++ b/src/products/components/ProductListPage/filters.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { IFilter } from "@dashboard/components/Filter"; import { SingleAutocompleteChoiceType } from "@dashboard/components/SingleAutocompleteSelectField"; import { AttributeInputTypeEnum, StockAvailability } from "@dashboard/graphql"; diff --git a/src/products/components/ProductListTiles/ProductListTiles.tsx b/src/products/components/ProductListTiles/ProductListTiles.tsx index e7aab428e..efa62376b 100644 --- a/src/products/components/ProductListTiles/ProductListTiles.tsx +++ b/src/products/components/ProductListTiles/ProductListTiles.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TablePaginationWithContext } from "@dashboard/components/TablePagination"; import { ProductListColumns } from "@dashboard/config"; import { ProductListQuery } from "@dashboard/graphql"; diff --git a/src/products/components/ProductMedia/ProductMedia.tsx b/src/products/components/ProductMedia/ProductMedia.tsx index e8e7868bf..4145753c9 100644 --- a/src/products/components/ProductMedia/ProductMedia.tsx +++ b/src/products/components/ProductMedia/ProductMedia.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { DashboardCard } from "@dashboard/components/Card"; import ImageUpload from "@dashboard/components/ImageUpload"; import MediaTile from "@dashboard/components/MediaTile"; diff --git a/src/products/components/ProductMediaNavigation/ProductMediaNavigation.tsx b/src/products/components/ProductMediaNavigation/ProductMediaNavigation.tsx index 36007bbdd..994eff30f 100644 --- a/src/products/components/ProductMediaNavigation/ProductMediaNavigation.tsx +++ b/src/products/components/ProductMediaNavigation/ProductMediaNavigation.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import CardTitle from "@dashboard/components/CardTitle"; import Skeleton from "@dashboard/components/Skeleton"; import { Card, CardContent } from "@material-ui/core"; diff --git a/src/products/components/ProductMediaPage/ProductMediaPage.stories.tsx b/src/products/components/ProductMediaPage/ProductMediaPage.stories.tsx index 73a823eab..52dff7030 100644 --- a/src/products/components/ProductMediaPage/ProductMediaPage.stories.tsx +++ b/src/products/components/ProductMediaPage/ProductMediaPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import placeholder from "@assets/images/placeholder1080x1080.png"; import { ProductMediaType } from "@dashboard/graphql"; import React from "react"; diff --git a/src/products/components/ProductMediaPage/ProductMediaPage.tsx b/src/products/components/ProductMediaPage/ProductMediaPage.tsx index 407976700..8f7c9edbd 100644 --- a/src/products/components/ProductMediaPage/ProductMediaPage.tsx +++ b/src/products/components/ProductMediaPage/ProductMediaPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import CardTitle from "@dashboard/components/CardTitle"; import { ConfirmButtonTransitionState } from "@dashboard/components/ConfirmButton"; diff --git a/src/products/components/ProductOrganization/ProductOrganization.tsx b/src/products/components/ProductOrganization/ProductOrganization.tsx index 0a76c97b2..cf5f26c28 100644 --- a/src/products/components/ProductOrganization/ProductOrganization.tsx +++ b/src/products/components/ProductOrganization/ProductOrganization.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { DashboardCard } from "@dashboard/components/Card"; import Link from "@dashboard/components/Link"; import MultiAutocompleteSelectField, { diff --git a/src/products/components/ProductShipping/ProductShipping.tsx b/src/products/components/ProductShipping/ProductShipping.tsx index 35355efbe..04b416435 100644 --- a/src/products/components/ProductShipping/ProductShipping.tsx +++ b/src/products/components/ProductShipping/ProductShipping.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { DashboardCard } from "@dashboard/components/Card"; import { ProductErrorFragment } from "@dashboard/graphql"; import { getFormErrors, getProductErrorMessage } from "@dashboard/utils/errors"; diff --git a/src/products/components/ProductStocks/ProductStocks.tsx b/src/products/components/ProductStocks/ProductStocks.tsx index cda4e2000..ce6b564f5 100644 --- a/src/products/components/ProductStocks/ProductStocks.tsx +++ b/src/products/components/ProductStocks/ProductStocks.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ChannelData, ChannelPriceAndPreorderArgs, diff --git a/src/products/components/ProductTile/ProductTile.test.tsx b/src/products/components/ProductTile/ProductTile.test.tsx index 9f7ccba95..9a609c294 100644 --- a/src/products/components/ProductTile/ProductTile.test.tsx +++ b/src/products/components/ProductTile/ProductTile.test.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { products } from "@dashboard/products/fixtures"; import { render, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; diff --git a/src/products/components/ProductTile/ProductTile.tsx b/src/products/components/ProductTile/ProductTile.tsx index 744e57941..b648e5525 100644 --- a/src/products/components/ProductTile/ProductTile.tsx +++ b/src/products/components/ProductTile/ProductTile.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { StatusDot } from "@dashboard/components/StatusDot/StatusDot"; import { ProductListQuery } from "@dashboard/graphql"; import { RelayToFlat } from "@dashboard/types"; diff --git a/src/products/components/ProductTile/utils.ts b/src/products/components/ProductTile/utils.ts index 3132ff37d..4ffa7748c 100644 --- a/src/products/components/ProductTile/utils.ts +++ b/src/products/components/ProductTile/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { StatusDotProps } from "@dashboard/components/StatusDot/StatusDot"; import { ProductFragment } from "@dashboard/graphql"; diff --git a/src/products/components/ProductTypePickerDialog/ProductTypePickerDialog.tsx b/src/products/components/ProductTypePickerDialog/ProductTypePickerDialog.tsx index 90ef03a9f..8fc74da79 100644 --- a/src/products/components/ProductTypePickerDialog/ProductTypePickerDialog.tsx +++ b/src/products/components/ProductTypePickerDialog/ProductTypePickerDialog.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import ActionDialog from "@dashboard/components/ActionDialog"; import { ConfirmButtonTransitionState } from "@dashboard/components/ConfirmButton"; import SingleAutocompleteSelectField, { diff --git a/src/products/components/ProductUpdatePage/ProductChannelsListingsDialog.tsx b/src/products/components/ProductUpdatePage/ProductChannelsListingsDialog.tsx index c3daa2850..b4e34de67 100644 --- a/src/products/components/ProductUpdatePage/ProductChannelsListingsDialog.tsx +++ b/src/products/components/ProductUpdatePage/ProductChannelsListingsDialog.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import ChannelsAvailabilityDialog from "@dashboard/components/ChannelsAvailabilityDialog"; import { ChannelFragment } from "@dashboard/graphql"; import useStateFromProps from "@dashboard/hooks/useStateFromProps"; @@ -19,13 +20,9 @@ export interface ProductChannelsListingsDialogProps extends DialogProps { onConfirm: ProductChannelsListingDialogSubmit; } -const ProductChannelsListingsDialog: React.FC = ({ - channels, - data, - open, - onClose, - onConfirm, -}) => { +const ProductChannelsListingsDialog: React.FC< + ProductChannelsListingsDialogProps +> = ({ channels, data, open, onClose, onConfirm }) => { const intl = useIntl(); const [selected, setSelected] = useStateFromProps( diff --git a/src/products/components/ProductUpdatePage/ProductUpdatePage.stories.tsx b/src/products/components/ProductUpdatePage/ProductUpdatePage.stories.tsx index f833fce74..a4b194f1e 100644 --- a/src/products/components/ProductUpdatePage/ProductUpdatePage.stories.tsx +++ b/src/products/components/ProductUpdatePage/ProductUpdatePage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import placeholderImage from "@assets/images/placeholder255x255.png"; import { channelsList } from "@dashboard/channels/fixtures"; import { collections } from "@dashboard/collections/fixtures"; diff --git a/src/products/components/ProductUpdatePage/ProductUpdatePage.test.tsx b/src/products/components/ProductUpdatePage/ProductUpdatePage.test.tsx index 570855406..1c0540fa1 100644 --- a/src/products/components/ProductUpdatePage/ProductUpdatePage.test.tsx +++ b/src/products/components/ProductUpdatePage/ProductUpdatePage.test.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import placeholderImage from "@assets/images/placeholder255x255.png"; import { channelsList } from "@dashboard/channels/fixtures"; import { collections } from "@dashboard/collections/fixtures"; diff --git a/src/products/components/ProductUpdatePage/ProductUpdatePage.tsx b/src/products/components/ProductUpdatePage/ProductUpdatePage.tsx index f4e3ea06e..c785cb270 100644 --- a/src/products/components/ProductUpdatePage/ProductUpdatePage.tsx +++ b/src/products/components/ProductUpdatePage/ProductUpdatePage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { extensionMountPoints, mapToMenuItemsForProductDetails, diff --git a/src/products/components/ProductUpdatePage/form.tsx b/src/products/components/ProductUpdatePage/form.tsx index ded0f8de1..982f52a32 100644 --- a/src/products/components/ProductUpdatePage/form.tsx +++ b/src/products/components/ProductUpdatePage/form.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { getAttributesDisplayData, getRichTextAttributesFromMap, diff --git a/src/products/components/ProductUpdatePage/formChannels.ts b/src/products/components/ProductUpdatePage/formChannels.ts index 2477425b8..d614feee6 100644 --- a/src/products/components/ProductUpdatePage/formChannels.ts +++ b/src/products/components/ProductUpdatePage/formChannels.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ChannelOpts } from "@dashboard/components/ChannelsAvailabilityCard/types"; import { ProductChannelListingAddInput, @@ -46,17 +47,16 @@ export function useProductChannelListingsForm( product: Pick, triggerChange: () => void, ) { - const [channels, setChannels] = useStateFromProps< - ProductChannelListingUpdateInput - >({ - removeChannels: [], - updateChannels: - product?.channelListings.map(listing => ({ - channelId: listing.channel.id, - availableForPurchaseDate: listing.availableForPurchase, - ...listing, - })) ?? [], - }); + const [channels, setChannels] = + useStateFromProps({ + removeChannels: [], + updateChannels: + product?.channelListings.map(listing => ({ + channelId: listing.channel.id, + availableForPurchaseDate: listing.availableForPurchase, + ...listing, + })) ?? [], + }); const touched = useRef([]); const touch = (id: string) => { @@ -72,29 +72,30 @@ export function useProductChannelListingsForm( [setChannels, triggerChange], ); - const handleChannelListUpdate: ProductChannelsListingDialogSubmit = useCallback( - ({ added, removed }) => { - setChannels(prevData => ({ - ...prevData, - updateChannels: uniqBy( - [ - ...prevData.updateChannels, - ...added.map(id => ({ - channelId: id, - ...emptyListing, - })), - ], - "channelId", - ).filter(({ channelId }) => !removed.includes(channelId)), - removeChannels: uniq([...prevData.removeChannels, ...removed]).filter( - id => !added.includes(id), - ), - })); - triggerChange(); - added.forEach(id => touch(id)); - }, - [product], - ); + const handleChannelListUpdate: ProductChannelsListingDialogSubmit = + useCallback( + ({ added, removed }) => { + setChannels(prevData => ({ + ...prevData, + updateChannels: uniqBy( + [ + ...prevData.updateChannels, + ...added.map(id => ({ + channelId: id, + ...emptyListing, + })), + ], + "channelId", + ).filter(({ channelId }) => !removed.includes(channelId)), + removeChannels: uniq([...prevData.removeChannels, ...removed]).filter( + id => !added.includes(id), + ), + })); + triggerChange(); + added.forEach(id => touch(id)); + }, + [product], + ); return { channels, diff --git a/src/products/components/ProductUpdatePage/types.ts b/src/products/components/ProductUpdatePage/types.ts index d5e947a14..b02c3768f 100644 --- a/src/products/components/ProductUpdatePage/types.ts +++ b/src/products/components/ProductUpdatePage/types.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { RichTextProps } from "@dashboard/attributes/utils/data"; import { AttributeInput } from "@dashboard/components/Attributes"; import { ChannelOpts } from "@dashboard/components/ChannelsAvailabilityCard/types"; diff --git a/src/products/components/ProductUpdatePage/utils.ts b/src/products/components/ProductUpdatePage/utils.ts index fdcd0c6ba..253a9742f 100644 --- a/src/products/components/ProductUpdatePage/utils.ts +++ b/src/products/components/ProductUpdatePage/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { DatagridChange, DatagridChangeOpts, diff --git a/src/products/components/ProductVariantAttributes/ProductVariantAttributes.tsx b/src/products/components/ProductVariantAttributes/ProductVariantAttributes.tsx index 5d67c77e0..a08ccbb1a 100644 --- a/src/products/components/ProductVariantAttributes/ProductVariantAttributes.tsx +++ b/src/products/components/ProductVariantAttributes/ProductVariantAttributes.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import CardTitle from "@dashboard/components/CardTitle"; import FormSpacer from "@dashboard/components/FormSpacer"; import Grid from "@dashboard/components/Grid"; diff --git a/src/products/components/ProductVariantChannels/ChannelsAvailabilityCard/ChannelsListItem.tsx b/src/products/components/ProductVariantChannels/ChannelsAvailabilityCard/ChannelsListItem.tsx index 81f05f930..dcafe8210 100644 --- a/src/products/components/ProductVariantChannels/ChannelsAvailabilityCard/ChannelsListItem.tsx +++ b/src/products/components/ProductVariantChannels/ChannelsAvailabilityCard/ChannelsListItem.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import useDateLocalize from "@dashboard/hooks/useDateLocalize"; import { CardContent, Divider, Typography } from "@material-ui/core"; import React from "react"; diff --git a/src/products/components/ProductVariantChannels/ChannelsAvailabilityCard/availabilityCount.ts b/src/products/components/ProductVariantChannels/ChannelsAvailabilityCard/availabilityCount.ts index 4d28d2dd4..452022d3f 100644 --- a/src/products/components/ProductVariantChannels/ChannelsAvailabilityCard/availabilityCount.ts +++ b/src/products/components/ProductVariantChannels/ChannelsAvailabilityCard/availabilityCount.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ProductVariantCreateDataQuery, ProductVariantFragment, diff --git a/src/products/components/ProductVariantChannels/ChannelsAvailabilityCard/index.tsx b/src/products/components/ProductVariantChannels/ChannelsAvailabilityCard/index.tsx index 510dde43f..1c97127e7 100644 --- a/src/products/components/ProductVariantChannels/ChannelsAvailabilityCard/index.tsx +++ b/src/products/components/ProductVariantChannels/ChannelsAvailabilityCard/index.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import React from "react"; import { Channel, Product, Variant } from "./../types"; @@ -34,10 +35,9 @@ const Wrapper: React.FC = ({ item, children }) => { return children({ channels }); }; -export const VariantDetailsChannelsAvailabilityCard: React.FC = ({ - variant, - onManageClick, -}) => ( +export const VariantDetailsChannelsAvailabilityCard: React.FC< + VariantDetailsChannelsAvailabilityCardProps +> = ({ variant, onManageClick }) => ( {({ channels }) => ( ); -export const ProductDetailsChannelsAvailabilityCard: React.FC = ({ - product, - onManageClick, -}) => ( +export const ProductDetailsChannelsAvailabilityCard: React.FC< + ProductDetailsChannelsAvailabilityCardProps +> = ({ product, onManageClick }) => ( {({ channels }) => ( = props => { +const ProductVariantNavigation: React.FC< + ProductVariantNavigationProps +> = props => { const { current, defaultVariantId, diff --git a/src/products/components/ProductVariantPage/ProductVariantPage.tsx b/src/products/components/ProductVariantPage/ProductVariantPage.tsx index 4b27aa8d2..29deb39ea 100644 --- a/src/products/components/ProductVariantPage/ProductVariantPage.tsx +++ b/src/products/components/ProductVariantPage/ProductVariantPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { getReferenceAttributeEntityTypeFromAttribute, mergeAttributeValues, diff --git a/src/products/components/ProductVariantPage/ProductVarinatPage.stories.tsx b/src/products/components/ProductVariantPage/ProductVarinatPage.stories.tsx index 64ac699f4..813a6d2be 100644 --- a/src/products/components/ProductVariantPage/ProductVarinatPage.stories.tsx +++ b/src/products/components/ProductVariantPage/ProductVarinatPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import placeholderImage from "@assets/images/placeholder60x60.png"; import { createVariantChannels } from "@dashboard/channels/utils"; import { ProductErrorCode } from "@dashboard/graphql"; diff --git a/src/products/components/ProductVariantPage/form.tsx b/src/products/components/ProductVariantPage/form.tsx index 125f157fa..45e5dbc3c 100644 --- a/src/products/components/ProductVariantPage/form.tsx +++ b/src/products/components/ProductVariantPage/form.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { getAttributesDisplayData, getRichTextAttributesFromMap, @@ -313,9 +314,8 @@ function useProductVariantUpdateForm( ); if (variantChannel) { - const { costPrice, price } = extractChannelPricesFromVariantChannel( - variantChannel, - ); + const { costPrice, price } = + extractChannelPricesFromVariantChannel(variantChannel); return { ...variantChannel.channel, diff --git a/src/products/components/ProductVariantPrice/ProductVariantPrice.tsx b/src/products/components/ProductVariantPrice/ProductVariantPrice.tsx index 7120a285d..c4a070d69 100644 --- a/src/products/components/ProductVariantPrice/ProductVariantPrice.tsx +++ b/src/products/components/ProductVariantPrice/ProductVariantPrice.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ChannelData, ChannelPriceAndPreorderArgs, diff --git a/src/products/components/ProductVariants/ProductVariants.tsx b/src/products/components/ProductVariants/ProductVariants.tsx index ff28300fa..a1e0c9acf 100644 --- a/src/products/components/ProductVariants/ProductVariants.tsx +++ b/src/products/components/ProductVariants/ProductVariants.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ChannelData } from "@dashboard/channels/utils"; import ColumnPicker from "@dashboard/components/ColumnPicker"; import Datagrid, { diff --git a/src/products/components/ProductVariants/utils.tsx b/src/products/components/ProductVariants/utils.tsx index da3b4eb6f..ee376c7cd 100644 --- a/src/products/components/ProductVariants/utils.tsx +++ b/src/products/components/ProductVariants/utils.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ChannelData } from "@dashboard/channels/utils"; import { booleanCell, diff --git a/src/products/fixtures.ts b/src/products/fixtures.ts index d5227432a..f5e1a2b89 100644 --- a/src/products/fixtures.ts +++ b/src/products/fixtures.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { channelsList } from "@dashboard/channels/fixtures"; import { AttributeInputTypeEnum, diff --git a/src/products/utils/data.ts b/src/products/utils/data.ts index dd66fc722..30938eb72 100644 --- a/src/products/utils/data.ts +++ b/src/products/utils/data.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { getDefaultAttributeValues, getSelectedAttributeValues, diff --git a/src/products/utils/datagrid.test.ts b/src/products/utils/datagrid.test.ts index 4fb8c63fc..34765b9a5 100644 --- a/src/products/utils/datagrid.test.ts +++ b/src/products/utils/datagrid.test.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { isCurrentRow } from "./datagrid"; describe("isCurrentRow", () => { diff --git a/src/products/utils/datagrid.ts b/src/products/utils/datagrid.ts index 05720abff..ba5559eba 100644 --- a/src/products/utils/datagrid.ts +++ b/src/products/utils/datagrid.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore export function makeGetColumnData( regexp: RegExp, ): (column: string) => string | null { diff --git a/src/products/utils/handlers.ts b/src/products/utils/handlers.ts index b46778654..f059f6642 100644 --- a/src/products/utils/handlers.ts +++ b/src/products/utils/handlers.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FetchResult } from "@apollo/client"; import { ChannelData, @@ -140,36 +141,37 @@ export const getAvailabilityVariables = ( }; }); -export const createPreorderEndDateChangeHandler = ( - form: UseFormResult<{ preorderEndDateTime?: string }>, - triggerChange: () => void, - preorderPastDateErrorMessage: string, -): FormChange => event => { - form.change(event); - if (moment(event.target.value).isSameOrBefore(Date.now())) { - form.setError("preorderEndDateTime", preorderPastDateErrorMessage); - } else { - form.clearErrors("preorderEndDateTime"); - } - triggerChange(); -}; +export const createPreorderEndDateChangeHandler = + ( + form: UseFormResult<{ preorderEndDateTime?: string }>, + triggerChange: () => void, + preorderPastDateErrorMessage: string, + ): FormChange => + event => { + form.change(event); + if (moment(event.target.value).isSameOrBefore(Date.now())) { + form.setError("preorderEndDateTime", preorderPastDateErrorMessage); + } else { + form.clearErrors("preorderEndDateTime"); + } + triggerChange(); + }; -export const createMediaChangeHandler = ( - form: UseFormResult<{ media: string[] }>, - triggerChange: () => void, -) => (ids: string[]) => { - form.change({ - target: { - name: "media", - value: ids, - }, - }); +export const createMediaChangeHandler = + (form: UseFormResult<{ media: string[] }>, triggerChange: () => void) => + (ids: string[]) => { + form.change({ + target: { + name: "media", + value: ids, + }, + }); - triggerChange(); -}; + triggerChange(); + }; export const handleAssignMedia = async < - T extends Pick + T extends Pick, >( media: string[], variant: T, diff --git a/src/products/views/ProductCreate/ProductCreate.tsx b/src/products/views/ProductCreate/ProductCreate.tsx index 196fb156a..e14195094 100644 --- a/src/products/views/ProductCreate/ProductCreate.tsx +++ b/src/products/views/ProductCreate/ProductCreate.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ChannelData, createSortedChannelsData, @@ -65,9 +66,8 @@ export const ProductCreateView: React.FC = ({ params }) => { const notify = useNotifier(); const shop = useShop(); const intl = useIntl(); - const [productCreateComplete, setProductCreateComplete] = React.useState( - false, - ); + const [productCreateComplete, setProductCreateComplete] = + React.useState(false); const selectedProductTypeId = params["product-type-id"]; const handleSelectProductType = (productTypeId: string) => @@ -139,9 +139,8 @@ export const ProductCreateView: React.FC = ({ params }) => { mapEdgesToItems(searchProductTypesOpts?.data?.search) || []; const { availableChannels } = useAppChannel(false); - const allChannels: ChannelData[] = createSortedChannelsData( - availableChannels, - ); + const allChannels: ChannelData[] = + createSortedChannelsData(availableChannels); const { channelListElements, @@ -189,33 +188,27 @@ export const ProductCreateView: React.FC = ({ params }) => { const [uploadFile, uploadFileOpts] = useFileUploadMutation({}); - const [ - updateChannels, - updateChannelsOpts, - ] = useProductChannelListingUpdateMutation({}); - const [ - updateVariantChannels, - updateVariantChannelsOpts, - ] = useProductVariantChannelListingUpdateMutation({}); + const [updateChannels, updateChannelsOpts] = + useProductChannelListingUpdateMutation({}); + const [updateVariantChannels, updateVariantChannelsOpts] = + useProductVariantChannelListingUpdateMutation({}); const [productCreate, productCreateOpts] = useProductCreateMutation({}); const [deleteProduct] = useProductDeleteMutation({}); - const [ - productVariantCreate, - productVariantCreateOpts, - ] = useVariantCreateMutation({ - onCompleted: data => { - const errors = data.productVariantCreate.errors; - if (errors.length) { - errors.map(error => - notify({ - status: "error", - text: getProductErrorMessage(error, intl), - }), - ); - } - }, - }); + const [productVariantCreate, productVariantCreateOpts] = + useVariantCreateMutation({ + onCompleted: data => { + const errors = data.productVariantCreate.errors; + if (errors.length) { + errors.map(error => + notify({ + status: "error", + text: getProductErrorMessage(error, intl), + }), + ); + } + }, + }); const handleSubmit = async (data: ProductCreateData) => { const errors = await createMetadataCreateHandler( @@ -282,8 +275,9 @@ export const ProductCreateView: React.FC = ({ params }) => { onFetchMore: loadMoreProducts, }; const fetchMoreAttributeValues = { - hasMore: !!searchAttributeValuesOpts.data?.attribute?.choices?.pageInfo - ?.hasNextPage, + hasMore: + !!searchAttributeValuesOpts.data?.attribute?.choices?.pageInfo + ?.hasNextPage, loading: !!searchAttributeValuesOpts.loading, onFetchMore: loadMoreAttributeValues, }; diff --git a/src/products/views/ProductCreate/handlers.ts b/src/products/views/ProductCreate/handlers.ts index bc0aba78d..bce96e315 100644 --- a/src/products/views/ProductCreate/handlers.ts +++ b/src/products/views/ProductCreate/handlers.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FetchResult } from "@apollo/client"; import { getAttributesAfterFileAttributesUpdate, diff --git a/src/products/views/ProductImage.tsx b/src/products/views/ProductImage.tsx index b59498741..2dd887617 100644 --- a/src/products/views/ProductImage.tsx +++ b/src/products/views/ProductImage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import ActionDialog from "@dashboard/components/ActionDialog"; import NotFoundPage from "@dashboard/components/NotFoundPage"; import { diff --git a/src/products/views/ProductList/ProductList.tsx b/src/products/views/ProductList/ProductList.tsx index 6e55768f3..8329e50ce 100644 --- a/src/products/views/ProductList/ProductList.tsx +++ b/src/products/views/ProductList/ProductList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { filterable } from "@dashboard/attributes/utils/data"; import ActionDialog from "@dashboard/components/ActionDialog"; import useAppChannel from "@dashboard/components/AppLayout/AppChannelContext"; diff --git a/src/products/views/ProductList/filters.test.ts b/src/products/views/ProductList/filters.test.ts index fa3accec5..7323cf06b 100644 --- a/src/products/views/ProductList/filters.test.ts +++ b/src/products/views/ProductList/filters.test.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { AttributeInputTypeEnum, StockAvailability } from "@dashboard/graphql"; import { createFilterStructure } from "@dashboard/products/components/ProductListPage"; import { ProductListUrlFilters } from "@dashboard/products/urls"; diff --git a/src/products/views/ProductList/filters.ts b/src/products/views/ProductList/filters.ts index 1904d5df5..64f4c0223 100644 --- a/src/products/views/ProductList/filters.ts +++ b/src/products/views/ProductList/filters.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { SingleAutocompleteChoiceType } from "@dashboard/components/SingleAutocompleteSelectField"; import { AttributeFragment, diff --git a/src/products/views/ProductList/fixtures.ts b/src/products/views/ProductList/fixtures.ts index 1d0f04e41..e3d0e7be7 100644 --- a/src/products/views/ProductList/fixtures.ts +++ b/src/products/views/ProductList/fixtures.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { attributes } from "@dashboard/attributes/fixtures"; import { categories } from "@dashboard/categories/fixtures"; import { collections } from "@dashboard/collections/fixtures"; diff --git a/src/products/views/ProductList/sort.ts b/src/products/views/ProductList/sort.ts index 2bc9630dd..63bf7313e 100644 --- a/src/products/views/ProductList/sort.ts +++ b/src/products/views/ProductList/sort.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ProductOrder, ProductOrderField } from "@dashboard/graphql"; import { ProductListUrlQueryParams, diff --git a/src/products/views/ProductUpdate/ProductUpdate.tsx b/src/products/views/ProductUpdate/ProductUpdate.tsx index 0e77274e4..34c136549 100644 --- a/src/products/views/ProductUpdate/ProductUpdate.tsx +++ b/src/products/views/ProductUpdate/ProductUpdate.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import ActionDialog from "@dashboard/components/ActionDialog"; import useAppChannel from "@dashboard/components/AppLayout/AppChannelContext"; import { AttributeInput } from "@dashboard/components/Attributes"; diff --git a/src/products/views/ProductUpdate/handlers/data/channel.test.ts b/src/products/views/ProductUpdate/handlers/data/channel.test.ts index 0f9077d7a..a7a31f4ad 100644 --- a/src/products/views/ProductUpdate/handlers/data/channel.test.ts +++ b/src/products/views/ProductUpdate/handlers/data/channel.test.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { DatagridChangeOpts } from "@dashboard/components/Datagrid/hooks/useDatagridChange"; import { ProductFragment } from "@dashboard/graphql"; diff --git a/src/products/views/ProductUpdate/handlers/data/channel.ts b/src/products/views/ProductUpdate/handlers/data/channel.ts index 6262d707f..808ea6625 100644 --- a/src/products/views/ProductUpdate/handlers/data/channel.ts +++ b/src/products/views/ProductUpdate/handlers/data/channel.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { DatagridChange, DatagridChangeOpts, diff --git a/src/products/views/ProductUpdate/handlers/data/stock.ts b/src/products/views/ProductUpdate/handlers/data/stock.ts index cf00f4ebd..bf5f56f44 100644 --- a/src/products/views/ProductUpdate/handlers/data/stock.ts +++ b/src/products/views/ProductUpdate/handlers/data/stock.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { numberCellEmptyValue } from "@dashboard/components/Datagrid/customCells/NumberCell"; import { DatagridChange } from "@dashboard/components/Datagrid/hooks/useDatagridChange"; import { diff --git a/src/products/views/ProductUpdate/handlers/data/stocks.test.ts b/src/products/views/ProductUpdate/handlers/data/stocks.test.ts index c1ddb8935..c8723472e 100644 --- a/src/products/views/ProductUpdate/handlers/data/stocks.test.ts +++ b/src/products/views/ProductUpdate/handlers/data/stocks.test.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { numberCellEmptyValue } from "@dashboard/components/Datagrid/customCells/NumberCell"; import { DatagridChange } from "@dashboard/components/Datagrid/hooks/useDatagridChange"; import { ProductFragment } from "@dashboard/graphql"; diff --git a/src/products/views/ProductUpdate/handlers/errors.ts b/src/products/views/ProductUpdate/handlers/errors.ts index ac8d7786e..15f12f499 100644 --- a/src/products/views/ProductUpdate/handlers/errors.ts +++ b/src/products/views/ProductUpdate/handlers/errors.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FetchResult } from "@apollo/client"; import { ProductErrorCode, diff --git a/src/products/views/ProductUpdate/handlers/index.ts b/src/products/views/ProductUpdate/handlers/index.ts index 765e4e6e4..7d7f05d4e 100644 --- a/src/products/views/ProductUpdate/handlers/index.ts +++ b/src/products/views/ProductUpdate/handlers/index.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Node, ProductFragment, @@ -42,7 +43,7 @@ function areVariantsEqual(a: Node, b: Node) { } export function createVariantReorderHandler< - T extends { id: string; variants: any[] } + T extends { id: string; variants: any[] }, >(product: T, reorderProductVariants: ProductVariantReorderMutationFn) { return ({ newIndex, oldIndex }: ReorderEvent) => { const oldVariantOrder = [...product.variants]; diff --git a/src/products/views/ProductUpdate/handlers/useProductUpdateHandler.ts b/src/products/views/ProductUpdate/handlers/useProductUpdateHandler.ts index 188f4a8d7..91e0dc3b4 100644 --- a/src/products/views/ProductUpdate/handlers/useProductUpdateHandler.ts +++ b/src/products/views/ProductUpdate/handlers/useProductUpdateHandler.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { mergeAttributeValueDeleteErrors, mergeFileUploadErrors, diff --git a/src/products/views/ProductUpdate/handlers/utils.test.ts b/src/products/views/ProductUpdate/handlers/utils.test.ts index da84fd128..0f581c866 100644 --- a/src/products/views/ProductUpdate/handlers/utils.test.ts +++ b/src/products/views/ProductUpdate/handlers/utils.test.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { DatagridChangeOpts } from "@dashboard/components/Datagrid/hooks/useDatagridChange"; import { ProductFragment } from "@dashboard/graphql"; import { ProductUpdateSubmitData } from "@dashboard/products/components/ProductUpdatePage/types"; diff --git a/src/products/views/ProductUpdate/handlers/utils.ts b/src/products/views/ProductUpdate/handlers/utils.ts index dd4899c18..5c29a7e04 100644 --- a/src/products/views/ProductUpdate/handlers/utils.ts +++ b/src/products/views/ProductUpdate/handlers/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FetchResult } from "@apollo/client"; import { getAttributesAfterFileAttributesUpdate } from "@dashboard/attributes/utils/data"; import { prepareAttributesInput } from "@dashboard/attributes/utils/handlers"; diff --git a/src/products/views/ProductVariant/ProductVariant.tsx b/src/products/views/ProductVariant/ProductVariant.tsx index 8c6540dea..5c08abe70 100644 --- a/src/products/views/ProductVariant/ProductVariant.tsx +++ b/src/products/views/ProductVariant/ProductVariant.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import placeholderImg from "@assets/images/placeholder255x255.png"; import { getAttributesAfterFileAttributesUpdate, @@ -132,10 +133,8 @@ export const ProductVariant: React.FC = ({ }, }); - const [ - deleteAttributeValue, - deleteAttributeValueOpts, - ] = useAttributeValueDeleteMutation({}); + const [deleteAttributeValue, deleteAttributeValueOpts] = + useAttributeValueDeleteMutation({}); const { handleSubmitChannels, updateChannelsOpts } = useSubmitChannels(); @@ -152,17 +151,13 @@ export const ProductVariant: React.FC = ({ }, }); - const [ - deactivatePreorder, - deactivatePreoderOpts, - ] = useProductVariantPreorderDeactivateMutation({}); + const [deactivatePreorder, deactivatePreoderOpts] = + useProductVariantPreorderDeactivateMutation({}); const handleDeactivateVariantPreorder = (id: string) => deactivatePreorder({ variables: { id } }); - const [ - reorderProductVariants, - reorderProductVariantsOpts, - ] = useProductVariantReorderMutation({}); + const [reorderProductVariants, reorderProductVariantsOpts] = + useProductVariantReorderMutation({}); const onSetDefaultVariant = useOnSetDefaultVariant(productId, variant); @@ -188,11 +183,12 @@ export const ProductVariant: React.FC = ({ variables => uploadFile({ variables }), ); - const deleteAttributeValuesResult = await handleDeleteMultipleAttributeValues( - data.attributesWithNewFileValue, - variant?.nonSelectionAttributes, - variables => deleteAttributeValue({ variables }), - ); + const deleteAttributeValuesResult = + await handleDeleteMultipleAttributeValues( + data.attributesWithNewFileValue, + variant?.nonSelectionAttributes, + variables => deleteAttributeValue({ variables }), + ); const updatedFileAttributes = getAttributesAfterFileAttributesUpdate( data.attributesWithNewFileValue, @@ -294,8 +290,9 @@ export const ProductVariant: React.FC = ({ onFetchMore: loadMoreProducts, }; const fetchMoreAttributeValues = { - hasMore: !!searchAttributeValuesOpts.data?.attribute?.choices?.pageInfo - ?.hasNextPage, + hasMore: + !!searchAttributeValuesOpts.data?.attribute?.choices?.pageInfo + ?.hasNextPage, loading: !!searchAttributeValuesOpts.loading, onFetchMore: loadMoreAttributeValues, }; diff --git a/src/products/views/ProductVariant/useSubmitChannels.ts b/src/products/views/ProductVariant/useSubmitChannels.ts index cad9ac304..5376f8bd0 100644 --- a/src/products/views/ProductVariant/useSubmitChannels.ts +++ b/src/products/views/ProductVariant/useSubmitChannels.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ProductVariantFragment, useProductChannelListingUpdateMutation, @@ -51,10 +52,8 @@ const createVariantUpdateListingInput = (data: Product) => export const useSubmitChannels = () => { const [updateChannelListing] = useProductChannelListingUpdateMutation(); - const [ - updateChannels, - updateChannelsOpts, - ] = useProductVariantChannelListingUpdateMutation(); + const [updateChannels, updateChannelsOpts] = + useProductVariantChannelListingUpdateMutation(); const handleSubmitChannels = async (data: Product, variant: Variant) => { const channelsHaveChanged = isFormDataChanged(data, variant); diff --git a/src/products/views/ProductVariantCreate.tsx b/src/products/views/ProductVariantCreate.tsx index 6ff0512c9..587cd3303 100644 --- a/src/products/views/ProductVariantCreate.tsx +++ b/src/products/views/ProductVariantCreate.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { getAttributesAfterFileAttributesUpdate } from "@dashboard/attributes/utils/data"; import { handleUploadMultipleFiles, @@ -91,10 +92,8 @@ export const ProductVariant: React.FC = ({ const [updateMetadata] = useUpdateMetadataMutation({}); const [updatePrivateMetadata] = useUpdatePrivateMetadataMutation({}); - const [ - reorderProductVariants, - reorderProductVariantsOpts, - ] = useProductVariantReorderMutation({}); + const [reorderProductVariants, reorderProductVariantsOpts] = + useProductVariantReorderMutation({}); const handleVariantReorder = createVariantReorderHandler( product, @@ -219,8 +218,9 @@ export const ProductVariant: React.FC = ({ onFetchMore: loadMoreProducts, }; const fetchMoreAttributeValues = { - hasMore: !!searchAttributeValuesOpts.data?.attribute?.choices?.pageInfo - ?.hasNextPage, + hasMore: + !!searchAttributeValuesOpts.data?.attribute?.choices?.pageInfo + ?.hasNextPage, loading: !!searchAttributeValuesOpts.loading, onFetchMore: loadMoreAttributeValues, }; diff --git a/src/searches/useAttributeSearch.ts b/src/searches/useAttributeSearch.ts index 856c09656..ffe3f54a3 100644 --- a/src/searches/useAttributeSearch.ts +++ b/src/searches/useAttributeSearch.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { gql } from "@apollo/client"; import { SearchAttributesDocument, diff --git a/src/searches/useAttributeValueSearch.ts b/src/searches/useAttributeValueSearch.ts index c7d9a3f87..c0844b387 100644 --- a/src/searches/useAttributeValueSearch.ts +++ b/src/searches/useAttributeValueSearch.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { gql, useApolloClient } from "@apollo/client"; import { SearchAttributeValuesDocument, diff --git a/src/searches/useAvailableInGridAttributesSearch.ts b/src/searches/useAvailableInGridAttributesSearch.ts index 5bb45c5cc..fd360eae9 100644 --- a/src/searches/useAvailableInGridAttributesSearch.ts +++ b/src/searches/useAvailableInGridAttributesSearch.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { gql } from "@apollo/client"; import { SearchAvailableInGridAttributesDocument, diff --git a/src/searches/useAvailablePageAttributesSearch.ts b/src/searches/useAvailablePageAttributesSearch.ts index d07b91546..6919e442c 100644 --- a/src/searches/useAvailablePageAttributesSearch.ts +++ b/src/searches/useAvailablePageAttributesSearch.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { gql } from "@apollo/client"; import { SearchAvailablePageAttributesDocument, diff --git a/src/searches/useAvailableProductAttributeSearch.ts b/src/searches/useAvailableProductAttributeSearch.ts index fb3625e28..8cc8f4e28 100644 --- a/src/searches/useAvailableProductAttributeSearch.ts +++ b/src/searches/useAvailableProductAttributeSearch.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { gql } from "@apollo/client"; import { SearchAvailableProductAttributesDocument, diff --git a/src/searches/useCategorySearch.ts b/src/searches/useCategorySearch.ts index 08480701e..1a2d02a85 100644 --- a/src/searches/useCategorySearch.ts +++ b/src/searches/useCategorySearch.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { gql } from "@apollo/client"; import { SearchCategoriesDocument, diff --git a/src/searches/useCollectionSearch.ts b/src/searches/useCollectionSearch.ts index b788e2313..e9b648468 100644 --- a/src/searches/useCollectionSearch.ts +++ b/src/searches/useCollectionSearch.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { gql } from "@apollo/client"; import { SearchCollectionsDocument, diff --git a/src/searches/useCustomerSearch.ts b/src/searches/useCustomerSearch.ts index 71c74acf4..11aa2b62a 100644 --- a/src/searches/useCustomerSearch.ts +++ b/src/searches/useCustomerSearch.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { gql } from "@apollo/client"; import { SearchCustomersDocument, diff --git a/src/searches/useGiftCardTagsSearch.ts b/src/searches/useGiftCardTagsSearch.ts index fbf7d4fff..1b934a67c 100644 --- a/src/searches/useGiftCardTagsSearch.ts +++ b/src/searches/useGiftCardTagsSearch.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { gql } from "@apollo/client"; import { SearchGiftCardTagsDocument, diff --git a/src/searches/useOrderVariantSearch.ts b/src/searches/useOrderVariantSearch.ts index 3833553b9..74df1bf34 100644 --- a/src/searches/useOrderVariantSearch.ts +++ b/src/searches/useOrderVariantSearch.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { gql } from "@apollo/client"; import { SearchOrderVariantDocument, diff --git a/src/searches/usePageSearch.ts b/src/searches/usePageSearch.ts index e33fb3c81..95eb95285 100644 --- a/src/searches/usePageSearch.ts +++ b/src/searches/usePageSearch.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { gql } from "@apollo/client"; import { SearchPagesDocument, diff --git a/src/searches/usePageTypeSearch.ts b/src/searches/usePageTypeSearch.ts index 11c717444..f53dad195 100644 --- a/src/searches/usePageTypeSearch.ts +++ b/src/searches/usePageTypeSearch.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { gql } from "@apollo/client"; import { SearchPageTypesDocument, diff --git a/src/searches/usePermissionGroupSearch.ts b/src/searches/usePermissionGroupSearch.ts index 815daad1d..df255b848 100644 --- a/src/searches/usePermissionGroupSearch.ts +++ b/src/searches/usePermissionGroupSearch.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { gql } from "@apollo/client"; import { SearchPermissionGroupsDocument, diff --git a/src/searches/useProductSearch.ts b/src/searches/useProductSearch.ts index 2533e3056..9011f2154 100644 --- a/src/searches/useProductSearch.ts +++ b/src/searches/useProductSearch.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { gql } from "@apollo/client"; import { SearchProductsDocument, diff --git a/src/searches/useProductTypeSearch.ts b/src/searches/useProductTypeSearch.ts index f37d4257e..5d3649aa1 100644 --- a/src/searches/useProductTypeSearch.ts +++ b/src/searches/useProductTypeSearch.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { gql, useApolloClient } from "@apollo/client"; import { SearchProductTypesDocument, diff --git a/src/searches/useShippingZonesSearch.ts b/src/searches/useShippingZonesSearch.ts index ff0684c9e..79addb830 100644 --- a/src/searches/useShippingZonesSearch.ts +++ b/src/searches/useShippingZonesSearch.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { gql } from "@apollo/client"; import { SearchShippingZonesDocument, diff --git a/src/searches/useStaffMemberSearch.ts b/src/searches/useStaffMemberSearch.ts index 398b5f69f..86950dff4 100644 --- a/src/searches/useStaffMemberSearch.ts +++ b/src/searches/useStaffMemberSearch.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { gql } from "@apollo/client"; import { SearchStaffMembersDocument, diff --git a/src/searches/useWarehouseSearch.ts b/src/searches/useWarehouseSearch.ts index af9ab11f3..6b8652681 100644 --- a/src/searches/useWarehouseSearch.ts +++ b/src/searches/useWarehouseSearch.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { gql } from "@apollo/client"; import { SearchWarehousesDocument, diff --git a/src/services/errorTracking/index.ts b/src/services/errorTracking/index.ts index 1351888b8..e347e4f25 100644 --- a/src/services/errorTracking/index.ts +++ b/src/services/errorTracking/index.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { SentryAdapter } from "./adapters"; import { ErrorTrackerFactory } from "./trackerFactory"; diff --git a/src/services/errorTracking/trackerFactory.ts b/src/services/errorTracking/trackerFactory.ts index 503db840e..122cfead1 100644 --- a/src/services/errorTracking/trackerFactory.ts +++ b/src/services/errorTracking/trackerFactory.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TrackerMethods, TrackerPermission, UserData } from "./types"; type ErrorTrackerFactory = ( diff --git a/src/shipping/components/OrderValue/OrderValue.tsx b/src/shipping/components/OrderValue/OrderValue.tsx index 2447ec0f6..a1875f5b2 100644 --- a/src/shipping/components/OrderValue/OrderValue.tsx +++ b/src/shipping/components/OrderValue/OrderValue.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ChannelShippingData } from "@dashboard/channels/utils"; import CardTitle from "@dashboard/components/CardTitle"; import ControlledCheckbox from "@dashboard/components/ControlledCheckbox"; diff --git a/src/shipping/components/OrderWeight/OrderWeight.tsx b/src/shipping/components/OrderWeight/OrderWeight.tsx index 0118e89b1..976e6a7ee 100644 --- a/src/shipping/components/OrderWeight/OrderWeight.tsx +++ b/src/shipping/components/OrderWeight/OrderWeight.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import CardTitle from "@dashboard/components/CardTitle"; import ControlledCheckbox from "@dashboard/components/ControlledCheckbox"; import VerticalSpacer from "@dashboard/components/VerticalSpacer"; diff --git a/src/shipping/components/PricingCard/PricingCard.tsx b/src/shipping/components/PricingCard/PricingCard.tsx index 9da8bc114..828522876 100644 --- a/src/shipping/components/PricingCard/PricingCard.tsx +++ b/src/shipping/components/PricingCard/PricingCard.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ChannelShippingData } from "@dashboard/channels/utils"; import CardTitle from "@dashboard/components/CardTitle"; import PriceField from "@dashboard/components/PriceField"; diff --git a/src/shipping/components/ShippingMethodProducts/ShippingMethodProducts.tsx b/src/shipping/components/ShippingMethodProducts/ShippingMethodProducts.tsx index b2cd6cb77..2a5234934 100644 --- a/src/shipping/components/ShippingMethodProducts/ShippingMethodProducts.tsx +++ b/src/shipping/components/ShippingMethodProducts/ShippingMethodProducts.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Button } from "@dashboard/components/Button"; import CardTitle from "@dashboard/components/CardTitle"; import Checkbox from "@dashboard/components/Checkbox"; diff --git a/src/shipping/components/ShippingMethodProductsAddDialog/ShippingMethodProductsAddDialog.tsx b/src/shipping/components/ShippingMethodProductsAddDialog/ShippingMethodProductsAddDialog.tsx index 12e71c47c..73e2a206b 100644 --- a/src/shipping/components/ShippingMethodProductsAddDialog/ShippingMethodProductsAddDialog.tsx +++ b/src/shipping/components/ShippingMethodProductsAddDialog/ShippingMethodProductsAddDialog.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FetchResult } from "@apollo/client"; import BackButton from "@dashboard/components/BackButton"; import Checkbox from "@dashboard/components/Checkbox"; diff --git a/src/shipping/components/ShippingRateInfo/ShippingRateInfo.tsx b/src/shipping/components/ShippingRateInfo/ShippingRateInfo.tsx index 899ea52b6..50e6cfa06 100644 --- a/src/shipping/components/ShippingRateInfo/ShippingRateInfo.tsx +++ b/src/shipping/components/ShippingRateInfo/ShippingRateInfo.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import CardSpacer from "@dashboard/components/CardSpacer"; import CardTitle from "@dashboard/components/CardTitle"; import RichTextEditor from "@dashboard/components/RichTextEditor"; @@ -72,12 +73,8 @@ const ShippingRateInfo: React.FC = props => { const intl = useIntl(); const classes = useStyles(props); - const { - defaultValue, - editorRef, - isReadyForMount, - handleChange, - } = useRichTextContext(); + const { defaultValue, editorRef, isReadyForMount, handleChange } = + useRichTextContext(); const formErrors = getFormErrors( ["name", "description", "minDays", "maxDays"], diff --git a/src/shipping/components/ShippingWeightUnitForm/ShippingWeightUnitForm.tsx b/src/shipping/components/ShippingWeightUnitForm/ShippingWeightUnitForm.tsx index 9200f7bc9..0b35a886f 100644 --- a/src/shipping/components/ShippingWeightUnitForm/ShippingWeightUnitForm.tsx +++ b/src/shipping/components/ShippingWeightUnitForm/ShippingWeightUnitForm.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Button } from "@dashboard/components/Button"; import CardTitle from "@dashboard/components/CardTitle"; import Form from "@dashboard/components/Form"; diff --git a/src/shipping/components/ShippingZoneCountriesAssignDialog/ShippingZoneCountriesAssignDialog.tsx b/src/shipping/components/ShippingZoneCountriesAssignDialog/ShippingZoneCountriesAssignDialog.tsx index bf262000b..6c72c1b1e 100644 --- a/src/shipping/components/ShippingZoneCountriesAssignDialog/ShippingZoneCountriesAssignDialog.tsx +++ b/src/shipping/components/ShippingZoneCountriesAssignDialog/ShippingZoneCountriesAssignDialog.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import BackButton from "@dashboard/components/BackButton"; import Checkbox from "@dashboard/components/Checkbox"; import { diff --git a/src/shipping/components/ShippingZoneCountriesAssignDialog/handlers.ts b/src/shipping/components/ShippingZoneCountriesAssignDialog/handlers.ts index b2db6f0db..aff63be5f 100644 --- a/src/shipping/components/ShippingZoneCountriesAssignDialog/handlers.ts +++ b/src/shipping/components/ShippingZoneCountriesAssignDialog/handlers.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FormChange } from "@dashboard/hooks/useForm"; export function createCountryChangeHandler( diff --git a/src/shipping/components/ShippingZoneCreatePage/ShippingZoneCreatePage.stories.tsx b/src/shipping/components/ShippingZoneCreatePage/ShippingZoneCreatePage.stories.tsx index 7c2a4fc6d..e064aa7ec 100644 --- a/src/shipping/components/ShippingZoneCreatePage/ShippingZoneCreatePage.stories.tsx +++ b/src/shipping/components/ShippingZoneCreatePage/ShippingZoneCreatePage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ShippingErrorCode } from "@dashboard/graphql"; import { mapCountriesToCountriesCodes } from "@dashboard/utils/maps"; import React from "react"; diff --git a/src/shipping/components/ShippingZoneCreatePage/ShippingZoneCreatePage.tsx b/src/shipping/components/ShippingZoneCreatePage/ShippingZoneCreatePage.tsx index 6c8f346cd..9af8c978d 100644 --- a/src/shipping/components/ShippingZoneCreatePage/ShippingZoneCreatePage.tsx +++ b/src/shipping/components/ShippingZoneCreatePage/ShippingZoneCreatePage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import CardSpacer from "@dashboard/components/CardSpacer"; import { ConfirmButtonTransitionState } from "@dashboard/components/ConfirmButton"; diff --git a/src/shipping/components/ShippingZoneDetailsPage/ShippingZoneDetailsPage.stories.tsx b/src/shipping/components/ShippingZoneDetailsPage/ShippingZoneDetailsPage.stories.tsx index 4c23ea634..68a10c8ad 100644 --- a/src/shipping/components/ShippingZoneDetailsPage/ShippingZoneDetailsPage.stories.tsx +++ b/src/shipping/components/ShippingZoneDetailsPage/ShippingZoneDetailsPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { fetchMoreProps, searchPageProps } from "@dashboard/fixtures"; import { ShippingErrorCode } from "@dashboard/graphql"; import { warehouseList } from "@dashboard/warehouses/fixtures"; diff --git a/src/shipping/components/ShippingZoneDetailsPage/ShippingZoneDetailsPage.tsx b/src/shipping/components/ShippingZoneDetailsPage/ShippingZoneDetailsPage.tsx index 9eed60601..ef9416756 100644 --- a/src/shipping/components/ShippingZoneDetailsPage/ShippingZoneDetailsPage.tsx +++ b/src/shipping/components/ShippingZoneDetailsPage/ShippingZoneDetailsPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import CardSpacer from "@dashboard/components/CardSpacer"; import { ConfirmButtonTransitionState } from "@dashboard/components/ConfirmButton"; diff --git a/src/shipping/components/ShippingZoneDetailsPage/utils.ts b/src/shipping/components/ShippingZoneDetailsPage/utils.ts index fb1c69690..0c2950ee4 100644 --- a/src/shipping/components/ShippingZoneDetailsPage/utils.ts +++ b/src/shipping/components/ShippingZoneDetailsPage/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ShippingZoneQuery } from "@dashboard/graphql"; import { mapMetadataItemToInput } from "@dashboard/utils/maps"; diff --git a/src/shipping/components/ShippingZonePostalCodes/ShippingZonePostalCodes.tsx b/src/shipping/components/ShippingZonePostalCodes/ShippingZonePostalCodes.tsx index 3794515fe..89d23812d 100644 --- a/src/shipping/components/ShippingZonePostalCodes/ShippingZonePostalCodes.tsx +++ b/src/shipping/components/ShippingZonePostalCodes/ShippingZonePostalCodes.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Button } from "@dashboard/components/Button"; import CardTitle from "@dashboard/components/CardTitle"; import RadioGroupField from "@dashboard/components/RadioGroupField"; diff --git a/src/shipping/components/ShippingZoneRates/ShippingZoneRates.tsx b/src/shipping/components/ShippingZoneRates/ShippingZoneRates.tsx index cb3f08aa3..5b0e785d5 100644 --- a/src/shipping/components/ShippingZoneRates/ShippingZoneRates.tsx +++ b/src/shipping/components/ShippingZoneRates/ShippingZoneRates.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import CardTitle from "@dashboard/components/CardTitle"; import IconButtonTableCell from "@dashboard/components/IconButtonTableCell"; import Money from "@dashboard/components/Money"; diff --git a/src/shipping/components/ShippingZoneRatesCreatePage/ShippingZoneRatesCreatePage.stories.tsx b/src/shipping/components/ShippingZoneRatesCreatePage/ShippingZoneRatesCreatePage.stories.tsx index 4acefdd2d..bcab9a7f2 100644 --- a/src/shipping/components/ShippingZoneRatesCreatePage/ShippingZoneRatesCreatePage.stories.tsx +++ b/src/shipping/components/ShippingZoneRatesCreatePage/ShippingZoneRatesCreatePage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { PostalCodeRuleInclusionTypeEnum, ShippingMethodTypeEnum, diff --git a/src/shipping/components/ShippingZoneRatesCreatePage/ShippingZoneRatesCreatePage.tsx b/src/shipping/components/ShippingZoneRatesCreatePage/ShippingZoneRatesCreatePage.tsx index 0022e08a6..38d881600 100644 --- a/src/shipping/components/ShippingZoneRatesCreatePage/ShippingZoneRatesCreatePage.tsx +++ b/src/shipping/components/ShippingZoneRatesCreatePage/ShippingZoneRatesCreatePage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ChannelShippingData } from "@dashboard/channels/utils"; import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import CardSpacer from "@dashboard/components/CardSpacer"; diff --git a/src/shipping/components/ShippingZoneRatesPage/ShippingZoneRatesPage.stories.tsx b/src/shipping/components/ShippingZoneRatesPage/ShippingZoneRatesPage.stories.tsx index 41d9036ae..b7dc51e42 100644 --- a/src/shipping/components/ShippingZoneRatesPage/ShippingZoneRatesPage.stories.tsx +++ b/src/shipping/components/ShippingZoneRatesPage/ShippingZoneRatesPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ShippingMethodTypeEnum } from "@dashboard/graphql"; import { shippingZone } from "@dashboard/shipping/fixtures"; import { taxClasses } from "@dashboard/taxes/fixtures"; diff --git a/src/shipping/components/ShippingZoneRatesPage/ShippingZoneRatesPage.tsx b/src/shipping/components/ShippingZoneRatesPage/ShippingZoneRatesPage.tsx index d04ec4f38..b76e2cb62 100644 --- a/src/shipping/components/ShippingZoneRatesPage/ShippingZoneRatesPage.tsx +++ b/src/shipping/components/ShippingZoneRatesPage/ShippingZoneRatesPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ChannelShippingData } from "@dashboard/channels/utils"; import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import CardSpacer from "@dashboard/components/CardSpacer"; diff --git a/src/shipping/components/ShippingZonesList/ShippingZonesList.tsx b/src/shipping/components/ShippingZonesList/ShippingZonesList.tsx index b08e27acd..255b0b858 100644 --- a/src/shipping/components/ShippingZonesList/ShippingZonesList.tsx +++ b/src/shipping/components/ShippingZonesList/ShippingZonesList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { Button } from "@dashboard/components/Button"; import CardTitle from "@dashboard/components/CardTitle"; import Checkbox from "@dashboard/components/Checkbox"; diff --git a/src/shipping/components/ShippingZonesListPage/ShippingZonesListPage.stories.tsx b/src/shipping/components/ShippingZonesListPage/ShippingZonesListPage.stories.tsx index 38682ce68..a1b1f6f2d 100644 --- a/src/shipping/components/ShippingZonesListPage/ShippingZonesListPage.stories.tsx +++ b/src/shipping/components/ShippingZonesListPage/ShippingZonesListPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { adminUserPermissions, listActionsProps, diff --git a/src/shipping/errors.ts b/src/shipping/errors.ts index 2b70bdc64..fd0b3929d 100644 --- a/src/shipping/errors.ts +++ b/src/shipping/errors.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ShippingErrorCode, ShippingErrorFragment } from "@dashboard/graphql"; import getShippingErrorMessage from "@dashboard/utils/errors/shipping"; import { defineMessages, IntlShape } from "react-intl"; diff --git a/src/shipping/fixtures.ts b/src/shipping/fixtures.ts index 3dc838280..0c2b57157 100644 --- a/src/shipping/fixtures.ts +++ b/src/shipping/fixtures.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { PostalCodeRuleInclusionTypeEnum, SearchProductsQuery, diff --git a/src/shipping/handlers.ts b/src/shipping/handlers.ts index 75456c6fc..10858bcfc 100644 --- a/src/shipping/handlers.ts +++ b/src/shipping/handlers.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ChannelShippingData } from "@dashboard/channels/utils"; import { CountryFragment, @@ -23,28 +24,30 @@ import { useIntl } from "react-intl"; import { ShippingZoneRateCommonFormData } from "./components/ShippingZoneRatesPage/types"; import { shippingRateEditUrl } from "./urls"; -export const createChannelsChangeHandler = ( - selectedChannels: ChannelShippingData[], - setSelectedChannels: (channels: ChannelShippingData[]) => void, - triggerChange: () => void, -) => ( - channelId: string, - value: { maxValue: string; minValue: string; price: string }, -) => { - const itemIndex = selectedChannels.findIndex(item => item.id === channelId); - const channel = selectedChannels[itemIndex]; - setSelectedChannels([ - ...selectedChannels.slice(0, itemIndex), - { - ...channel, - maxValue: value.maxValue, - minValue: value.minValue, - price: value.price, - }, - ...selectedChannels.slice(itemIndex + 1), - ]); - triggerChange(); -}; +export const createChannelsChangeHandler = + ( + selectedChannels: ChannelShippingData[], + setSelectedChannels: (channels: ChannelShippingData[]) => void, + triggerChange: () => void, + ) => + ( + channelId: string, + value: { maxValue: string; minValue: string; price: string }, + ) => { + const itemIndex = selectedChannels.findIndex(item => item.id === channelId); + const channel = selectedChannels[itemIndex]; + setSelectedChannels([ + ...selectedChannels.slice(0, itemIndex), + { + ...channel, + maxValue: value.maxValue, + minValue: value.minValue, + price: value.price, + }, + ...selectedChannels.slice(itemIndex + 1), + ]); + triggerChange(); + }; const getPostalCodeRulesToAdd = ( rules: ShippingMethodTypeFragment["postalCodeRules"], @@ -208,10 +211,8 @@ export function useShippingRateCreator( const intl = useIntl(); const notify = useNotifier(); const navigate = useNavigator(); - const [ - createBaseShippingRate, - createBaseShippingRateOpts, - ] = useCreateShippingRateMutation({}); + const [createBaseShippingRate, createBaseShippingRateOpts] = + useCreateShippingRateMutation({}); const [ updateShippingMethodChannelListing, updateShippingMethodChannelListingOpts, diff --git a/src/shipping/views/RateCreate.tsx b/src/shipping/views/RateCreate.tsx index 8439868ac..0b032e695 100644 --- a/src/shipping/views/RateCreate.tsx +++ b/src/shipping/views/RateCreate.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { createSortedShippingChannels } from "@dashboard/channels/utils"; import ChannelsAvailabilityDialog from "@dashboard/components/ChannelsAvailabilityDialog"; import { WindowTitle } from "@dashboard/components/WindowTitle"; @@ -45,13 +46,11 @@ export const RateCreate: React.FC = ({ id, params }) => { ShippingRateCreateUrlQueryParams >(navigate, params => shippingRateCreateUrl(id, params), params); - const { - data: shippingZoneData, - loading: channelsLoading, - } = useShippingZoneChannelsQuery({ - displayLoader: true, - variables: { id }, - }); + const { data: shippingZoneData, loading: channelsLoading } = + useShippingZoneChannelsQuery({ + displayLoader: true, + variables: { id }, + }); const { taxClasses, fetchMoreTaxClasses } = useTaxClassFetchMore(); @@ -85,17 +84,13 @@ export const RateCreate: React.FC = ({ id, params }) => { postalCodeRules: [], }); - const { - channelErrors, - createShippingRate, - errors, - status, - } = useShippingRateCreator( - id, - params.type, - state.postalCodeRules, - state.inclusionType, - ); + const { channelErrors, createShippingRate, errors, status } = + useShippingRateCreator( + id, + params.type, + state.postalCodeRules, + state.inclusionType, + ); const onPostalCodeAssign = (rule: MinMax) => { if ( diff --git a/src/shipping/views/RateUpdate.tsx b/src/shipping/views/RateUpdate.tsx index bf360e800..f26f20828 100644 --- a/src/shipping/views/RateUpdate.tsx +++ b/src/shipping/views/RateUpdate.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { createShippingChannelsFromRate, createSortedShippingChannels, @@ -77,9 +78,8 @@ export const RateUpdate: React.FC = ({ const notify = useNotifier(); const intl = useIntl(); - const [paginationState, setPaginationState] = useLocalPaginationState( - PAGINATE_BY, - ); + const [paginationState, setPaginationState] = + useLocalPaginationState(PAGINATE_BY); const paginate = useLocalPaginator(setPaginationState); const { data, loading, refetch } = useShippingZoneQuery({ @@ -116,31 +116,27 @@ export const RateUpdate: React.FC = ({ updateShippingMethodChannelListingOpts, ] = useShippingMethodChannelListingUpdateMutation({}); - const [ - unassignProduct, - unassignProductOpts, - ] = useShippingPriceRemoveProductFromExcludeMutation({ - onCompleted: data => { - if (data.shippingPriceRemoveProductFromExclude.errors.length === 0) { - handleSuccess(); - refetch(); - closeModal(); - } - }, - }); + const [unassignProduct, unassignProductOpts] = + useShippingPriceRemoveProductFromExcludeMutation({ + onCompleted: data => { + if (data.shippingPriceRemoveProductFromExclude.errors.length === 0) { + handleSuccess(); + refetch(); + closeModal(); + } + }, + }); - const [ - assignProduct, - assignProductOpts, - ] = useShippingPriceExcludeProductMutation({ - onCompleted: data => { - if (data.shippingPriceExcludeProducts.errors.length === 0) { - handleSuccess(); - refetch(); - closeModal(); - } - }, - }); + const [assignProduct, assignProductOpts] = + useShippingPriceExcludeProductMutation({ + onCompleted: data => { + if (data.shippingPriceExcludeProducts.errors.length === 0) { + handleSuccess(); + refetch(); + closeModal(); + } + }, + }); const shippingChannels = createShippingChannelsFromRate( rate?.channelListings, ); @@ -166,10 +162,8 @@ export const RateUpdate: React.FC = ({ const { taxClasses, fetchMoreTaxClasses } = useTaxClassFetchMore(); - const [ - updateShippingRate, - updateShippingRateOpts, - ] = useUpdateShippingRateMutation({}); + const [updateShippingRate, updateShippingRateOpts] = + useUpdateShippingRateMutation({}); const handleSuccess = () => { notify({ @@ -177,17 +171,15 @@ export const RateUpdate: React.FC = ({ text: intl.formatMessage(commonMessages.savedChanges), }); }; - const [ - deleteShippingRate, - deleteShippingRateOpts, - ] = useDeleteShippingRateMutation({ - onCompleted: data => { - if (data.shippingPriceDelete.errors.length === 0) { - handleSuccess(); - navigate(shippingZoneUrl(id)); - } - }, - }); + const [deleteShippingRate, deleteShippingRateOpts] = + useDeleteShippingRateMutation({ + onCompleted: data => { + if (data.shippingPriceDelete.errors.length === 0) { + handleSuccess(); + navigate(shippingZoneUrl(id)); + } + }, + }); const [updateMetadata] = useUpdateMetadataMutation({}); const [updatePrivateMetadata] = useUpdatePrivateMetadataMutation({}); diff --git a/src/shipping/views/ShippingZoneCreate.tsx b/src/shipping/views/ShippingZoneCreate.tsx index d76029faf..73cdacf52 100644 --- a/src/shipping/views/ShippingZoneCreate.tsx +++ b/src/shipping/views/ShippingZoneCreate.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useCreateShippingZoneMutation, useShopCountriesQuery, @@ -30,20 +31,18 @@ const ShippingZoneCreate: React.FC<{}> = () => { }, }); - const [ - createShippingZone, - createShippingZoneOpts, - ] = useCreateShippingZoneMutation({ - onCompleted: data => { - if (data.shippingZoneCreate.errors.length === 0) { - notify({ - status: "success", - text: intl.formatMessage(commonMessages.savedChanges), - }); - navigate(shippingZoneUrl(data.shippingZoneCreate.shippingZone.id)); - } - }, - }); + const [createShippingZone, createShippingZoneOpts] = + useCreateShippingZoneMutation({ + onCompleted: data => { + if (data.shippingZoneCreate.errors.length === 0) { + notify({ + status: "success", + text: intl.formatMessage(commonMessages.savedChanges), + }); + navigate(shippingZoneUrl(data.shippingZoneCreate.shippingZone.id)); + } + }, + }); const handleSubmit = (data: ShippingZoneCreateFormData) => extractMutationErrors( diff --git a/src/shipping/views/ShippingZoneDetails/index.tsx b/src/shipping/views/ShippingZoneDetails/index.tsx index 87a797262..0866fac66 100644 --- a/src/shipping/views/ShippingZoneDetails/index.tsx +++ b/src/shipping/views/ShippingZoneDetails/index.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import ActionDialog from "@dashboard/components/ActionDialog"; import useAppChannel from "@dashboard/components/AppLayout/AppChannelContext"; import NotFoundPage from "@dashboard/components/NotFoundPage"; @@ -67,24 +68,24 @@ const ShippingZoneDetails: React.FC = ({ const intl = useIntl(); const shop = useShop(); - const { - data: restWorldCountries, - refetch: refetchRestWorldCountries, - } = useShopCountriesQuery({ - variables: { - filter: { - attachedToShippingZones: false, + const { data: restWorldCountries, refetch: refetchRestWorldCountries } = + useShopCountriesQuery({ + variables: { + filter: { + attachedToShippingZones: false, + }, }, - }, - }); + }); const [paginationState] = useLocalPaginationState(PAGINATE_BY); - const { result: searchWarehousesOpts, loadMore, search } = useWarehouseSearch( - { - variables: DEFAULT_INITIAL_SEARCH_DATA, - }, - ); + const { + result: searchWarehousesOpts, + loadMore, + search, + } = useWarehouseSearch({ + variables: DEFAULT_INITIAL_SEARCH_DATA, + }); const { data, loading } = useShippingZoneQuery({ displayLoader: true, @@ -98,51 +99,45 @@ const ShippingZoneDetails: React.FC = ({ >(navigate, params => shippingZoneUrl(id, params), params); const rate = data?.shippingZone?.shippingMethods?.find(getById(params.id)); - const [ - deleteShippingRate, - deleteShippingRateOpts, - ] = useDeleteShippingRateMutation({ - onCompleted: data => { - if (data.shippingPriceDelete.errors.length === 0) { - notify({ - status: "success", - text: intl.formatMessage(commonMessages.savedChanges), - }); - closeModal(); - } - }, - }); + const [deleteShippingRate, deleteShippingRateOpts] = + useDeleteShippingRateMutation({ + onCompleted: data => { + if (data.shippingPriceDelete.errors.length === 0) { + notify({ + status: "success", + text: intl.formatMessage(commonMessages.savedChanges), + }); + closeModal(); + } + }, + }); - const [ - deleteShippingZone, - deleteShippingZoneOpts, - ] = useDeleteShippingZoneMutation({ - onCompleted: data => { - if (data.shippingZoneDelete.errors.length === 0) { - notify({ - status: "success", - text: intl.formatMessage(commonMessages.savedChanges), - }); - navigate(shippingZonesListUrl(), { replace: true }); - } - }, - }); + const [deleteShippingZone, deleteShippingZoneOpts] = + useDeleteShippingZoneMutation({ + onCompleted: data => { + if (data.shippingZoneDelete.errors.length === 0) { + notify({ + status: "success", + text: intl.formatMessage(commonMessages.savedChanges), + }); + navigate(shippingZonesListUrl(), { replace: true }); + } + }, + }); - const [ - updateShippingZone, - updateShippingZoneOpts, - ] = useUpdateShippingZoneMutation({ - onCompleted: data => { - if (data.shippingZoneUpdate.errors.length === 0) { - notify({ - status: "success", - text: intl.formatMessage(commonMessages.savedChanges), - }); - closeModal(); - refetchRestWorldCountries(); - } - }, - }); + const [updateShippingZone, updateShippingZoneOpts] = + useUpdateShippingZoneMutation({ + onCompleted: data => { + if (data.shippingZoneUpdate.errors.length === 0) { + notify({ + status: "success", + text: intl.formatMessage(commonMessages.savedChanges), + }); + closeModal(); + refetchRestWorldCountries(); + } + }, + }); const [createWarehouse, createWarehouseOpts] = useWarehouseCreateMutation({ onCompleted: data => { diff --git a/src/shipping/views/ShippingZonesList.tsx b/src/shipping/views/ShippingZonesList.tsx index f2638ae8c..86fd997e0 100644 --- a/src/shipping/views/ShippingZonesList.tsx +++ b/src/shipping/views/ShippingZonesList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useUser } from "@dashboard/auth"; import ActionDialog from "@dashboard/components/ActionDialog"; import { @@ -79,52 +80,46 @@ export const ShippingZonesList: React.FC = ({ variables: queryVariables, }); - const [ - deleteShippingZone, - deleteShippingZoneOpts, - ] = useDeleteShippingZoneMutation({ - onCompleted: data => { - if (data.shippingZoneDelete.errors.length === 0) { - notify({ - status: "success", - text: intl.formatMessage(commonMessages.savedChanges), - }); - closeModal(); - refetch(); - } - }, - }); + const [deleteShippingZone, deleteShippingZoneOpts] = + useDeleteShippingZoneMutation({ + onCompleted: data => { + if (data.shippingZoneDelete.errors.length === 0) { + notify({ + status: "success", + text: intl.formatMessage(commonMessages.savedChanges), + }); + closeModal(); + refetch(); + } + }, + }); - const [ - updateDefaultWeightUnit, - updateDefaultWeightUnitOpts, - ] = useUpdateDefaultWeightUnitMutation({ - onCompleted: data => { - if (data.shopSettingsUpdate.errors.length === 0) { - notify({ - status: "success", - text: intl.formatMessage(commonMessages.savedChanges), - }); - } - }, - }); + const [updateDefaultWeightUnit, updateDefaultWeightUnitOpts] = + useUpdateDefaultWeightUnitMutation({ + onCompleted: data => { + if (data.shopSettingsUpdate.errors.length === 0) { + notify({ + status: "success", + text: intl.formatMessage(commonMessages.savedChanges), + }); + } + }, + }); - const [ - bulkDeleteShippingZone, - bulkDeleteShippingZoneOpts, - ] = useBulkDeleteShippingZoneMutation({ - onCompleted: data => { - if (data.shippingZoneBulkDelete.errors.length === 0) { - notify({ - status: "success", - text: intl.formatMessage(commonMessages.savedChanges), - }); - closeModal(); - reset(); - refetch(); - } - }, - }); + const [bulkDeleteShippingZone, bulkDeleteShippingZoneOpts] = + useBulkDeleteShippingZoneMutation({ + onCompleted: data => { + if (data.shippingZoneBulkDelete.errors.length === 0) { + notify({ + status: "success", + text: intl.formatMessage(commonMessages.savedChanges), + }); + closeModal(); + reset(); + refetch(); + } + }, + }); const paginationValues = usePaginator({ pageInfo: maybe(() => data.shippingZones.pageInfo), diff --git a/src/shipping/views/utils.tsx b/src/shipping/views/utils.tsx index dfce9e180..6c5c9657e 100644 --- a/src/shipping/views/utils.tsx +++ b/src/shipping/views/utils.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { PostalCodeRuleInclusionTypeEnum } from "@dashboard/graphql"; import { MinMax } from "@dashboard/types"; @@ -7,8 +8,10 @@ export const filterPostalCodes = (postalCodes, codeToFilterOut) => rule.start !== codeToFilterOut.start && rule.end !== codeToFilterOut.end, ); -export const getPostalCodeRuleByMinMax = ({ min, max }) => ({ start, end }) => - start === min && end === max; +export const getPostalCodeRuleByMinMax = + ({ min, max }) => + ({ start, end }) => + start === min && end === max; export const getRuleObject = ( rule: MinMax, diff --git a/src/siteSettings/components/SiteSettingsPage/SiteSettingsPage.tsx b/src/siteSettings/components/SiteSettingsPage/SiteSettingsPage.tsx index db0004c9b..0275058bd 100644 --- a/src/siteSettings/components/SiteSettingsPage/SiteSettingsPage.tsx +++ b/src/siteSettings/components/SiteSettingsPage/SiteSettingsPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { createCountryHandler } from "@dashboard/components/AddressEdit/createCountryHandler"; import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import { DashboardCard } from "@dashboard/components/Card"; diff --git a/src/staff/components/StaffAddMemberDialog/StaffAddMemberDialog.tsx b/src/staff/components/StaffAddMemberDialog/StaffAddMemberDialog.tsx index a322eb7ee..2b26a47e3 100644 --- a/src/staff/components/StaffAddMemberDialog/StaffAddMemberDialog.tsx +++ b/src/staff/components/StaffAddMemberDialog/StaffAddMemberDialog.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import BackButton from "@dashboard/components/BackButton"; import { ConfirmButton, diff --git a/src/staff/components/StaffDetailsPage/StaffDetailsPage.stories.tsx b/src/staff/components/StaffDetailsPage/StaffDetailsPage.stories.tsx index fbe7acc53..0eba82bf6 100644 --- a/src/staff/components/StaffDetailsPage/StaffDetailsPage.stories.tsx +++ b/src/staff/components/StaffDetailsPage/StaffDetailsPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { userPermissionGroups } from "@dashboard/permissionGroups/fixtures"; import { staffMember } from "@dashboard/staff/fixtures"; import React from "react"; diff --git a/src/staff/components/StaffDetailsPage/StaffDetailsPage.tsx b/src/staff/components/StaffDetailsPage/StaffDetailsPage.tsx index 66662883d..7ce00142c 100644 --- a/src/staff/components/StaffDetailsPage/StaffDetailsPage.tsx +++ b/src/staff/components/StaffDetailsPage/StaffDetailsPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import AccountPermissionGroups from "@dashboard/components/AccountPermissionGroups"; import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import CardSpacer from "@dashboard/components/CardSpacer"; diff --git a/src/staff/components/StaffList/StaffList.tsx b/src/staff/components/StaffList/StaffList.tsx index 7cc455eca..8d78d6959 100644 --- a/src/staff/components/StaffList/StaffList.tsx +++ b/src/staff/components/StaffList/StaffList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import ResponsiveTable from "@dashboard/components/ResponsiveTable"; import Skeleton from "@dashboard/components/Skeleton"; import TableCellHeader from "@dashboard/components/TableCellHeader"; diff --git a/src/staff/components/StaffListPage/StaffListPage.stories.tsx b/src/staff/components/StaffListPage/StaffListPage.stories.tsx index 8e472c114..181c7194a 100644 --- a/src/staff/components/StaffListPage/StaffListPage.stories.tsx +++ b/src/staff/components/StaffListPage/StaffListPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { filterPageProps, limits, diff --git a/src/staff/components/StaffListPage/StaffListPage.tsx b/src/staff/components/StaffListPage/StaffListPage.tsx index 6dca40fcc..ee4b8c22b 100644 --- a/src/staff/components/StaffListPage/StaffListPage.tsx +++ b/src/staff/components/StaffListPage/StaffListPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { LimitsInfo } from "@dashboard/components/AppLayout/LimitsInfo"; import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import { Button } from "@dashboard/components/Button"; diff --git a/src/staff/components/StaffPasswordResetDialog/StaffPasswordResetDialog.tsx b/src/staff/components/StaffPasswordResetDialog/StaffPasswordResetDialog.tsx index b0386b505..9c5c8a7a4 100644 --- a/src/staff/components/StaffPasswordResetDialog/StaffPasswordResetDialog.tsx +++ b/src/staff/components/StaffPasswordResetDialog/StaffPasswordResetDialog.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import BackButton from "@dashboard/components/BackButton"; import { ConfirmButton, diff --git a/src/staff/components/StaffProperties/StaffProperties.tsx b/src/staff/components/StaffProperties/StaffProperties.tsx index 919ce23df..aa4ec5db8 100644 --- a/src/staff/components/StaffProperties/StaffProperties.tsx +++ b/src/staff/components/StaffProperties/StaffProperties.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import photoIcon from "@assets/images/photo-icon.svg"; import CardTitle from "@dashboard/components/CardTitle"; import { diff --git a/src/staff/fixtures.ts b/src/staff/fixtures.ts index 542037591..f60aec13e 100644 --- a/src/staff/fixtures.ts +++ b/src/staff/fixtures.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import avatarImage from "@assets/images/avatars/avatar.png"; import { permissions } from "@dashboard/fixtures"; import { diff --git a/src/staff/utils.ts b/src/staff/utils.ts index 70b65362e..0b06ba55c 100644 --- a/src/staff/utils.ts +++ b/src/staff/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { StaffMemberDetailsFragment, UserFragment } from "@dashboard/graphql"; import difference from "lodash/difference"; diff --git a/src/staff/views/StaffDetails.tsx b/src/staff/views/StaffDetails.tsx index 266507e9b..b125d1af7 100644 --- a/src/staff/views/StaffDetails.tsx +++ b/src/staff/views/StaffDetails.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useUser } from "@dashboard/auth"; import ActionDialog from "@dashboard/components/ActionDialog"; import NotFoundPage from "@dashboard/components/NotFoundPage"; diff --git a/src/staff/views/StaffList/StaffList.tsx b/src/staff/views/StaffList/StaffList.tsx index d8f2df2b2..2fd89ffbd 100644 --- a/src/staff/views/StaffList/StaffList.tsx +++ b/src/staff/views/StaffList/StaffList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { newPasswordUrl } from "@dashboard/auth/urls"; import DeleteFilterTabDialog from "@dashboard/components/DeleteFilterTabDialog"; import SaveFilterTabDialog, { @@ -110,16 +111,13 @@ export const StaffList: React.FC = ({ params }) => { const currentTab = getFiltersCurrentTab(params, tabs); - const [ - changeFilters, - resetFilters, - handleSearchChange, - ] = createFilterHandlers({ - createUrl: staffListUrl, - getFilterQueryParam, - navigate, - params, - }); + const [changeFilters, resetFilters, handleSearchChange] = + createFilterHandlers({ + createUrl: staffListUrl, + getFilterQueryParam, + navigate, + params, + }); const [openModal, closeModal] = createDialogActionHandlers< StaffListUrlDialog, diff --git a/src/staff/views/StaffList/filters.ts b/src/staff/views/StaffList/filters.ts index 4409c931a..6df7b1830 100644 --- a/src/staff/views/StaffList/filters.ts +++ b/src/staff/views/StaffList/filters.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FilterElement, FilterElementRegular, @@ -59,16 +60,10 @@ export function getFilterQueryParam( } } -export const { - deleteFilterTab, - getFilterTabs, - saveFilterTab, -} = createFilterTabUtils(STAFF_FILTERS_KEY); +export const { deleteFilterTab, getFilterTabs, saveFilterTab } = + createFilterTabUtils(STAFF_FILTERS_KEY); -export const { - areFiltersApplied, - getActiveFilters, - getFiltersCurrentTab, -} = createFilterUtils( - StaffListUrlFiltersEnum, -); +export const { areFiltersApplied, getActiveFilters, getFiltersCurrentTab } = + createFilterUtils( + StaffListUrlFiltersEnum, + ); diff --git a/src/staff/views/StaffList/sort.ts b/src/staff/views/StaffList/sort.ts index 92f08e74e..db946efe8 100644 --- a/src/staff/views/StaffList/sort.ts +++ b/src/staff/views/StaffList/sort.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { UserSortField } from "@dashboard/graphql"; import { StaffListUrlSortField } from "@dashboard/staff/urls"; import { createGetSortQueryVariables } from "@dashboard/utils/sort"; @@ -13,6 +14,5 @@ export function getSortQueryField(sort: StaffListUrlSortField): UserSortField { } } -export const getSortQueryVariables = createGetSortQueryVariables( - getSortQueryField, -); +export const getSortQueryVariables = + createGetSortQueryVariables(getSortQueryField); diff --git a/src/taxes/components/TaxCountryDialog/TaxCountryDialog.tsx b/src/taxes/components/TaxCountryDialog/TaxCountryDialog.tsx index a4f815236..89bdcf844 100644 --- a/src/taxes/components/TaxCountryDialog/TaxCountryDialog.tsx +++ b/src/taxes/components/TaxCountryDialog/TaxCountryDialog.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import VerticalSpacer from "@dashboard/components/VerticalSpacer"; import { CountryFragment } from "@dashboard/graphql"; import { useLocalSearch } from "@dashboard/hooks/useLocalSearch"; diff --git a/src/taxes/pages/TaxChannelsPage/TaxChannelsPage.tsx b/src/taxes/pages/TaxChannelsPage/TaxChannelsPage.tsx index 897d985c3..f38533dd2 100644 --- a/src/taxes/pages/TaxChannelsPage/TaxChannelsPage.tsx +++ b/src/taxes/pages/TaxChannelsPage/TaxChannelsPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import CardTitle from "@dashboard/components/CardTitle"; import { ConfirmButtonTransitionState } from "@dashboard/components/ConfirmButton"; diff --git a/src/taxes/pages/TaxChannelsPage/TaxCountryExceptionListItem/TaxCountryExceptionListItem.tsx b/src/taxes/pages/TaxChannelsPage/TaxCountryExceptionListItem/TaxCountryExceptionListItem.tsx index bd02c1416..5d4e7a073 100644 --- a/src/taxes/pages/TaxChannelsPage/TaxCountryExceptionListItem/TaxCountryExceptionListItem.tsx +++ b/src/taxes/pages/TaxChannelsPage/TaxCountryExceptionListItem/TaxCountryExceptionListItem.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import ControlledCheckbox from "@dashboard/components/ControlledCheckbox"; import SingleSelectField, { Choice, @@ -26,13 +27,9 @@ interface TaxCountryExceptionListItemProps { strategyChoices: Choice[]; } -export const TaxCountryExceptionListItem: React.FC = ({ - country, - onDelete, - onChange, - strategyChoices, - divider = true, -}) => { +export const TaxCountryExceptionListItem: React.FC< + TaxCountryExceptionListItemProps +> = ({ country, onDelete, onChange, strategyChoices, divider = true }) => { const classes = useStyles(); return ( <> diff --git a/src/taxes/pages/TaxClassesPage/TaxClassesPage.stories.tsx b/src/taxes/pages/TaxClassesPage/TaxClassesPage.stories.tsx index b6b569476..c4b7915e7 100644 --- a/src/taxes/pages/TaxClassesPage/TaxClassesPage.stories.tsx +++ b/src/taxes/pages/TaxClassesPage/TaxClassesPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { taxClasses } from "@dashboard/taxes/fixtures"; import React from "react"; diff --git a/src/taxes/pages/TaxClassesPage/form.tsx b/src/taxes/pages/TaxClassesPage/form.tsx index 8a7804fb0..0287cb6ed 100644 --- a/src/taxes/pages/TaxClassesPage/form.tsx +++ b/src/taxes/pages/TaxClassesPage/form.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useExitFormDialog } from "@dashboard/components/Form/useExitFormDialog"; import { TaxClassFragment } from "@dashboard/graphql"; import useForm, { FormChange, SubmitPromise } from "@dashboard/hooks/useForm"; @@ -75,9 +76,8 @@ function useTaxClassesForm( formset.change(id, value); }; - const { - makeChangeHandler: makeMetadataChangeHandler, - } = useMetadataChangeTrigger(); + const { makeChangeHandler: makeMetadataChangeHandler } = + useMetadataChangeTrigger(); const changeMetadata = makeMetadataChangeHandler(handleChange); @@ -116,10 +116,10 @@ function useTaxClassesForm( formId, }); - React.useEffect(() => setExitDialogSubmitRef(submit), [ - setExitDialogSubmitRef, - submit, - ]); + React.useEffect( + () => setExitDialogSubmitRef(submit), + [setExitDialogSubmitRef, submit], + ); setIsSubmitDisabled(disabled); return { diff --git a/src/taxes/pages/TaxCountriesPage/TaxCountriesPage.stories.tsx b/src/taxes/pages/TaxCountriesPage/TaxCountriesPage.stories.tsx index ba25c6300..9dfe4addc 100644 --- a/src/taxes/pages/TaxCountriesPage/TaxCountriesPage.stories.tsx +++ b/src/taxes/pages/TaxCountriesPage/TaxCountriesPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { taxCountryConfigurations } from "@dashboard/taxes/fixtures"; import React from "react"; diff --git a/src/taxes/pages/TaxCountriesPage/TaxCountriesPage.tsx b/src/taxes/pages/TaxCountriesPage/TaxCountriesPage.tsx index 36c642d57..8f84fe13d 100644 --- a/src/taxes/pages/TaxCountriesPage/TaxCountriesPage.tsx +++ b/src/taxes/pages/TaxCountriesPage/TaxCountriesPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import CardTitle from "@dashboard/components/CardTitle"; import { ConfirmButtonTransitionState } from "@dashboard/components/ConfirmButton"; diff --git a/src/taxes/pages/TaxCountriesPage/form.tsx b/src/taxes/pages/TaxCountriesPage/form.tsx index 4282629f4..2bf184424 100644 --- a/src/taxes/pages/TaxCountriesPage/form.tsx +++ b/src/taxes/pages/TaxCountriesPage/form.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useExitFormDialog } from "@dashboard/components/Form/useExitFormDialog"; import { TaxClassFragment, @@ -88,10 +89,10 @@ function useTaxCountriesForm( formId, }); - React.useEffect(() => setExitDialogSubmitRef(submit), [ - setExitDialogSubmitRef, - submit, - ]); + React.useEffect( + () => setExitDialogSubmitRef(submit), + [setExitDialogSubmitRef, submit], + ); setIsSubmitDisabled(disabled); return { data: formset.data, handlers: { handleRateChange }, submit }; diff --git a/src/taxes/utils/data.ts b/src/taxes/utils/data.ts index c55ebe993..6ea5feafd 100644 --- a/src/taxes/utils/data.ts +++ b/src/taxes/utils/data.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { CountryCode, CountryRateInput, diff --git a/src/taxes/utils/useTaxClassFetchMore.ts b/src/taxes/utils/useTaxClassFetchMore.ts index e91ef2387..33dc2cf3a 100644 --- a/src/taxes/utils/useTaxClassFetchMore.ts +++ b/src/taxes/utils/useTaxClassFetchMore.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TaxClassBaseFragment, useTaxClassAssignQuery, diff --git a/src/taxes/utils/utils.ts b/src/taxes/utils/utils.ts index 1e3d0daed..eeea7ee45 100644 --- a/src/taxes/utils/utils.ts +++ b/src/taxes/utils/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { CountryFragment, TaxClassFragment, diff --git a/src/taxes/views/TaxChannelsList.tsx b/src/taxes/views/TaxChannelsList.tsx index d9658d5f0..8f37ce698 100644 --- a/src/taxes/views/TaxChannelsList.tsx +++ b/src/taxes/views/TaxChannelsList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useTaxConfigurationsListQuery, useTaxConfigurationUpdateMutation, diff --git a/src/taxes/views/TaxClassesList.tsx b/src/taxes/views/TaxClassesList.tsx index 2c42a307d..9f0a01a9d 100644 --- a/src/taxes/views/TaxClassesList.tsx +++ b/src/taxes/views/TaxClassesList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TaxClassCreateErrorFragment, TaxClassFragment, @@ -73,42 +74,38 @@ export const TaxClassesList: React.FC = ({ id }) => { }, }); - const [ - taxClassUpdateMutation, - taxClassUpdateMutationState, - ] = useTaxClassUpdateMutation({ - onCompleted: data => { - const errors = data?.taxClassUpdate?.errors; - if (errors.length === 0) { - notify({ - status: "success", - text: intl.formatMessage(commonMessages.savedChanges), - }); - } - }, - }); + const [taxClassUpdateMutation, taxClassUpdateMutationState] = + useTaxClassUpdateMutation({ + onCompleted: data => { + const errors = data?.taxClassUpdate?.errors; + if (errors.length === 0) { + notify({ + status: "success", + text: intl.formatMessage(commonMessages.savedChanges), + }); + } + }, + }); - const [ - taxClassCreateMutation, - taxClassCreateMutationState, - ] = useTaxClassCreateMutation({ - onCompleted: data => { - const errors = data?.taxClassCreate?.errors; - if (errors.length === 0) { - notify({ - status: "success", - text: intl.formatMessage(commonMessages.savedChanges), - }); - navigate(taxClassesListUrl(data?.taxClassCreate?.taxClass?.id)); - } - }, - }); + const [taxClassCreateMutation, taxClassCreateMutationState] = + useTaxClassCreateMutation({ + onCompleted: data => { + const errors = data?.taxClassCreate?.errors; + if (errors.length === 0) { + notify({ + status: "success", + text: intl.formatMessage(commonMessages.savedChanges), + }); + navigate(taxClassesListUrl(data?.taxClassCreate?.taxClass?.id)); + } + }, + }); const createTaxClass = async ( data: TaxClassesPageFormData, - ): Promise> => { + ): Promise< + CreateMetadataHandlerFunctionResult + > => { const res = await taxClassCreateMutation({ variables: { input: createTaxClassCreateInput(data), diff --git a/src/taxes/views/TaxCountriesList.tsx b/src/taxes/views/TaxCountriesList.tsx index 877f5017c..ad1879890 100644 --- a/src/taxes/views/TaxCountriesList.tsx +++ b/src/taxes/views/TaxCountriesList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { CountryCode, TaxCountryConfigurationFragment, @@ -61,19 +62,18 @@ export const TaxCountriesList: React.FC = ({ } }, }); - const [ - taxCountryConfigurationDeleteMutation, - ] = useTaxCountryConfigurationDeleteMutation({ - onCompleted: data => { - const errors = data?.taxCountryConfigurationDelete?.errors; - if (errors.length === 0) { - notify({ - status: "success", - text: intl.formatMessage(commonMessages.savedChanges), - }); - } - }, - }); + const [taxCountryConfigurationDeleteMutation] = + useTaxCountryConfigurationDeleteMutation({ + onCompleted: data => { + const errors = data?.taxCountryConfigurationDelete?.errors; + if (errors.length === 0) { + notify({ + status: "success", + text: intl.formatMessage(commonMessages.savedChanges), + }); + } + }, + }); const shop = useShop(); @@ -82,9 +82,8 @@ export const TaxCountriesList: React.FC = ({ TaxesUrlQueryParams >(navigate, params => taxCountriesListUrl(id, params), params); - const [newCountry, setNewCountry] = React.useState< - TaxCountryConfigurationFragment - >(); + const [newCountry, setNewCountry] = + React.useState(); const { data, @@ -98,19 +97,20 @@ export const TaxCountriesList: React.FC = ({ const taxCountryConfigurations = data?.taxCountryConfigurations; const taxClasses = mapEdgesToItems(taxClassesData?.taxClasses); - const allCountryTaxes: TaxCountryConfigurationFragment[] = React.useMemo(() => { - if (taxClasses && taxCountryConfigurations) { - return [ - ...(newCountry ? [newCountry] : []), - ...mapUndefinedTaxRatesToCountries( - taxCountryConfigurations ?? [], - taxClasses ?? [], - ), - ]; - } else { - return undefined; - } - }, [taxCountryConfigurations, newCountry, taxClasses]); + const allCountryTaxes: TaxCountryConfigurationFragment[] = + React.useMemo(() => { + if (taxClasses && taxCountryConfigurations) { + return [ + ...(newCountry ? [newCountry] : []), + ...mapUndefinedTaxRatesToCountries( + taxCountryConfigurations ?? [], + taxClasses ?? [], + ), + ]; + } else { + return undefined; + } + }, [taxCountryConfigurations, newCountry, taxClasses]); const handleDeleteConfiguration = async (countryCode: CountryCode) => { if (newCountry?.country.code === countryCode) { diff --git a/src/translations/components/ProductContextSwitcher/ProductContextSwitcher.tsx b/src/translations/components/ProductContextSwitcher/ProductContextSwitcher.tsx index 4376e4f30..9bbdf710c 100644 --- a/src/translations/components/ProductContextSwitcher/ProductContextSwitcher.tsx +++ b/src/translations/components/ProductContextSwitcher/ProductContextSwitcher.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useProductVariantListQuery } from "@dashboard/graphql"; import useNavigator from "@dashboard/hooks/useNavigator"; import { diff --git a/src/translations/components/TranslationFields/TranslationFields.tsx b/src/translations/components/TranslationFields/TranslationFields.tsx index c8547e918..95add738e 100644 --- a/src/translations/components/TranslationFields/TranslationFields.tsx +++ b/src/translations/components/TranslationFields/TranslationFields.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import CardTitle from "@dashboard/components/CardTitle"; import { ConfirmButtonTransitionState } from "@dashboard/components/ConfirmButton"; import Grid from "@dashboard/components/Grid"; diff --git a/src/translations/components/TranslationFields/TranslationFieldsRich.tsx b/src/translations/components/TranslationFields/TranslationFieldsRich.tsx index e5ac9a6e6..340636df2 100644 --- a/src/translations/components/TranslationFields/TranslationFieldsRich.tsx +++ b/src/translations/components/TranslationFields/TranslationFieldsRich.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { ConfirmButtonTransitionState } from "@dashboard/components/ConfirmButton"; import RichTextEditor from "@dashboard/components/RichTextEditor"; import RichTextEditorContent from "@dashboard/components/RichTextEditor/RichTextEditorContent"; diff --git a/src/translations/components/TranslationsAttributesPage/TranslationsAttributesPage.tsx b/src/translations/components/TranslationsAttributesPage/TranslationsAttributesPage.tsx index a6fdca7cb..1cb7b46d0 100644 --- a/src/translations/components/TranslationsAttributesPage/TranslationsAttributesPage.tsx +++ b/src/translations/components/TranslationsAttributesPage/TranslationsAttributesPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import CardSpacer from "@dashboard/components/CardSpacer"; import LanguageSwitch from "@dashboard/components/LanguageSwitch"; diff --git a/src/translations/components/TranslationsCategoriesPage/TranslationsCategoriesPage.tsx b/src/translations/components/TranslationsCategoriesPage/TranslationsCategoriesPage.tsx index a1a9f2d98..3f88649d7 100644 --- a/src/translations/components/TranslationsCategoriesPage/TranslationsCategoriesPage.tsx +++ b/src/translations/components/TranslationsCategoriesPage/TranslationsCategoriesPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import CardSpacer from "@dashboard/components/CardSpacer"; import LanguageSwitch from "@dashboard/components/LanguageSwitch"; diff --git a/src/translations/components/TranslationsCollectionsPage/TranslationsCollectionsPage.tsx b/src/translations/components/TranslationsCollectionsPage/TranslationsCollectionsPage.tsx index e0ba805b6..4a10b1914 100644 --- a/src/translations/components/TranslationsCollectionsPage/TranslationsCollectionsPage.tsx +++ b/src/translations/components/TranslationsCollectionsPage/TranslationsCollectionsPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import CardSpacer from "@dashboard/components/CardSpacer"; import LanguageSwitch from "@dashboard/components/LanguageSwitch"; diff --git a/src/translations/components/TranslationsEntitiesListPage/TranslationsEntitiesListPage.stories.tsx b/src/translations/components/TranslationsEntitiesListPage/TranslationsEntitiesListPage.stories.tsx index 7b01508de..b5708d1bd 100644 --- a/src/translations/components/TranslationsEntitiesListPage/TranslationsEntitiesListPage.stories.tsx +++ b/src/translations/components/TranslationsEntitiesListPage/TranslationsEntitiesListPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { pageListProps, searchPageProps } from "@dashboard/fixtures"; import { LanguageCodeEnum } from "@dashboard/graphql"; import { Meta, StoryObj } from "@storybook/react"; diff --git a/src/translations/components/TranslationsLanguageList/TranslationsLanguageList.tsx b/src/translations/components/TranslationsLanguageList/TranslationsLanguageList.tsx index d97de90b5..f0c50684d 100644 --- a/src/translations/components/TranslationsLanguageList/TranslationsLanguageList.tsx +++ b/src/translations/components/TranslationsLanguageList/TranslationsLanguageList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import ResponsiveTable from "@dashboard/components/ResponsiveTable"; import Skeleton from "@dashboard/components/Skeleton"; import TableRowLink from "@dashboard/components/TableRowLink"; diff --git a/src/translations/components/TranslationsLanguageListPage/TranslationsLanguageListPage.stories.tsx b/src/translations/components/TranslationsLanguageListPage/TranslationsLanguageListPage.stories.tsx index 9693b37ec..f40558f98 100644 --- a/src/translations/components/TranslationsLanguageListPage/TranslationsLanguageListPage.stories.tsx +++ b/src/translations/components/TranslationsLanguageListPage/TranslationsLanguageListPage.stories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import React from "react"; import TranslationsLanguageListPage, { diff --git a/src/translations/components/TranslationsMenuItemPage/TranslationsMenuItemPage.tsx b/src/translations/components/TranslationsMenuItemPage/TranslationsMenuItemPage.tsx index 7c456954d..48291a5fd 100644 --- a/src/translations/components/TranslationsMenuItemPage/TranslationsMenuItemPage.tsx +++ b/src/translations/components/TranslationsMenuItemPage/TranslationsMenuItemPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import LanguageSwitch from "@dashboard/components/LanguageSwitch"; import { DetailPageLayout } from "@dashboard/components/Layouts"; diff --git a/src/translations/components/TranslationsPagesPage/TranslationsPagesPage.tsx b/src/translations/components/TranslationsPagesPage/TranslationsPagesPage.tsx index 70b36230a..fef4e9a0a 100644 --- a/src/translations/components/TranslationsPagesPage/TranslationsPagesPage.tsx +++ b/src/translations/components/TranslationsPagesPage/TranslationsPagesPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import CardSpacer from "@dashboard/components/CardSpacer"; import LanguageSwitch from "@dashboard/components/LanguageSwitch"; diff --git a/src/translations/components/TranslationsProductVariantsPage/TranslationsProductVariantsPage.tsx b/src/translations/components/TranslationsProductVariantsPage/TranslationsProductVariantsPage.tsx index 2132bbd5f..308767722 100644 --- a/src/translations/components/TranslationsProductVariantsPage/TranslationsProductVariantsPage.tsx +++ b/src/translations/components/TranslationsProductVariantsPage/TranslationsProductVariantsPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import CardSpacer from "@dashboard/components/CardSpacer"; import LanguageSwitch from "@dashboard/components/LanguageSwitch"; diff --git a/src/translations/components/TranslationsProductsPage/TranslationsProductsPage.tsx b/src/translations/components/TranslationsProductsPage/TranslationsProductsPage.tsx index 4f8399219..5eae06fe2 100644 --- a/src/translations/components/TranslationsProductsPage/TranslationsProductsPage.tsx +++ b/src/translations/components/TranslationsProductsPage/TranslationsProductsPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import CardSpacer from "@dashboard/components/CardSpacer"; import LanguageSwitch from "@dashboard/components/LanguageSwitch"; diff --git a/src/translations/components/TranslationsSalesPage/TranslationsSalesPage.tsx b/src/translations/components/TranslationsSalesPage/TranslationsSalesPage.tsx index 0e6e0ff3f..0643506cc 100644 --- a/src/translations/components/TranslationsSalesPage/TranslationsSalesPage.tsx +++ b/src/translations/components/TranslationsSalesPage/TranslationsSalesPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import LanguageSwitch from "@dashboard/components/LanguageSwitch"; import { DetailPageLayout } from "@dashboard/components/Layouts"; diff --git a/src/translations/components/TranslationsShippingMethodPage/TranslationsShippingMethodPage.tsx b/src/translations/components/TranslationsShippingMethodPage/TranslationsShippingMethodPage.tsx index 0f16f779a..576ba3720 100644 --- a/src/translations/components/TranslationsShippingMethodPage/TranslationsShippingMethodPage.tsx +++ b/src/translations/components/TranslationsShippingMethodPage/TranslationsShippingMethodPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import LanguageSwitch from "@dashboard/components/LanguageSwitch"; import { DetailPageLayout } from "@dashboard/components/Layouts"; diff --git a/src/translations/components/TranslationsVouchersPage/TranslationsVouchersPage.tsx b/src/translations/components/TranslationsVouchersPage/TranslationsVouchersPage.tsx index cd774a54d..37064f4f6 100644 --- a/src/translations/components/TranslationsVouchersPage/TranslationsVouchersPage.tsx +++ b/src/translations/components/TranslationsVouchersPage/TranslationsVouchersPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import LanguageSwitch from "@dashboard/components/LanguageSwitch"; import { DetailPageLayout } from "@dashboard/components/Layouts"; diff --git a/src/translations/index.tsx b/src/translations/index.tsx index 891a4cd34..44111aff6 100644 --- a/src/translations/index.tsx +++ b/src/translations/index.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { LanguageCodeEnum } from "@dashboard/graphql"; import { sectionNames } from "@dashboard/intl"; import { parse as parseQs } from "qs"; diff --git a/src/translations/utils.ts b/src/translations/utils.ts index 596969fbe..0f558ee0a 100644 --- a/src/translations/utils.ts +++ b/src/translations/utils.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { AttributeTranslationDetailsFragment, AttributeValueTranslatableFragment, diff --git a/src/translations/views/EntityLists/TranslationsAttributeList.tsx b/src/translations/views/EntityLists/TranslationsAttributeList.tsx index 2938af206..02b57ddca 100644 --- a/src/translations/views/EntityLists/TranslationsAttributeList.tsx +++ b/src/translations/views/EntityLists/TranslationsAttributeList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useAttributeTranslationsQuery } from "@dashboard/graphql"; import usePaginator, { PaginatorContext } from "@dashboard/hooks/usePaginator"; import TranslationsEntitiesList from "@dashboard/translations/components/TranslationsEntitiesList"; diff --git a/src/translations/views/EntityLists/TranslationsCategoryList.tsx b/src/translations/views/EntityLists/TranslationsCategoryList.tsx index 0514920e5..ea65c5a09 100644 --- a/src/translations/views/EntityLists/TranslationsCategoryList.tsx +++ b/src/translations/views/EntityLists/TranslationsCategoryList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useCategoryTranslationsQuery } from "@dashboard/graphql"; import usePaginator, { PaginatorContext } from "@dashboard/hooks/usePaginator"; import TranslationsEntitiesList from "@dashboard/translations/components/TranslationsEntitiesList"; diff --git a/src/translations/views/EntityLists/TranslationsCollectionList.tsx b/src/translations/views/EntityLists/TranslationsCollectionList.tsx index 046e82e36..f78097179 100644 --- a/src/translations/views/EntityLists/TranslationsCollectionList.tsx +++ b/src/translations/views/EntityLists/TranslationsCollectionList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useCollectionTranslationsQuery } from "@dashboard/graphql"; import usePaginator, { PaginatorContext } from "@dashboard/hooks/usePaginator"; import TranslationsEntitiesList from "@dashboard/translations/components/TranslationsEntitiesList"; diff --git a/src/translations/views/EntityLists/TranslationsMenuItemList.tsx b/src/translations/views/EntityLists/TranslationsMenuItemList.tsx index f25ba43dc..7c61a2d40 100644 --- a/src/translations/views/EntityLists/TranslationsMenuItemList.tsx +++ b/src/translations/views/EntityLists/TranslationsMenuItemList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useMenuItemTranslationsQuery } from "@dashboard/graphql"; import usePaginator, { PaginatorContext } from "@dashboard/hooks/usePaginator"; import TranslationsEntitiesList from "@dashboard/translations/components/TranslationsEntitiesList"; diff --git a/src/translations/views/EntityLists/TranslationsPageList.tsx b/src/translations/views/EntityLists/TranslationsPageList.tsx index 223597cf3..f0afe76ef 100644 --- a/src/translations/views/EntityLists/TranslationsPageList.tsx +++ b/src/translations/views/EntityLists/TranslationsPageList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { usePageTranslationsQuery } from "@dashboard/graphql"; import usePaginator, { PaginatorContext } from "@dashboard/hooks/usePaginator"; import TranslationsEntitiesList from "@dashboard/translations/components/TranslationsEntitiesList"; diff --git a/src/translations/views/EntityLists/TranslationsProductList.tsx b/src/translations/views/EntityLists/TranslationsProductList.tsx index 04de675a4..242618150 100644 --- a/src/translations/views/EntityLists/TranslationsProductList.tsx +++ b/src/translations/views/EntityLists/TranslationsProductList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useProductTranslationsQuery } from "@dashboard/graphql"; import usePaginator, { PaginatorContext } from "@dashboard/hooks/usePaginator"; import TranslationsEntitiesList from "@dashboard/translations/components/TranslationsEntitiesList"; diff --git a/src/translations/views/EntityLists/TranslationsSaleList.tsx b/src/translations/views/EntityLists/TranslationsSaleList.tsx index be120a303..58e2fcd83 100644 --- a/src/translations/views/EntityLists/TranslationsSaleList.tsx +++ b/src/translations/views/EntityLists/TranslationsSaleList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useSaleTranslationsQuery } from "@dashboard/graphql"; import usePaginator, { PaginatorContext } from "@dashboard/hooks/usePaginator"; import TranslationsEntitiesList from "@dashboard/translations/components/TranslationsEntitiesList"; diff --git a/src/translations/views/EntityLists/TranslationsShippingMethodList.tsx b/src/translations/views/EntityLists/TranslationsShippingMethodList.tsx index 891fd3ce8..a50013308 100644 --- a/src/translations/views/EntityLists/TranslationsShippingMethodList.tsx +++ b/src/translations/views/EntityLists/TranslationsShippingMethodList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useShippingMethodTranslationsQuery } from "@dashboard/graphql"; import usePaginator, { PaginatorContext } from "@dashboard/hooks/usePaginator"; import TranslationsEntitiesList from "@dashboard/translations/components/TranslationsEntitiesList"; diff --git a/src/translations/views/EntityLists/TranslationsVoucherList.tsx b/src/translations/views/EntityLists/TranslationsVoucherList.tsx index c27f6d0bf..000276f6a 100644 --- a/src/translations/views/EntityLists/TranslationsVoucherList.tsx +++ b/src/translations/views/EntityLists/TranslationsVoucherList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useVoucherTranslationsQuery } from "@dashboard/graphql"; import usePaginator, { PaginatorContext } from "@dashboard/hooks/usePaginator"; import TranslationsEntitiesList from "@dashboard/translations/components/TranslationsEntitiesList"; diff --git a/src/translations/views/TranslationsAttributes.tsx b/src/translations/views/TranslationsAttributes.tsx index 929f7aa3a..dfe59765b 100644 --- a/src/translations/views/TranslationsAttributes.tsx +++ b/src/translations/views/TranslationsAttributes.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { LanguageCodeEnum, useAttributeTranslationDetailsQuery, @@ -47,10 +48,8 @@ const TranslationsAttributes: React.FC = ({ const { updateListSettings, settings } = useListSettings( ListViews.TRANSLATION_ATTRIBUTE_VALUE_LIST, ); - const [ - valuesPaginationState, - setValuesPaginationState, - ] = useLocalPaginationState(settings?.rowNumber); + const [valuesPaginationState, setValuesPaginationState] = + useLocalPaginationState(settings?.rowNumber); const attributeTranslations = useAttributeTranslationDetailsQuery({ variables: { @@ -74,21 +73,19 @@ const TranslationsAttributes: React.FC = ({ valuesPaginationState, ); - const [ - updateAttributeTranslations, - updateAttributeTranslationsOpts, - ] = useUpdateAttributeTranslationsMutation({ - onCompleted: data => { - if (data.attributeTranslate.errors.length === 0) { - attributeTranslations.refetch(); - notify({ - status: "success", - text: intl.formatMessage(commonMessages.savedChanges), - }); - navigate("?", { replace: true }); - } - }, - }); + const [updateAttributeTranslations, updateAttributeTranslationsOpts] = + useUpdateAttributeTranslationsMutation({ + onCompleted: data => { + if (data.attributeTranslate.errors.length === 0) { + attributeTranslations.refetch(); + notify({ + status: "success", + text: intl.formatMessage(commonMessages.savedChanges), + }); + navigate("?", { replace: true }); + } + }, + }); const [ updateAttributeValueTranslations, diff --git a/src/translations/views/TranslationsCategories.tsx b/src/translations/views/TranslationsCategories.tsx index 836aeed8d..d210c09b9 100644 --- a/src/translations/views/TranslationsCategories.tsx +++ b/src/translations/views/TranslationsCategories.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { LanguageCodeEnum, useCategoryTranslationDetailsQuery, @@ -40,21 +41,19 @@ const TranslationsCategories: React.FC = ({ variables: { id, language: languageCode }, }); - const [ - updateTranslations, - updateTranslationsOpts, - ] = useUpdateCategoryTranslationsMutation({ - onCompleted: data => { - if (data.categoryTranslate.errors.length === 0) { - categoryTranslations.refetch(); - notify({ - status: "success", - text: intl.formatMessage(commonMessages.savedChanges), - }); - navigate("?", { replace: true }); - } - }, - }); + const [updateTranslations, updateTranslationsOpts] = + useUpdateCategoryTranslationsMutation({ + onCompleted: data => { + if (data.categoryTranslate.errors.length === 0) { + categoryTranslations.refetch(); + notify({ + status: "success", + text: intl.formatMessage(commonMessages.savedChanges), + }); + navigate("?", { replace: true }); + } + }, + }); const onEdit = (field: string) => navigate( diff --git a/src/translations/views/TranslationsCollections.tsx b/src/translations/views/TranslationsCollections.tsx index 8f57dff22..35848d7d7 100644 --- a/src/translations/views/TranslationsCollections.tsx +++ b/src/translations/views/TranslationsCollections.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { LanguageCodeEnum, useCollectionTranslationDetailsQuery, @@ -39,21 +40,19 @@ const TranslationsCollections: React.FC = ({ variables: { id, language: languageCode }, }); - const [ - updateTranslations, - updateTranslationsOpts, - ] = useUpdateCollectionTranslationsMutation({ - onCompleted: data => { - if (data.collectionTranslate.errors.length === 0) { - collectionTranslations.refetch(); - notify({ - status: "success", - text: intl.formatMessage(commonMessages.savedChanges), - }); - navigate("?", { replace: true }); - } - }, - }); + const [updateTranslations, updateTranslationsOpts] = + useUpdateCollectionTranslationsMutation({ + onCompleted: data => { + if (data.collectionTranslate.errors.length === 0) { + collectionTranslations.refetch(); + notify({ + status: "success", + text: intl.formatMessage(commonMessages.savedChanges), + }); + navigate("?", { replace: true }); + } + }, + }); const onEdit = (field: string) => navigate( diff --git a/src/translations/views/TranslationsEntities.tsx b/src/translations/views/TranslationsEntities.tsx index 5cff7b3af..e009635eb 100644 --- a/src/translations/views/TranslationsEntities.tsx +++ b/src/translations/views/TranslationsEntities.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import useNavigator from "@dashboard/hooks/useNavigator"; import { createPaginationState } from "@dashboard/hooks/usePaginator"; import useShop from "@dashboard/hooks/useShop"; diff --git a/src/translations/views/TranslationsLanguageList.tsx b/src/translations/views/TranslationsLanguageList.tsx index 80b9058e3..fb60bff28 100644 --- a/src/translations/views/TranslationsLanguageList.tsx +++ b/src/translations/views/TranslationsLanguageList.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import useShop from "@dashboard/hooks/useShop"; import React from "react"; diff --git a/src/translations/views/TranslationsMenuItem.tsx b/src/translations/views/TranslationsMenuItem.tsx index 8adb3f2df..375f59afc 100644 --- a/src/translations/views/TranslationsMenuItem.tsx +++ b/src/translations/views/TranslationsMenuItem.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { LanguageCodeEnum, useMenuItemTranslationDetailsQuery, @@ -39,21 +40,19 @@ const TranslationsMenuItem: React.FC = ({ variables: { id, language: languageCode }, }); - const [ - updateTranslations, - updateTranslationsOpts, - ] = useUpdateMenuItemTranslationsMutation({ - onCompleted: data => { - if (data.menuItemTranslate.errors.length === 0) { - menuItemTranslations.refetch(); - notify({ - status: "success", - text: intl.formatMessage(commonMessages.savedChanges), - }); - navigate("?", { replace: true }); - } - }, - }); + const [updateTranslations, updateTranslationsOpts] = + useUpdateMenuItemTranslationsMutation({ + onCompleted: data => { + if (data.menuItemTranslate.errors.length === 0) { + menuItemTranslations.refetch(); + notify({ + status: "success", + text: intl.formatMessage(commonMessages.savedChanges), + }); + navigate("?", { replace: true }); + } + }, + }); const onEdit = (field: string) => navigate( diff --git a/src/translations/views/TranslationsPages.tsx b/src/translations/views/TranslationsPages.tsx index 310e66d82..bc423ec5f 100644 --- a/src/translations/views/TranslationsPages.tsx +++ b/src/translations/views/TranslationsPages.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { LanguageCodeEnum, usePageTranslationDetailsQuery, @@ -55,18 +56,15 @@ const TranslationsPages: React.FC = ({ } }; - const [ - updateTranslations, - updateTranslationsOpts, - ] = useUpdatePageTranslationsMutation({ - onCompleted: data => onUpdate(data.pageTranslate.errors), - }); + const [updateTranslations, updateTranslationsOpts] = + useUpdatePageTranslationsMutation({ + onCompleted: data => onUpdate(data.pageTranslate.errors), + }); - const [ - updateAttributeValueTranslations, - ] = useUpdateAttributeValueTranslationsMutation({ - onCompleted: data => onUpdate(data.attributeValueTranslate.errors), - }); + const [updateAttributeValueTranslations] = + useUpdateAttributeValueTranslationsMutation({ + onCompleted: data => onUpdate(data.attributeValueTranslate.errors), + }); const onEdit = (field: string) => navigate( diff --git a/src/translations/views/TranslationsProductVariants.tsx b/src/translations/views/TranslationsProductVariants.tsx index 171af2001..23b947857 100644 --- a/src/translations/views/TranslationsProductVariants.tsx +++ b/src/translations/views/TranslationsProductVariants.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { LanguageCodeEnum, useProductVariantTranslationDetailsQuery, @@ -31,12 +32,9 @@ export interface TranslationsProductVariantsProps { params: TranslationsProductVariantsQueryParams; } -const TranslationsProductVariants: React.FC = ({ - id, - productId, - languageCode, - params, -}) => { +const TranslationsProductVariants: React.FC< + TranslationsProductVariantsProps +> = ({ id, productId, languageCode, params }) => { const navigate = useNavigator(); const notify = useNotifier(); const shop = useShop(); @@ -57,18 +55,15 @@ const TranslationsProductVariants: React.FC = } }; - const [ - updateTranslations, - updateTranslationsOpts, - ] = useUpdateProductVariantTranslationsMutation({ - onCompleted: data => onUpdate(data.productVariantTranslate.errors), - }); + const [updateTranslations, updateTranslationsOpts] = + useUpdateProductVariantTranslationsMutation({ + onCompleted: data => onUpdate(data.productVariantTranslate.errors), + }); - const [ - updateAttributeValueTranslations, - ] = useUpdateAttributeValueTranslationsMutation({ - onCompleted: data => onUpdate(data.attributeValueTranslate.errors), - }); + const [updateAttributeValueTranslations] = + useUpdateAttributeValueTranslationsMutation({ + onCompleted: data => onUpdate(data.attributeValueTranslate.errors), + }); const onEdit = (field: string) => navigate( diff --git a/src/translations/views/TranslationsProducts.tsx b/src/translations/views/TranslationsProducts.tsx index 8e9dbe5ac..ade0bea49 100644 --- a/src/translations/views/TranslationsProducts.tsx +++ b/src/translations/views/TranslationsProducts.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { LanguageCodeEnum, useProductTranslationDetailsQuery, @@ -55,18 +56,15 @@ const TranslationsProducts: React.FC = ({ } }; - const [ - updateTranslations, - updateTranslationsOpts, - ] = useUpdateProductTranslationsMutation({ - onCompleted: data => onUpdate(data.productTranslate.errors), - }); + const [updateTranslations, updateTranslationsOpts] = + useUpdateProductTranslationsMutation({ + onCompleted: data => onUpdate(data.productTranslate.errors), + }); - const [ - updateAttributeValueTranslations, - ] = useUpdateAttributeValueTranslationsMutation({ - onCompleted: data => onUpdate(data.attributeValueTranslate.errors), - }); + const [updateAttributeValueTranslations] = + useUpdateAttributeValueTranslationsMutation({ + onCompleted: data => onUpdate(data.attributeValueTranslate.errors), + }); const onEdit = (field: string) => navigate( diff --git a/src/translations/views/TranslationsSales.tsx b/src/translations/views/TranslationsSales.tsx index 452277091..b652d5db4 100644 --- a/src/translations/views/TranslationsSales.tsx +++ b/src/translations/views/TranslationsSales.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { LanguageCodeEnum, useSaleTranslationDetailsQuery, @@ -39,21 +40,19 @@ const TranslationsSales: React.FC = ({ variables: { id, language: languageCode }, }); - const [ - updateTranslations, - updateTranslationsOpts, - ] = useUpdateSaleTranslationsMutation({ - onCompleted: data => { - if (data.saleTranslate.errors.length === 0) { - saleTranslations.refetch(); - notify({ - status: "success", - text: intl.formatMessage(commonMessages.savedChanges), - }); - navigate("?", { replace: true }); - } - }, - }); + const [updateTranslations, updateTranslationsOpts] = + useUpdateSaleTranslationsMutation({ + onCompleted: data => { + if (data.saleTranslate.errors.length === 0) { + saleTranslations.refetch(); + notify({ + status: "success", + text: intl.formatMessage(commonMessages.savedChanges), + }); + navigate("?", { replace: true }); + } + }, + }); const onEdit = (field: string) => navigate( diff --git a/src/translations/views/TranslationsShippingMethod.tsx b/src/translations/views/TranslationsShippingMethod.tsx index 14e535f83..a26cdfbfb 100644 --- a/src/translations/views/TranslationsShippingMethod.tsx +++ b/src/translations/views/TranslationsShippingMethod.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { LanguageCodeEnum, useShippingMethodTranslationDetailsQuery, @@ -39,21 +40,19 @@ const TranslationsShippingMethod: React.FC = ({ variables: { id, language: languageCode }, }); - const [ - updateTranslations, - updateTranslationsOpts, - ] = useUpdateShippingMethodTranslationsMutation({ - onCompleted: data => { - if (data.shippingPriceTranslate.errors.length === 0) { - shippingMethodTranslations.refetch(); - notify({ - status: "success", - text: intl.formatMessage(commonMessages.savedChanges), - }); - navigate("?", { replace: true }); - } - }, - }); + const [updateTranslations, updateTranslationsOpts] = + useUpdateShippingMethodTranslationsMutation({ + onCompleted: data => { + if (data.shippingPriceTranslate.errors.length === 0) { + shippingMethodTranslations.refetch(); + notify({ + status: "success", + text: intl.formatMessage(commonMessages.savedChanges), + }); + navigate("?", { replace: true }); + } + }, + }); const onEdit = (field: string) => navigate( diff --git a/src/translations/views/TranslationsVouchers.tsx b/src/translations/views/TranslationsVouchers.tsx index d78cb1403..518ecf0e1 100644 --- a/src/translations/views/TranslationsVouchers.tsx +++ b/src/translations/views/TranslationsVouchers.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { LanguageCodeEnum, useUpdateVoucherTranslationsMutation, @@ -39,21 +40,19 @@ const TranslationsVouchers: React.FC = ({ variables: { id, language: languageCode }, }); - const [ - updateTranslations, - updateTranslationsOpts, - ] = useUpdateVoucherTranslationsMutation({ - onCompleted: data => { - if (data.voucherTranslate.errors.length === 0) { - voucherTranslations.refetch(); - notify({ - status: "success", - text: intl.formatMessage(commonMessages.savedChanges), - }); - navigate("?", { replace: true }); - } - }, - }); + const [updateTranslations, updateTranslationsOpts] = + useUpdateVoucherTranslationsMutation({ + onCompleted: data => { + if (data.voucherTranslate.errors.length === 0) { + voucherTranslations.refetch(); + notify({ + status: "success", + text: intl.formatMessage(commonMessages.savedChanges), + }); + navigate("?", { replace: true }); + } + }, + }); const onEdit = (field: string) => navigate( diff --git a/src/utils/errors/transaction.ts b/src/utils/errors/transaction.ts index 288d85062..b24ccdc21 100644 --- a/src/utils/errors/transaction.ts +++ b/src/utils/errors/transaction.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { TransactionCreateErrorCode, TransactionCreateErrorFragment, diff --git a/src/utils/filters/filters.ts b/src/utils/filters/filters.ts index 4bc908aba..92fec2e0f 100644 --- a/src/utils/filters/filters.ts +++ b/src/utils/filters/filters.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { FilterElement, FilterElementKeyValue, diff --git a/src/utils/graphql.ts b/src/utils/graphql.ts index acd077059..22e6f5482 100644 --- a/src/utils/graphql.ts +++ b/src/utils/graphql.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { getApiUrl } from "@dashboard/config"; import LzString from "lz-string"; diff --git a/src/utils/handlers/singleAutocompleteSelectChangeHandler.ts b/src/utils/handlers/singleAutocompleteSelectChangeHandler.ts index 5ca5eb7e4..ab900af81 100644 --- a/src/utils/handlers/singleAutocompleteSelectChangeHandler.ts +++ b/src/utils/handlers/singleAutocompleteSelectChangeHandler.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { SingleAutocompleteChoiceType } from "@dashboard/components/SingleAutocompleteSelectField"; import { FormChange } from "@dashboard/hooks/useForm"; diff --git a/src/utils/lists/lists.test.ts b/src/utils/lists/lists.test.ts index 5023aa778..8ffd2e20c 100644 --- a/src/utils/lists/lists.test.ts +++ b/src/utils/lists/lists.test.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { add, addAtIndex, diff --git a/src/utils/richText/__mocks__/useRichText.ts b/src/utils/richText/__mocks__/useRichText.ts index 519e8a0b5..165b8c3a9 100644 --- a/src/utils/richText/__mocks__/useRichText.ts +++ b/src/utils/richText/__mocks__/useRichText.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { useRichText } from "../useRichText"; const useRichTextMocked = ({ diff --git a/src/utils/toFixed.ts b/src/utils/toFixed.ts index 820823d16..1e8ba60f9 100644 --- a/src/utils/toFixed.ts +++ b/src/utils/toFixed.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore export function toFixed(num: string | number, fixed: number) { if (num === "" || num === null) { return ""; diff --git a/src/utils/urls.ts b/src/utils/urls.ts index 7affc63ab..a4aac60e8 100644 --- a/src/utils/urls.ts +++ b/src/utils/urls.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { getAppDefaultUri, getAppMountUri } from "@dashboard/config"; import { stringify } from "qs"; diff --git a/src/warehouses/components/WarehouseCreatePage/WarehouseCreatePage.tsx b/src/warehouses/components/WarehouseCreatePage/WarehouseCreatePage.tsx index 15893f370..5c3c76286 100644 --- a/src/warehouses/components/WarehouseCreatePage/WarehouseCreatePage.tsx +++ b/src/warehouses/components/WarehouseCreatePage/WarehouseCreatePage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { createCountryHandler } from "@dashboard/components/AddressEdit/createCountryHandler"; import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import CardSpacer from "@dashboard/components/CardSpacer"; diff --git a/src/warehouses/components/WarehouseDetailsPage/WarehouseDetailsPage.tsx b/src/warehouses/components/WarehouseDetailsPage/WarehouseDetailsPage.tsx index db872dc5d..f879304eb 100644 --- a/src/warehouses/components/WarehouseDetailsPage/WarehouseDetailsPage.tsx +++ b/src/warehouses/components/WarehouseDetailsPage/WarehouseDetailsPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { createCountryHandler } from "@dashboard/components/AddressEdit/createCountryHandler"; import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import CardSpacer from "@dashboard/components/CardSpacer"; diff --git a/src/warehouses/components/WarehouseListPage/WarehouseListPage.tsx b/src/warehouses/components/WarehouseListPage/WarehouseListPage.tsx index 90c66ab3c..562fcc879 100644 --- a/src/warehouses/components/WarehouseListPage/WarehouseListPage.tsx +++ b/src/warehouses/components/WarehouseListPage/WarehouseListPage.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { LimitsInfo } from "@dashboard/components/AppLayout/LimitsInfo"; import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import { Backlink } from "@dashboard/components/Backlink"; diff --git a/src/warehouses/components/WarehouseSettings/WarehouseSettings.tsx b/src/warehouses/components/WarehouseSettings/WarehouseSettings.tsx index e0269c7c7..a72d2ebd6 100644 --- a/src/warehouses/components/WarehouseSettings/WarehouseSettings.tsx +++ b/src/warehouses/components/WarehouseSettings/WarehouseSettings.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import CardTitle from "@dashboard/components/CardTitle"; import { FormSpacer } from "@dashboard/components/FormSpacer"; import Link from "@dashboard/components/Link"; diff --git a/testUtils/ApolloMockedProvider.tsx b/testUtils/ApolloMockedProvider.tsx index 7c5a6d0e4..4fb2eab6a 100644 --- a/testUtils/ApolloMockedProvider.tsx +++ b/testUtils/ApolloMockedProvider.tsx @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { MockedProvider, MockedResponse } from "@apollo/client/testing"; import React from "react"; diff --git a/testUtils/filters.ts b/testUtils/filters.ts index d407fae69..bbb30e800 100644 --- a/testUtils/filters.ts +++ b/testUtils/filters.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import { IFilter } from "@dashboard/components/Filter"; import clone from "lodash/clone"; diff --git a/testUtils/setup.ts b/testUtils/setup.ts index 0ae5254b4..26bdd3887 100644 --- a/testUtils/setup.ts +++ b/testUtils/setup.ts @@ -1,3 +1,4 @@ +// @ts-strict-ignore import "@testing-library/jest-dom"; import { configure } from "@testing-library/react"; diff --git a/tsconfig.json b/tsconfig.json index cbd850d19..84dfd2330 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,9 +2,6 @@ "$schema": "https://json.schemastore.org/tsconfig.json", "compilerOptions": { "baseUrl": ".", - // Migration to strict null checks is in progress. - // https://github.com/saleor/saleor-dashboard/issues/2584 - "strictNullChecks": false, "esModuleInterop": true, "jsx": "react", "lib": ["es2020", "dom", "esnext"], @@ -16,17 +13,15 @@ "noUnusedLocals": true, "noUnusedParameters": true, "downlevelIteration": true, - "noImplicitThis": true, - "alwaysStrict": true, - "strictBindCallApply": true, - "useUnknownInCatchVariables": true, + "strict": false, + "resolveJsonModule": true, + "plugins": [{ "name": "typescript-strict-plugin" }], "paths": { "@assets/*": ["assets/*"], "@locale/*": ["locale/*"], "@dashboard/*": ["src/*"], "@test/*": ["testUtils/*"] }, - "resolveJsonModule": true }, "exclude": ["node_modules", "cypress"] }