Skip to content

Commit

Permalink
Merge pull request #8 from DennisSnijder/bugfix/invalid-type
Browse files Browse the repository at this point in the history
ListControl import fix
  • Loading branch information
DennisSnijder authored Jan 6, 2024
2 parents b363ea5 + c33589a commit 635f000
Show file tree
Hide file tree
Showing 8 changed files with 99 additions and 53 deletions.
8 changes: 4 additions & 4 deletions dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
107 changes: 71 additions & 36 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 14 additions & 7 deletions src/components/WorkflowView/WorkflowView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -37,6 +37,8 @@ export const WorkflowView = (config: PluginCollectionConfig) => (props: ListProp
handleSortChange,
resetParams,
data,
titleField,
handleSearchChange
} = props;

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

<ListControls
collection={ collection }
modifySearchQuery={ modifySearchParams }
handleSortChange={ handleSortChange }
handleWhereChange={ handleWhereChange }
resetParams={ resetParams }
collection={collection}
handleSearchChange={handleSearchChange}
handleSortChange={handleSortChange}
handleWhereChange={handleWhereChange}
modifySearchQuery={modifySearchParams}
resetParams={resetParams}
titleField={titleField}
/>

<Board
Expand All @@ -109,3 +113,6 @@ export const WorkflowView = (config: PluginCollectionConfig) => (props: ListProp
</SelectionProvider>
</div>
}


export default WorkflowView;
1 change: 1 addition & 0 deletions src/components/WorkflowView/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@
overflow-x: auto;
max-width: 100%;
height: 100%;
min-height: base(10);
}
5 changes: 4 additions & 1 deletion src/hooks/generateOrderRank.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -33,3 +33,6 @@ export const generateOrderRank: CollectionBeforeChangeHook = async ({data, req})

return data;
}


export default generateOrderRank;
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -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[],
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"declaration": true,
"declarationDir": "./dist",
"skipLibCheck": true,
"strict": true,
"strict": false,
},
"include": [
"src/**/*"
],
}
}

0 comments on commit 635f000

Please sign in to comment.