Skip to content
6 changes: 6 additions & 0 deletions .changeset/spotty-chairs-tie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@example/erp": patch
"@genseki/react": patch
---

feat: add action select
1 change: 1 addition & 0 deletions examples/erp/genseki/collections/tags.ts
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please provide an example for the select flag?

Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const list = builder.list(fields, {
search: ['name'],
sortBy: ['name'],
},
actions: { create: true, update: true },
})

const update = builder.update(fields, {})
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/core/collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@
}): React.ReactElement
}
interface CustomCollectionUI<
TContext extends AnyContextable = AnyContextable,

Check warning on line 382 in packages/react/src/core/collection.ts

View workflow job for this annotation

GitHub Actions / ci

'TContext' is defined but never used. Allowed unused vars must match /^_/u
TFields extends Fields = Fields,
> {
layout?: CustomCollectionLayout
Expand All @@ -404,6 +404,7 @@
update?: boolean
delete?: boolean
one?: boolean
select?: boolean
}
} & CollectionFieldsOptions<TContext, TFields>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export function ClientCollectionListView() {

const columnHelper = createColumnHelper<BaseData>()
return [
...(listViewProps.actions?.delete
...(listViewProps.actions?.select
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it mean delete will not be usable if select is not turned on.

Suggested change
...(listViewProps.actions?.select
...((listViewProps.actions?.select || listViewProps.actions?.delete)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no delete still useable in action dropdown this action is only for disable select action

? [
columnHelper.display({
id: 'select',
Expand Down Expand Up @@ -178,7 +178,7 @@ export function ClientCollectionListView() {
table={table}
loadingItems={pagination.pageSize}
className="static"
onRowClick="toggleSelect"
onRowClick={listViewProps.actions?.select ? 'toggleSelect' : undefined}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as previous comment

Suggested change
onRowClick={listViewProps.actions?.select ? 'toggleSelect' : undefined}
onRowClick={(listViewProps.actions?.select || listViewProps.actions?.delete) ? 'toggleSelect' : undefined}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as previous

isLoading={isLoading}
isError={isError}
configuration={listViewProps.listConfiguration}
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/react/views/collections/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ export interface ListActions {
update?: boolean
delete?: boolean
one?: boolean
select?: boolean
}
Loading