-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dashboard builder] static layout + toasts (#4763)
* [dashboard-builder] remove spacer component * [dashboard-builder] better transparent indicator, better grid gutter logic, no dragging top-level tabs, headers are multiples of grid unit, fix row height granularity, update redux state key dashboard => dashboardLayout * [dashboard-builder] don't blast column child dimensions on resize * [dashboard-builder] ResizableContainer min size can't be smaller than size, fix row style, role=none on WithPopoverMenu container * [edit mode] add edit mode to redux and propogate to all <DashboardComponent />s * [toasts] add Toast component, ToastPresenter container and component, and toast redux actions + reducers * [dashboard-builder] add info toast when dropResult overflows parent
- Loading branch information
1 parent
1aebfd6
commit a19a260
Showing
62 changed files
with
715 additions
and
630 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export const SET_EDIT_MODE = 'SET_EDIT_MODE'; | ||
export function setEditMode(editMode) { | ||
return { | ||
type: SET_EDIT_MODE, | ||
payload: { | ||
editMode, | ||
}, | ||
}; | ||
} |
49 changes: 49 additions & 0 deletions
49
superset/assets/javascripts/dashboard/v2/actions/messageToasts.js
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,49 @@ | ||
import { INFO_TOAST, SUCCESS_TOAST, WARNING_TOAST, DANGER_TOAST } from '../util/constants'; | ||
|
||
function getToastUuid(type) { | ||
return `${Math.random().toString(16).slice(2)}-${type}-${Math.random().toString(16).slice(2)}`; | ||
} | ||
|
||
export const ADD_TOAST = 'ADD_TOAST'; | ||
export function addToast({ toastType, text }) { | ||
debugger; | ||
return { | ||
type: ADD_TOAST, | ||
payload: { | ||
id: getToastUuid(toastType), | ||
toastType, | ||
text, | ||
}, | ||
}; | ||
} | ||
|
||
export const REMOVE_TOAST = 'REMOVE_TOAST'; | ||
export function removeToast(id) { | ||
return { | ||
type: REMOVE_TOAST, | ||
payload: { | ||
id, | ||
}, | ||
}; | ||
} | ||
|
||
// Different types of toasts | ||
export const ADD_INFO_TOAST = 'ADD_INFO_TOAST'; | ||
export function addInfoToast(text) { | ||
return dispatch => dispatch(addToast({ text, toastType: INFO_TOAST })); | ||
} | ||
|
||
export const ADD_SUCCESS_TOAST = 'ADD_SUCCESS_TOAST'; | ||
export function addSuccessToast(text) { | ||
return dispatch => dispatch(addToast({ text, toastType: SUCCESS_TOAST })); | ||
} | ||
|
||
export const ADD_WARNING_TOAST = 'ADD_WARNING_TOAST'; | ||
export function addWarningToast(text) { | ||
return dispatch => dispatch(addToast({ text, toastType: WARNING_TOAST })); | ||
} | ||
|
||
export const ADD_DANGER_TOAST = 'ADD_DANGER_TOAST'; | ||
export function addDangerToast(text) { | ||
return dispatch => dispatch(addToast({ text, toastType: DANGER_TOAST })); | ||
} |
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.