-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from williaster/resizable-grid
add resizable grid and dragdroppables
- Loading branch information
Showing
75 changed files
with
3,969 additions
and
329 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
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,29 @@ | ||
{ | ||
"rules": { | ||
"prefer-template": 2, | ||
"new-cap": 2, | ||
"no-restricted-syntax": 2, | ||
"guard-for-in": 2, | ||
"prefer-arrow-callback": 2, | ||
"func-names": 2, | ||
"react/jsx-no-bind": 2, | ||
"no-confusing-arrow": 2, | ||
"jsx-a11y/no-static-element-interactions": 2, | ||
"jsx-a11y/anchor-has-content": 2, | ||
"react/require-default-props": 2, | ||
"no-plusplus": 2, | ||
"no-mixed-operators": 2, | ||
"no-continue": 2, | ||
"no-bitwise": 2, | ||
"no-undef": 2, | ||
"no-multi-assign": 2, | ||
"no-restricted-properties": 2, | ||
"no-prototype-builtins": 2, | ||
"jsx-a11y/href-no-hash": 2, | ||
"class-methods-use-this": 2, | ||
"import/no-named-as-default": 2, | ||
"import/prefer-default-export": 2, | ||
"react/no-unescaped-entities": 2, | ||
"react/no-string-refs": 2, | ||
} | ||
} |
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,69 @@ | ||
export const UPDATE_COMPONENTS = 'UPDATE_COMPONENTS'; | ||
export function updateComponents(nextComponents) { | ||
return { | ||
type: UPDATE_COMPONENTS, | ||
payload: { | ||
nextComponents, | ||
}, | ||
}; | ||
} | ||
|
||
export const DELETE_COMPONENT = 'DELETE_COMPONENT'; | ||
export function deleteComponent(id, parentId) { | ||
return { | ||
type: DELETE_COMPONENT, | ||
payload: { | ||
id, | ||
parentId, | ||
}, | ||
}; | ||
} | ||
|
||
export const CREATE_COMPONENT = 'CREATE_COMPONENT'; | ||
export function createComponent(dropResult) { | ||
return { | ||
type: CREATE_COMPONENT, | ||
payload: { | ||
dropResult, | ||
}, | ||
}; | ||
} | ||
|
||
|
||
// Drag and drop -------------------------------------------------------------- | ||
export const MOVE_COMPONENT = 'MOVE_COMPONENT'; | ||
export function moveComponent(dropResult) { | ||
return { | ||
type: MOVE_COMPONENT, | ||
payload: { | ||
dropResult, | ||
}, | ||
}; | ||
} | ||
|
||
export const HANDLE_COMPONENT_DROP = 'HANDLE_COMPONENT_DROP'; | ||
export function handleComponentDrop(dropResult) { | ||
return (dispatch) => { | ||
if ( | ||
dropResult.destination | ||
&& dropResult.source | ||
&& !( // ensure it has moved | ||
dropResult.destination.droppableId === dropResult.source.droppableId | ||
&& dropResult.destination.index === dropResult.source.index | ||
) | ||
) { | ||
return dispatch(moveComponent(dropResult)); | ||
|
||
// new components don't have a source | ||
} else if (dropResult.destination && !dropResult.source) { | ||
return dispatch(createComponent(dropResult)); | ||
} | ||
return null; | ||
}; | ||
} | ||
|
||
// Resize --------------------------------------------------------------------- | ||
|
||
// export function dashboardComponentResizeStart() {} | ||
// export function dashboardComponentResize() {} | ||
// export function dashboardComponentResizeStop() {} |
48 changes: 18 additions & 30 deletions
48
superset/assets/javascripts/dashboard/v2/components/BuilderComponentPane.jsx
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.