Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
13 changes: 7 additions & 6 deletions src/components/SearchResults/ListView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ const Description = ({ description }) => {

const InfoSection = ({ searchResult }) => {
const infoItems = [
{ label: 'Preferred ID', value: searchResult.preferredId },
{ label: 'ID', value: searchResult.id },
{ label: 'Preferred ID', value: searchResult.ilx.replace('_', ':').toUpperCase() },
{ label: 'IDs', value: searchResult.existing_ids.flatMap(item => item.curie) },
{ label: 'Type', value: searchResult.type },
{ label: 'Score', value: searchResult.score },
{ label: 'Score', value: searchResult.status },
{ label: 'Organization', value: searchResult.organization },
];

Expand All @@ -80,10 +80,11 @@ const InfoSection = ({ searchResult }) => {
}}
>
{infoItems.map(({ label, value }) => (
<Stack key={label} direction="column" gap={1} alignItems="start">
<Stack key={label} direction="column" gap={1} alignItems="start" sx={{width: '100%'}}>
<Typography variant='body1' sx={{ color: gray700, fontWeight: 500 }}>{label}</Typography>
{label === 'ID' ?
<Chip label={value} className='rounded IDchip-outlined' /> : <Typography variant='body2' sx={{ color: gray500 }}>{value}</Typography>
{label === 'IDs'
? (value.map((val, index) => ( <Chip key={`result${index}`} label={val} className='rounded IDchip-outlined' />)))
: <Typography variant='body2' sx={{ color: gray500 }}>{value}</Typography>
}
</Stack>
))}
Expand Down
26 changes: 18 additions & 8 deletions src/components/SingleTermView/OverView/Details.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ const Details = ({loading, data }) => {
window.open(url, '_blank');
};

const processExistingIds = (existingID) => {
if (Array.isArray(existingID)) {
return existingID;
} else if (typeof existingID === 'string') {
return [existingID];
}
return [];
}

if (loading) {
return <Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
<CircularProgress />
Expand All @@ -25,6 +34,7 @@ const Details = ({loading, data }) => {
if (!data) {
return <div>No data available</div>;
}

return (
<>
<Grid container>
Expand All @@ -34,17 +44,17 @@ const Details = ({loading, data }) => {
Synonyms
</Typography>
<Box display="flex" flexWrap="wrap" gap=".5rem">
{data?.synonym &&
{data?.synonym && processExistingIds(data?.synonym).map((syn) => (
<Chip
className="rounded dual-text-chip"
variant="outlined"
key={data?.synonym}
key={syn}
label={
<span>
{data?.synonym} <span>{data?.synonym}</span>
{syn} <span>{syn}</span>
</span>
}
/>
/>))
}
</Box>
</Stack>
Expand All @@ -55,7 +65,7 @@ const Details = ({loading, data }) => {
Preferred ID
</Typography>
<Typography fontSize=".875rem" color={gray500}>
{data?.hasIlxPreferredId}
{data?.id}
</Typography>
</Stack>
</Grid>
Expand All @@ -65,9 +75,9 @@ const Details = ({loading, data }) => {
Existing IDs
</Typography>
<Box display="flex" flexWrap="wrap" gap=".5rem">
{data?.existingID && (
<Chip className="rounded IDchip-outlined" variant="outlined" key={data?.existingID} label={data?.existingID} icon={<OpenInNewOutlinedIcon />} onClick={() => handleChipClick(data?.existingID)} />
)}
{data?.existingID && ( processExistingIds(data?.existingID).map((id) =>
<Chip className="rounded IDchip-outlined" variant="outlined" key={id} label={id} icon={<OpenInNewOutlinedIcon />} onClick={() => handleChipClick(id)} />
))}
</Box>
</Stack>
</Grid>
Expand Down
2 changes: 1 addition & 1 deletion src/components/organizations/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const Organizations = () => {
const [message, setMessage] = useState();

// TODO: change this to be dynamic when we get the response from api call
const groupname = "aigul"
const groupname = "dariodippi"

const fetchOrganizations = async() => {
setLoading(true);
Expand Down
2 changes: 1 addition & 1 deletion src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const API_CONFIG = {
GET_ENDPOINTS_ILX: "/api/real/endpoints-ilx",
PATCH_ENDPOINTS_ILX: "/api/real/patch-endpoints-ilx",
SIGNIN: "/u/ops/user-login",
ORCID_SIGNIN: "/u/ops/orcid-new",
ORCID_SIGNIN: "/u/ops/orcid-login",
NEWUSER_ILX: "/u/ops/user-new",
NEWUSER_ORCID: "/u/ops/orcid-new",
CREATE_NEW_ORGANIZATION: "/priv/org-new",
Expand Down