{hasResolvedItems && (
<>
@@ -588,7 +589,7 @@ const UploadConceptListModal = ({
label={t("uploadConceptListModal.includeUnresolved")}
/>
)}
-
+
{mustIncludeUnresolved
? t("uploadConceptListModal.insertRegardless")
: t("uploadConceptListModal.insertNode")}
From 94cbd57cba98bb89af023bcd244a24769c18be4b Mon Sep 17 00:00:00 2001
From: Max Thonagel <12283268+thoniTUB@users.noreply.github.com>
Date: Fri, 29 Nov 2024 12:33:02 +0100
Subject: [PATCH 3/4] adds e2e test for filter value resolve
---
cypress/e2e/frontend/test_1_runQuery.cy.js | 45 +++++++++++++++++--
.../test_data/all_types.table copy.json | 41 +++++++++++++++++
.../test_data/filter_value_reference_list.txt | 3 ++
.../test_data/multi_connector.concept.json | 32 +++----------
cypress/support/test_data/table1.csv | 2 +
cypress/support/test_data/table1.import.json | 31 +++++++++++++
cypress/support/test_data/table1.table.json | 13 ++++++
scripts/load_e2e_data.sh | 15 +++++--
8 files changed, 151 insertions(+), 31 deletions(-)
create mode 100644 cypress/support/test_data/all_types.table copy.json
create mode 100644 cypress/support/test_data/filter_value_reference_list.txt
create mode 100644 cypress/support/test_data/table1.csv
create mode 100644 cypress/support/test_data/table1.import.json
create mode 100644 cypress/support/test_data/table1.table.json
diff --git a/cypress/e2e/frontend/test_1_runQuery.cy.js b/cypress/e2e/frontend/test_1_runQuery.cy.js
index 76e8039095..d20a199c3e 100644
--- a/cypress/e2e/frontend/test_1_runQuery.cy.js
+++ b/cypress/e2e/frontend/test_1_runQuery.cy.js
@@ -12,7 +12,7 @@ describe("Run query", () => {
visitWithToken(USER_TOKEN_WITH_PERMISSIONS);
});
- it.skip("Can execute query and see it in the queries tab", () => {
+ it("Can execute query and see it in the queries tab", () => {
cy.get('[data-test-id="right-pane-container"] >div:visible').as("queryEditor");
// Drag concept to editor
@@ -42,7 +42,7 @@ describe("Run query", () => {
cy.get("@queryEditor").contains("Ergebnisse");
});
- it.skip("Can see the executed query in the queries tab", () => {
+ it("Can see the executed query in the queries tab", () => {
cy.get('[data-test-id="left-pane"]').contains("Anfragen").click();
cy.get('[data-test-id="left-pane-container"]').as("leftPaneContainer");
@@ -51,7 +51,7 @@ describe("Run query", () => {
cy.get("@leftPaneContainer").contains("Concept1");
});
- it.skip("Can delete the query", () => {
+ it("Can delete the query", () => {
cy.get('[data-test-id="left-pane"]').contains("Anfragen").click();
cy.get('[data-test-id="left-pane-container"]').as("leftPaneContainer");
@@ -106,4 +106,43 @@ describe("Reference list", () => {
cy.get('@queryEditor').find('[data-test-id="query-group"]').contains("My List")
})
+ it("Use reference list to resolve filter values", () =>{
+ cy.get('[data-test-id="right-pane-container"] >div:visible').as("queryEditor");
+
+ // We need force here because the input is invisible
+ cy.get("@queryEditor").get('input[type=file]').selectFile('cypress/support/test_data/filter_value_reference_list.txt', {"force": true})
+ cy.get('@queryEditor')
+ .find('[data-test-id="uploadConceptListModal"]')
+ .as("uploadConceptListModal")
+ .find('[data-test-id="selection-dropdown"]').click()
+
+ // Choose a concept
+ cy.get('@uploadConceptListModal')
+ .find('[data-test-id="select-options"]').contains("connector1").first().click()
+
+ // We expect that one value 'b' cannot be resolved
+ cy.get('@uploadConceptListModal').contains("1 Wert nicht aufgelöst")
+ cy.get('@uploadConceptListModal').find('[data-test-id="unresolvable-list"]').contains('b')
+ // 'a1' can be resolved
+ cy.get('@uploadConceptListModal').contains("2 Werte aufgelöst.")
+
+ // Change list name
+ cy.get('@uploadConceptListModal').find('[data-test-id="insert-form"]').as("insert-form")
+ cy.get('@insert-form').find('input[type=text]').should('have.value', 'filter_value_reference_list')
+ cy.get('@insert-form').find('button[type=button]').click()
+ cy.get('@insert-form').find('input[type=text]').type("My List")
+
+ // Insert elements
+ cy.get('@uploadConceptListModal').find('[data-test-id="insert"]').click()
+
+ // Check that node was inserted in query editor
+ cy.get('@queryEditor').find('[data-test-id="query-group"]').contains("MultiConnector").click()
+
+ // Check that filter values are set corretly
+ cy.get("@queryEditor")
+ .find('[data-test-id="table-filter-dataset1.multiconnector.connector1.big_multi_select"]').as("multi_select")
+ cy.get("@multi_select").scrollIntoView()
+ cy.get("@multi_select").find('p').eq(0).contains('a')
+ cy.get("@multi_select").find('p').eq(1).contains('abc')
+ })
})
\ No newline at end of file
diff --git a/cypress/support/test_data/all_types.table copy.json b/cypress/support/test_data/all_types.table copy.json
new file mode 100644
index 0000000000..8e994da651
--- /dev/null
+++ b/cypress/support/test_data/all_types.table copy.json
@@ -0,0 +1,41 @@
+{
+ "name": "table",
+ "columns": [
+ {
+ "name": "id",
+ "type": "STRING"
+ },
+ {
+ "name": "STRING",
+ "type": "STRING"
+ },
+ {
+ "name": "INTEGER",
+ "type": "INTEGER"
+ },
+ {
+ "name": "BOOLEAN",
+ "type": "BOOLEAN"
+ },
+ {
+ "name": "REAL",
+ "type": "REAL"
+ },
+ {
+ "name": "DECIMAL",
+ "type": "DECIMAL"
+ },
+ {
+ "name": "MONEY",
+ "type": "MONEY"
+ },
+ {
+ "name": "DATE",
+ "type": "DATE"
+ },
+ {
+ "name": "DATE_RANGE",
+ "type": "DATE_RANGE"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/cypress/support/test_data/filter_value_reference_list.txt b/cypress/support/test_data/filter_value_reference_list.txt
new file mode 100644
index 0000000000..aa1727a649
--- /dev/null
+++ b/cypress/support/test_data/filter_value_reference_list.txt
@@ -0,0 +1,3 @@
+a
+abc
+b
diff --git a/cypress/support/test_data/multi_connector.concept.json b/cypress/support/test_data/multi_connector.concept.json
index e6297081f0..d9d22dec0a 100644
--- a/cypress/support/test_data/multi_connector.concept.json
+++ b/cypress/support/test_data/multi_connector.concept.json
@@ -6,17 +6,6 @@
{
"name": "connector0",
"column": "table.STRING",
- "validityDatesDescription": "Tooltip for the available validity dates",
- "validityDates": [
- {
- "label": "DATE",
- "column": "table.DATE"
- },
- {
- "label": "DATE_RANGE",
- "column": "table.DATE_RANGE"
- }
- ],
"filters": [
{
"label": "BIG_MULTI_SELECT",
@@ -29,24 +18,17 @@
},
{
"name": "connector1",
- "column": "table.STRING",
- "validityDatesDescription": "Tooltip for the available validity dates",
- "validityDates": [
- {
- "label": "DATE",
- "column": "table.DATE"
- },
- {
- "label": "DATE_RANGE",
- "column": "table.DATE_RANGE"
- }
- ],
+ "column": "table1.STRING",
"filters": [
{
"label": "BIG_MULTI_SELECT",
- "column": "table.STRING",
+ "column": "table1.STRING",
"type": "BIG_MULTI_SELECT",
- "allowDropFile": true
+ "allowDropFile": true,
+ "labels": {
+ "Value A": "a",
+ "Value A1": "a1"
+ }
}
],
"selects": []
diff --git a/cypress/support/test_data/table1.csv b/cypress/support/test_data/table1.csv
new file mode 100644
index 0000000000..f2acb0ce6b
--- /dev/null
+++ b/cypress/support/test_data/table1.csv
@@ -0,0 +1,2 @@
+id,STRING
+1,abc
\ No newline at end of file
diff --git a/cypress/support/test_data/table1.import.json b/cypress/support/test_data/table1.import.json
new file mode 100644
index 0000000000..281aac393e
--- /dev/null
+++ b/cypress/support/test_data/table1.import.json
@@ -0,0 +1,31 @@
+{
+ "inputs": [
+ {
+ "output": [
+ {
+ "inputColumn": "id",
+ "name": "id",
+ "inputType": "STRING",
+ "operation": "COPY"
+ },
+ {
+ "inputColumn": "STRING",
+ "name": "STRING",
+ "inputType": "STRING",
+ "operation": "COPY"
+ }
+ ],
+ "primary": {
+ "inputColumn": "id",
+ "inputType": "STRING",
+ "name": "id",
+ "operation": "COPY",
+ "required": true
+ },
+ "sourceFile": "table1.csv"
+ }
+ ],
+ "label": "Table 1",
+ "name": "table1",
+ "table": "table1"
+}
\ No newline at end of file
diff --git a/cypress/support/test_data/table1.table.json b/cypress/support/test_data/table1.table.json
new file mode 100644
index 0000000000..8175103b5a
--- /dev/null
+++ b/cypress/support/test_data/table1.table.json
@@ -0,0 +1,13 @@
+{
+ "name": "table1",
+ "columns": [
+ {
+ "name": "id",
+ "type": "STRING"
+ },
+ {
+ "name": "STRING",
+ "type": "STRING"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/scripts/load_e2e_data.sh b/scripts/load_e2e_data.sh
index 3347a84709..7ab6c404d0 100755
--- a/scripts/load_e2e_data.sh
+++ b/scripts/load_e2e_data.sh
@@ -14,7 +14,7 @@ until $(curl --output /dev/null --silent --head -H "$h_auth" --fail $admin_api/u
done
echo "Preprocess test data"
-java -jar ./executable/target/executable*.jar preprocess --in cypress/support/test_data/ --out cypress/support/test_data/ --desc cypress/support/test_data/data.import.json
+java -jar ./executable/target/executable*.jar preprocess --in cypress/support/test_data/ --out cypress/support/test_data/ --desc cypress/support/test_data/*.import.json
# Create users
echo "Creating users and permissions"
@@ -35,7 +35,10 @@ sleep 3
# TODO secondary ID
echo "Creating tables"
-curl --fail -X POST "$admin_api/datasets/dataset1/tables" -H "$h_ct" -H "$h_auth" -d "@./cypress/support/test_data/all_types.table.json"
+for table_json in `ls ./cypress/support/test_data/*.table.json`
+do
+ curl --fail -X POST "$admin_api/datasets/dataset1/tables" -H "$h_ct" -H "$h_auth" -d "@$table_json"
+done
sleep 3
echo "Creating concepts"
@@ -45,6 +48,12 @@ do
done
echo "Upload test data"
-curl --fail -X POST --compressed "$admin_api/datasets/dataset1/cqpp" -H "content-type:application/octet-stream" -H "$h_auth" --data-binary "@./cypress/support/test_data/table.cqpp"
+for cqpp in `ls ./cypress/support/test_data/*.cqpp`
+do
+ curl --fail -X POST --compressed "$admin_api/datasets/dataset1/cqpp" -H "content-type:application/octet-stream" -H "$h_auth" --data-binary "@$cqpp"
+done
+
+echo "Init Matching Stats and Search"
+curl --fail -X POST "$admin_api/datasets/dataset1/update-matching-stats" -H "$h_ct" -H "$h_auth"
echo "Done loading data"
From 04fb3228d177606290e515b660af9a53249ed814 Mon Sep 17 00:00:00 2001
From: Max Thonagel <12283268+thoniTUB@users.noreply.github.com>
Date: Fri, 29 Nov 2024 12:43:20 +0100
Subject: [PATCH 4/4] prettier and revert '>' in single text element
---
.../src/js/scrollable-list/ScrollableList.tsx | 15 ++++++++++++---
.../js/ui-components/InputSelect/InputSelect.tsx | 2 +-
.../UploadConceptListModal.tsx | 6 +++++-
3 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/frontend/src/js/scrollable-list/ScrollableList.tsx b/frontend/src/js/scrollable-list/ScrollableList.tsx
index 567058ab88..f8e35c6828 100644
--- a/frontend/src/js/scrollable-list/ScrollableList.tsx
+++ b/frontend/src/js/scrollable-list/ScrollableList.tsx
@@ -7,7 +7,7 @@ interface PropsType {
items: ReactNode[];
maxVisibleItems: number;
fullWidth?: boolean;
- dataTestId?: string
+ dataTestId?: string;
}
// With the number of visible items specified here,
@@ -44,7 +44,12 @@ const Item = styled("div")`
font-size: ${({ theme }) => theme.font.sm};
`;
-const ScrollableList = ({ items, maxVisibleItems, fullWidth, dataTestId }: PropsType) => {
+const ScrollableList = ({
+ items,
+ maxVisibleItems,
+ fullWidth,
+ dataTestId,
+}: PropsType) => {
const renderItem = (index: number, key: string | number) => {
return (
-
@@ -54,7 +59,11 @@ const ScrollableList = ({ items, maxVisibleItems, fullWidth, dataTestId }: Props
};
return (
-
+
diff --git a/frontend/src/js/upload-concept-list-modal/UploadConceptListModal.tsx b/frontend/src/js/upload-concept-list-modal/UploadConceptListModal.tsx
index 36f78f1b88..9dba7a16c4 100644
--- a/frontend/src/js/upload-concept-list-modal/UploadConceptListModal.tsx
+++ b/frontend/src/js/upload-concept-list-modal/UploadConceptListModal.tsx
@@ -511,7 +511,11 @@ const UploadConceptListModal = ({
);
return (
-
+