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

refactor: update the pattern for settings the flowSettings in state #2396

Closed
wants to merge 2 commits into from

Conversation

Mike-Heneghan
Copy link
Contributor

What

  • Rationalise the syntax for managing the flowSettings in state
  • Remove unnecessary custom setter

Why

  • Improves readability/maintainability

- Remove the custom setter `setFlowSettings`
- Rationalise the way we assign the flowSettings and store it
state.setTeam(team);

console.log('Standalone state: ', state)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've been trying to test the refactoring locally by logging out the state to ensure that the state is being set successfully in the relevant components.

Although I'm struggling to figure out how to setup a standalone view 🤔

I believe an example would be an invite to pay and I maybe just need to persevere to setup that up locally?

Copy link
Contributor

@DafyddLlyr DafyddLlyr Nov 7, 2023

Choose a reason for hiding this comment

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

This might add some context here - https://trello.com/c/0Uw8ViZJ/2324-make-editor-sidebar-preview-behave-same-as-the-unpublished-preview-increase-granularity-of-previewenvironment

It's a bit of a pain point (at least for me!) and something I'd love to have a crack at refactoring / removing / rationalising.

This is referring to the PreviewEnvironment variable in shared.ts (the SharedStore slice) - standalone is essentially all pages that are not the Editor such as /preview 👌

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the info on this @DafyddLlyr!

I'm still a bit confused because based on this I thought I'd see the output from console.log('Standalone state: ', state) when I was on a /preview route?

Although that seems to use the published view rather than the standalone view?

@Mike-Heneghan Mike-Heneghan self-assigned this Nov 7, 2023
@Mike-Heneghan Mike-Heneghan deleted the mh/refactor-flow-settings branch March 14, 2024 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants