nytai commented on a change in pull request #11109:
URL: https://github.com/apache/incubator-superset/pull/11109#discussion_r497847844
##########
File path: superset-frontend/src/views/CRUD/data/savedquery/SavedQueryList.tsx
##########
@@ -299,17 +450,92 @@ function SavedQueryList({
return (
<>
<SubMenu {...menuData} />
- <ListView<SavedQueryObject>
- className="saved_query-list-view"
- columns={columns}
- count={queryCount}
- data={queries}
- fetchData={fetchData}
- filters={filters}
- initialSort={initialSort}
- loading={loading}
- pageSize={PAGE_SIZE}
- />
+ {queryCurrentlyDeleting && (
+ <DeleteModal
+ description={t(
+ 'This action will permanently delete the saved query.',
+ )}
+ onConfirm={() => {
+ if (queryCurrentlyDeleting) {
+ handleQueryDelete(queryCurrentlyDeleting);
+ }
+ }}
+ onHide={() => setQueryCurrentlyDeleting(null)}
+ open
+ title={t('Delete Query?')}
+ />
+ )}
+ <ConfirmStatusChange
+ title={t('Please confirm')}
+ description={t('Are you sure you want to delete the selected queries?')}
+ onConfirm={handleBulkQueryDelete}
+ >
+ {confirmDelete => {
+ const bulkActions: ListViewProps['bulkActions'] = canDelete
+ ? [
+ {
+ key: 'delete',
+ name: t('Delete'),
+ onSelect: confirmDelete,
+ type: 'danger',
+ },
+ ]
+ : [];
+
+ return (
+ <ListView<SavedQueryObject>
+ className="saved_query-list-view"
+ columns={columns}
+ count={queryCount}
+ data={queries}
+ fetchData={fetchData}
+ filters={filters}
+ initialSort={initialSort}
+ loading={loading}
+ pageSize={PAGE_SIZE}
+ bulkActions={bulkActions}
+ bulkSelectEnabled={bulkSelectEnabled}
+ disableBulkSelect={toggleBulkSelect}
+ renderBulkSelectCopy={selected => {
Review comment:
The ListView component already generates a default copy, this prop just just for overriding
it (needed for datasets)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
|