-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
search, my dashboard: highlight verified community #2587
search, my dashboard: highlight verified community #2587
Conversation
3f977b3
to
6863899
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, we (@yashlamba) just have one question about the definition of a branded community. It was asked in another PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed with @jrcastro2. Left a minor comment
...nio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/components/RecordsResultsListItem.js
Outdated
Show resolved
Hide resolved
c034f4c
to
61f1f2b
Compare
The "part of" should not show the "Fancy community". |
3cede6f
to
45bdade
Compare
@@ -117,6 +146,9 @@ class RecordsResultsListItem extends Component { | |||
|
|||
<div className="flex justify-space-between align-items-end"> | |||
<small> | |||
<p> | |||
<b>{printPartOf()}</b> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<b>{printPartOf()}</b> | |
<b>{<PartOfCommunities />}</b> |
@@ -58,6 +59,34 @@ class RecordsResultsListItem extends Component { | |||
const filters = currentQueryState && Object.fromEntries(currentQueryState.filters); | |||
const allVersionsVisible = filters?.allversions; | |||
const numOtherVersions = versions.index - 1; | |||
const communitiesEntries = result.parent?.communities?.entries; | |||
|
|||
const printPartOf = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const printPartOf = () => { | |
const PartOfCommunities = () => { |
<Label | ||
as="a" | ||
href={`/communities/${verifiedCommunity.id}`} | ||
style={{ backgroundColor: verifiedCommunity?.theme?.style?.primaryColor }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that should translate to a className rather that inline style if the community is verified
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to discuss. Created an issue for this #2596
return displayCommunity; | ||
}; | ||
|
||
const verifiedCommunity = displayCommunity(communities); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const verifiedCommunity = displayCommunity(communities); | |
const verifiedCommunity = filterBrandedCommunity(communities); |
assuming from the code branded == verified at the moment.
@@ -42,6 +43,32 @@ export const ComputerTabletUploadsItem = ({ | |||
); | |||
const uniqueViews = _get(result, "stats.all_versions.unique_views", 0); | |||
const uniqueDownloads = _get(result, "stats.all_versions.unique_downloads", 0); | |||
const communitiesEntries = result.parent?.communities?.entries; | |||
const printPartOf = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicate of the above?
@@ -42,6 +43,33 @@ export const MobileUploadsItem = ({ | |||
); | |||
const uniqueViews = _get(result, "stats.all_versions.unique_views", 0); | |||
const uniqueDownloads = _get(result, "stats.all_versions.unique_downloads", 0); | |||
const communitiesEntries = result.parent?.communities?.entries; | |||
const printPartOf = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
45bdade
to
c12d997
Compare
* Add "Part of" to the global search and user dashboard * closes zenodo/zenodo-rdm#716
c12d997
to
45f3356
Compare
General search:
My dashboard:
My dashboard mobile: