box-ui-elements 24.0.0-beta.7 → 24.0.0-beta.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/explorer.js +1 -1
  2. package/dist/picker.js +1 -1
  3. package/es/elements/content-explorer/MetadataQueryAPIHelper.js +3 -11
  4. package/es/elements/content-explorer/MetadataQueryAPIHelper.js.map +1 -1
  5. package/es/elements/content-explorer/MetadataQueryBuilder.js +13 -23
  6. package/es/elements/content-explorer/MetadataQueryBuilder.js.map +1 -1
  7. package/es/elements/content-explorer/constants.js +0 -1
  8. package/es/elements/content-explorer/constants.js.map +1 -1
  9. package/es/elements/content-explorer/utils.js +5 -10
  10. package/es/elements/content-explorer/utils.js.map +1 -1
  11. package/es/src/elements/content-explorer/constants.d.ts +0 -1
  12. package/es/src/elements/content-explorer/utils.d.ts +1 -2
  13. package/i18n/bn-IN.js +1 -1
  14. package/i18n/bn-IN.properties +1 -1
  15. package/i18n/da-DK.js +1 -1
  16. package/i18n/da-DK.properties +1 -1
  17. package/i18n/de-DE.js +2 -2
  18. package/i18n/de-DE.properties +2 -2
  19. package/i18n/es-419.js +2 -2
  20. package/i18n/es-419.properties +2 -2
  21. package/i18n/es-ES.js +2 -2
  22. package/i18n/es-ES.properties +2 -2
  23. package/i18n/fi-FI.js +1 -1
  24. package/i18n/fi-FI.properties +1 -1
  25. package/i18n/fr-CA.js +1 -1
  26. package/i18n/fr-CA.properties +1 -1
  27. package/i18n/fr-FR.js +1 -1
  28. package/i18n/fr-FR.properties +1 -1
  29. package/i18n/hi-IN.js +1 -1
  30. package/i18n/hi-IN.properties +1 -1
  31. package/i18n/it-IT.js +1 -1
  32. package/i18n/it-IT.properties +1 -1
  33. package/i18n/ko-KR.js +1 -1
  34. package/i18n/ko-KR.properties +1 -1
  35. package/i18n/nb-NO.js +1 -1
  36. package/i18n/nb-NO.properties +1 -1
  37. package/i18n/nl-NL.js +1 -1
  38. package/i18n/nl-NL.properties +1 -1
  39. package/i18n/pl-PL.js +1 -1
  40. package/i18n/pl-PL.properties +1 -1
  41. package/i18n/pt-BR.js +1 -1
  42. package/i18n/pt-BR.properties +1 -1
  43. package/i18n/ru-RU.js +2 -2
  44. package/i18n/ru-RU.properties +2 -2
  45. package/i18n/sv-SE.js +1 -1
  46. package/i18n/sv-SE.properties +1 -1
  47. package/i18n/tr-TR.js +2 -2
  48. package/i18n/tr-TR.properties +2 -2
  49. package/i18n/zh-CN.js +1 -1
  50. package/i18n/zh-CN.properties +1 -1
  51. package/i18n/zh-TW.js +1 -1
  52. package/i18n/zh-TW.properties +1 -1
  53. package/package.json +1 -1
  54. package/src/elements/content-explorer/MetadataQueryAPIHelper.ts +3 -9
  55. package/src/elements/content-explorer/MetadataQueryBuilder.ts +14 -26
  56. package/src/elements/content-explorer/__tests__/MetadataQueryAPIHelper.test.ts +41 -14
  57. package/src/elements/content-explorer/__tests__/MetadataQueryBuilder.test.ts +13 -0
  58. package/src/elements/content-explorer/constants.ts +0 -2
  59. package/src/elements/content-explorer/utils.ts +5 -14
@@ -977,7 +977,7 @@ boxui.classification.add = Ajouter
977
977
  # Title of the card that shows the reason why the AI classification was applied when no date is available.
978
978
  boxui.classification.appliedByBoxAi = Box AI
979
979
  # Title of the card that shows the reason why the AI classification was applied on a specific date.
980
- boxui.classification.appliedByBoxAiOnDate = Box AI on {modifiedAt}
980
+ boxui.classification.appliedByBoxAiOnDate = Box AI sur {modifiedAt}
981
981
  # Header for classification section in sidebar
982
982
  boxui.classification.classification = Classement
983
983
  # Classification label color name as dark blue
