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: automatically publish newly created flows #4230

Merged
merged 9 commits into from
Feb 3, 2025

Conversation

jessicamcinchak
Copy link
Member

@jessicamcinchak jessicamcinchak commented Jan 30, 2025

Realising this will be nice to have in place before templates - as I think we'll want a new createTemplate function to follow a similar pattern (offline by default, but is already published)!

Applies to both creating a new flow and copying a flow.

E2E tests rely on methods defined in planx-core which are updated here theopensystemslab/planx-core#639

Testing:

  • When creating via "Add a new service" button or "Copy" menu, ensure that on initial navigation the flow is published (
    • This is indicated underneath "Check for changes to publish" button in text and via console command window.api.getState().isFlowPublished
  • Make changes, "Check for changes to publish", and ensure that you can manually publish the first time as normal/expected

@jessicamcinchak
Copy link
Member Author

Copy link

github-actions bot commented Jan 30, 2025

Removed vultr server and associated DNS entries

@jessicamcinchak jessicamcinchak marked this pull request as ready for review January 31, 2025 13:42
@jessicamcinchak jessicamcinchak requested a review from a team January 31, 2025 13:42
@@ -63,7 +65,7 @@ interface InsertFlow {
}

// Insert a new flow into the `flows` table
const insertFlow = async (
const createFlow = async (
Copy link
Member Author

@jessicamcinchak jessicamcinchak Jan 31, 2025

Choose a reason for hiding this comment

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

In my opinion, the editor store function createFlow should be calling/sharing this API method instead of doing a separate/equivalent frontend mutation ! Have made a note of this for now, but intentionally choosing not to refactor here to keep momentum on templates as a whole - will revisit when adding methods for "createTemplatedFlow"

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep - agreed - we want to be narrowing this down to (ideally) a single implementation.

@@ -114,39 +114,7 @@ test.describe("Flow creation, publish and preview", () => {
]);
});

test("Cannot preview an unpublished flow", async ({
Copy link
Member Author

Choose a reason for hiding this comment

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

E2E tests always start from an empty database and create a flow from scratch which now includes publishing - meaning they no longer have the concept of ever accessing an "unpublished" flow or needing to test initial publish action separately.

The "publishFlow" action is still called throughout this file to save/publish content changes.

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.

One comment in theopensystemslab/planx-core#639 which is worth thinking about / trying out, but no blockers! 👌

@@ -63,7 +65,7 @@ interface InsertFlow {
}

// Insert a new flow into the `flows` table
const insertFlow = async (
const createFlow = async (
Copy link
Contributor

Choose a reason for hiding this comment

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

Yep - agreed - we want to be narrowing this down to (ideally) a single implementation.

Copy link
Contributor

@RODO94 RODO94 left a comment

Choose a reason for hiding this comment

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

looks good to me, tested manually on the pizza a few times and tried to find edge cases around combining creating and publishing flows. Couldn't find anything

@jessicamcinchak jessicamcinchak merged commit 5558e78 into main Feb 3, 2025
17 of 18 checks passed
@jessicamcinchak jessicamcinchak deleted the jess/publish-flow-on-create branch February 3, 2025 11:36
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.

3 participants