Skip to content

Commit c33589a

Browse files
committed
Fixed ListControl import from the Payload pacakge on newer versions, consistent default exports for components. Package updates for dev deps
1 parent b363ea5 commit c33589a

File tree

8 files changed

+99
-53
lines changed

8 files changed

+99
-53
lines changed

dev/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
"generate:graphQLSchema": "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts payload generate:graphQLSchema"
1717
},
1818
"dependencies": {
19-
"@payloadcms/bundler-webpack": "^1.0.2",
20-
"@payloadcms/db-mongodb": "^1.0.2",
21-
"@payloadcms/richtext-slate": "^1.0.1",
19+
"@payloadcms/bundler-webpack": "^1.0.5",
20+
"@payloadcms/db-mongodb": "^1.2.0",
21+
"@payloadcms/richtext-slate": "^1.3.1",
2222
"dotenv": "^16.3.1",
2323
"express": "^4.18.2",
24-
"payload": "^2.0.0"
24+
"payload": "^2.6.0"
2525
},
2626
"devDependencies": {
2727
"@types/express": "^4.17.17",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"@types/react-beautiful-dnd": "^13.1.4",
3636
"@types/react-router-dom": "^5.3.3",
3737
"copyfiles": "^2.4.1",
38-
"payload": "^2.0.0",
38+
"payload": "^2.6.0",
3939
"typescript": "^4.9.5"
4040
},
4141
"dependencies": {

pnpm-lock.yaml

Lines changed: 71 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/WorkflowView/WorkflowView.tsx

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ import { requests } from "payload/dist/admin/api";
1313
import { PluginCollectionConfig } from "../../index";
1414
import { useConfig } from "payload/components/utilities";
1515
import { SelectionProvider } from "payload/dist/admin/components/views/collections/List/SelectionProvider";
16-
import ListControls from "payload/dist/admin/components/elements/ListControls";
16+
import { ListControls } from 'payload/dist/admin/components/elements/ListControls'
1717
import DefaultList from "payload/dist/admin/components/views/collections/List/Default";
1818

1919
const baseClass = 'scrumboard';
2020

21-
export const WorkflowView = (config: PluginCollectionConfig) => (props: ListProps) => {
21+
const WorkflowView = (config: PluginCollectionConfig) => (props: ListProps) => {
2222

2323
const {
2424
collection,
@@ -37,6 +37,8 @@ export const WorkflowView = (config: PluginCollectionConfig) => (props: ListProp
3737
handleSortChange,
3838
resetParams,
3939
data,
40+
titleField,
41+
handleSearchChange
4042
} = props;
4143

4244
const {i18n} = useTranslation('general');
@@ -91,11 +93,13 @@ export const WorkflowView = (config: PluginCollectionConfig) => (props: ListProp
9193
/>
9294

9395
<ListControls
94-
collection={ collection }
95-
modifySearchQuery={ modifySearchParams }
96-
handleSortChange={ handleSortChange }
97-
handleWhereChange={ handleWhereChange }
98-
resetParams={ resetParams }
96+
collection={collection}
97+
handleSearchChange={handleSearchChange}
98+
handleSortChange={handleSortChange}
99+
handleWhereChange={handleWhereChange}
100+
modifySearchQuery={modifySearchParams}
101+
resetParams={resetParams}
102+
titleField={titleField}
99103
/>
100104

101105
<Board
@@ -109,3 +113,6 @@ export const WorkflowView = (config: PluginCollectionConfig) => (props: ListProp
109113
</SelectionProvider>
110114
</div>
111115
}
116+
117+
118+
export default WorkflowView;

src/components/WorkflowView/styles.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@
1818
overflow-x: auto;
1919
max-width: 100%;
2020
height: 100%;
21+
min-height: base(10);
2122
}

src/hooks/generateOrderRank.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { CollectionBeforeChangeHook } from "payload/types";
55
/**
66
* Generates the initial 'Lexorank'/orderRank based on the last known document in the same status.
77
*/
8-
export const generateOrderRank: CollectionBeforeChangeHook = async ({data, req}) => {
8+
const generateOrderRank: CollectionBeforeChangeHook = async ({data, req}) => {
99
const {payload, collection,} = req;
1010

1111
if (!collection || !!data.workflowOrderRank || !data.workflowStatus) {
@@ -33,3 +33,6 @@ export const generateOrderRank: CollectionBeforeChangeHook = async ({data, req})
3333

3434
return data;
3535
}
36+
37+
38+
export default generateOrderRank;

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Config, Plugin } from "payload/config";
22
import { CollectionConfig, OptionObject } from "payload/types";
3-
import { generateOrderRank } from "./hooks/generateOrderRank";
4-
import { WorkflowView } from "./components/WorkflowView/WorkflowView";
3+
import generateOrderRank from "./hooks/generateOrderRank";
4+
import WorkflowView from "./components/WorkflowView/WorkflowView";
55

66
export interface PluginCollectionConfig {
77
statuses: OptionObject[],

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
"declaration": true,
1616
"declarationDir": "./dist",
1717
"skipLibCheck": true,
18-
"strict": true,
18+
"strict": false,
1919
},
2020
"include": [
2121
"src/**/*"
2222
],
23-
}
23+
}

0 commit comments

Comments
 (0)