diff --git a/frontend/src/components/multi-step-forms/instance/MultiStepApplicationsInstanceForm.vue b/frontend/src/components/multi-step-forms/instance/MultiStepApplicationsInstanceForm.vue index 2b0f0ae95b..5581ecf64c 100644 --- a/frontend/src/components/multi-step-forms/instance/MultiStepApplicationsInstanceForm.vue +++ b/frontend/src/components/multi-step-forms/instance/MultiStepApplicationsInstanceForm.vue @@ -233,15 +233,22 @@ export default { }) .then((application) => { if (this.instanceFollowUp && !this.shouldHideInstanceSteps) { - return instanceApi.create({ + const payload = { applicationId: application.id, name: this.form[INSTANCE_SLUG].input.name, projectType: this.form[INSTANCE_SLUG].input.instanceType, stack: this.form[INSTANCE_SLUG].input.nodeREDVersion, - template: this.form[INSTANCE_SLUG].input.template, - flowBlueprintId: this.form[FLOWS_SLUG].blueprint?.id ?? '', - flows: this.form[FLOWS_SLUG].flows ?? '' - }) + template: this.form[INSTANCE_SLUG].input.template + } + + if (this.form[FLOWS_SLUG].blueprint?.id) { + payload.flowBlueprintId = this.form[FLOWS_SLUG].blueprint?.id + } + + if (this.form[FLOWS_SLUG].flows) { + payload.flows = this.form[FLOWS_SLUG].flows + } + return instanceApi.create(payload) } }) .catch(err => { diff --git a/frontend/src/components/multi-step-forms/instance/MultiStepInstanceForm.vue b/frontend/src/components/multi-step-forms/instance/MultiStepInstanceForm.vue index f66284d057..9e10433371 100644 --- a/frontend/src/components/multi-step-forms/instance/MultiStepInstanceForm.vue +++ b/frontend/src/components/multi-step-forms/instance/MultiStepInstanceForm.vue @@ -118,9 +118,15 @@ export default { name: this.form[INSTANCE_SLUG].input.name, projectType: this.form[INSTANCE_SLUG].input.instanceType, stack: this.form[INSTANCE_SLUG].input.nodeREDVersion, - template: this.form[INSTANCE_SLUG].input.template, - flowBlueprintId: this.form[FLOWS_SLUG].blueprint?.id ?? '', - flows: this.form[FLOWS_SLUG].flows ?? '' + template: this.form[INSTANCE_SLUG].input.template + } + + if (this.form[FLOWS_SLUG].blueprint?.id) { + payload.flowBlueprintId = this.form[FLOWS_SLUG].blueprint?.id + } + + if (this.form[FLOWS_SLUG].flows) { + payload.flows = this.form[FLOWS_SLUG].flows } return instanceApi.create(payload) diff --git a/test/e2e/frontend/cypress/tests/invitations.spec.js b/test/e2e/frontend/cypress/tests/invitations.spec.js index 699a1ea36a..c77e881600 100644 --- a/test/e2e/frontend/cypress/tests/invitations.spec.js +++ b/test/e2e/frontend/cypress/tests/invitations.spec.js @@ -27,7 +27,7 @@ describe('FlowFuse platform invitees', () => { }) cy.get('[data-el="notifications-drawer"]').should('be.visible') - cy.get('[data-el="invitation-message"]').eq(0).click() + cy.get('[data-el="invitation-message"]:first .body').click() // user should see a message