mirror of
https://github.com/apache/superset.git
synced 2026-04-21 17:14:57 +00:00
chore: refactor submenu's right nav to accept list of buttons (#11102)
* submenu right-nav button refactor * undo changes * fix lint * fix test * update pr with suggested changes and test * fix lint * use enum to define btn style props * add suggestions * update savedquery buttons
This commit is contained in:
committed by
GitHub
parent
2a906bc9d1
commit
07716ffd76
@@ -126,19 +126,22 @@ function DatabaseList({ addDangerToast, addSuccessToast }: DatabaseListProps) {
|
||||
};
|
||||
|
||||
if (canCreate) {
|
||||
menuData.primaryButton = {
|
||||
name: (
|
||||
<>
|
||||
{' '}
|
||||
<i className="fa fa-plus" /> {t('Database')}{' '}
|
||||
</>
|
||||
),
|
||||
onClick: () => {
|
||||
// Ensure modal will be opened in add mode
|
||||
setCurrentDatabase(null);
|
||||
setDatabaseModalOpen(true);
|
||||
menuData.buttons = [
|
||||
{
|
||||
name: (
|
||||
<>
|
||||
{' '}
|
||||
<i className="fa fa-plus" /> {t('Database')}{' '}
|
||||
</>
|
||||
),
|
||||
buttonStyle: 'primary',
|
||||
onClick: () => {
|
||||
// Ensure modal will be opened in add mode
|
||||
setCurrentDatabase(null);
|
||||
setDatabaseModalOpen(true);
|
||||
},
|
||||
},
|
||||
};
|
||||
];
|
||||
}
|
||||
|
||||
const initialSort = [{ id: 'changed_on_delta_humanized', desc: true }];
|
||||
|
||||
Reference in New Issue
Block a user