Explorar o código

Add a new entry to the label dictionary

Add entry to the enum fields for which its items will be parsed by the
dictionary.

Also includes lowercasing the words as part of the label dictionary
parsing process.
Sergiu Miclea %!s(int64=6) %!d(string=hai) anos
pai
achega
8a2d080533
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      src/utils/LabelDictionary.js

+ 2 - 2
src/utils/LabelDictionary.js

@@ -60,7 +60,7 @@ const cache: { name: string, label: ?string, description: ?string }[] = []
 class LabelDictionary {
 class LabelDictionary {
   // Fields which have enums for which dictionary labels should be used.
   // Fields which have enums for which dictionary labels should be used.
   // If a field has enums and is not in this array, their values will be used as labels
   // If a field has enums and is not in this array, their values will be used as labels
-  static enumFields = ['port_reuse_policy', 'replica_export_mechanism']
+  static enumFields = ['port_reuse_policy', 'replica_export_mechanism', 'virtual_disk_clone_type']
 
 
   static get(fieldName: ?string): string {
   static get(fieldName: ?string): string {
     if (!fieldName) {
     if (!fieldName) {
@@ -85,7 +85,7 @@ class LabelDictionary {
     let words = fieldName.split('_')
     let words = fieldName.split('_')
     words = words.map(word => {
     words = words.map(word => {
       let acronym = acronyms.find(a => a === word)
       let acronym = acronyms.find(a => a === word)
-      let newWord = acronym ? acronym.toUpperCase() : (abbreviations[word] || word)
+      let newWord = acronym ? acronym.toUpperCase() : (abbreviations[word] || word.toLowerCase())
       return newWord.charAt(0).toUpperCase() + newWord.substr(1)
       return newWord.charAt(0).toUpperCase() + newWord.substr(1)
     })
     })
     return words.join(' ')
     return words.join(' ')