Skip to content

Commit

Permalink
Tuning of interface listing view #709
Browse files Browse the repository at this point in the history
  • Loading branch information
ComLock committed Jan 10, 2023
1 parent a1d7fd6 commit c172127
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
15 changes: 10 additions & 5 deletions src/main/resources/assets/react/interfaces/Interfaces.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export function Interfaces({
setShowStopWords,
setShowSynonyms,
showCollections,
showCollectionCount,
// showCollectionCount,
showDelete,
showFields,
showStopWords,
Expand Down Expand Up @@ -127,9 +127,9 @@ export function Interfaces({
<Table.Row>
<Table.HeaderCell>Edit</Table.HeaderCell>
<Table.HeaderCell>Name</Table.HeaderCell>
{showCollectionCount ? <Table.HeaderCell>Collection count</Table.HeaderCell> : null}
{/*showCollectionCount ? <Table.HeaderCell>Collection count</Table.HeaderCell> : null*/}
{showCollections ? <Table.HeaderCell>Collection(s)</Table.HeaderCell> : null}
{showFields ? <Table.HeaderCell>Field(s)</Table.HeaderCell> : null}
{showFields ? <Table.HeaderCell>Boosting</Table.HeaderCell> : null}
{showSynonyms ? <Table.HeaderCell>Synonyms</Table.HeaderCell> : null}
{showStopWords ? <Table.HeaderCell>Stopwords</Table.HeaderCell> : null}
<Table.HeaderCell>Actions</Table.HeaderCell>
Expand All @@ -147,6 +147,9 @@ export function Interfaces({
//stopWordIds = [],
thesaurusNames = []
} = initialValues;
if (_name === 'default') {
return null;
}
//console.debug({_name, index});
return <Table.Row key={index}>
<Table.Cell collapsing>
Expand All @@ -168,7 +171,7 @@ export function Interfaces({
/>
</Table.Cell>
<Table.Cell collapsing disabled={isLoading}>{_name}</Table.Cell>
{showCollectionCount ? <Table.Cell collapsing disabled={isLoading}>{_name === 'default' ? '∞' : collectionNames.length}</Table.Cell> : null}
{/*showCollectionCount ? <Table.Cell collapsing disabled={isLoading}>{_name === 'default' ? '∞' : collectionNames.length}</Table.Cell> : null*/}
{showCollections ? <Table.Cell collapsing disabled={isLoading}>{_name === 'default' ? '∞' : <ul style={{
listStyleType: 'none',
margin: 0,
Expand Down Expand Up @@ -219,7 +222,9 @@ export function Interfaces({
</Button.Group>
</Table.Cell>
</Table.Row>;
})}
})
.filter(x => x) // Remove the default interface
}
</Table.Body>
</Table>
<NewOrEditInterfaceModal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ export function NewOrEditInterfaceModal(props :NewOrEditInterfaceModalProps) {
}}><Icon
name='plus'
/></Button>}/>}
>{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
? <>
<Modal.Header>{header}</Modal.Header>
<NewOrEditInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export function useInterfacesState({
const [stopWordOptions, setStopWordOptions] = React.useState<Array<DropdownItemProps>>([]);
const [thesauriOptions, setThesauriOptions] = React.useState<Array<DropdownItemProps>>([]);

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);
Expand Down Expand Up @@ -500,7 +500,7 @@ export function useInterfacesState({
setShowStopWords,
setShowSynonyms,
showCollections,
showCollectionCount,
// showCollectionCount,
showDelete,
showFields,
showStopWords,
Expand Down

0 comments on commit c172127

Please sign in to comment.