package/i18n/fr-FR.js CHANGED
@@ -488,7 +488,7 @@ export default {
488
488
  "boxui.checkboxTooltip.iconInfoText": "Info",
489
489
  "boxui.classification.add": "Ajouter",
490
490
  "boxui.classification.appliedByBoxAi": "Box AI",
491
- "boxui.classification.appliedByBoxAiOnDate": "Box AI on {modifiedAt}",
491
+ "boxui.classification.appliedByBoxAiOnDate": "Box AI sur {modifiedAt}",
492
492
  "boxui.classification.classification": "Classement",
493
493
  "boxui.classification.classificationDarkBlue": "Bleu foncé",
494
494
  "boxui.classification.classificationGreen": "Vert",
@@ -977,7 +977,7 @@ boxui.classification.add = Ajouter
977
977
  # Title of the card that shows the reason why the AI classification was applied when no date is available.
978
978
  boxui.classification.appliedByBoxAi = Box AI
979
979
  # Title of the card that shows the reason why the AI classification was applied on a specific date.
980
- boxui.classification.appliedByBoxAiOnDate = Box AI on {modifiedAt}
980
+ boxui.classification.appliedByBoxAiOnDate = Box AI sur {modifiedAt}
981
981
  # Header for classification section in sidebar
982
982
  boxui.classification.classification = Classement
983
983
  # Classification label color name as dark blue
package/i18n/hi-IN.js CHANGED
@@ -488,7 +488,7 @@ export default {
488
488
  "boxui.checkboxTooltip.iconInfoText": "जानकारी",
489
489
  "boxui.classification.add": "जोड़ें",
490
490
  "boxui.classification.appliedByBoxAi": "Box AI",
491
- "boxui.classification.appliedByBoxAiOnDate": "Box AI on {modifiedAt}",
491
+ "boxui.classification.appliedByBoxAiOnDate": "{modifiedAt} पर Box AI",
492
492
  "boxui.classification.classification": "वर्गीकरण",
493
493
  "boxui.classification.classificationDarkBlue": "गहरा नीला",
494
494
  "boxui.classification.classificationGreen": "हरा",
@@ -977,7 +977,7 @@ boxui.classification.add = जोड़ें
977
977
  # Title of the card that shows the reason why the AI classification was applied when no date is available.
978
978
  boxui.classification.appliedByBoxAi = Box AI
979
979
  # Title of the card that shows the reason why the AI classification was applied on a specific date.
980
- boxui.classification.appliedByBoxAiOnDate = Box AI on {modifiedAt}
980
+ boxui.classification.appliedByBoxAiOnDate = {modifiedAt} पर Box AI
981
981
  # Header for classification section in sidebar
982
982
  boxui.classification.classification = वर्गीकरण
983
983
  # Classification label color name as dark blue
package/i18n/it-IT.js CHANGED
@@ -488,7 +488,7 @@ export default {
488
488
  "boxui.checkboxTooltip.iconInfoText": "Informazioni",
489
489
  "boxui.classification.add": "Aggiungi",
490
490
  "boxui.classification.appliedByBoxAi": "Box AI",
491
- "boxui.classification.appliedByBoxAiOnDate": "Box AI on {modifiedAt}",
491
+ "boxui.classification.appliedByBoxAiOnDate": "Box AI su {modifiedAt}",
492
492
  "boxui.classification.classification": "Classificazione",
493
493
  "boxui.classification.classificationDarkBlue": "Blu scuro",
494
494
  "boxui.classification.classificationGreen": "Verde",
@@ -977,7 +977,7 @@ boxui.classification.add = Aggiungi
977
977
  # Title of the card that shows the reason why the AI classification was applied when no date is available.
978
978
  boxui.classification.appliedByBoxAi = Box AI
979
979
  # Title of the card that shows the reason why the AI classification was applied on a specific date.
980
- boxui.classification.appliedByBoxAiOnDate = Box AI on {modifiedAt}
980
+ boxui.classification.appliedByBoxAiOnDate = Box AI su {modifiedAt}
981
981
  # Header for classification section in sidebar
982
982
  boxui.classification.classification = Classificazione
983
983
  # Classification label color name as dark blue
package/i18n/ko-KR.js CHANGED
@@ -488,7 +488,7 @@ export default {
488
488
  "boxui.checkboxTooltip.iconInfoText": "정보",
489
489
  "boxui.classification.add": "추가",
490
490
  "boxui.classification.appliedByBoxAi": "Box AI",
491
- "boxui.classification.appliedByBoxAiOnDate": "Box AI on {modifiedAt}",
491
+ "boxui.classification.appliedByBoxAiOnDate": "{modifiedAt}의 Box AI 분류 사유",
492
492
  "boxui.classification.classification": "분류",
493
493
  "boxui.classification.classificationDarkBlue": "진한 파란색",
494
494
  "boxui.classification.classificationGreen": "녹색",
@@ -977,7 +977,7 @@ boxui.classification.add = 추가
977
977
  # Title of the card that shows the reason why the AI classification was applied when no date is available.
978
978
  boxui.classification.appliedByBoxAi = Box AI
979
979
  # Title of the card that shows the reason why the AI classification was applied on a specific date.
980
- boxui.classification.appliedByBoxAiOnDate = Box AI on {modifiedAt}
980
+ boxui.classification.appliedByBoxAiOnDate = {modifiedAt}의 Box AI 분류 사유
981
981
  # Header for classification section in sidebar
982
982
  boxui.classification.classification = 분류
983
983
  # Classification label color name as dark blue
package/i18n/nb-NO.js CHANGED
@@ -488,7 +488,7 @@ export default {
488
488
  "boxui.checkboxTooltip.iconInfoText": "Informasjon",
489
489
  "boxui.classification.add": "Legg til",
490
490
  "boxui.classification.appliedByBoxAi": "Box AI",
491
- "boxui.classification.appliedByBoxAiOnDate": "Box AI on {modifiedAt}",
491
+ "boxui.classification.appliedByBoxAiOnDate": "Box AI {modifiedAt}",
492
492
  "boxui.classification.classification": "Klassifisering",
493
493
  "boxui.classification.classificationDarkBlue": "Mørkeblå",
494
494
  "boxui.classification.classificationGreen": "Grønn",
@@ -977,7 +977,7 @@ boxui.classification.add = Legg til
977
977
  # Title of the card that shows the reason why the AI classification was applied when no date is available.
978
978
  boxui.classification.appliedByBoxAi = Box AI
979
979
  # Title of the card that shows the reason why the AI classification was applied on a specific date.
980
- boxui.classification.appliedByBoxAiOnDate = Box AI on {modifiedAt}
980
+ boxui.classification.appliedByBoxAiOnDate = Box AI {modifiedAt}
981
981
  # Header for classification section in sidebar
982
982
  boxui.classification.classification = Klassifisering
983
983
  # Classification label color name as dark blue
package/i18n/nl-NL.js CHANGED
@@ -488,7 +488,7 @@ export default {
488
488
  "boxui.checkboxTooltip.iconInfoText": "Info",
489
489
  "boxui.classification.add": "Toevoegen",
490
490
  "boxui.classification.appliedByBoxAi": "Box AI",
491
- "boxui.classification.appliedByBoxAiOnDate": "Box AI on {modifiedAt}",
491
+ "boxui.classification.appliedByBoxAiOnDate": "Box AI op {modifiedAt}",
492
492
  "boxui.classification.classification": "Classificatie",
493
493
  "boxui.classification.classificationDarkBlue": "Donkerblauw",
494
494
  "boxui.classification.classificationGreen": "Groen",
@@ -977,7 +977,7 @@ boxui.classification.add = Toevoegen
977
977
  # Title of the card that shows the reason why the AI classification was applied when no date is available.
978
978
  boxui.classification.appliedByBoxAi = Box AI
979
979
  # Title of the card that shows the reason why the AI classification was applied on a specific date.
980
- boxui.classification.appliedByBoxAiOnDate = Box AI on {modifiedAt}
980
+ boxui.classification.appliedByBoxAiOnDate = Box AI op {modifiedAt}
981
981
  # Header for classification section in sidebar
982
982
  boxui.classification.classification = Classificatie
983
983
  # Classification label color name as dark blue
package/i18n/pl-PL.js CHANGED
@@ -488,7 +488,7 @@ export default {
488
488
  "boxui.checkboxTooltip.iconInfoText": "Informacje",
489
489
  "boxui.classification.add": "Dodaj",
490
490
  "boxui.classification.appliedByBoxAi": "Box AI",
491
- "boxui.classification.appliedByBoxAiOnDate": "Box AI on {modifiedAt}",
491
+ "boxui.classification.appliedByBoxAiOnDate": "Box AI w dniu {modifiedAt}",
492
492
  "boxui.classification.classification": "Klasyfikacja",
493
493
  "boxui.classification.classificationDarkBlue": "Ciemnoniebieski",
494
494
  "boxui.classification.classificationGreen": "Zielony",
@@ -977,7 +977,7 @@ boxui.classification.add = Dodaj
977
977
  # Title of the card that shows the reason why the AI classification was applied when no date is available.
978
978
  boxui.classification.appliedByBoxAi = Box AI
979
979
  # Title of the card that shows the reason why the AI classification was applied on a specific date.
980
- boxui.classification.appliedByBoxAiOnDate = Box AI on {modifiedAt}
980
+ boxui.classification.appliedByBoxAiOnDate = Box AI w dniu {modifiedAt}
981
981
  # Header for classification section in sidebar
982
982
  boxui.classification.classification = Klasyfikacja
983
983
  # Classification label color name as dark blue
package/i18n/pt-BR.js CHANGED
@@ -488,7 +488,7 @@ export default {
488
488
  "boxui.checkboxTooltip.iconInfoText": "Informações",
489
489
  "boxui.classification.add": "Adicionar",
490
490
  "boxui.classification.appliedByBoxAi": "Box AI",
491
- "boxui.classification.appliedByBoxAiOnDate": "Box AI on {modifiedAt}",
491
+ "boxui.classification.appliedByBoxAiOnDate": "Box AI no {modifiedAt}",
492
492
  "boxui.classification.classification": "Classificação",
493
493
  "boxui.classification.classificationDarkBlue": "Azul escuro",
494
494
  "boxui.classification.classificationGreen": "Verde",
@@ -977,7 +977,7 @@ boxui.classification.add = Adicionar
977
977
  # Title of the card that shows the reason why the AI classification was applied when no date is available.
978
978
  boxui.classification.appliedByBoxAi = Box AI
979
979
  # Title of the card that shows the reason why the AI classification was applied on a specific date.
980
- boxui.classification.appliedByBoxAiOnDate = Box AI on {modifiedAt}
980
+ boxui.classification.appliedByBoxAiOnDate = Box AI no {modifiedAt}
981
981
  # Header for classification section in sidebar
982
982
  boxui.classification.classification = Classificação
983
983
  # Classification label color name as dark blue
package/i18n/ru-RU.js CHANGED
@@ -487,8 +487,8 @@ export default {
487
487
  "boxui.categorySelector.label.more": "Дополнительно",
488
488
  "boxui.checkboxTooltip.iconInfoText": "Информация",
489
489
  "boxui.classification.add": "Добавить",
490
- "boxui.classification.appliedByBoxAi": "ИИ Box",
491
- "boxui.classification.appliedByBoxAiOnDate": "Box AI on {modifiedAt}",
490
+ "boxui.classification.appliedByBoxAi": "Box AI",
491
+ "boxui.classification.appliedByBoxAiOnDate": "Box AI на {modifiedAt}",
492
492
  "boxui.classification.classification": "Классификация",
493
493
  "boxui.classification.classificationDarkBlue": "Темно-синий",
494
494
  "boxui.classification.classificationGreen": "Зеленый",
@@ -975,9 +975,9 @@ boxui.checkboxTooltip.iconInfoText = Информация
975
975
  # Button to add classification on an item
976
976
  boxui.classification.add = Добавить
977
977
  # Title of the card that shows the reason why the AI classification was applied when no date is available.
978
- boxui.classification.appliedByBoxAi = ИИ Box
978
+ boxui.classification.appliedByBoxAi = Box AI
979
979
  # Title of the card that shows the reason why the AI classification was applied on a specific date.
980
- boxui.classification.appliedByBoxAiOnDate = Box AI on {modifiedAt}
980
+ boxui.classification.appliedByBoxAiOnDate = Box AI на {modifiedAt}
981
981
  # Header for classification section in sidebar
982
982
  boxui.classification.classification = Классификация
983
983
  # Classification label color name as dark blue
package/i18n/sv-SE.js CHANGED
@@ -488,7 +488,7 @@ export default {
488
488
  "boxui.checkboxTooltip.iconInfoText": "Info",
489
489
  "boxui.classification.add": "Lägg till",
490
490
  "boxui.classification.appliedByBoxAi": "Box AI",
491
- "boxui.classification.appliedByBoxAiOnDate": "Box AI on {modifiedAt}",
491
+ "boxui.classification.appliedByBoxAiOnDate": "Box AI {modifiedAt}",
492
492
  "boxui.classification.classification": "Klassificering",
493
493
  "boxui.classification.classificationDarkBlue": "Mörkblått",
494
494
  "boxui.classification.classificationGreen": "Grön",
@@ -977,7 +977,7 @@ boxui.classification.add = Lägg till
977
977
  # Title of the card that shows the reason why the AI classification was applied when no date is available.
978
978
  boxui.classification.appliedByBoxAi = Box AI
979
979
  # Title of the card that shows the reason why the AI classification was applied on a specific date.
980
- boxui.classification.appliedByBoxAiOnDate = Box AI on {modifiedAt}
980
+ boxui.classification.appliedByBoxAiOnDate = Box AI {modifiedAt}
981
981
  # Header for classification section in sidebar
982
982
  boxui.classification.classification = Klassificering
983
983
  # Classification label color name as dark blue
package/i18n/tr-TR.js CHANGED
@@ -487,8 +487,8 @@ export default {
487
487
  "boxui.categorySelector.label.more": "Daha fazla",
488
488
  "boxui.checkboxTooltip.iconInfoText": "Bilgi",
489
489
  "boxui.classification.add": "Ekle",
490
- "boxui.classification.appliedByBoxAi": "Box IA",
491
- "boxui.classification.appliedByBoxAiOnDate": "Box AI on {modifiedAt}",
490
+ "boxui.classification.appliedByBoxAi": "Box AI",
491
+ "boxui.classification.appliedByBoxAiOnDate": "{modifiedAt} bilgisine ayarlı Box AI",
492
492
  "boxui.classification.classification": "Sınıflandırma",
493
493
  "boxui.classification.classificationDarkBlue": "Koyu Mavi",
494
494
  "boxui.classification.classificationGreen": "Yeşil",
@@ -975,9 +975,9 @@ boxui.checkboxTooltip.iconInfoText = Bilgi
975
975
  # Button to add classification on an item
976
976
  boxui.classification.add = Ekle
977
977
  # Title of the card that shows the reason why the AI classification was applied when no date is available.
978
- boxui.classification.appliedByBoxAi = Box IA
978
+ boxui.classification.appliedByBoxAi = Box AI
979
979
  # Title of the card that shows the reason why the AI classification was applied on a specific date.
980
- boxui.classification.appliedByBoxAiOnDate = Box AI on {modifiedAt}
980
+ boxui.classification.appliedByBoxAiOnDate = {modifiedAt} bilgisine ayarlı Box AI
981
981
  # Header for classification section in sidebar
982
982
  boxui.classification.classification = Sınıflandırma
983
983
  # Classification label color name as dark blue
package/i18n/zh-CN.js CHANGED
@@ -488,7 +488,7 @@ export default {
488
488
  "boxui.checkboxTooltip.iconInfoText": "信息",
489
489
  "boxui.classification.add": "添加",
490
490
  "boxui.classification.appliedByBoxAi": "Box AI",
491
- "boxui.classification.appliedByBoxAiOnDate": "Box AI on {modifiedAt}",
491
+ "boxui.classification.appliedByBoxAiOnDate": "Box AI {modifiedAt}",
492
492
  "boxui.classification.classification": "分类",
493
493
  "boxui.classification.classificationDarkBlue": "深蓝色",
494
494
  "boxui.classification.classificationGreen": "绿色",
@@ -977,7 +977,7 @@ boxui.classification.add = 添加
977
977
  # Title of the card that shows the reason why the AI classification was applied when no date is available.
978
978
  boxui.classification.appliedByBoxAi = Box AI
979
979
  # Title of the card that shows the reason why the AI classification was applied on a specific date.
980
- boxui.classification.appliedByBoxAiOnDate = Box AI on {modifiedAt}
980
+ boxui.classification.appliedByBoxAiOnDate = Box AI {modifiedAt}
981
981
  # Header for classification section in sidebar
982
982
  boxui.classification.classification = 分类
983
983
  # Classification label color name as dark blue
package/i18n/zh-TW.js CHANGED
@@ -488,7 +488,7 @@ export default {
488
488
  "boxui.checkboxTooltip.iconInfoText": "資訊",
489
489
  "boxui.classification.add": "新增",
490
490
  "boxui.classification.appliedByBoxAi": "Box AI",
491
- "boxui.classification.appliedByBoxAiOnDate": "Box AI on {modifiedAt}",
491
+ "boxui.classification.appliedByBoxAiOnDate": "Box AI 已修改於 {modifiedAt}",
492
492
  "boxui.classification.classification": "分類",
493
493
  "boxui.classification.classificationDarkBlue": "深藍色",
494
494
  "boxui.classification.classificationGreen": "綠色",
@@ -977,7 +977,7 @@ boxui.classification.add = 新增
977
977
  # Title of the card that shows the reason why the AI classification was applied when no date is available.
978
978
  boxui.classification.appliedByBoxAi = Box AI
979
979
  # Title of the card that shows the reason why the AI classification was applied on a specific date.
980
- boxui.classification.appliedByBoxAiOnDate = Box AI on {modifiedAt}
980
+ boxui.classification.appliedByBoxAiOnDate = Box AI 已修改於 {modifiedAt}
981
981
  # Header for classification section in sidebar
982
982
  boxui.classification.classification = 分類
983
983
  # Classification label color name as dark blue
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "box-ui-elements",
3
- "version": "24.0.0-beta.7",
3
+ "version": "24.0.0-beta.8",
4
4
  "description": "Box UI Elements",
5
5
  "author": "Box (https://www.box.com/)",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -172,17 +172,11 @@ export default class MetadataQueryAPIHelper {
172
172
  };
173
173
 
174
174
  getTemplateSchemaInfo = (data: MetadataQueryResponseData): Promise<MetadataTemplateSchemaResponse | void> => {
175
- const { entries } = data;
176
175
  this.metadataQueryResponseData = data;
177
- if (!entries || entries.length === 0) {
178
- // Don't make metadata API call to get template info
179
- return Promise.resolve();
180
- }
181
176
 
182
- const metadata = getProp(entries, '[0].metadata');
183
- this.templateScope = Object.keys(metadata)[0];
184
- const instance = metadata[this.templateScope];
185
- this.templateKey = Object.keys(instance)[0];
177
+ const [scope, key] = this.metadataQuery.from.split('.');
178
+ this.templateScope = scope;
179
+ this.templateKey = key;
186
180
 
187
181
  return this.api.getMetadataAPI(true).getSchemaByTemplateKey(this.templateKey);
188
182
  };
@@ -1,6 +1,5 @@
1
- import { BoxItemSelection } from '@box/box-item-type-selector';
2
1
  import isNil from 'lodash/isNil';
3
- import { mapFileTypes } from './utils';
2
+ import { getFileExtensions } from './utils';
4
3
 
5
4
  type QueryResult = {
6
5
  queryParams: { [key: string]: number | Date | string };
@@ -134,42 +133,31 @@ export const getMimeTypeFilter = (filterValue: string[], fieldKey: string, argIn
134
133
  };
135
134
  }
136
135
 
137
- // Use mapFileTypes to get the correct extensions and handle special cases
138
- const mappedExtensions = mapFileTypes(filterValue as BoxItemSelection);
139
- if (mappedExtensions.length === 0) {
140
- return {
141
- queryParams: {},
142
- queries: [],
143
- keysGenerated: 0,
144
- };
145
- }
146
-
147
136
  let currentArgIndex = argIndexStart;
148
137
  const queryParams: { [key: string]: number | Date | string } = {};
149
138
  const queries: string[] = [];
150
139
 
151
140
  // Handle specific extensions and folder type
152
- const extensions: string[] = [];
141
+ const extensions: string[][] = [];
153
142
  let hasFolder = false;
154
-
155
- for (const extension of mappedExtensions) {
156
- if (extension === 'folder') {
157
- if (!hasFolder) {
158
- currentArgIndex += 1;
159
- const folderArgKey = generateArgKey('mime_folderType', currentArgIndex);
160
- queryParams[folderArgKey] = 'folder';
161
- queries.push(`(item.type = :${folderArgKey})`);
162
- hasFolder = true;
163
- }
143
+ for (const extension of filterValue) {
144
+ if (extension === 'folderType' && !hasFolder) {
145
+ currentArgIndex += 1;
146
+ const folderArgKey = generateArgKey('mime_folderType', currentArgIndex);
147
+ queryParams[folderArgKey] = 'folder';
148
+ queries.push(`(item.type = :${folderArgKey})`);
149
+ hasFolder = true;
164
150
  } else {
165
- extensions.push(extension);
151
+ extensions.push(getFileExtensions(extension));
166
152
  }
167
153
  }
168
154
 
155
+ // flat the array of arrays
156
+ const flattenExtensions = extensions.flat();
169
157
  // Handle extensions in batch if any exist
170
- if (extensions.length > 0) {
158
+ if (flattenExtensions.length > 0) {
171
159
  const extensionQueryParams = Object.fromEntries(
172
- extensions.map(extension => {
160
+ flattenExtensions.map(extension => {
173
161
  currentArgIndex += 1;
174
162
  return [generateArgKey(fieldKey, currentArgIndex), extension];
175
163
  }),
@@ -189,14 +189,14 @@ describe('elements/content-explorer/MetadataQueryAPIHelper', () => {
189
189
  };
190
190
  const mdQuery = {
191
191
  ancestor_folder_id: '672838458',
192
- from: 'enterprise_1234.templateKey',
192
+ from: `${templateScope}.${templateKey}`,
193
193
  query: 'query',
194
194
  query_params: {},
195
195
  fields: [
196
196
  FIELD_ITEM_NAME,
197
- 'metadata.enterprise_1234.templateKey.type',
198
- 'metadata.enterprise_1234.templateKey.year',
199
- 'metadata.enterprise_1234.templateKey.approved',
197
+ `metadata.${templateScope}.${templateKey}.type`,
198
+ `metadata.${templateScope}.${templateKey}.year`,
199
+ `metadata.${templateScope}.${templateKey}.approved`,
200
200
  ],
201
201
  };
202
202
 
@@ -206,6 +206,10 @@ describe('elements/content-explorer/MetadataQueryAPIHelper', () => {
206
206
  metadataQueryAPIHelper.templateScope = templateScope;
207
207
  metadataQueryAPIHelper.metadataTemplate = template;
208
208
  metadataQueryAPIHelper.metadataQuery = mdQuery;
209
+
210
+ // Reset mocks before each test
211
+ getSchemaByTemplateKeyFunc.mockClear();
212
+ getSchemaByTemplateKeyFunc.mockResolvedValue(templateSchemaResponse);
209
213
  });
210
214
 
211
215
  describe('flattenMetadata()', () => {
@@ -267,7 +271,7 @@ describe('elements/content-explorer/MetadataQueryAPIHelper', () => {
267
271
  });
268
272
 
269
273
  describe('getTemplateSchemaInfo()', () => {
270
- test('should set instance properties and make xhr call to get template info when response has valid entries', async () => {
274
+ test('should set instance properties and make xhr call to get template info', async () => {
271
275
  const result = await metadataQueryAPIHelper.getTemplateSchemaInfo(metadataQueryResponse);
272
276
  expect(getSchemaByTemplateKeyFunc).toHaveBeenCalledWith(templateKey);
273
277
  expect(result).toEqual(templateSchemaResponse);
@@ -276,26 +280,49 @@ describe('elements/content-explorer/MetadataQueryAPIHelper', () => {
276
280
  expect(metadataQueryAPIHelper.templateKey).toEqual(templateKey);
277
281
  });
278
282
 
279
- test('should not make xhr call to get metadata template info when response has zero/invalid entries', async () => {
283
+ test('should make xhr call to get metadata template info even when response has zero entries', async () => {
280
284
  const emptyEntriesResponse = { entries: [], next_marker: nextMarker };
281
285
  const result = await metadataQueryAPIHelper.getTemplateSchemaInfo(emptyEntriesResponse);
282
- expect(getSchemaByTemplateKeyFunc).not.toHaveBeenCalled();
283
- expect(result).toBe(undefined);
286
+ expect(getSchemaByTemplateKeyFunc).toHaveBeenCalledWith(templateKey);
287
+ expect(result).toEqual(templateSchemaResponse);
284
288
  expect(metadataQueryAPIHelper.metadataQueryResponseData).toEqual(emptyEntriesResponse);
289
+ expect(metadataQueryAPIHelper.templateScope).toEqual(templateScope);
290
+ expect(metadataQueryAPIHelper.templateKey).toEqual(templateKey);
285
291
  });
286
292
 
287
- test('should handle response with null entries', async () => {
293
+ test('should make xhr call to get metadata template info even when response has null entries', async () => {
288
294
  const nullEntriesResponse = { entries: null, next_marker: nextMarker };
289
295
  const result = await metadataQueryAPIHelper.getTemplateSchemaInfo(nullEntriesResponse);
290
- expect(getSchemaByTemplateKeyFunc).not.toHaveBeenCalled();
291
- expect(result).toBe(undefined);
296
+ expect(getSchemaByTemplateKeyFunc).toHaveBeenCalledWith(templateKey);
297
+ expect(result).toEqual(templateSchemaResponse);
298
+ expect(metadataQueryAPIHelper.metadataQueryResponseData).toEqual(nullEntriesResponse);
299
+ expect(metadataQueryAPIHelper.templateScope).toEqual(templateScope);
300
+ expect(metadataQueryAPIHelper.templateKey).toEqual(templateKey);
292
301
  });
293
302
 
294
- test('should handle response with undefined entries', async () => {
303
+ test('should make xhr call to get metadata template info even when response has undefined entries', async () => {
295
304
  const undefinedEntriesResponse = { next_marker: nextMarker };
296
305
  const result = await metadataQueryAPIHelper.getTemplateSchemaInfo(undefinedEntriesResponse);
297
- expect(getSchemaByTemplateKeyFunc).not.toHaveBeenCalled();
298
- expect(result).toBe(undefined);
306
+ expect(getSchemaByTemplateKeyFunc).toHaveBeenCalledWith(templateKey);
307
+ expect(result).toEqual(templateSchemaResponse);
308
+ expect(metadataQueryAPIHelper.metadataQueryResponseData).toEqual(undefinedEntriesResponse);
309
+ expect(metadataQueryAPIHelper.templateScope).toEqual(templateScope);
310
+ expect(metadataQueryAPIHelper.templateKey).toEqual(templateKey);
311
+ });
312
+
313
+ test('should extract template scope and key from metadata query from field', async () => {
314
+ // Test with different scope and key in the query
315
+ const differentScope = 'enterprise_99999';
316
+ const differentKey = 'differentTemplate';
317
+ metadataQueryAPIHelper.metadataQuery = {
318
+ ...mdQuery,
319
+ from: `${differentScope}.${differentKey}`,
320
+ };
321
+
322
+ await metadataQueryAPIHelper.getTemplateSchemaInfo(metadataQueryResponse);
323
+ expect(getSchemaByTemplateKeyFunc).toHaveBeenCalledWith(differentKey);
324
+ expect(metadataQueryAPIHelper.templateScope).toEqual(differentScope);
325
+ expect(metadataQueryAPIHelper.templateKey).toEqual(differentKey);
299
326
  });
300
327
  });
301
328
 
@@ -6,6 +6,7 @@ import {
6
6
  getSelectFilter,
7
7
  getMimeTypeFilter,
8
8
  } from '../MetadataQueryBuilder';
9
+ import { getFileExtensions } from '../utils';
9
10
 
10
11
  describe('elements/content-explorer/MetadataQueryBuilder', () => {
11
12
  describe('mergeQueryParams', () => {
@@ -532,4 +533,16 @@ describe('elements/content-explorer/MetadataQueryBuilder', () => {
532
533
  });
533
534
  });
534
535
  });
536
+
537
+ describe('getFileExtensions', () => {
538
+ test('should return actual file extensions for single file type', () => {
539
+ const result = getFileExtensions('documentType');
540
+ expect(result).toEqual(['doc', 'docx', 'gdoc', 'rtf', 'txt']);
541
+ });
542
+
543
+ test('should handle empty array input', () => {
544
+ const result = getFileExtensions('');
545
+ expect(result).toEqual([]);
546
+ });
547
+ });
535
548
  });
@@ -45,6 +45,4 @@ export const NON_FOLDER_FILE_TYPES_MAP = new Map([
45
45
  ['threedType', ['obj', 'fbx', 'stl', 'amf', 'iges']],
46
46
  ]);
47
47
 
48
- export const FILE_FOLDER_TYPES_MAP = new Map(NON_FOLDER_FILE_TYPES_MAP).set('folderType', ['folder']);
49
-
50
48
  export const NON_FOLDER_FILE_TYPES = Array.from(NON_FOLDER_FILE_TYPES_MAP.keys());
@@ -11,11 +11,10 @@ import {
11
11
  } from '@box/metadata-editor';
12
12
  import type { MetadataFieldType } from '@box/metadata-view';
13
13
  import type { Selection } from 'react-aria-components';
14
- import { BoxItemSelection } from '@box/box-item-type-selector';
15
14
  import type { BoxItem, Collection } from '../../common/types/core';
16
15
 
17
16
  import messages from '../common/messages';
18
- import { FILE_FOLDER_TYPES_MAP, NON_FOLDER_FILE_TYPES } from './constants';
17
+ import { NON_FOLDER_FILE_TYPES_MAP } from './constants';
19
18
 
20
19
  // Specific type for metadata field value in the item
21
20
  // Note: Item doesn't have field value in metadata object if that field is not set, so the value will be undefined in this case
@@ -196,17 +195,9 @@ export function useTemplateInstance(metadataTemplate: MetadataTemplate, selected
196
195
  };
197
196
  }
198
197
 
199
- export const mapFileTypes = (selectedFileTypes: BoxItemSelection) => {
200
- const selectedFileTypesSet = new Set(selectedFileTypes);
201
-
202
- const areAllNonFolderFileTypesSelected = NON_FOLDER_FILE_TYPES.every(key => selectedFileTypesSet.has(key));
203
-
204
- if (areAllNonFolderFileTypesSelected) {
205
- if (selectedFileTypes.includes('folderType')) {
206
- return [];
207
- }
208
- return ['file'];
198
+ export const getFileExtensions = (selectedFileType: string) => {
199
+ if (NON_FOLDER_FILE_TYPES_MAP.has(selectedFileType)) {
200
+ return NON_FOLDER_FILE_TYPES_MAP.get(selectedFileType).flat();
209
201
  }
210
-
211
- return selectedFileTypes.map(fileType => FILE_FOLDER_TYPES_MAP.get(fileType as string) || []).flat();
202
+ return [];
212
203
  };