parent
d98aa2ac8a
commit
1d2eeb7592
854 changed files with 3545 additions and 2592 deletions
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import * as React from "react";
|
||||
import { UserContext } from "../../src/auth";
|
||||
import { adminUserPermissions } from "../../src/fixtures";
|
||||
|
|
362
package-lock.json
generated
362
package-lock.json
generated
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import { render } from "@testing-library/react";
|
||||
import React from "react";
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import CardTitle from "@dashboard/components/CardTitle";
|
||||
import Skeleton from "@dashboard/components/Skeleton";
|
||||
import { AppQuery } from "@dashboard/graphql";
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import { useAppDashboardUpdates } from "@dashboard/apps/components/AppFrame/useAppDashboardUpdates";
|
||||
import { useUpdateAppToken } from "@dashboard/apps/components/AppFrame/useUpdateAppToken";
|
||||
import {
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import { GetV2SaleorAppsResponse } from "@dashboard/apps/marketplace.types";
|
||||
import { AppInstallation, InstalledApp } from "@dashboard/apps/types";
|
||||
import {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import { useAppListContext } from "@dashboard/apps/context";
|
||||
import { GetV2SaleorAppsResponse } from "@dashboard/apps/marketplace.types";
|
||||
import {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import { AppUrls } from "@dashboard/apps/urls";
|
||||
import {
|
||||
borderHeight,
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import { useUserPermissions } from "@dashboard/auth/hooks/useUserPermissions";
|
||||
import {
|
||||
AppExtensionMountEnum,
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import { renderHook } from "@testing-library/react-hooks";
|
||||
|
||||
import { comingSoonApp, releasedApp } from "../fixtures";
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import { getAppsConfig } from "@dashboard/config";
|
||||
import { AppInstallationFragment, JobStatusEnum } from "@dashboard/graphql";
|
||||
import { IntlShape } from "react-intl";
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import { Choice } from "@dashboard/components/SingleSelectField";
|
||||
import { MeasurementUnitsEnum } from "@dashboard/graphql";
|
||||
import React from "react";
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import {
|
||||
attributeAddUrl,
|
||||
AttributeListUrlSortField,
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import { FetchResult } from "@apollo/client";
|
||||
import {
|
||||
AttributeInput,
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import {
|
||||
deleteFilterTab,
|
||||
getActiveFilters,
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import { useApolloClient } from "@apollo/client";
|
||||
import { useUserDetailsQuery } from "@dashboard/graphql";
|
||||
import useNotifier from "@dashboard/hooks/useNotifier";
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import React from "react";
|
||||
|
||||
import { CardDecorator } from "../../../../.storybook/decorators";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import { AccountErrorCode } from "@dashboard/graphql";
|
||||
import React from "react";
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import React from "react";
|
||||
|
||||
import { CardDecorator } from "../../../../.storybook/decorators";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import { getAppMountUri } from "@dashboard/config";
|
||||
import { getAppMountUriForRedirect } from "@dashboard/utils/urls";
|
||||
import { useEffect } from "react";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import { PermissionEnum, UserFragment } from "@dashboard/graphql";
|
||||
|
||||
export const hasPermission = (permission: PermissionEnum, user: UserFragment) =>
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import { useAvailableExternalAuthenticationsLazyQuery } from "@dashboard/graphql";
|
||||
import useNavigator from "@dashboard/hooks/useNavigator";
|
||||
import { getAppMountUriForRedirect } from "@dashboard/utils/urls";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import BackButton from "@dashboard/components/BackButton";
|
||||
import { Button } from "@dashboard/components/Button";
|
||||
import { buttonMessages } from "@dashboard/intl";
|
||||
|
|
|
@ -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<CategoryDetailsFormProps> = ({
|
|||
errors,
|
||||
}) => {
|
||||
const intl = useIntl();
|
||||
const {
|
||||
defaultValue,
|
||||
editorRef,
|
||||
isReadyForMount,
|
||||
handleChange,
|
||||
} = useRichTextContext();
|
||||
const { defaultValue, editorRef, isReadyForMount, handleChange } =
|
||||
useRichTextContext();
|
||||
|
||||
const formErrors = getFormErrors(["name", "description"], errors);
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import {
|
||||
CategoryListUrlSortField,
|
||||
categoryUrl,
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import { categories } from "@dashboard/categories/fixtures";
|
||||
import { CategoryListUrlSortField } from "@dashboard/categories/urls";
|
||||
import {
|
||||
|
|
|
@ -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<CategoryDetailsQuery["category"]["products"]>;
|
||||
}
|
||||
|
||||
export const CategoryProductList: React.FC<CategoryProductListProps> = props => {
|
||||
export const CategoryProductList: React.FC<
|
||||
CategoryProductListProps
|
||||
> = props => {
|
||||
const {
|
||||
disabled,
|
||||
isChecked,
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import {
|
||||
categoryAddUrl,
|
||||
categoryListUrl,
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import { sectionNames } from "@dashboard/intl";
|
||||
import { asSortParams } from "@dashboard/utils/sort";
|
||||
import { parse as parseQs } from "qs";
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import { WindowTitle } from "@dashboard/components/WindowTitle";
|
||||
import {
|
||||
CategoryCreateMutation,
|
||||
|
|
|
@ -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<CategoryDetailsProps> = ({
|
|||
}
|
||||
};
|
||||
|
||||
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,
|
||||
|
|
|
@ -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<CategoryListProps> = ({ params }) => {
|
|||
}
|
||||
};
|
||||
|
||||
const [
|
||||
categoryBulkDelete,
|
||||
categoryBulkDeleteOpts,
|
||||
] = useCategoryBulkDeleteMutation({
|
||||
onCompleted: handleCategoryBulkDelete,
|
||||
});
|
||||
const [categoryBulkDelete, categoryBulkDeleteOpts] =
|
||||
useCategoryBulkDeleteMutation({
|
||||
onCompleted: handleCategoryBulkDelete,
|
||||
});
|
||||
|
||||
const handleSort = createSortHandler(navigate, categoryListUrl, params);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import {
|
||||
ChannelShippingZones,
|
||||
ChannelWarehouses,
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import {
|
||||
AllocationStrategyEnum,
|
||||
ChannelDetailsFragment,
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import { channel, channelCreateErrors } from "@dashboard/channels/fixtures";
|
||||
import { countries } from "@dashboard/fixtures";
|
||||
import { ChannelErrorFragment } from "@dashboard/graphql";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import {
|
||||
ChannelShippingZonesQuery,
|
||||
WarehouseFragment,
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import {
|
||||
ChannelSaleFormData,
|
||||
SaleDetailsPageFormData,
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import { FormData } from "@dashboard/channels/components/ChannelForm/ChannelForm";
|
||||
import { WindowTitle } from "@dashboard/components/WindowTitle";
|
||||
import {
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import { getChannelsCurrencyChoices } from "@dashboard/channels/utils";
|
||||
import { useShopLimitsQuery } from "@dashboard/components/Shop/queries";
|
||||
import {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import { channelsList } from "@dashboard/channels/fixtures";
|
||||
import { createCollectionChannels } from "@dashboard/channels/utils";
|
||||
import { CollectionErrorCode } from "@dashboard/graphql";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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<CollectionDetailsProps> = ({
|
|||
errors,
|
||||
}) => {
|
||||
const intl = useIntl();
|
||||
const {
|
||||
defaultValue,
|
||||
editorRef,
|
||||
isReadyForMount,
|
||||
handleChange,
|
||||
} = useRichTextContext();
|
||||
const { defaultValue, editorRef, isReadyForMount, handleChange } =
|
||||
useRichTextContext();
|
||||
const formErrors = getFormErrors(["name", "description"], errors);
|
||||
|
||||
return (
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import {
|
||||
CollectionListUrlSortField,
|
||||
collectionUrl,
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import {
|
||||
CollectionDetailsQuery,
|
||||
CollectionListQuery,
|
||||
|
|
|
@ -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<ChannelCollectionData, "name" | "id">) => {
|
||||
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<ChannelCollectionData, "name" | "id">) => {
|
||||
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"],
|
||||
|
|
|
@ -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<CollectionCreateProps> = ({
|
|||
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 {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import {
|
||||
createCollectionChannels,
|
||||
createCollectionChannelsData,
|
||||
|
@ -80,10 +81,8 @@ export const CollectionDetails: React.FC<CollectionDetailsProps> = ({
|
|||
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<CollectionDetailsProps> = ({
|
|||
},
|
||||
);
|
||||
|
||||
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<CollectionDetailsProps> = ({
|
|||
},
|
||||
});
|
||||
|
||||
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<CollectionDetailsProps> = ({
|
|||
});
|
||||
|
||||
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 {
|
||||
|
|
|
@ -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<CollectionListProps> = ({ 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<CollectionListProps> = ({ 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();
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import {
|
||||
CollectionFilterKeys,
|
||||
CollectionListFilterOpts,
|
||||
|
@ -72,16 +73,10 @@ export function getFilterQueryParam(
|
|||
}
|
||||
}
|
||||
|
||||
export const {
|
||||
deleteFilterTab,
|
||||
getFilterTabs,
|
||||
saveFilterTab,
|
||||
} = createFilterTabUtils<CollectionListUrlFilters>(COLLECTION_FILTERS_KEY);
|
||||
export const { deleteFilterTab, getFilterTabs, saveFilterTab } =
|
||||
createFilterTabUtils<CollectionListUrlFilters>(COLLECTION_FILTERS_KEY);
|
||||
|
||||
export const {
|
||||
areFiltersApplied,
|
||||
getActiveFilters,
|
||||
getFiltersCurrentTab,
|
||||
} = createFilterUtils<CollectionListUrlQueryParams, CollectionListUrlFilters>(
|
||||
CollectionListUrlFiltersEnum,
|
||||
);
|
||||
export const { areFiltersApplied, getActiveFilters, getFiltersCurrentTab } =
|
||||
createFilterUtils<CollectionListUrlQueryParams, CollectionListUrlFilters>(
|
||||
CollectionListUrlFiltersEnum,
|
||||
);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import {
|
||||
SearchPermissionGroupsQuery,
|
||||
StaffErrorFragment,
|
||||
|
@ -27,7 +28,9 @@ export interface AccountPermissionGroupsProps
|
|||
displayValues: MultiAutocompleteChoiceType[];
|
||||
}
|
||||
|
||||
const AccountPermissionGroups: React.FC<AccountPermissionGroupsProps> = props => {
|
||||
const AccountPermissionGroups: React.FC<
|
||||
AccountPermissionGroupsProps
|
||||
> = props => {
|
||||
const {
|
||||
availablePermissionGroups,
|
||||
disabled,
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import { useUser } from "@dashboard/auth";
|
||||
import CardTitle from "@dashboard/components/CardTitle";
|
||||
import Skeleton from "@dashboard/components/Skeleton";
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import {
|
||||
PermissionGroupDetailsQuery,
|
||||
ShopInfoQuery,
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import { ConfirmButtonTransitionState } from "@dashboard/components/ConfirmButton";
|
||||
import { buttonMessages } from "@dashboard/intl";
|
||||
import { DialogActions } from "@material-ui/core";
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import { AddressTypeInput } from "@dashboard/customers/types";
|
||||
import { AccountErrorFragment, OrderErrorFragment } from "@dashboard/graphql";
|
||||
import { commonMessages } from "@dashboard/intl";
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue