From 34fa388d790c6ff8bcb72aa185ebf4ef3f27597e Mon Sep 17 00:00:00 2001 From: Christian Westgaard Date: Tue, 10 Jan 2023 10:03:28 +0100 Subject: [PATCH] Tuning of interface listing view #709 --- .../assets/react/interfaces/Interfaces.tsx | 15 ++++++++++----- .../react/interfaces/NewOrEditInterfaceModal.tsx | 4 +++- .../assets/react/interfaces/useInterfacesState.ts | 4 ++-- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/main/resources/assets/react/interfaces/Interfaces.tsx b/src/main/resources/assets/react/interfaces/Interfaces.tsx index dcbfd7f1..8090a206 100644 --- a/src/main/resources/assets/react/interfaces/Interfaces.tsx +++ b/src/main/resources/assets/react/interfaces/Interfaces.tsx @@ -63,7 +63,7 @@ export function Interfaces({ setShowStopWords, setShowSynonyms, showCollections, - showCollectionCount, + // showCollectionCount, showDelete, showFields, showStopWords, @@ -127,9 +127,9 @@ export function Interfaces({ Edit Name - {showCollectionCount ? Collection count : null} + {/*showCollectionCount ? Collection count : null*/} {showCollections ? Collection(s) : null} - {showFields ? Field(s) : null} + {showFields ? Boosting : null} {showSynonyms ? Synonyms : null} {showStopWords ? Stopwords : null} Actions @@ -147,6 +147,9 @@ export function Interfaces({ //stopWordIds = [], thesaurusNames = [] } = initialValues; + if (_name === 'default') { + return null; + } //console.debug({_name, index}); return @@ -168,7 +171,7 @@ export function Interfaces({ /> {_name} - {showCollectionCount ? {_name === 'default' ? '∞' : collectionNames.length} : null} + {/*showCollectionCount ? {_name === 'default' ? '∞' : collectionNames.length} : null*/} {showCollections ? {_name === 'default' ? '∞' :
    ; - })} + }) + .filter(x => x) // Remove the default interface + } }/>} - >{licenseValid || total <= 1 // This means it will be allowed to create interface number 2, but not number 3 + >{licenseValid + || (!_id && total <= 1) // Allowed to create interface number 2, but not number 3 + || (_id && total <= 2) // Allowed to edit interface number 2, but not number 3 ? <> {header} >([]); const [thesauriOptions, setThesauriOptions] = React.useState>([]); - const [showCollectionCount/*, setShowCollectionCount*/] = React.useState(true); + // const [showCollectionCount/*, setShowCollectionCount*/] = React.useState(true); const [showCollections, setShowCollections] = React.useState(true); const [showFields, setShowFields] = React.useState(true); const [showSynonyms, setShowSynonyms] = React.useState(true); @@ -500,7 +500,7 @@ export function useInterfacesState({ setShowStopWords, setShowSynonyms, showCollections, - showCollectionCount, + // showCollectionCount, showDelete, showFields, showStopWords,