-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds: New submenu 'Delete' on the Taxonomy card menu Delete Dialog with the functionality to delete a Taxonomy Show a Toast after delete the Taxonomy Enable export for System defined Taxonomies
- Loading branch information
Showing
28 changed files
with
634 additions
and
119 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
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,14 +1,35 @@ | ||
import React, { useMemo, useState } from 'react'; | ||
import { StudioFooter } from '@edx/frontend-component-footer'; | ||
import { Outlet } from 'react-router-dom'; | ||
import { Toast } from '@edx/paragon'; | ||
|
||
import Header from '../header'; | ||
import { TaxonomyContext } from './common/context'; | ||
|
||
const TaxonomyLayout = () => ( | ||
<div className="bg-light-400"> | ||
<Header isHiddenMainMenu /> | ||
<Outlet /> | ||
<StudioFooter /> | ||
</div> | ||
); | ||
const TaxonomyLayout = () => { | ||
// Use `setToastMessage` to show the toast. | ||
const [toastMessage, setToastMessage] = useState(null); | ||
|
||
const context = useMemo(() => ({ | ||
toastMessage, setToastMessage, | ||
}), []); | ||
|
||
return ( | ||
<TaxonomyContext.Provider value={context}> | ||
<div className="bg-light-400"> | ||
<Header isHiddenMainMenu /> | ||
<Outlet /> | ||
<StudioFooter /> | ||
<Toast | ||
show={toastMessage !== null} | ||
onClose={() => setToastMessage(null)} | ||
data-testid="taxonomy-toast" | ||
> | ||
{toastMessage} | ||
</Toast> | ||
</div> | ||
</TaxonomyContext.Provider> | ||
); | ||
}; | ||
|
||
export default TaxonomyLayout; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* eslint-disable import/prefer-default-export */ | ||
import React from 'react'; | ||
|
||
export const TaxonomyContext = React.createContext({ | ||
toastMessage: null, | ||
setToastMessage: null, | ||
}); |
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.