-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make Trash Usable - Dynamic Trash Collection Id (#42532)
* wip * fixes hardcoded reference to trash id in sidebar * remove TRAHS_COLLECTION * fixes line and e2e tests * fix invert logic mistake and fixes lint
- Loading branch information
1 parent
e3a8a22
commit 6004264
Showing
18 changed files
with
91 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,15 @@ | ||
import { push } from "react-router-redux"; | ||
import { t } from "ttag"; | ||
|
||
import { TRASH_COLLECTION } from "metabase/entities/collections"; | ||
import { createThunkAction } from "metabase/lib/redux"; | ||
import * as Urls from "metabase/lib/urls"; | ||
import { addUndo } from "metabase/redux/undo"; | ||
|
||
export const deletePermanently = createThunkAction( | ||
"metabase/archive/DELETE_PERMANENTLY", | ||
// pass in result of Entity.actions.delete(...) | ||
(entityDeleteAction: any) => async dispatch => { | ||
await dispatch(entityDeleteAction); | ||
dispatch(push(Urls.collection(TRASH_COLLECTION))); | ||
dispatch(push("/trash")); | ||
dispatch(addUndo({ message: t`This item has been permanently deleted.` })); | ||
}, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...end/src/metabase/collections/components/TrashCollectionLanding/TrashCollectionLanding.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { useGetCollectionQuery } from "metabase/api"; | ||
import LoadingAndErrorWrapper from "metabase/components/LoadingAndErrorWrapper"; | ||
|
||
import { CollectionContent } from "../CollectionContent"; | ||
|
||
export const TrashCollectionLanding = () => { | ||
const { data, isLoading, error } = useGetCollectionQuery("trash"); | ||
|
||
return ( | ||
<LoadingAndErrorWrapper loading={isLoading} error={error} noWrapper> | ||
{data && <CollectionContent collectionId={data.id} />} | ||
</LoadingAndErrorWrapper> | ||
); | ||
}; |
1 change: 1 addition & 0 deletions
1
frontend/src/metabase/collections/components/TrashCollectionLanding/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./TrashCollectionLanding"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.