From ca2e8f59edd6ff9d2a4eb5e2fa9ad6946febae33 Mon Sep 17 00:00:00 2001 From: PascalDR Date: Thu, 16 Jan 2025 16:07:27 +0100 Subject: [PATCH 1/8] fix: table border --- src/App.css | 5 +++++ src/atoms/InfoView.tsx | 10 +--------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/App.css b/src/App.css index a099d24..72e1606 100644 --- a/src/App.css +++ b/src/App.css @@ -69,3 +69,8 @@ pre { overflow-y: scroll !important; height: 20rem !important; } + +table, th, td { + border: 0.5px solid hsl(0deg, 0%, 64%) !important; + border-collapse: collapse !important; +} \ No newline at end of file diff --git a/src/atoms/InfoView.tsx b/src/atoms/InfoView.tsx index 1d5e4b0..c9d3bef 100644 --- a/src/atoms/InfoView.tsx +++ b/src/atoms/InfoView.tsx @@ -11,18 +11,15 @@ export const InfoView = ({ id, infos }: InfoViewProps) => { {} - + {info[1]} @@ -32,11 +29,6 @@ export const InfoView = ({ id, infos }: InfoViewProps) => {
{infos.map(toRow)}
From 175927e2d5403862079fa56c57ad2fa7b40acb14 Mon Sep 17 00:00:00 2001 From: PascalDR Date: Thu, 16 Jan 2025 16:55:40 +0100 Subject: [PATCH 2/8] fix: items dynamic pagination --- src/atoms/PaginatedList.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/atoms/PaginatedList.tsx b/src/atoms/PaginatedList.tsx index 3bcb99a..064bce0 100644 --- a/src/atoms/PaginatedList.tsx +++ b/src/atoms/PaginatedList.tsx @@ -44,7 +44,7 @@ export const PaginatedListAtom = ({ useEffect( () => setCurrentItemsBySearch(searchValue, itemOffset), - [searchValue, itemOffset], + [searchValue, itemOffset, items], ); return ( From 8af6d56ff5735378572872c59b928b8267c451e5 Mon Sep 17 00:00:00 2001 From: PascalDR Date: Thu, 16 Jan 2025 16:56:51 +0100 Subject: [PATCH 3/8] choore: lint --- src/App.css | 6 ++++-- src/atoms/InfoView.tsx | 13 +++---------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/App.css b/src/App.css index 72e1606..5c5be37 100644 --- a/src/App.css +++ b/src/App.css @@ -70,7 +70,9 @@ pre { height: 20rem !important; } -table, th, td { +table, +th, +td { border: 0.5px solid hsl(0deg, 0%, 64%) !important; border-collapse: collapse !important; -} \ No newline at end of file +} diff --git a/src/atoms/InfoView.tsx b/src/atoms/InfoView.tsx index c9d3bef..9e93980 100644 --- a/src/atoms/InfoView.tsx +++ b/src/atoms/InfoView.tsx @@ -8,10 +8,7 @@ export interface InfoViewProps { export const InfoView = ({ id, infos }: InfoViewProps) => { const toRow = (info: (string | number)[], index: number) => ( - + { > {} - - {info[1]} - + {info[1]} ); return (
- +
{infos.map(toRow)}
From 5fab8e9b1c323ce05e6d2f621ee7b095cff9521d Mon Sep 17 00:00:00 2001 From: PascalDR Date: Thu, 16 Jan 2025 17:12:28 +0100 Subject: [PATCH 4/8] feat: filter all discovered toggle --- src/assets/localization/en.json | 3 +- src/assets/localization/it.json | 3 +- src/atoms/NodeMenu.tsx | 59 +++++++++++++++++++++++---------- 3 files changed, 45 insertions(+), 20 deletions(-) diff --git a/src/assets/localization/en.json b/src/assets/localization/en.json index 4ef3636..bc5f127 100644 --- a/src/assets/localization/en.json +++ b/src/assets/localization/en.json @@ -53,5 +53,6 @@ "static_dynamic_title": "View Type", "static_dynamic_choice_message": "Choose dynamic if you want to keep only the necessary information recalculating it at the next import, otherwise choose static to keep all the information without recalculating it during the import.", "dynamic": "Dynamic", - "static": "Static" + "static": "Static", + "filter_discovered": "Filter discovered entities" } diff --git a/src/assets/localization/it.json b/src/assets/localization/it.json index fb77fea..eea758d 100644 --- a/src/assets/localization/it.json +++ b/src/assets/localization/it.json @@ -53,5 +53,6 @@ "static_dynamic_title": "Tipo di View", "static_dynamic_choice_message": "Secgli il tipo dinamico se vuoi mantenere solo le informazioni necessarie ricalcolandola al prossimo import, altrimenti scegli statico per mantenere tutte le informazioni senza ricalcolarle in fase di import.", "dynamic": "Dinamico", - "static": "Statico" + "static": "Statico", + "filter_discovered": "Filtra le entità scoperte" } diff --git a/src/atoms/NodeMenu.tsx b/src/atoms/NodeMenu.tsx index 1c6ec2e..b7c5652 100644 --- a/src/atoms/NodeMenu.tsx +++ b/src/atoms/NodeMenu.tsx @@ -9,6 +9,8 @@ import { SubListItemsRenderer } from "./SubListItemRender"; import { useEffect, useState } from "react"; import { WarningModalAtom } from "./WarningModal"; import { showModal, fmtValidity } from "../lib/utils"; +import { FormattedMessage } from "react-intl"; +import style from "../css/ContextMenu.module.css"; export interface ContextMenuProps { data: GraphNode; @@ -29,6 +31,8 @@ export const NodeMenuAtom = ({ const [discoveringList, setDiscoveringList] = useState([]); const [discovering, setDiscovering] = useState(false); const [errorModalText, setErrorModalText] = useState(new Error()); + const [filterDiscovered, setFilterDiscovered] = useState(false); + const [immDependants, setImmDependants] = useState(data.info.immDependants || []); const [errorDetails, setErrorDetails] = useState( undefined, ); @@ -76,8 +80,6 @@ export const NodeMenuAtom = ({ if (result.failed.length === 0) return; - console.error(`Failed to discover entities`, result.failed); - addToFailedList(result.failed.map((f) => f.entity)); setErrorModalText( new Error(`Failed to discover ${result.failed.length} entities`), @@ -106,6 +108,14 @@ export const NodeMenuAtom = ({ showModal("warning-modal"); }, [discoveringList]); + useEffect(() => { + setImmDependants( + filterDiscovered ? + data.info.immDependants.filter((dep) => !isDiscovered(dep)) : + data.info.immDependants + ); + }, [filterDiscovered]); + const displayedInfo = [ ["federation_entity_type_label", data.info.type], ["immediate_subordinate_count_label", data.info.immDependants.length], @@ -149,26 +159,39 @@ export const NodeMenuAtom = ({ /> } /> - {data.info.immDependants.length > 0 && ( + {immDependants.length > 0 && ( + <> +
+ +
+ + } /> )} From 8f5597dac0f8eedca8e97f436e4537dceb1d5ffe Mon Sep 17 00:00:00 2001 From: PascalDR Date: Thu, 16 Jan 2025 17:13:17 +0100 Subject: [PATCH 5/8] chore: lint --- src/atoms/NodeMenu.tsx | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/atoms/NodeMenu.tsx b/src/atoms/NodeMenu.tsx index b7c5652..bd28cb9 100644 --- a/src/atoms/NodeMenu.tsx +++ b/src/atoms/NodeMenu.tsx @@ -32,7 +32,9 @@ export const NodeMenuAtom = ({ const [discovering, setDiscovering] = useState(false); const [errorModalText, setErrorModalText] = useState(new Error()); const [filterDiscovered, setFilterDiscovered] = useState(false); - const [immDependants, setImmDependants] = useState(data.info.immDependants || []); + const [immDependants, setImmDependants] = useState( + data.info.immDependants || [], + ); const [errorDetails, setErrorDetails] = useState( undefined, ); @@ -110,9 +112,9 @@ export const NodeMenuAtom = ({ useEffect(() => { setImmDependants( - filterDiscovered ? - data.info.immDependants.filter((dep) => !isDiscovered(dep)) : - data.info.immDependants + filterDiscovered + ? data.info.immDependants.filter((dep) => !isDiscovered(dep)) + : data.info.immDependants, ); }, [filterDiscovered]); @@ -165,8 +167,14 @@ export const NodeMenuAtom = ({ labelId="subordinate_list" hiddenElement={ <> -
-
+
+ : {currentPage + 1} / {pageCount} +
); }; From 477bc324b9257cc96ff470ba5c0e2851027eb172 Mon Sep 17 00:00:00 2001 From: PascalDR Date: Thu, 16 Jan 2025 17:49:16 +0100 Subject: [PATCH 8/8] fix: input style --- src/atoms/UrlInput.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/atoms/UrlInput.tsx b/src/atoms/UrlInput.tsx index e5f07b6..7272455 100644 --- a/src/atoms/UrlInput.tsx +++ b/src/atoms/UrlInput.tsx @@ -5,6 +5,7 @@ import { handleCollapseVisibility, cleanInput } from "../lib/utils"; import { getTranslations } from "../lib/translations"; import { handleKeyDownEvent } from "../lib/utils"; import { isValidUrl } from "../lib/utils"; +import style from "../css/ContextMenu.module.css"; export const UrlInputAtom = () => { const [inputValue, setInputValue] = useState(""); @@ -43,7 +44,7 @@ export const UrlInputAtom = () => {
{ : "insert_anchor_url_label" ] } - style={{ fontSize: "14px" }} />