Skip to content

Commit

Permalink
#45: Ensure that assets and relations lists are sorted correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
kenmeacham committed Jan 23, 2025
1 parent c626091 commit 03a645e
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class AddRelationModal extends React.Component {
onChange={this.handleAssetUpdate}
ref="select-to">
<option key={0} disabled selected value="">Select asset...</option>
{self.state.selectableAssets.sort((assetA, assetB) => assetA["label"] > assetB["label"]).map((asset, index) => {
{self.state.selectableAssets.sort((assetA, assetB) => assetA["label"].localeCompare(assetB["label"])).map((asset, index) => {
return <option key={index + 1} value={asset["id"]}>
{asset["label"]}
</option>
Expand All @@ -135,7 +135,7 @@ class AddRelationModal extends React.Component {
value={self.state.selectedAsset}
ref="select-from">
<option key={0} disabled selected value="">Select asset...</option>
{self.state.selectableAssets.sort((assetA, assetB) => assetA["label"] > assetB["label"]).map((asset, index) => {
{self.state.selectableAssets.sort((assetA, assetB) => assetA["label"].localeCompare(assetB["label"])).map((asset, index) => {
return <option key={index + 1} value={asset["id"]}>
{asset["label"]}
</option>
Expand All @@ -158,7 +158,7 @@ class AddRelationModal extends React.Component {
disabled={this.props.links === null}>
<option key={0} disabled value="">Select relation type...</option>
{this.state.selectableLinks.sort((linkA, linkB) => {
return linkA.label > linkB.label
return linkA.label.localeCompare(linkB.label)
}).map((link, index) => {
return <option key={index + 1} value={link["uri"]}>
{link["label"]}
Expand Down

0 comments on commit 03a645e

Please sign in to comment.