diff --git a/dev/package.json b/dev/package.json index 6005866..d47116e 100644 --- a/dev/package.json +++ b/dev/package.json @@ -16,12 +16,12 @@ "generate:graphQLSchema": "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts payload generate:graphQLSchema" }, "dependencies": { - "@payloadcms/bundler-webpack": "^1.0.2", - "@payloadcms/db-mongodb": "^1.0.2", - "@payloadcms/richtext-slate": "^1.0.1", + "@payloadcms/bundler-webpack": "^1.0.5", + "@payloadcms/db-mongodb": "^1.2.0", + "@payloadcms/richtext-slate": "^1.3.1", "dotenv": "^16.3.1", "express": "^4.18.2", - "payload": "^2.0.0" + "payload": "^2.6.0" }, "devDependencies": { "@types/express": "^4.17.17", diff --git a/package.json b/package.json index bc72227..3c6a273 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "@types/react-beautiful-dnd": "^13.1.4", "@types/react-router-dom": "^5.3.3", "copyfiles": "^2.4.1", - "payload": "^2.0.0", + "payload": "^2.6.0", "typescript": "^4.9.5" }, "dependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 07e8938..52ba279 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -41,8 +41,8 @@ devDependencies: specifier: ^2.4.1 version: 2.4.1 payload: - specifier: ^2.0.0 - version: 2.0.4(typescript@4.9.5)(webpack@5.88.2) + specifier: ^2.6.0 + version: 2.6.0(typescript@4.9.5)(webpack@5.88.2) typescript: specifier: ^4.9.5 version: 4.9.5 @@ -890,6 +890,10 @@ packages: engines: {node: '>= 0.4'} dev: true + /b4a@1.6.4: + resolution: {integrity: sha512-fpWrvyVHEKyeEvbKZTVOeZF3VSKKWtJxFIxX/jaVPf+cLbGUSitjb49pHLqPV2BUNNZ0LcoeEGfE/YCpyDYHIw==} + dev: true + /babel-plugin-macros@3.1.0: resolution: {integrity: sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg==} engines: {node: '>=10', npm: '>=6'} @@ -1770,6 +1774,10 @@ packages: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} dev: true + /fast-fifo@1.3.2: + resolution: {integrity: sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==} + dev: true + /fast-json-stable-stringify@2.1.0: resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} dev: true @@ -1976,13 +1984,13 @@ packages: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} dev: true - /graphql-http@1.21.0(graphql@16.7.1): + /graphql-http@1.21.0(graphql@16.8.1): resolution: {integrity: sha512-yrItPfHj5WeT4n7iusbVin+vGSQjXFAX6U/GnYytdCJRXVad1TWGtYFDZ2ROjCKpXQzIwvfbiWCEwfuXgR3B6A==} engines: {node: '>=12'} peerDependencies: graphql: '>=0.11 <=16' dependencies: - graphql: 16.7.1 + graphql: 16.8.1 dev: true /graphql-playground-html@1.6.30: @@ -2000,35 +2008,35 @@ packages: graphql-playground-html: 1.6.30 dev: true - /graphql-query-complexity@0.12.0(graphql@16.7.1): + /graphql-query-complexity@0.12.0(graphql@16.8.1): resolution: {integrity: sha512-fWEyuSL6g/+nSiIRgIipfI6UXTI7bAxrpPlCY1c0+V3pAEUo1ybaKmSBgNr1ed2r+agm1plJww8Loig9y6s2dw==} peerDependencies: graphql: ^14.6.0 || ^15.0.0 || ^16.0.0 dependencies: - graphql: 16.7.1 + graphql: 16.8.1 lodash.get: 4.4.2 dev: true - /graphql-scalars@1.22.2(graphql@16.7.1): + /graphql-scalars@1.22.2(graphql@16.8.1): resolution: {integrity: sha512-my9FB4GtghqXqi/lWSVAOPiTzTnnEzdOXCsAC2bb5V7EFNQjVjwy3cSSbUvgYOtDuDibd+ZsCDhz+4eykYOlhQ==} engines: {node: '>=10'} peerDependencies: graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 dependencies: - graphql: 16.7.1 + graphql: 16.8.1 tslib: 2.6.2 dev: true - /graphql-type-json@0.3.2(graphql@16.7.1): + /graphql-type-json@0.3.2(graphql@16.8.1): resolution: {integrity: sha512-J+vjof74oMlCWXSvt0DOf2APEdZOCdubEvGDUAlqH//VBYcOYsGgRW7Xzorr44LvkjiuvecWc8fChxuZZbChtg==} peerDependencies: graphql: '>=0.8.0' dependencies: - graphql: 16.7.1 + graphql: 16.8.1 dev: true - /graphql@16.7.1: - resolution: {integrity: sha512-DRYR9tf+UGU0KOsMcKAlXeFfX89UiiIZ0dRU3mR0yJfu6OjZqUcp68NnFLnqQU5RexygFoDy1EW+ccOYcPfmHg==} + /graphql@16.8.1: + resolution: {integrity: sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw==} engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0} dev: true @@ -2773,8 +2781,8 @@ packages: semver: 7.5.4 dev: true - /node-addon-api@5.1.0: - resolution: {integrity: sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA==} + /node-addon-api@6.1.0: + resolution: {integrity: sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==} dev: true /node-fetch@2.7.0: @@ -2793,8 +2801,8 @@ packages: resolution: {integrity: sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==} dev: true - /nodemailer@6.9.4: - resolution: {integrity: sha512-CXjQvrQZV4+6X5wP6ZIgdehJamI63MFoYFGGPtHudWym9qaEHDNdPzaj5bfMCvxG1vhAileSWW90q7nL0N36mA==} + /nodemailer@6.9.8: + resolution: {integrity: sha512-cfrYUk16e67Ks051i4CntM9kshRYei1/o/Gi8K1d+R34OIs21xdFnW7Pt7EucmVKA0LKtqUGNcjMZ7ehjl49mQ==} engines: {node: '>=6.0.0'} dev: true @@ -3022,9 +3030,9 @@ packages: resolution: {integrity: sha512-KG8UEiEVkR3wGEb4m5yZkVCzigAD+cVEJck2CzYZO37ZGJfctvVptVO192MwrtPhzONn6go8ylnOdMhKqi4nfg==} dev: true - /payload@2.0.4(typescript@4.9.5)(webpack@5.88.2): - resolution: {integrity: sha512-Eh75yw2xyDdir4Bfk3Gy6laJ4Q+FFvWkkRgGwJ1oDC60V6ztqMFLbejSdXNxLlfj800GYa9LwnXlFjUDV+2pmQ==} - engines: {node: '>=14', pnpm: '>=8'} + /payload@2.6.0(typescript@4.9.5)(webpack@5.88.2): + resolution: {integrity: sha512-DWRatMu9fkqClLvC3DStr1qY1M27tGjsmbFP+cQ7aN0vLpXGEMSorr1uOjtYGGElgapW2Cz2V8DRL4vtqBvRYA==} + engines: {node: '>=14'} hasBin: true dependencies: '@date-io/date-fns': 2.16.0(date-fns@2.30.0) @@ -3056,12 +3064,12 @@ packages: flatley: 5.2.0 fs-extra: 10.1.0 get-tsconfig: 4.6.2 - graphql: 16.7.1 - graphql-http: 1.21.0(graphql@16.7.1) + graphql: 16.8.1 + graphql-http: 1.21.0(graphql@16.8.1) graphql-playground-middleware-express: 1.7.23(express@4.18.2) - graphql-query-complexity: 0.12.0(graphql@16.7.1) - graphql-scalars: 1.22.2(graphql@16.7.1) - graphql-type-json: 0.3.2(graphql@16.7.1) + graphql-query-complexity: 0.12.0(graphql@16.8.1) + graphql-scalars: 1.22.2(graphql@16.8.1) + graphql-type-json: 0.3.2(graphql@16.8.1) html-webpack-plugin: 5.5.3(webpack@5.88.2) http-status: 1.6.2 i18next: 22.5.1 @@ -3080,7 +3088,7 @@ packages: minimist: 1.2.8 mkdirp: 1.0.4 monaco-editor: 0.38.0 - nodemailer: 6.9.4 + nodemailer: 6.9.8 object-to-formdata: 4.5.1 passport: 0.6.0 passport-anonymous: 1.0.1 @@ -3107,15 +3115,15 @@ packages: react-select: 5.7.4(react-dom@18.2.0)(react@18.2.0) react-toastify: 8.2.0(react-dom@18.2.0)(react@18.2.0) sanitize-filename: 1.6.3 - sass: 1.64.0 + sass: 1.69.4 scheduler: 0.23.0 scmp: 2.1.0 - sharp: 0.31.3 + sharp: 0.32.6 swc-loader: 0.2.3(@swc/core@1.3.76)(webpack@5.88.2) terser-webpack-plugin: 5.3.9(@swc/core@1.3.76)(webpack@5.88.2) ts-essentials: 7.0.3(typescript@4.9.5) use-context-selector: 1.4.1(react-dom@18.2.0)(react@18.2.0)(scheduler@0.23.0) - uuid: 8.3.2 + uuid: 9.0.1 transitivePeerDependencies: - '@swc/helpers' - '@types/react' @@ -3322,6 +3330,10 @@ packages: engines: {node: '>=0.6'} dev: true + /queue-tick@1.0.1: + resolution: {integrity: sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag==} + dev: true + /quick-format-unescaped@4.0.4: resolution: {integrity: sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==} dev: true @@ -3787,8 +3799,8 @@ packages: truncate-utf8-bytes: 1.0.2 dev: true - /sass@1.64.0: - resolution: {integrity: sha512-m7YtAGmQta9uANIUJwXesAJMSncqH+3INc8kdVXs6eV6GUC8Qu2IYKQSN8PRLgiQfpca697G94klm2leYMxSHw==} + /sass@1.69.4: + resolution: {integrity: sha512-+qEreVhqAy8o++aQfCJwp0sklr2xyEzkm9Pp/Igu9wNPoe7EZEQ8X/MBvvXggI2ql607cxKg/RKOwDj6pp2XDA==} engines: {node: '>=14.0.0'} hasBin: true dependencies: @@ -3883,18 +3895,18 @@ packages: resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} dev: true - /sharp@0.31.3: - resolution: {integrity: sha512-XcR4+FCLBFKw1bdB+GEhnUNXNXvnt0tDo4WsBsraKymuo/IAuPuCBVAL2wIkUw2r/dwFW5Q5+g66Kwl2dgDFVg==} + /sharp@0.32.6: + resolution: {integrity: sha512-KyLTWwgcR9Oe4d9HwCwNM2l7+J0dUQwn/yf7S0EnTtb0eVS4RxO0eUSvxPtzT4F3SY+C4K6fqdv/DO27sJ/v/w==} engines: {node: '>=14.15.0'} requiresBuild: true dependencies: color: 4.2.3 detect-libc: 2.0.2 - node-addon-api: 5.1.0 + node-addon-api: 6.1.0 prebuild-install: 7.1.1 semver: 7.5.4 simple-get: 4.0.1 - tar-fs: 2.1.1 + tar-fs: 3.0.4 tunnel-agent: 0.6.0 dev: true @@ -3990,6 +4002,13 @@ packages: engines: {node: '>=10.0.0'} dev: true + /streamx@2.15.6: + resolution: {integrity: sha512-q+vQL4AAz+FdfT137VF69Cc/APqUbxy+MDOImRrMvchJpigHj9GksgDU2LYbO9rx7RX6osWgxJB2WxhYv4SZAw==} + dependencies: + fast-fifo: 1.3.2 + queue-tick: 1.0.1 + dev: true + /string-width@4.2.3: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} engines: {node: '>=8'} @@ -4091,6 +4110,14 @@ packages: tar-stream: 2.2.0 dev: true + /tar-fs@3.0.4: + resolution: {integrity: sha512-5AFQU8b9qLfZCX9zp2duONhPmZv0hGYiBPJsyUdqMjzq/mqVpy/rEUSeHk1+YitmxugaptgBh5oDGU3VsAJq4w==} + dependencies: + mkdirp-classic: 0.5.3 + pump: 3.0.0 + tar-stream: 3.1.6 + dev: true + /tar-stream@2.2.0: resolution: {integrity: sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==} engines: {node: '>=6'} @@ -4102,6 +4129,14 @@ packages: readable-stream: 3.6.2 dev: true + /tar-stream@3.1.6: + resolution: {integrity: sha512-B/UyjYwPpMBv+PaFSWAmtYjwdrlEaZQEhMIBFNC5oEG8lpiW8XjcSdmEaClj28ArfKScKHs2nshz3k2le6crsg==} + dependencies: + b4a: 1.6.4 + fast-fifo: 1.3.2 + streamx: 2.15.6 + dev: true + /terser-webpack-plugin@5.3.9(@swc/core@1.3.76)(webpack@5.88.2): resolution: {integrity: sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA==} engines: {node: '>= 10.13.0'} @@ -4343,8 +4378,8 @@ packages: engines: {node: '>= 0.4.0'} dev: true - /uuid@8.3.2: - resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==} + /uuid@9.0.1: + resolution: {integrity: sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==} hasBin: true dev: true diff --git a/src/components/WorkflowView/WorkflowView.tsx b/src/components/WorkflowView/WorkflowView.tsx index ef3c9f5..02f6103 100644 --- a/src/components/WorkflowView/WorkflowView.tsx +++ b/src/components/WorkflowView/WorkflowView.tsx @@ -13,12 +13,12 @@ import { requests } from "payload/dist/admin/api"; import { PluginCollectionConfig } from "../../index"; import { useConfig } from "payload/components/utilities"; import { SelectionProvider } from "payload/dist/admin/components/views/collections/List/SelectionProvider"; -import ListControls from "payload/dist/admin/components/elements/ListControls"; +import { ListControls } from 'payload/dist/admin/components/elements/ListControls' import DefaultList from "payload/dist/admin/components/views/collections/List/Default"; const baseClass = 'scrumboard'; -export const WorkflowView = (config: PluginCollectionConfig) => (props: ListProps) => { +const WorkflowView = (config: PluginCollectionConfig) => (props: ListProps) => { const { collection, @@ -37,6 +37,8 @@ export const WorkflowView = (config: PluginCollectionConfig) => (props: ListProp handleSortChange, resetParams, data, + titleField, + handleSearchChange } = props; const {i18n} = useTranslation('general'); @@ -91,11 +93,13 @@ export const WorkflowView = (config: PluginCollectionConfig) => (props: ListProp /> (props: ListProp } + + +export default WorkflowView; diff --git a/src/components/WorkflowView/styles.scss b/src/components/WorkflowView/styles.scss index bf822b4..497fdfd 100644 --- a/src/components/WorkflowView/styles.scss +++ b/src/components/WorkflowView/styles.scss @@ -18,4 +18,5 @@ overflow-x: auto; max-width: 100%; height: 100%; + min-height: base(10); } diff --git a/src/hooks/generateOrderRank.ts b/src/hooks/generateOrderRank.ts index 8d712e6..79a904f 100644 --- a/src/hooks/generateOrderRank.ts +++ b/src/hooks/generateOrderRank.ts @@ -5,7 +5,7 @@ import { CollectionBeforeChangeHook } from "payload/types"; /** * Generates the initial 'Lexorank'/orderRank based on the last known document in the same status. */ -export const generateOrderRank: CollectionBeforeChangeHook = async ({data, req}) => { +const generateOrderRank: CollectionBeforeChangeHook = async ({data, req}) => { const {payload, collection,} = req; if (!collection || !!data.workflowOrderRank || !data.workflowStatus) { @@ -33,3 +33,6 @@ export const generateOrderRank: CollectionBeforeChangeHook = async ({data, req}) return data; } + + +export default generateOrderRank; diff --git a/src/index.ts b/src/index.ts index 2cf07f0..19285a3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,7 @@ import { Config, Plugin } from "payload/config"; import { CollectionConfig, OptionObject } from "payload/types"; -import { generateOrderRank } from "./hooks/generateOrderRank"; -import { WorkflowView } from "./components/WorkflowView/WorkflowView"; +import generateOrderRank from "./hooks/generateOrderRank"; +import WorkflowView from "./components/WorkflowView/WorkflowView"; export interface PluginCollectionConfig { statuses: OptionObject[], diff --git a/tsconfig.json b/tsconfig.json index 04a3bc3..76ce746 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,9 +15,9 @@ "declaration": true, "declarationDir": "./dist", "skipLibCheck": true, - "strict": true, + "strict": false, }, "include": [ "src/**/*" ], -} \ No newline at end of file +}