ui: add the missing label for the backup resource limit - #14163
Open
stag7824 wants to merge 1 commit into
Open
Conversation
The Resource Limits tab derives each label from the resource type name
returned by listResourceLimits:
$t('label.max' + item.resourcetypename.replace('_', ''))
Resource.ResourceType declares backup("backup", 12), so the key looked up
for that row is label.maxbackup, which exists in no locale. en.json has
label.maxbackups, a different string used by the backup schedule form for
how many backups to retain, and label.maxbackupstorage, which is resource
type 13. With fallbackLocale 'en' and silentTranslationWarn enabled, the
miss is silent and vue-i18n renders the key itself, so the row reads
"label.maxbackup".
The same key is used for the tagged-limit validation message, which shows
the raw key for the same reason.
Backup was the only one of the 17 ResourceType values without a label; the
other 16 already resolve.
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.
Description
The Resource Limits tab (account, domain and project) shows the backup row labelled with the
raw translation key
label.maxbackupinstead of a readable name.ResourceLimitTab.vuederives the label from the resource type name returned bylistResourceLimits:ResourceLimitResponse.setResourceTypefillsresourcetypenamefrom the enum name, andResource.ResourceTypedeclaresbackup("backup", 12), so the key looked up for that row islabel.maxbackup. That key exists in no locale.en.jsonhas onlylabel.maxbackups, whichis a different string used by the backup schedule form for how many backups to retain
(
FormSchedule.vue), andlabel.maxbackupstorage, which is resource type 13.i18n is configured with
fallbackLocale: 'en'andsilentTranslationWarn: true, so themissing key produces no warning and vue-i18n renders the key itself.
The same key is used for the validation message when a tagged limit exceeds its untagged
limit, so that error currently reads
label.maxbackuptoo:Adding the key is enough; nothing else changes. Backup is the only one of the 17
Resource.ResourceTypevalues whose label was missing — the other 16 already resolve.Types of changes
Feature/Enhancement Scale or Bug Severity
Bug Severity
How Has This Been Tested?
Resolved every
Resource.ResourceTypethrough the same expression the template uses, againstthe real
en.jsonbefore and after the change ($treturns the key when it is missing):So the one row that was broken now resolves, and no other label moves.
en.jsonstill parses(4177 keys).
Found while looking at #13944. That report attributes the problem to resource types 15
(object_storage) and 16 (gpu), but
label.maxobjectstorageandlabel.maxgpuare bothpresent and resolve correctly, so I do not think this change closes that issue — I have left
a note there with what I found.