Fixed ids coming up as label issue in JDK Downloader#389
Merged
Achal1607 merged 1 commit intooracle:telemetryfrom Mar 19, 2025
Merged
Fixed ids coming up as label issue in JDK Downloader#389Achal1607 merged 1 commit intooracle:telemetryfrom
Achal1607 merged 1 commit intooracle:telemetryfrom
Conversation
sid-srini
reviewed
Mar 19, 2025
Member
There was a problem hiding this comment.
It may be better to return the id as is if not found.
Suggested change
| public static getJdkLabel = (id: string) => Object.values(this.JDK_TYPE).find(el=>el.id === id)?.label || ""; | |
| public static getJdkLabel = (id: string) => Object.values(this.JDK_TYPE).find(el=>el.id === id)?.label || id; |
Member
There was a problem hiding this comment.
Is JSON.stringify required here for a string value in the id field?
Member
Author
There was a problem hiding this comment.
No note required, it was required for the earlier object. Thanks for pointing this out.
sid-srini
requested changes
Mar 19, 2025
Comment on lines
28
to
35
Member
There was a problem hiding this comment.
The labels have got swapped.
I think it may be better to use a programmatic approach like l10n.value("jdk.downloader.label."+id) which would be computed in the getJdkLabel(id) method and avoid storing the labels altogether.
The returned value from l10n.value(key) could be compared with the key and return id if not localised, i.e. return l10nValue !== key ? l10nValue : id
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While fixing the label in the downloader in #379, a bug was introduced where all the download messages were showing
idof thejdkTypeinstead of the label. So, this PR aims to fix that.