Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

Previous changes not listed in this document can be traced using Git history.

## [1.0.22] - 2026-04-27

### Added
- Added customization for `tableActions` column label
- Added JQ interpolation logic for `openDrawer` and `openModal` titles

## [1.0.21] - 2026-04-23

### Fixed
Expand Down
2 changes: 2 additions & 0 deletions docs/widgets-api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,8 @@ Table displays structured data with customizable columns and pagination
| tableActions[].button.size | no | the size of the button | `small` \| `middle` \| `large` |
| tableActions[].button.type | no | the visual style of the button | `default` \| `text` \| `link` \| `primary` \| `dashed` |
| tableActions[].clickActionId | no | the id of the action to be executed when the button is clicked | string |
| tableActionsColumn | no | customization for the table actions column | object |
| tableActionsColumn.label | no | table actions column customized label, default is empty string | string |


[Examples](../src/examples/widgets/Table/Table.example.yaml)
Expand Down
3 changes: 1 addition & 2 deletions src/examples/widgets/Button/Button.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -450,15 +450,14 @@ spec:
widgetData:
label: Open Modal Default
type: primary

size: middle
clickActionId: open-modal-default
actions:
openModal:
- id: open-modal-default
type: openModal
resourceRefId: example-yamlviewer-simple-json
title: Default Modal Example
title: ${"Default Modal Example:" + " " + .widget.status.widgetData.label}
loading:
display: true
size: default
Expand Down
2 changes: 2 additions & 0 deletions src/examples/widgets/Table/Table.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,8 @@ spec:
button:
label: Navigate
type: default
tableActionsColumn:
label: Actions
resourcesRefs:
items: []
resourcesRefsTemplate:
Expand Down
18 changes: 16 additions & 2 deletions src/hooks/useHandleActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,16 +200,30 @@ export const useHandleAction = () => {
case 'openDrawer': {
const { size, title } = action

let drawerTitle: string | undefined
if (title) {
drawerTitle = title.startsWith('${')
? await resolveJq(title, { json: customPayload, widget })
: title
}

setIsActionLoading(false)
openDrawer({ size, title, widgetEndpoint: path })
openDrawer({ size, title: drawerTitle, widgetEndpoint: path })

break
}
case 'openModal': {
const { customWidth, size, title } = action

let modalTitle: string | undefined
if (title) {
modalTitle = title.startsWith('${')
? await resolveJq(title, { json: customPayload, widget })
: title
}

setIsActionLoading(false)
openModal({ customWidth, size, title, widgetEndpoint: path })
openModal({ customWidth, size, title: modalTitle, widgetEndpoint: path })

break
}
Expand Down
11 changes: 11 additions & 0 deletions src/widgets/Table/Table.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,17 @@
},
"additionalProperties": false
}
},
"tableActionsColumn": {
"description": "customization for the table actions column",
"type": "object",
"properties": {
"label": {
"description": "table actions column customized label, default is empty string",
"type": "string"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
Expand Down
4 changes: 2 additions & 2 deletions src/widgets/Table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export type NormalizedRow = {
} & Record<string, unknown>

const Table = ({ resourcesRefs, uid, widgetData }: WidgetProps<TableWidgetData>) => {
const { actions, columns, data, pageSize, prefix, tableActions } = widgetData
const { actions, columns, data, pageSize, prefix, tableActions, tableActionsColumn } = widgetData
const { getFilteredData } = useFilter()

// TODO: check if this works with RESTAction, it should not be displayed
Expand Down Expand Up @@ -152,7 +152,7 @@ const Table = ({ resourcesRefs, uid, widgetData }: WidgetProps<TableWidgetData>)
/>))
}
</div>,
title: 'Actions',
title: tableActionsColumn?.label ?? '',
}]
: []

Expand Down
9 changes: 9 additions & 0 deletions src/widgets/Table/Table.type.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,15 @@ export interface Table {
*/
clickActionId?: string
}[]
/**
* customization for the table actions column
*/
tableActionsColumn?: {
/**
* table actions column customized label, default is empty string
*/
label?: string
}
}
resourcesRefs?: {
items: {
Expand Down
Loading