-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NU-1805] Scenario labels support (#6766)
* Scenario labels support * style fixes * labels validation * Scenario labels validation * QS * Labels validation via endpoint, multiple validation rules * QS * Fixes * Fixes * Fixes * Fixes * Review fixes * make input value uncontrolled * Migration API with labels, permission handling, e2e tests * Updated snapshots (#6831) Co-authored-by: mateuszkp96 <[email protected]> * Cypress test fix * Review fixes * fix truncate popover opening scenario on close * Review fixes * Fixes * Fix * Cypress fix * Updated snapshots (#6881) Co-authored-by: mateuszkp96 <[email protected]> * Fixes * Review fixes * Review fixes * Updated snapshots (#6903) Co-authored-by: mateuszkp96 <[email protected]> --------- Co-authored-by: Dawid Poliszak <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: mateuszkp96 <[email protected]>
- Loading branch information
1 parent
adc8db1
commit 3f1e660
Showing
111 changed files
with
3,203 additions
and
474 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-2.84 KB
(95%)
...d allow adding input parameters and display used fragment graph in modal #4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-86 Bytes
(100%)
...d allow adding input parameters and display used fragment graph in modal #6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+9 Bytes
(100%)
...ots__/electron/Linux/Fragment should display dead-ended fragment correct #0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.36 KB
(99%)
...ots__/electron/Linux/Process initially clean should import JSON and save #0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
describe("Scenario labels", () => { | ||
const seed = "process"; | ||
|
||
before(() => { | ||
cy.deleteAllTestProcesses({ filter: seed, force: true }); | ||
}); | ||
|
||
beforeEach(() => { | ||
cy.mockWindowDate(); | ||
}); | ||
|
||
afterEach(() => { | ||
cy.deleteAllTestProcesses({ filter: seed, force: true }); | ||
}); | ||
|
||
describe("designer", () => { | ||
it("should allow to set labels for new process", () => { | ||
cy.visitNewProcess(seed).as("processName"); | ||
|
||
cy.intercept("PUT", "/api/processes/*").as("save"); | ||
|
||
cy.intercept("POST", "/api/scenarioLabels/validation").as("labelvalidation"); | ||
|
||
cy.get("[data-testid=AddLabel]").should("be.visible").click(); | ||
|
||
cy.get("[data-testid=LabelInput]").as("labelInput"); | ||
|
||
cy.get("@labelInput").should("be.visible").click().type("tagX"); | ||
|
||
cy.wait("@labelvalidation"); | ||
|
||
cy.get('.MuiAutocomplete-popper li[data-option-index="0"]').contains('Add label "tagX"').click(); | ||
|
||
cy.get("[data-testid=scenario-label-0]").should("be.visible").contains("tagX"); | ||
|
||
cy.get("@labelInput").should("be.visible").click().type("tag2"); | ||
|
||
cy.wait("@labelvalidation"); | ||
|
||
cy.get('.MuiAutocomplete-popper li[data-option-index="0"]').contains('Add label "tag2"').click(); | ||
|
||
cy.get("@labelInput").type("{enter}"); | ||
|
||
cy.get("[data-testid=scenario-label-1]").should("be.visible").contains("tag2"); | ||
|
||
cy.contains(/^save/i).should("be.enabled").click(); | ||
cy.contains(/^ok$/i).should("be.enabled").click(); | ||
cy.wait("@save").its("response.statusCode").should("eq", 200); | ||
|
||
cy.viewport(1500, 800); | ||
|
||
cy.get("[data-testid=scenario-label-0]").should("be.visible").contains("tag2"); | ||
cy.get("[data-testid=scenario-label-1]").should("be.visible").contains("tagX"); | ||
|
||
cy.get("@labelInput").should("be.visible").click().type("very long tag"); | ||
|
||
cy.wait("@labelvalidation").then((_) => cy.wait(100)); | ||
|
||
cy.get("@labelInput").should("be.visible").contains("Incorrect value 'very long tag'"); | ||
|
||
cy.contains(/^save/i).should("be.disabled"); | ||
}); | ||
|
||
it("should show labels for scenario", () => { | ||
cy.visitNewProcess(seed).then((processName) => cy.addLabelsToNewProcess(processName, ["tag1", "tag3"])); | ||
|
||
cy.viewport(1500, 800); | ||
|
||
cy.get("[data-testid=scenario-label-0]").should("be.visible").contains("tag1"); | ||
cy.get("[data-testid=scenario-label-1]").should("be.visible").contains("tag3"); | ||
}); | ||
}); | ||
|
||
describe("scenario list", () => { | ||
it("should allow to filter scenarios by label", () => { | ||
cy.visitNewProcess(seed).then((processName) => cy.addLabelsToNewProcess(processName, ["tag1", "tag3"])); | ||
cy.visitNewProcess(seed).then((processName) => cy.addLabelsToNewProcess(processName, ["tag2", "tag3"])); | ||
cy.visitNewProcess(seed).then((processName) => cy.addLabelsToNewProcess(processName, ["tag4"])); | ||
cy.visitNewProcess(seed); | ||
|
||
cy.visit("/"); | ||
|
||
cy.contains("button", /label/i).click(); | ||
|
||
cy.get("ul[role='menu']").within(() => { | ||
cy.contains(/tag2/i).click(); | ||
}); | ||
|
||
cy.contains(/1 of the 4 rows match the filters/i).should("be.visible"); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export type AvailableScenarioLabels = { | ||
labels: string[]; | ||
}; | ||
|
||
export type ScenarioLabelValidationError = { | ||
label: string; | ||
messages: string[]; | ||
}; | ||
|
||
export type ScenarioLabelsValidationResponse = { | ||
validationErrors: ScenarioLabelValidationError[]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.