Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show connector/table when referencing a filter #3626

Merged
merged 4 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cypress/support/test_data/all_types.concept.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@
{
"label": "BIG_MULTI_SELECT",
"column": "table.STRING",
"type": "BIG_MULTI_SELECT"
"type": "BIG_MULTI_SELECT",
"allowDropFile": true
},
{
"label": "DURATION_SUM",
Expand Down
76 changes: 76 additions & 0 deletions cypress/support/test_data/multi_connector.concept.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"label": "MultiConnector",
"description": "Concept with multiple connector that each have a filter that allows file drop.",
"type": "TREE",
"connectors": [
{
"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",
"column": "table.STRING",
"type": "BIG_MULTI_SELECT",
"allowDropFile": true
}
],
"selects": []
},
{
"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"
}
],
"filters": [
{
"label": "BIG_MULTI_SELECT",
"column": "table.STRING",
"type": "BIG_MULTI_SELECT",
"allowDropFile": true
}
],
"selects": []
}
],
"children": {
"name": "a1",
"condition": {
"type": "EQUAL",
"values": "A1"
}
},
"selects": [
{
"label": "EXISTS",
"type": "EXISTS"
},
{
"label": "EVENT_DATE_UNION",
"type": "EVENT_DATE_UNION"
},
{
"label": "EVENT_DURATION_SUM",
"type": "EVENT_DURATION_SUM"
}
]
}
7 changes: 6 additions & 1 deletion frontend/src/js/upload-concept-list-modal/DropdownOption.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Icon } from "../icon/FaIcon";

const Container = styled("div")`
display: grid;
grid-template-columns: 110px 30px auto 1fr;
grid-template-columns: 110px 30px auto auto auto auto 1fr;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚗🚗🚗🚗 🇫🇷

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:D

align-items: flex-start;
gap: 0 8px;
padding: 3px 0;
Expand Down Expand Up @@ -43,10 +43,12 @@ const Right = styled("div")`
export const DropdownOption = memo(
({
conceptLabel,
connectorLabel,
filterLabel,
filterIdx,
}: {
conceptLabel: string;
connectorLabel?: string;
filterLabel?: string;
filterIdx?: number;
}) => {
Expand Down Expand Up @@ -74,6 +76,9 @@ export const DropdownOption = memo(
<Text bold={!hasDifferentFilterLabel}>{conceptLabel}</Text>
{hasDifferentFilterLabel && (
<>
<Text>&gt;</Text>
<Text>{connectorLabel}</Text>
<Text>&gt;</Text>
Comment on lines +79 to +81
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<Text>&gt;</Text>
<Text>{connectorLabel}</Text>
<Text>&gt;</Text>
<Text>&gt;&nbsp;{connectorLabel}&nbsp;&gt;</Text>

warum nicht so?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

guter punkt

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

grafik
Das macht leider das Spacing ungleichmäßig

<Text bold>{filterLabel}</Text>
</>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ const useDropdownOptions = () => {
conceptId,
concept,
tableId: table.id,
table,
filter,
filterIdx: idx + 1,
};
Expand Down Expand Up @@ -192,6 +193,7 @@ const useDropdownOptions = () => {
displayLabel: (
<DropdownOption
conceptLabel={opt.concept.label}
connectorLabel={opt.table.label}
filterLabel={opt.filter.label}
filterIdx={filterIdx}
/>
Expand Down
6 changes: 5 additions & 1 deletion scripts/load_e2e_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,12 @@ sleep 3
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"
sleep 3

echo "Creating concepts"
curl --fail -X POST "$admin_api/datasets/dataset1/concepts" -H "$h_ct" -H "$h_auth" -d "@./cypress/support/test_data/all_types.concept.json"
for concept_json in `ls ./cypress/support/test_data/*.concept.json`
do
curl --fail -X POST "$admin_api/datasets/dataset1/concepts" -H "$h_ct" -H "$h_auth" -d "@$concept_json"
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"
Expand Down
Loading