Skip to content

Commit

Permalink
gate features behind capabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
mspector committed Sep 29, 2024
1 parent d379ddd commit e3b019b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/libs/ajax/data-table-providers/WdsDataTableProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ export class WdsDataTableProvider implements DataTableProvider {
supportsExport: false,
supportsPointCorrection: false,
supportsFiltering: false,
supportsRowSelection: true,
supportsRowSelection: this.isCapabilityEnabled('apiV1.deleteRecords'),
supportsEditableData: this.isCapabilityEnabled('apiV1.deleteRecords'), // deletion is the only editing action available right now
supportsPerColumnDatatype: true,
};
}
Expand Down
6 changes: 5 additions & 1 deletion src/workspace-data/data-table/wds/WDSContent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@ export const WDSContent = ({
},
border: false,
loadMetadata,
childrenBefore: () => div({ style: { display: 'flex', alignItems: 'center', flex: 'none' } }, [renderEditMenu()]),
childrenBefore: () =>
div(
{ style: { display: 'flex', alignItems: 'center', flex: 'none' } },
dataProvider.features.supportsEditableData ? [renderEditMenu()] : []
),
}),
deletingRecords &&
h(RecordDeleter, {
Expand Down

0 comments on commit e3b019b

Please sign in to comment.