Skip to content
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

UI/UX: improve display of ROR information in select field #1203

Merged
merged 2 commits into from
Oct 31, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import _isEmpty from "lodash/isEmpty";
import _isNull from "lodash/isNull";
import _isNumber from "lodash/isNumber";
import _isObject from "lodash/isObject";
import _map from "lodash/map";
import _mapValues from "lodash/mapValues";
import _pick from "lodash/pick";
import _pickBy from "lodash/pickBy";
Expand All @@ -33,6 +32,7 @@ import {
SelectField,
TextField,
TextAreaField,
AffiliationsSuggestions,
carlinmack marked this conversation as resolved.
Show resolved Hide resolved
} from "react-invenio-forms";
import { Button, Form, Grid, Icon, Message, Divider } from "semantic-ui-react";
import * as Yup from "yup";
Expand Down Expand Up @@ -469,25 +469,9 @@ class CommunityProfileForm extends Component {
"metadata.organizations",
[]
)}
serializeSuggestions={(organizations) =>
_map(organizations, (organization) => {
// eslint-disable-next-line no-prototype-builtins
const isKnownOrg = this.knownOrganizations.hasOwnProperty(
organization.name
);
if (!isKnownOrg) {
this.knownOrganizations = {
...this.knownOrganizations,
[organization.name]: organization.id,
};
}
return {
text: organization.name,
value: organization.name,
key: organization.name,
};
})
}
serializeSuggestions={(organizations) => {
return AffiliationsSuggestions(organizations, true);
}}
label={
<FieldLabel
htmlFor="metadata.organizations"
Expand Down
Loading