From c4072ddebd77310d6faa291f2ca099f6fa9e51b2 Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Tue, 17 Dec 2024 16:02:42 -0400 Subject: [PATCH] Revert "FOUR-20487: Display "Screen Interstitial" Option" --- .../inspectors/ElementDestination.vue | 56 +++++-------------- .../inspectors/taskElementDestination.js | 1 - tests/e2e/specs/DisplayNextAssignedTask.cy.js | 32 ----------- tests/e2e/specs/Tasks.cy.js | 17 +++--- 4 files changed, 21 insertions(+), 85 deletions(-) delete mode 100644 tests/e2e/specs/DisplayNextAssignedTask.cy.js diff --git a/src/components/inspectors/ElementDestination.vue b/src/components/inspectors/ElementDestination.vue index 7ad7d7821..3dfc70d7e 100644 --- a/src/components/inspectors/ElementDestination.vue +++ b/src/components/inspectors/ElementDestination.vue @@ -276,54 +276,26 @@ export default { this.setBpmnValues(event); }, /** - * Handle interstitial behavior based on node type - * - * @param {String} newValue - The new destination type value selected - * @returns {void} + * Handle interstitial for task source + * + * @param {String} newValue */ handleInterstitial(newValue) { - const nodeType = this.node.$type; - const nodeId = this.node.id; + const taskTypes = ['bpmn:Task', 'bpmn:ManualTask']; - const handlers = { - /** - * Handler for Start Event nodes - * Emits handle-interstitial event with node ID and disabled state - */ - 'bpmn:StartEvent': () => { - this.$root.$emit('handle-interstitial', { - nodeId, - isDisabled: newValue !== 'taskSource', - }); - }, - /** - * Handler for Task nodes - * Delegates to handleTaskInterstitial method - */ - 'bpmn:Task': () => this.handleTaskInterstitial(newValue, nodeId), - /** - * Handler for Manual Task nodes - * Delegates to handleTaskInterstitial method - */ - 'bpmn:ManualTask': () => this.handleTaskInterstitial(newValue, nodeId), - }; + if (!taskTypes.includes(this.node.$type)) { + return; + } + + let isDisabled = false; - const handler = handlers[nodeType]; - if (handler) { - handler(); + if (newValue !== 'taskSource') { + isDisabled = true; } - }, - /** - * Handle interstitial for task elements - * - * @param {String} newValue - The new destination type value selected - * @param {String} nodeId - The ID of the task node being modified - */ - handleTaskInterstitial(newValue, nodeId) { - this.$root.$emit('handle-task-interstitial', { - nodeId, - show: newValue === 'displayNextAssignedTask', + this.$root.$emit('handle-interstitial', { + nodeId: this.node.id, + isDisabled, }); }, }, diff --git a/src/components/inspectors/taskElementDestination.js b/src/components/inspectors/taskElementDestination.js index 93a71713c..9cd3ee1ab 100644 --- a/src/components/inspectors/taskElementDestination.js +++ b/src/components/inspectors/taskElementDestination.js @@ -13,7 +13,6 @@ export default { { value: 'homepageDashboard', content: 'Welcome Screen' }, { value: 'customDashboard', content: 'Custom Dashboard' }, { value: 'externalURL', content: 'External URL' }, - { value: 'displayNextAssignedTask', content: 'Display Next Assigned Task' }, ], }, }; diff --git a/tests/e2e/specs/DisplayNextAssignedTask.cy.js b/tests/e2e/specs/DisplayNextAssignedTask.cy.js deleted file mode 100644 index c4a227df2..000000000 --- a/tests/e2e/specs/DisplayNextAssignedTask.cy.js +++ /dev/null @@ -1,32 +0,0 @@ - -const { nodeTypes } = require('../support/constants'); -const { - clickAndDropElement, - waitToRenderAllShapes, - getElementAtPosition, - toggleInspector, -} = require('../support/utils'); - -// Test suite for Display Next Assigned Task functionality -describe('Display Next Assigned Task', { scrollBehavior: false }, () => { - - // Setup before each test - beforeEach(() => { - toggleInspector(); - }); - - // Step 1: Test selecting Display Next Assigned Task option - it('should select Display Next Assigned Task as element destination type', () => { - const manualTaskPosition = { x: 300, y: 200 }; - clickAndDropElement(nodeTypes.task, manualTaskPosition); - waitToRenderAllShapes(); - getElementAtPosition(manualTaskPosition).click(); - - // Verify element destination dropdown exists and select option - cy.get('[data-test=element-destination-type]').should('exist').click(); - cy.get('[id=option-1-6]').click(); - - // Verify selected option is displayed correctly - cy.get('[class=multiselect__single]').should('exist').contains('Display Next Assigned Task'); - }); -}); diff --git a/tests/e2e/specs/Tasks.cy.js b/tests/e2e/specs/Tasks.cy.js index 07fbb48e3..ab65f9bf5 100644 --- a/tests/e2e/specs/Tasks.cy.js +++ b/tests/e2e/specs/Tasks.cy.js @@ -73,22 +73,19 @@ describe('Tasks', () => { // Custom Dashboards cy.get('[data-test=element-destination-type]').should('exist'); cy.get('[data-test=element-destination-type]').click(); - cy.contains('External URL').click(); - // cy.contains('Display Next Assigned Task').click(); + cy.get('[id=option-1-5]').click(); cy.get('[class=multiselect__single]').should('exist'); cy.get('[class=multiselect__single]').contains('External URL'); cy.get('[data-test=dashboard]').should('not.exist'); cy.get('[data-test=external-url]').should('exist'); cy.get('[data-test=downloadXMLBtn]').click(); + // TODO need a new version of processmaker-bpmn-moddle [https://github.com/ProcessMaker/processmaker-bpmn-moddle/pull/58] + // const validXML = '\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n'; - // Display Next Assigned Task - cy.get('[data-test=element-destination-type]').should('exist'); - cy.get('[data-test=element-destination-type]').click(); - cy.contains('Display Next Assigned Task').click(); - cy.get('[class=multiselect__single]').should('exist'); - cy.get('[class=multiselect__single]').contains('Display Next Assigned Task'); - cy.get('[data-test=dashboard]').should('not.exist'); - cy.get('[data-test=external-url]').should('not.exist'); + // cy.window() + // .its('xml') + // .then(xml => xml.trim()) + // .should('eq', validXML.trim()); }); it('Correctly renders task after undo/redo', () => {