-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* closes #193
- Loading branch information
Showing
6 changed files
with
121 additions
and
2 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
assets/js/components/deposit/overrides/CreatibutorsRemoteSelectItem.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// This file is part of CDS RDM | ||
// Copyright (C) 2024 CERN. | ||
// | ||
// CDS RDM is free software; you can redistribute it and/or modify it | ||
// under the terms of the MIT License; see LICENSE file for more details. | ||
|
||
import _get from "lodash/get"; | ||
import _truncate from "lodash/truncate"; | ||
import _upperCase from "lodash/upperCase"; | ||
import React from "react"; | ||
import PropTypes from "prop-types"; | ||
import { Header, Image } from "semantic-ui-react"; | ||
|
||
export const CDSCreatibutorsRemoteSelectItem = ({ creatibutor, isOrganization, idString, affNames }) => { | ||
|
||
if (creatibutor.props?.is_cern) { | ||
const cmp = ( | ||
<span key={creatibutor.props.email}> | ||
<Image | ||
src="/static/images/CERN-logo.svg" | ||
className="inline-id-icon ml-5 mr-5" | ||
verticalAlign="middle" | ||
/> | ||
{creatibutor.props.email} | ||
</span> | ||
) | ||
idString.push(cmp) | ||
} | ||
|
||
return ( | ||
<Header> | ||
{creatibutor.name} {idString.length ? <>({idString})</> : null} | ||
<Header.Subheader> | ||
{isOrganization ? creatibutor.acronym : affNames} | ||
</Header.Subheader> | ||
</Header> | ||
); | ||
}; | ||
|
||
CDSCreatibutorsRemoteSelectItem.propTypes = { | ||
creatibutor: PropTypes.object.isRequired, | ||
isOrganization: PropTypes.bool.isRequired, | ||
idString: PropTypes.array, | ||
affNames: PropTypes.string, | ||
}; | ||
|
||
CDSCreatibutorsRemoteSelectItem.defaultProps = { | ||
idString: [], | ||
affNames: "", | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters