Skip to content

Commit

Permalink
[frontend] increase and sort values in bulk update lists (#6326)
Browse files Browse the repository at this point in the history
  • Loading branch information
Archidoit committed Mar 13, 2024
1 parent 6101d43 commit 7e31707
Showing 1 changed file with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -821,17 +821,15 @@ class ToolBar extends Component {
})
.toPromise()
.then((data) => {
const externalReferences = R.pipe(
R.pathOr([], ['externalReferences', 'edges']),
R.sortWith([R.ascend(R.path(['node', 'source_name']))]),
R.map((n) => ({
const externalReferences = (data?.externalReferences?.edges ?? [])
.map((n) => ({
label: `[${n.node.source_name}] ${truncate(
n.node.description || n.node.external_id,
150,
)} ${n.node.url && `(${n.node.url})`}`,
value: n.node.id,
})),
)(data);
}))
.sort((a, b) => a.label.localeCompare(b.label));
this.setState({
externalReferences: R.union(
this.state.externalReferences,
Expand All @@ -853,18 +851,18 @@ class ToolBar extends Component {
fetchQuery(identitySearchIdentitiesSearchQuery, {
types: ['Individual', 'Organization', 'System'],
search: newValue && newValue.length > 0 ? newValue : '',
first: 10,
first: 100,
})
.toPromise()
.then((data) => {
const identities = R.pipe(
R.pathOr([], ['identities', 'edges']),
R.map((n) => ({
const identities = (data?.identities?.edges ?? [])
.map((n) => ({
label: n.node.name,
value: n.node.id,
type: n.node.entity_type,
})),
)(data);
}))
.sort((a, b) => a.label.localeCompare(b.label))
.sort((a, b) => a.type.localeCompare(b.type));
this.setState({
identities: R.union(this.state.identities, identities),
});
Expand All @@ -881,7 +879,7 @@ class ToolBar extends Component {
);
this.setState({ actionsInputs });
fetchQuery(statusFieldStatusesSearchQuery, {
first: 10,
first: 100,
filters: {
mode: 'and',
filterGroups: [],
Expand Down

0 comments on commit 7e31707

Please sign in to comment.