box-ui-elements 24.0.0-beta.6 → 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.
- package/dist/explorer.js +1 -1
- package/dist/picker.js +1 -1
- package/es/elements/content-explorer/ContentExplorer.js +1 -1
- package/es/elements/content-explorer/ContentExplorer.js.map +1 -1
- package/es/elements/content-explorer/MetadataQueryAPIHelper.js +3 -11
- package/es/elements/content-explorer/MetadataQueryAPIHelper.js.map +1 -1
- package/es/elements/content-explorer/MetadataQueryBuilder.js +37 -8
- package/es/elements/content-explorer/MetadataQueryBuilder.js.map +1 -1
- package/es/elements/content-explorer/constants.js +3 -2
- package/es/elements/content-explorer/constants.js.map +1 -1
- package/es/elements/content-explorer/utils.js +7 -0
- package/es/elements/content-explorer/utils.js.map +1 -1
- package/es/src/elements/content-explorer/constants.d.ts +3 -2
- package/es/src/elements/content-explorer/utils.d.ts +1 -0
- package/i18n/bn-IN.js +1 -1
- package/i18n/bn-IN.properties +1 -1
- package/i18n/da-DK.js +1 -1
- package/i18n/da-DK.properties +1 -1
- package/i18n/de-DE.js +2 -2
- package/i18n/de-DE.properties +2 -2
- package/i18n/es-419.js +2 -2
- package/i18n/es-419.properties +2 -2
- package/i18n/es-ES.js +2 -2
- package/i18n/es-ES.properties +2 -2
- package/i18n/fi-FI.js +1 -1
- package/i18n/fi-FI.properties +1 -1
- package/i18n/fr-CA.js +1 -1
- package/i18n/fr-CA.properties +1 -1
- package/i18n/fr-FR.js +1 -1
- package/i18n/fr-FR.properties +1 -1
- package/i18n/hi-IN.js +1 -1
- package/i18n/hi-IN.properties +1 -1
- package/i18n/it-IT.js +1 -1
- package/i18n/it-IT.properties +1 -1
- package/i18n/ko-KR.js +1 -1
- package/i18n/ko-KR.properties +1 -1
- package/i18n/nb-NO.js +1 -1
- package/i18n/nb-NO.properties +1 -1
- package/i18n/nl-NL.js +1 -1
- package/i18n/nl-NL.properties +1 -1
- package/i18n/pl-PL.js +1 -1
- package/i18n/pl-PL.properties +1 -1
- package/i18n/pt-BR.js +1 -1
- package/i18n/pt-BR.properties +1 -1
- package/i18n/ru-RU.js +2 -2
- package/i18n/ru-RU.properties +2 -2
- package/i18n/sv-SE.js +1 -1
- package/i18n/sv-SE.properties +1 -1
- package/i18n/tr-TR.js +2 -2
- package/i18n/tr-TR.properties +2 -2
- package/i18n/zh-CN.js +1 -1
- package/i18n/zh-CN.properties +1 -1
- package/i18n/zh-TW.js +1 -1
- package/i18n/zh-TW.properties +1 -1
- package/package.json +1 -1
- package/src/elements/content-explorer/ContentExplorer.tsx +1 -1
- package/src/elements/content-explorer/MetadataQueryAPIHelper.ts +3 -9
- package/src/elements/content-explorer/MetadataQueryBuilder.ts +41 -18
- package/src/elements/content-explorer/__tests__/MetadataQueryAPIHelper.test.ts +49 -16
- package/src/elements/content-explorer/__tests__/MetadataQueryBuilder.test.ts +168 -39
- package/src/elements/content-explorer/constants.ts +37 -2
- package/src/elements/content-explorer/utils.ts +8 -0
package/i18n/fr-FR.properties
CHANGED
|
@@ -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
|
|
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
|
|
491
|
+
"boxui.classification.appliedByBoxAiOnDate": "{modifiedAt} पर Box AI",
|
|
492
492
|
"boxui.classification.classification": "वर्गीकरण",
|
|
493
493
|
"boxui.classification.classificationDarkBlue": "गहरा नीला",
|
|
494
494
|
"boxui.classification.classificationGreen": "हरा",
|
package/i18n/hi-IN.properties
CHANGED
|
@@ -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
|
|
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
|
|
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",
|
package/i18n/it-IT.properties
CHANGED
|
@@ -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
|
|
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
|
|
491
|
+
"boxui.classification.appliedByBoxAiOnDate": "{modifiedAt}의 Box AI 분류 사유",
|
|
492
492
|
"boxui.classification.classification": "분류",
|
|
493
493
|
"boxui.classification.classificationDarkBlue": "진한 파란색",
|
|
494
494
|
"boxui.classification.classificationGreen": "녹색",
|
package/i18n/ko-KR.properties
CHANGED
|
@@ -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
|
|
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
|
|
491
|
+
"boxui.classification.appliedByBoxAiOnDate": "Box AI på {modifiedAt}",
|
|
492
492
|
"boxui.classification.classification": "Klassifisering",
|
|
493
493
|
"boxui.classification.classificationDarkBlue": "Mørkeblå",
|
|
494
494
|
"boxui.classification.classificationGreen": "Grønn",
|
package/i18n/nb-NO.properties
CHANGED
|
@@ -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
|
|
980
|
+
boxui.classification.appliedByBoxAiOnDate = Box AI på {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
|
|
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",
|
package/i18n/nl-NL.properties
CHANGED
|
@@ -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
|
|
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
|
|
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",
|
package/i18n/pl-PL.properties
CHANGED
|
@@ -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
|
|
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
|
|
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",
|
package/i18n/pt-BR.properties
CHANGED
|
@@ -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
|
|
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": "
|
|
491
|
-
"boxui.classification.appliedByBoxAiOnDate": "Box AI
|
|
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": "Зеленый",
|
package/i18n/ru-RU.properties
CHANGED
|
@@ -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 =
|
|
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
|
|
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
|
|
491
|
+
"boxui.classification.appliedByBoxAiOnDate": "Box AI på {modifiedAt}",
|
|
492
492
|
"boxui.classification.classification": "Klassificering",
|
|
493
493
|
"boxui.classification.classificationDarkBlue": "Mörkblått",
|
|
494
494
|
"boxui.classification.classificationGreen": "Grön",
|
package/i18n/sv-SE.properties
CHANGED
|
@@ -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
|
|
980
|
+
boxui.classification.appliedByBoxAiOnDate = Box AI på {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
|
|
491
|
-
"boxui.classification.appliedByBoxAiOnDate": "Box AI
|
|
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",
|
package/i18n/tr-TR.properties
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
491
|
+
"boxui.classification.appliedByBoxAiOnDate": "Box AI 于 {modifiedAt}",
|
|
492
492
|
"boxui.classification.classification": "分类",
|
|
493
493
|
"boxui.classification.classificationDarkBlue": "深蓝色",
|
|
494
494
|
"boxui.classification.classificationGreen": "绿色",
|
package/i18n/zh-CN.properties
CHANGED
|
@@ -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
|
|
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
|
|
491
|
+
"boxui.classification.appliedByBoxAiOnDate": "Box AI 已修改於 {modifiedAt}",
|
|
492
492
|
"boxui.classification.classification": "分類",
|
|
493
493
|
"boxui.classification.classificationDarkBlue": "深藍色",
|
|
494
494
|
"boxui.classification.classificationGreen": "綠色",
|
package/i18n/zh-TW.properties
CHANGED
|
@@ -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
|
|
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
|
@@ -34,7 +34,7 @@ import Content from './Content';
|
|
|
34
34
|
import { isThumbnailAvailable } from '../common/utils';
|
|
35
35
|
import { isFocusableElement, isInputElement, focus } from '../../utils/dom';
|
|
36
36
|
import { FILE_SHARED_LINK_FIELDS_TO_FETCH } from '../../utils/fields';
|
|
37
|
-
import CONTENT_EXPLORER_FOLDER_FIELDS_TO_FETCH from './constants';
|
|
37
|
+
import { CONTENT_EXPLORER_FOLDER_FIELDS_TO_FETCH } from './constants';
|
|
38
38
|
import LocalStore from '../../utils/LocalStore';
|
|
39
39
|
import {
|
|
40
40
|
withFeatureConsumer,
|
|
@@ -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
|
|
183
|
-
this.templateScope =
|
|
184
|
-
|
|
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,4 +1,5 @@
|
|
|
1
1
|
import isNil from 'lodash/isNil';
|
|
2
|
+
import { getFileExtensions } from './utils';
|
|
2
3
|
|
|
3
4
|
type QueryResult = {
|
|
4
5
|
queryParams: { [key: string]: number | Date | string };
|
|
@@ -115,9 +116,7 @@ export const getSelectFilter = (filterValue: string[], fieldKey: string, argInde
|
|
|
115
116
|
return {
|
|
116
117
|
queryParams: multiSelectQueryParams,
|
|
117
118
|
queries: [
|
|
118
|
-
`(${fieldKey
|
|
119
|
-
multiSelectQueryParams,
|
|
120
|
-
)
|
|
119
|
+
`(${fieldKey} HASANY (${Object.keys(multiSelectQueryParams)
|
|
121
120
|
.map(argKey => `:${argKey}`)
|
|
122
121
|
.join(', ')}))`,
|
|
123
122
|
],
|
|
@@ -135,25 +134,49 @@ export const getMimeTypeFilter = (filterValue: string[], fieldKey: string, argIn
|
|
|
135
134
|
}
|
|
136
135
|
|
|
137
136
|
let currentArgIndex = argIndexStart;
|
|
138
|
-
|
|
139
|
-
const
|
|
140
|
-
|
|
137
|
+
const queryParams: { [key: string]: number | Date | string } = {};
|
|
138
|
+
const queries: string[] = [];
|
|
139
|
+
|
|
140
|
+
// Handle specific extensions and folder type
|
|
141
|
+
const extensions: string[][] = [];
|
|
142
|
+
let hasFolder = false;
|
|
143
|
+
for (const extension of filterValue) {
|
|
144
|
+
if (extension === 'folderType' && !hasFolder) {
|
|
141
145
|
currentArgIndex += 1;
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
146
|
+
const folderArgKey = generateArgKey('mime_folderType', currentArgIndex);
|
|
147
|
+
queryParams[folderArgKey] = 'folder';
|
|
148
|
+
queries.push(`(item.type = :${folderArgKey})`);
|
|
149
|
+
hasFolder = true;
|
|
150
|
+
} else {
|
|
151
|
+
extensions.push(getFileExtensions(extension));
|
|
152
|
+
}
|
|
153
|
+
}
|
|
149
154
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
155
|
+
// flat the array of arrays
|
|
156
|
+
const flattenExtensions = extensions.flat();
|
|
157
|
+
// Handle extensions in batch if any exist
|
|
158
|
+
if (flattenExtensions.length > 0) {
|
|
159
|
+
const extensionQueryParams = Object.fromEntries(
|
|
160
|
+
flattenExtensions.map(extension => {
|
|
161
|
+
currentArgIndex += 1;
|
|
162
|
+
return [generateArgKey(fieldKey, currentArgIndex), extension];
|
|
163
|
+
}),
|
|
164
|
+
);
|
|
165
|
+
|
|
166
|
+
Object.assign(queryParams, extensionQueryParams);
|
|
167
|
+
queries.push(
|
|
168
|
+
`(item.extension IN (${Object.keys(extensionQueryParams)
|
|
154
169
|
.map(argKey => `:${argKey}`)
|
|
155
170
|
.join(', ')}))`,
|
|
156
|
-
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// Combine queries with OR if multiple exist
|
|
175
|
+
const finalQueries = queries.length > 1 ? [`(${queries.join(' OR ')})`] : queries;
|
|
176
|
+
|
|
177
|
+
return {
|
|
178
|
+
queryParams,
|
|
179
|
+
queries: finalQueries,
|
|
157
180
|
keysGenerated: currentArgIndex - argIndexStart,
|
|
158
181
|
};
|
|
159
182
|
};
|
|
@@ -189,14 +189,14 @@ describe('elements/content-explorer/MetadataQueryAPIHelper', () => {
|
|
|
189
189
|
};
|
|
190
190
|
const mdQuery = {
|
|
191
191
|
ancestor_folder_id: '672838458',
|
|
192
|
-
from:
|
|
192
|
+
from: `${templateScope}.${templateKey}`,
|
|
193
193
|
query: 'query',
|
|
194
194
|
query_params: {},
|
|
195
195
|
fields: [
|
|
196
196
|
FIELD_ITEM_NAME,
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
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
|
|
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
|
|
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).
|
|
283
|
-
expect(result).
|
|
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
|
|
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).
|
|
291
|
-
expect(result).
|
|
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
|
|
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).
|
|
298
|
-
expect(result).
|
|
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
|
|
|
@@ -673,14 +700,20 @@ describe('elements/content-explorer/MetadataQueryAPIHelper', () => {
|
|
|
673
700
|
const filters = {
|
|
674
701
|
'mimetype-filter': {
|
|
675
702
|
fieldType: 'enum',
|
|
676
|
-
value: ['
|
|
703
|
+
value: ['pdfType', 'documentType'],
|
|
677
704
|
},
|
|
678
705
|
};
|
|
679
706
|
|
|
680
707
|
const result = metadataQueryAPIHelper.buildMetadataQueryParams(filters);
|
|
681
|
-
expect(result.query).toBe(
|
|
708
|
+
expect(result.query).toBe(
|
|
709
|
+
'(item.extension IN (:arg_mimetype_filter_1, :arg_mimetype_filter_2, :arg_mimetype_filter_3, :arg_mimetype_filter_4, :arg_mimetype_filter_5, :arg_mimetype_filter_6))',
|
|
710
|
+
);
|
|
682
711
|
expect(result.queryParams.arg_mimetype_filter_1).toBe('pdf');
|
|
683
712
|
expect(result.queryParams.arg_mimetype_filter_2).toBe('doc');
|
|
713
|
+
expect(result.queryParams.arg_mimetype_filter_3).toBe('docx');
|
|
714
|
+
expect(result.queryParams.arg_mimetype_filter_4).toBe('gdoc');
|
|
715
|
+
expect(result.queryParams.arg_mimetype_filter_5).toBe('rtf');
|
|
716
|
+
expect(result.queryParams.arg_mimetype_filter_6).toBe('txt');
|
|
684
717
|
});
|
|
685
718
|
|
|
686
719
|
test('should handle multiple filters of different types', () => {
|