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

feat: add a flow description settings section #3954

Merged
merged 7 commits into from
Nov 19, 2024

Conversation

RODO94
Copy link
Contributor

@RODO94 RODO94 commented Nov 14, 2024

What does this PR do?

This PR introduces a new section in the Service Settings page of the Editor. This houses the flow description which was added to the flows table in a previous PR: #3945

I have created relevant mutations and updated current queries to update, create, and select description in planx-core in this PR: theopensystemslab/planx-core#564

This new section has been added to the bottom of the Service Settings page as not to disrupt the UI too much, although it may be worth reviewing how these things are structured, but I imagined this is most aligned with the "Rethinking the Editor" work rather than this wee PR.

I've called the setting section "Service Information" in case we want to put anything else in there in the future, type of service, creator, templated dependency etc... and it also allowed me to stop constantly using the word "description"

Note

The input structure follows the pattern of going for an Input Label over a placeholder due to the accessibility needs, I'll add a ticket to update the rest of the settings (Footer / Disclaimer) in line with this

@RODO94 RODO94 force-pushed the rory/templates-description-settings branch from 66aaf4e to 17f1f4e Compare November 14, 2024 13:48
Copy link

github-actions bot commented Nov 14, 2024

Removed vultr server and associated DNS entries

@RODO94 RODO94 marked this pull request as ready for review November 15, 2024 13:56
@RODO94 RODO94 requested a review from a team November 15, 2024 14:30
@DafyddLlyr
Copy link
Contributor

@RODO94 Just tried testing but can't log into the Pizza - the db sync has failed here. Could you please rebase to pick up #3957, and then recreate Vultr instance to resolve this?

@RODO94 RODO94 force-pushed the rory/templates-description-settings branch from d336a51 to da12459 Compare November 15, 2024 16:56
@RODO94 RODO94 requested a review from DafyddLlyr November 18, 2024 13:38
editor.planx.uk/src/pages/FlowEditor/utils.ts Outdated Show resolved Hide resolved
return Boolean(result?.id);
},

getFlowSettings: async (flowSlug, teamSlug) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I found the naming here is a little unclear / unexpected - we already have a flowSettings property and this is not a getter for that property, but rather a function which fetches settings, status and description of a flow.

I think I'd stick to the existing pattern of -

  • Fetch within the route
  • Set store variables
  • Child components read from stores

Always using the route req object over store values also ensures we're always fetching the right data and there's no room for any race condition or unexpected behaviour. This relies on a user always navigating via a route which sets these.

Copy link
Contributor

Choose a reason for hiding this comment

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

Screen.Recording.2024-11-18.at.16.03.49.mov

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah good thinking, I did keep the function name the same for consistency, but probably need some altered naming here. It is complicated a bit by the current flowSettings not really being all the settings for a flow, and rather an object of footer, privacy, and help rich text info. I'll look to update the naming to make it clearer

The req bit is a great catch, sorry for missing this. Added the change now.

Would there be a reason why these settings maintain a different pattern to General Settings and Design Settings where we fetch within the index.tsx of the component?

Think I've fallen into a trap of trying to partially improve code while trying to debug and creating wee errors, thanks for all the help and time

Copy link
Contributor

Choose a reason for hiding this comment

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

Would there be a reason why these settings maintain a different pattern to General Settings and Design Settings where we fetch within the index.tsx of the component?

Honestly, I think it's just history! This has been around for a while and we've not yet taken the dive to standardise and update it to match the rest - not a pressing concern right now, but would be a super nice tidy up in future.

Think I've fallen into a trap of trying to partially improve code while trying to debug and creating wee errors, thanks for all the help and time

Very easily done - especially in sections of the code like this which are too low on test coverage.

editor.planx.uk/src/routes/serviceSettings.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

@DafyddLlyr DafyddLlyr left a comment

Choose a reason for hiding this comment

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

All working as expected 👌

@@ -1,12 +1,11 @@
import Box from "@mui/material/Box";
import Button from "@mui/material/Button";
import { formControlLabelClasses } from "@mui/material/FormControlLabel";
// eslint-disable-next-line no-restricted-imports
Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch!

return Boolean(result?.id);
},

getFlowSettings: async (flowSlug, teamSlug) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Would there be a reason why these settings maintain a different pattern to General Settings and Design Settings where we fetch within the index.tsx of the component?

Honestly, I think it's just history! This has been around for a while and we've not yet taken the dive to standardise and update it to match the rest - not a pressing concern right now, but would be a super nice tidy up in future.

Think I've fallen into a trap of trying to partially improve code while trying to debug and creating wee errors, thanks for all the help and time

Very easily done - especially in sections of the code like this which are too low on test coverage.

@RODO94 RODO94 merged commit 49a113e into main Nov 19, 2024
12 checks passed
@RODO94 RODO94 deleted the rory/templates-description-settings branch November 19, 2024 09:22
@RODO94
Copy link
Contributor Author

RODO94 commented Nov 20, 2024

Templates groundwork

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