-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(names, accessibility, collections, user-data): Infrastructure and…
… cli command to customize users' name parts; a11y tweaks to detail page; visual tweaks to collection detail page; bug fix preventing user data service from picking up profile changes
- Loading branch information
1 parent
81ac78a
commit 0d2b2e3
Showing
17 changed files
with
327 additions
and
19 deletions.
There are no files selected for viewing
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
52 changes: 52 additions & 0 deletions
52
...invenio_app_rdm/overridableRegistry/collections/members/components/MembersEmptyResults.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,52 @@ | ||
import React, { Component } from "react"; | ||
import { Button, Header, Icon, Segment } from "semantic-ui-react"; | ||
import { withState } from "react-searchkit"; | ||
import { i18next } from "@translations/invenio_communities/i18next"; | ||
import PropTypes from "prop-types"; | ||
|
||
const MembersEmptyResultsComponent = ({ | ||
resetQuery, | ||
extraContent = null, | ||
queryString, | ||
currentQueryState, | ||
currentResultsState, | ||
}) => { | ||
const isEmptyPageAfterSearch = currentQueryState.page < 0; | ||
const isEmptyPage = | ||
currentQueryState.page === 1 && currentResultsState.data.total === 0; | ||
|
||
return ( | ||
<Segment placeholder textAlign="center"> | ||
<Header icon> | ||
<Icon name={isEmptyPage ? "users" : "search"} /> | ||
{isEmptyPage && i18next.t("This collection has no public members.")} | ||
{isEmptyPageAfterSearch && i18next.t("No matching members found.")} | ||
</Header> | ||
{queryString && ( | ||
<p> | ||
<em> | ||
{i18next.t("Current search")} "{queryString}" | ||
</em> | ||
</p> | ||
)} | ||
{isEmptyPageAfterSearch && ( | ||
<Button primary onClick={() => resetQuery()}> | ||
{i18next.t("Clear query")} | ||
</Button> | ||
)} | ||
{extraContent} | ||
</Segment> | ||
); | ||
}; | ||
|
||
MembersEmptyResultsComponent.propTypes = { | ||
resetQuery: PropTypes.func.isRequired, | ||
queryString: PropTypes.string.isRequired, | ||
currentQueryState: PropTypes.object.isRequired, | ||
currentResultsState: PropTypes.object.isRequired, | ||
extraContent: PropTypes.node, | ||
}; | ||
|
||
const MembersEmptyResults = withState(MembersEmptyResultsComponent); | ||
|
||
export { MembersEmptyResults }; |
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
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 |
---|---|---|
|
@@ -18,4 +18,4 @@ | |
|
||
"""KCWorks customizations to InvenioRDM.""" | ||
|
||
__version__ = "0.3.2-beta5" | ||
__version__ = "0.3.3-beta6" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
function getFullName(nameParts) { | ||
let fullName = [ | ||
getGivenName(nameParts), | ||
nameParts?.family_prefix, | ||
getFamilyName(nameParts), | ||
] | ||
.filter(Boolean) | ||
.join(" "); | ||
if (nameParts?.suffix) { | ||
fullName += ", " + nameParts?.suffix; | ||
} | ||
return fullName; | ||
} | ||
|
||
function getFullNameInverted(nameParts) { | ||
const beforeComma = [ | ||
getFamilyName(nameParts), | ||
] | ||
const afterComma = [ | ||
getGivenName(nameParts), | ||
nameParts?.family_prefix, | ||
] | ||
.filter(Boolean) | ||
.join(" "); | ||
let fullNameInverted = `${beforeComma}, ${afterComma}`; | ||
if (nameParts?.suffix) { | ||
fullNameInverted += ", " + nameParts?.suffix; | ||
} | ||
return fullNameInverted; | ||
} | ||
|
||
function getFamilyName(nameParts) { | ||
return [ | ||
nameParts?.family_prefix_fixed, | ||
nameParts?.parental, | ||
nameParts?.spousal, | ||
nameParts?.family, | ||
nameParts?.last, | ||
] | ||
.filter(Boolean) | ||
.join(" "); | ||
} | ||
|
||
function getGivenName(nameParts) { | ||
return [ | ||
nameParts?.given, | ||
nameParts?.first, | ||
nameParts?.middle, | ||
nameParts?.nickname, | ||
] | ||
.filter(Boolean) | ||
.join(" "); | ||
} | ||
|
||
export { getFullName, getFullNameInverted, getFamilyName, getGivenName }; |
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
Submodule invenio-modular-detail-page
updated
3 files
Submodule invenio-remote-user-data-kcworks
updated
6 files
+5 −1 | CHANGES.md | |
+1 −1 | README.md | |
+1 −1 | VERSION | |
+1 −1 | invenio_remote_user_data_kcworks/__init__.py | |
+28 −78 | invenio_remote_user_data_kcworks/service.py | |
+5 −5 | pyproject.toml |
Oops, something went wrong.