Skip to content
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

Internal redux state structure refactor #1983

Closed
wants to merge 9 commits into from

Conversation

jitu5
Copy link
Contributor

@jitu5 jitu5 commented Jul 17, 2024

Description

Resolves #1969 (comment) point 2

To make React component options props consistent, Redux state structure is updated as below:

Current:

{
  visible: {
    code: false,
    exportBtn: true,
    exportModal: false,
    graph: true,
    labelBtn: true,
    layerBtn: true,
    metadataModal: false,
    miniMapBtn: true,
    modularPipelineFocusMode: null,
    expandPipelinesBtn: true,
    settingsModal: false,
    shareableUrlModal: false,
    sidebar: window.innerWidth > sidebarWidth.breakpoint,
  },
  display: {
    globalToolbar: true,
    sidebar: true,
    miniMap: true,
    expandAllPipelines: false,
  }
}

After this PR:

{
  visible: {
    code: false,
    exportModal: false,
    graph: true,
    metadataModal: false,
    miniMap: true,
    modularPipelineFocusMode: null,
    settingsModal: false,
    shareableUrlModal: false,
    sidebar: window.innerWidth > sidebarWidth.breakpoint,
  },
  display: {
    globalNavigation: true,
    sidebar: true,
    miniMap: true,
    expandPipelinesBtn: true,
    exportBtn: true,
    labelBtn: true,
    layerBtn: true,
  },
  expandAllPipelines: false,  
}

Development notes

  • Move all props from visible to display which are buttons that can only be controlled by passing to react component
  • Remove miniMapBtn from redux state
  • Keep miniMap in both display and visible
  • When display.miniMap is false both icon and miniMap will be hidden
  • visible.miniMap will be used internally when used without react component to show/hide miniMap when clicked by user
  • Move expandAllPipelines out of display and keep it same level as display
  • pipelineBtn renamed to expandPipelinesBtn

###Note:
This PR is linked with #1982, #1969 and #1965

Checklist

  • Read the contributing guidelines
  • Opened this PR as a 'Draft Pull Request' if it is work-in-progress
  • Updated the documentation to reflect the code changes
  • Added new entries to the RELEASE.md file
  • Added tests to cover my changes

@jitu5 jitu5 added the Javascript Pull requests that update Javascript code label Jul 17, 2024
@jitu5 jitu5 self-assigned this Jul 17, 2024
@jitu5 jitu5 changed the title Minimap props refactor: display.miniMap & visible.miniMap Props refactor: display.miniMap, visible.miniMap & pipelineBtn Jul 17, 2024
@jitu5 jitu5 closed this Jul 18, 2024
@jitu5 jitu5 force-pushed the feature/minimap-prop-refactor branch from 20382b4 to faceed9 Compare July 18, 2024 12:47
@jitu5 jitu5 reopened this Jul 18, 2024
Signed-off-by: Jitendra Gundaniya <[email protected]>
@jitu5 jitu5 changed the title Props refactor: display.miniMap, visible.miniMap & pipelineBtn Internal redux state structure refactor Jul 18, 2024
Signed-off-by: Jitendra Gundaniya <[email protected]>
Signed-off-by: Jitendra Gundaniya <[email protected]>
Signed-off-by: Jitendra Gundaniya <[email protected]>
Signed-off-by: Jitendra Gundaniya <[email protected]>
@rashidakanchwala rashidakanchwala self-requested a review July 19, 2024 17:48
@ravi-kumar-pilla ravi-kumar-pilla self-requested a review July 19, 2024 18:52
Copy link
Contributor

@ravi-kumar-pilla ravi-kumar-pilla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a minor rename comment, but overall looks fine. Thank you @jitu5

Signed-off-by: Jitendra Gundaniya <[email protected]>
@jitu5
Copy link
Contributor Author

jitu5 commented Jul 22, 2024

Closing this PR as it already merged with #1992 to main.

@jitu5 jitu5 closed this Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Javascript Pull requests that update Javascript code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants