-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Nu-1780] Add advanced search options (#6700)
* [Nu-1780] Expand search options --------- Co-authored-by: Piotr Rudnicki <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: DeamonDev <[email protected]>
- Loading branch information
1 parent
d54c0d3
commit def9d3b
Showing
20 changed files
with
538 additions
and
49 deletions.
There are no files selected for viewing
Binary file modified
BIN
-150 Bytes
(99%)
...tron/Linux/Creator toolbar should allow collapse (persist) and filtering #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
-208 Bytes
(99%)
...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.69 KB
(100%)
...ocess tests from file should properly display results of tests from file #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
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,144 @@ | ||
describe("Search Panel View", () => { | ||
const seed = "process"; | ||
|
||
before(() => { | ||
cy.deleteAllTestProcesses({ | ||
filter: seed, | ||
force: true, | ||
}); | ||
}); | ||
|
||
after(() => { | ||
cy.deleteAllTestProcesses({ | ||
filter: seed, | ||
force: true, | ||
}); | ||
}); | ||
|
||
beforeEach(() => { | ||
cy.visitNewProcess(seed, "testProcess"); | ||
}); | ||
|
||
it("should collapse advanced search filters", () => { | ||
cy.get("[data-testid=search-panel]").should("be.visible"); | ||
cy.get("[data-testid=search-panel]").contains(/^search$/i); | ||
cy.get("[data-testid=search-panel]").find("svg[id='advanced-search-icon']").click(); | ||
//cy.realType("se"); | ||
cy.get("[data-testid=search-panel]").contains("Advanced Search"); | ||
cy.get("[data-testid=search-panel]").contains("Name"); | ||
cy.get("[data-testid=search-panel]").contains("Description"); | ||
cy.get("[data-testid=search-panel]").contains("Label"); | ||
cy.get("[data-testid=search-panel]").contains("Value"); | ||
cy.get("[data-testid=search-panel]").contains("Output"); | ||
cy.get("[data-testid=search-panel]").contains("Type"); | ||
cy.get("[data-testid=search-panel]").contains("Edge"); | ||
}); | ||
|
||
it("should filter nodes when typing search query with selectors manually and editing it later in form", () => { | ||
cy.get("[data-testid=search-panel]").find("input[data-selector='NODES_IN_SCENARIO']").click(); | ||
|
||
cy.realType("type:(sink) se"); | ||
|
||
cy.get("[data-testid=search-panel]").contains("dynamicService").should("not.exist"); | ||
cy.get("[data-testid=search-panel]").contains("sendSms"); | ||
|
||
cy.get("[data-testid=search-panel]").find("svg[id='advanced-search-icon']").click(); | ||
cy.get("[data-testid=search-panel]").find("input[name='type']").should("have.value", "sink"); | ||
|
||
cy.get("[data-testid=search-panel]").find("input[name='type']").click(); | ||
cy.realType(",processor"); | ||
|
||
cy.get("[data-testid=search-panel]").find("button[type='submit']").click(); | ||
|
||
cy.get("[data-testid=search-panel]").contains("dynamicService"); | ||
cy.get("[data-testid=search-panel]").contains("sendSms"); | ||
}); | ||
|
||
it("should filter nodes when performing simple search and adding selectors using form", () => { | ||
cy.get("[data-testid=search-panel]").find("input[data-selector='NODES_IN_SCENARIO']").click(); | ||
cy.realType("se"); | ||
|
||
cy.get("[data-testid=search-panel]").find("svg[id='advanced-search-icon']").click(); | ||
cy.get("[data-testid=search-panel]").find("input[name='type']").click(); | ||
|
||
cy.realType("sink,processor"); | ||
|
||
cy.get("[data-testid=search-panel]").find("button[type='submit']").click(); | ||
|
||
cy.get("[data-testid=search-panel]") | ||
.find("input[data-selector='NODES_IN_SCENARIO']") | ||
.should("have.value", "type:(sink,processor) se"); | ||
|
||
cy.get("[data-testid=search-panel]").contains("dynamicService"); | ||
cy.get("[data-testid=search-panel]").contains("sendSms"); | ||
}); | ||
|
||
it("should filter nodes when setting up multiple selectors using form", () => { | ||
cy.get("[data-testid=search-panel]").find("svg[id='advanced-search-icon']").click(); | ||
|
||
cy.get("[data-testid=search-panel]").find("input[name='id']").click(); | ||
cy.realType("bounded,dynamic,send,enricher"); | ||
|
||
cy.get("[data-testid=search-panel]").find("input[name='type']").click(); | ||
cy.realType("sink,enricher"); | ||
|
||
cy.get("[data-testid=search-panel]").find("button[type='submit']").click(); | ||
|
||
cy.get("[data-testid=search-panel]") | ||
.find("input[data-selector='NODES_IN_SCENARIO']") | ||
.should("have.value", "id:(bounded,dynamic,send,enricher) type:(sink,enricher) "); | ||
|
||
cy.get("[data-testid=search-panel]").contains("enricher"); | ||
cy.get("[data-testid=search-panel]").contains("sendSms"); | ||
}); | ||
|
||
it("should synchronize the form input state with manually provided query with selectors", () => { | ||
cy.get("[data-testid=search-panel]").find("input[data-selector='NODES_IN_SCENARIO']").click(); | ||
cy.realType("type:(sink)"); | ||
|
||
cy.get("[data-testid=search-panel]").find("svg[id='advanced-search-icon']").click(); | ||
cy.get("[data-testid=search-panel]").find("input[name='type']").should("have.value", "sink"); | ||
|
||
cy.get("[data-testid=search-panel]") | ||
.find("input[data-selector='NODES_IN_SCENARIO']") | ||
.click() | ||
.type("{moveToEnd}") | ||
.type("{leftArrow}") | ||
.type(",source"); | ||
|
||
cy.get("[data-testid=search-panel]").find("svg[id='advanced-search-icon']").click(); | ||
cy.get("[data-testid=search-panel]").find("input[name='type']").should("have.value", "sink,source"); | ||
}); | ||
|
||
it("should clear search filters", () => { | ||
cy.get("[data-testid=search-panel]").find("input[data-selector='NODES_IN_SCENARIO']").click(); | ||
cy.realType("type:(sink) se"); | ||
|
||
cy.get("[data-testid=search-panel]").find("svg[id='advanced-search-icon']").click(); | ||
cy.get("[data-testid=search-panel]").find("button[type='button']").click(); | ||
|
||
cy.get("[data-testid=search-panel]").find("input[data-selector='NODES_IN_SCENARIO']").should("have.value", "se"); | ||
cy.get("[data-testid=search-panel]").find("input[name='type']").should("have.value", ""); | ||
|
||
cy.get("[data-testid=search-panel]").contains("dynamicService"); | ||
cy.get("[data-testid=search-panel]").contains("sendSms"); | ||
}); | ||
|
||
it("should clear filters when clear all button clicked", () => { | ||
cy.get("[data-testid=search-panel]").find("input[data-selector='NODES_IN_SCENARIO']").click(); | ||
cy.realType("se"); | ||
|
||
cy.get("[data-testid=search-panel]").find("svg[id='advanced-search-icon']").click(); | ||
cy.get("[data-testid=search-panel]").find("input[name='type']").click(); | ||
|
||
cy.realType("sink,processor"); | ||
|
||
cy.get("[data-testid=search-panel]").find("button[type='submit']").click(); | ||
cy.get("[data-testid=search-panel]").find("svg[id='clear-icon']").click(); | ||
|
||
cy.get("[data-testid=search-panel]").find("input[data-selector='NODES_IN_SCENARIO']").should("have.value", ""); | ||
|
||
cy.get("[data-testid=search-panel]").find("svg[id='advanced-search-icon']").click(); | ||
cy.get("[data-testid=search-panel]").find("input[name='type']").should("have.value", ""); | ||
}); | ||
}); |
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,10 @@ | ||
import { FieldLabel } from "../graph/node-modal/FieldLabel"; | ||
import React from "react"; | ||
|
||
interface Props { | ||
label: string; | ||
} | ||
|
||
export const SearchLabel = (props: Props) => { | ||
return <FieldLabel title={props.label} label={props.label} />; | ||
}; |
19 changes: 19 additions & 0 deletions
19
designer/client/src/components/sidePanels/SearchLabeledInput.tsx
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,19 @@ | ||
import { forwardRef, PropsWithChildren } from "react"; | ||
import { FormControl } from "@mui/material"; | ||
import { nodeInput } from "../graph/node-modal/NodeDetailsContent/NodeTableStyled"; | ||
import React from "react"; | ||
|
||
export type SearchLabeledInputProps = PropsWithChildren<{ | ||
name: string; | ||
}>; | ||
|
||
export const SearchLabeledInput = forwardRef<HTMLInputElement, SearchLabeledInputProps>(({ children, ...props }, ref) => { | ||
return ( | ||
<FormControl sx={{ display: "flex", flexDirection: "column", m: 0, gap: 1, width: "100%" }}> | ||
{children} | ||
<input ref={ref} {...props} className={nodeInput} /> | ||
</FormControl> | ||
); | ||
}); | ||
|
||
SearchLabeledInput.displayName = "SearchLabeledInput"; |
Oops, something went wrong.