Skip to content

Commit

Permalink
DOP-4151: Update product drop-down to use displayName value for labels (
Browse files Browse the repository at this point in the history
#978)

Co-authored-by: Maya Raman <[email protected]>
  • Loading branch information
anabellabuckvar and mayaraman19 authored Jan 10, 2024
1 parent 9b90db7 commit 9913e13
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/DeprecatedVersionSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ const DeprecatedVersionSelector = ({ metadata: { deprecated_versions: deprecated
return `${hostName}/${versionName}`;
};

const alphabetize = (product1, product2) => {
return product1.text.localeCompare(product2.text);
};

const productChoices = deprecatedVersions
? Object.keys(deprecatedVersions)
.map((product) => ({
Expand All @@ -128,6 +132,7 @@ const DeprecatedVersionSelector = ({ metadata: { deprecated_versions: deprecated
}))
// Ensure invalid entries do not break selector
.filter(({ text }) => !!text)
.sort(alphabetize)
: [];

const versionChoices = deprecatedVersions[product]
Expand Down

0 comments on commit 9913e13

Please sign in to comment.