-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor modular pipeline expansions to instantly update UI #2225
Open
SajidAlamQB
wants to merge
16
commits into
main
Choose a base branch
from
introduce-manage-toolbarOptions
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 10 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
25c7976
Update flowchart-primary-toolbar.js
SajidAlamQB 5878705
Update disabled.js
SajidAlamQB b5bae99
Update flowchart-primary-toolbar.js
SajidAlamQB 2dc948e
use toggleModularPipelineExpanded action
SajidAlamQB 17202b8
Merge branch 'main' into introduce-manage-toolbarOptions
SajidAlamQB cc8cb4f
fix test
SajidAlamQB 4a75c06
Merge branch 'introduce-manage-toolbarOptions' of https://github.com/…
SajidAlamQB e1168a1
Update disabled.js
SajidAlamQB 9172ffc
Update flowchart-primary-toolbar.js
SajidAlamQB 3eb1ba8
add check for modularpipelinefocus
SajidAlamQB 4842ef3
exclude root from modularPipelineIDs
SajidAlamQB 1a37fc1
Update flowchart-primary-toolbar.test.js
SajidAlamQB 87dbafc
revert disabled
SajidAlamQB c0c5a20
Add new reducer to hanlde update state for when toggle expanding all …
d11fd2d
Merge branch 'main' into introduce-manage-toolbarOptions
SajidAlamQB c3dbd9d
Merge branch 'main' into introduce-manage-toolbarOptions
rashidakanchwala File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ import { | |
toggleTextLabels, | ||
toggleExpandAllPipelines, | ||
} from '../../actions'; | ||
import { loadInitialPipelineData } from '../../actions/pipelines'; | ||
import { toggleModularPipelinesExpanded } from '../../actions/modular-pipelines'; | ||
import IconButton from '../ui/icon-button'; | ||
import LabelIcon from '../icons/label'; | ||
import ExportIcon from '../icons/export'; | ||
|
@@ -24,6 +24,7 @@ import { useGeneratePathname } from '../../utils/hooks/use-generate-pathname'; | |
* @param {Boolean} textLabels Whether text labels are displayed | ||
*/ | ||
export const FlowchartPrimaryToolbar = ({ | ||
modularPipelineIDs, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we don't need it anymore i think |
||
disableLayerBtn, | ||
onToggleExportModal, | ||
onToggleLayers, | ||
|
@@ -34,12 +35,17 @@ export const FlowchartPrimaryToolbar = ({ | |
display, | ||
visibleLayers, | ||
expandedPipelines, | ||
onToggleExpandPipelines, | ||
onToggleExpandAllPipelines, | ||
}) => { | ||
const { toSetQueryParam } = useGeneratePathname(); | ||
|
||
const handleToggleExpandAllPipelines = () => { | ||
const isExpanded = !expandedPipelines; | ||
|
||
// Pass an empty array when collapsing all pipelines | ||
onToggleExpandPipelines(isExpanded ? modularPipelineIDs : []); | ||
SajidAlamQB marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
onToggleExpandAllPipelines(isExpanded); | ||
toSetQueryParam('expandAllPipelines', isExpanded.toString()); | ||
}; | ||
|
@@ -103,6 +109,7 @@ export const FlowchartPrimaryToolbar = ({ | |
}; | ||
|
||
export const mapStateToProps = (state) => ({ | ||
modularPipelineIDs: state?.modularPipeline?.ids, | ||
disableLayerBtn: !state.layer.ids.length, | ||
textLabels: state.textLabels, | ||
visible: state.visible, | ||
|
@@ -124,9 +131,11 @@ export const mapDispatchToProps = (dispatch) => ({ | |
onToggleTextLabels: (value) => { | ||
dispatch(toggleTextLabels(Boolean(value))); | ||
}, | ||
onToggleExpandPipelines: (ids) => { | ||
dispatch(toggleModularPipelinesExpanded(ids)); | ||
}, | ||
onToggleExpandAllPipelines: (isExpanded) => { | ||
dispatch(toggleExpandAllPipelines(isExpanded)); | ||
dispatch(loadInitialPipelineData()); | ||
}, | ||
}); | ||
|
||
|
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think you should add this actions/modular-pipelines as well, it's confusing why this is here. and the other expanded ones are in the other