Skip to content

Commit

Permalink
Merge pull request #1615 from alliance-genome/release/v0.34.1
Browse files Browse the repository at this point in the history
Release/v0.34.1
  • Loading branch information
VarunReddy1111 authored Jul 16, 2024
2 parents 6894975 + 46a6860 commit 7e9d3be
Showing 1 changed file with 2 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ import { GenericDataTable } from '../../components/GenericDataTable/GenericDataT
import { useMutation, useQuery } from '@tanstack/react-query';
import { Toast } from 'primereact/toast';

import { Tooltip } from 'primereact/tooltip';
import { EllipsisTableCell } from '../../components/EllipsisTableCell';
import { ListTableCell } from '../../components/ListTableCell';
import { useControlledVocabularyService } from '../../service/useControlledVocabularyService';
import { VocabularyService } from '../../service/VocabularyService';
import { TrueFalseDropdown } from '../../components/TrueFalseDropDownSelector';
Expand All @@ -21,6 +18,7 @@ import { useGetTableData } from '../../service/useGetTableData';
import { useGetUserSettings } from '../../service/useGetUserSettings';
import { SearchService } from '../../service/SearchService';
import { setNewEntity } from '../../utils/utils';
import { StringListTemplate } from '../../components/Templates/StringListTemplate';

export const ControlledVocabularyTable = () => {
const newTermReducer = (state, action) => {
Expand Down Expand Up @@ -216,33 +214,6 @@ export const ControlledVocabularyTable = () => {
}
};

const synonymsBodyTemplate = (rowData) => {
if (rowData?.synonyms && rowData.synonyms.length > 0) {
const sortedSynonyms = rowData.synonyms.sort();
const listTemplate = (synonym) => {
return (
<EllipsisTableCell>
<div dangerouslySetInnerHTML={{ __html: synonym }} />
</EllipsisTableCell>
);
};
return (
<>
<div className={`a${rowData.id}${rowData.synonyms[0]}`}>
<ListTableCell template={listTemplate} listData={sortedSynonyms} />
</div>
<Tooltip
target={`.a${rowData.id}${rowData.synonyms[0]}`}
style={{ width: '450px', maxWidth: '450px' }}
position="left"
>
<ListTableCell template={listTemplate} listData={sortedSynonyms} />
</Tooltip>
</>
);
}
};

const columns = [
{
field: 'id',
Expand Down Expand Up @@ -270,7 +241,7 @@ export const ControlledVocabularyTable = () => {
header: 'Synonyms',
sortable: true,
filterConfig: FILTER_CONFIGS.synonymsFilterConfig,
body: synonymsBodyTemplate,
body: (rowData) => <StringListTemplate list={rowData.synonyms} />,
},
{
field: 'vocabulary.name',
Expand Down

0 comments on commit 7e9d3be

Please sign in to comment.