box-ui-elements 24.0.0-beta.3 → 24.0.0-beta.5
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/openwith.js +1 -1
- package/dist/picker.js +1 -1
- package/dist/preview.js +1 -1
- package/dist/sharing.js +1 -1
- package/dist/sidebar.js +1 -1
- package/dist/uploader.js +1 -1
- package/es/api/Metadata.js +98 -13
- package/es/api/Metadata.js.flow +110 -12
- package/es/api/Metadata.js.map +1 -1
- package/es/elements/common/messages.js +16 -0
- package/es/elements/common/messages.js.flow +25 -0
- package/es/elements/common/messages.js.map +1 -1
- package/es/elements/common/withBlueprintModernization.js +16 -0
- package/es/elements/common/withBlueprintModernization.js.map +1 -0
- package/es/elements/content-explorer/Content.js +2 -1
- package/es/elements/content-explorer/Content.js.map +1 -1
- package/es/elements/content-explorer/ContentExplorer.js +21 -6
- package/es/elements/content-explorer/ContentExplorer.js.map +1 -1
- package/es/elements/content-explorer/MetadataQueryAPIHelper.js +61 -4
- package/es/elements/content-explorer/MetadataQueryAPIHelper.js.map +1 -1
- package/es/elements/content-explorer/MetadataSidePanel.js +40 -14
- package/es/elements/content-explorer/MetadataSidePanel.js.map +1 -1
- package/es/elements/content-explorer/MetadataViewContainer.js +55 -4
- package/es/elements/content-explorer/MetadataViewContainer.js.map +1 -1
- package/es/elements/content-explorer/stories/tests/ContentExplorer-visual.stories.js +5 -0
- package/es/elements/content-explorer/stories/tests/ContentExplorer-visual.stories.js.flow +6 -0
- package/es/elements/content-explorer/stories/tests/ContentExplorer-visual.stories.js.map +1 -1
- package/es/elements/content-explorer/stories/tests/MetadataView-visual.stories.js +61 -13
- package/es/elements/content-explorer/stories/tests/MetadataView-visual.stories.js.map +1 -1
- package/es/elements/content-explorer/utils.js +140 -12
- package/es/elements/content-explorer/utils.js.map +1 -1
- package/es/elements/content-picker/ContentPicker.js +4 -1
- package/es/elements/content-picker/ContentPicker.js.flow +4 -1
- package/es/elements/content-picker/ContentPicker.js.map +1 -1
- package/es/elements/content-picker/stories/tests/ContentPicker-visual.stories.js +5 -0
- package/es/elements/content-picker/stories/tests/ContentPicker-visual.stories.js.flow +6 -0
- package/es/elements/content-picker/stories/tests/ContentPicker-visual.stories.js.map +1 -1
- package/es/elements/content-preview/ContentPreview.js +3 -1
- package/es/elements/content-preview/ContentPreview.js.flow +3 -0
- package/es/elements/content-preview/ContentPreview.js.map +1 -1
- package/es/elements/content-preview/stories/tests/ContentPreview-visual.stories.js +5 -0
- package/es/elements/content-preview/stories/tests/ContentPreview-visual.stories.js.flow +7 -1
- package/es/elements/content-preview/stories/tests/ContentPreview-visual.stories.js.map +1 -1
- package/es/elements/content-sharing/ContentSharing.js +4 -1
- package/es/elements/content-sharing/ContentSharing.js.flow +4 -1
- package/es/elements/content-sharing/ContentSharing.js.map +1 -1
- package/es/elements/content-sidebar/ContentSidebar.js +3 -1
- package/es/elements/content-sidebar/ContentSidebar.js.flow +3 -0
- package/es/elements/content-sidebar/ContentSidebar.js.map +1 -1
- package/es/elements/content-sidebar/stories/tests/ContentSidebar-visual.stories.js +5 -0
- package/es/elements/content-sidebar/stories/tests/ContentSidebar-visual.stories.js.map +1 -1
- package/es/elements/content-uploader/ContentUploader.js +3 -1
- package/es/elements/content-uploader/ContentUploader.js.map +1 -1
- package/es/elements/content-uploader/stories/tests/ContentUploader-visual.stories.js +5 -0
- package/es/elements/content-uploader/stories/tests/ContentUploader-visual.stories.js.flow +6 -0
- package/es/elements/content-uploader/stories/tests/ContentUploader-visual.stories.js.map +1 -1
- package/es/features/classification/applied-by-ai-classification-reason/AppliedByAiClassificationReason.js +51 -0
- package/es/features/classification/applied-by-ai-classification-reason/AppliedByAiClassificationReason.js.map +1 -0
- package/es/features/classification/applied-by-ai-classification-reason/AppliedByAiClassificationReason.scss +29 -0
- package/es/features/classification/applied-by-ai-classification-reason/messages.js +13 -0
- package/es/features/classification/applied-by-ai-classification-reason/messages.js.map +1 -0
- package/es/features/classification/types.js +2 -0
- package/es/features/classification/types.js.map +1 -0
- package/es/src/elements/common/__tests__/withBlueprintModernization.test.d.ts +1 -0
- package/es/src/elements/common/withBlueprintModernization.d.ts +3 -0
- package/es/src/elements/content-explorer/ContentExplorer.d.ts +11 -3
- package/es/src/elements/content-explorer/MetadataQueryAPIHelper.d.ts +11 -1
- package/es/src/elements/content-explorer/MetadataSidePanel.d.ts +6 -3
- package/es/src/elements/content-explorer/MetadataViewContainer.d.ts +3 -1
- package/es/src/elements/content-explorer/stories/tests/MetadataView-visual.stories.d.ts +1 -0
- package/es/src/elements/content-explorer/utils.d.ts +9 -3
- package/es/src/elements/content-sidebar/stories/tests/ContentSidebar-visual.stories.d.ts +5 -0
- package/es/src/features/classification/applied-by-ai-classification-reason/AppliedByAiClassificationReason.d.ts +6 -0
- package/es/src/features/classification/applied-by-ai-classification-reason/__tests__/AppliedByAiClassificationReason.test.d.ts +1 -0
- package/es/src/features/classification/applied-by-ai-classification-reason/messages.d.ts +13 -0
- package/es/src/features/classification/types.d.ts +6 -0
- package/i18n/bn-IN.js +8 -2
- package/i18n/bn-IN.properties +6 -2
- package/i18n/da-DK.js +8 -2
- package/i18n/da-DK.properties +6 -2
- package/i18n/de-DE.js +8 -2
- package/i18n/de-DE.properties +6 -2
- package/i18n/en-AU.js +6 -0
- package/i18n/en-AU.properties +4 -0
- package/i18n/en-CA.js +6 -0
- package/i18n/en-CA.properties +4 -0
- package/i18n/en-GB.js +6 -0
- package/i18n/en-GB.properties +4 -0
- package/i18n/en-US.js +6 -0
- package/i18n/en-US.properties +12 -0
- package/i18n/en-x-pseudo.js +6 -0
- package/i18n/es-419.js +8 -2
- package/i18n/es-419.properties +6 -2
- package/i18n/es-ES.js +8 -2
- package/i18n/es-ES.properties +6 -2
- package/i18n/fi-FI.js +8 -2
- package/i18n/fi-FI.properties +6 -2
- package/i18n/fr-CA.js +8 -2
- package/i18n/fr-CA.properties +6 -2
- package/i18n/fr-FR.js +8 -2
- package/i18n/fr-FR.properties +6 -2
- package/i18n/hi-IN.js +8 -2
- package/i18n/hi-IN.properties +6 -2
- package/i18n/it-IT.js +8 -2
- package/i18n/it-IT.properties +6 -2
- package/i18n/ja-JP.js +8 -2
- package/i18n/ja-JP.properties +6 -2
- package/i18n/ko-KR.js +8 -2
- package/i18n/ko-KR.properties +6 -2
- package/i18n/nb-NO.js +8 -2
- package/i18n/nb-NO.properties +6 -2
- package/i18n/nl-NL.js +8 -2
- package/i18n/nl-NL.properties +6 -2
- package/i18n/pl-PL.js +8 -2
- package/i18n/pl-PL.properties +6 -2
- package/i18n/pt-BR.js +8 -2
- package/i18n/pt-BR.properties +6 -2
- package/i18n/ru-RU.js +8 -2
- package/i18n/ru-RU.properties +6 -2
- package/i18n/sv-SE.js +8 -2
- package/i18n/sv-SE.properties +6 -2
- package/i18n/tr-TR.js +8 -2
- package/i18n/tr-TR.properties +6 -2
- package/i18n/zh-CN.js +8 -2
- package/i18n/zh-CN.properties +6 -2
- package/i18n/zh-TW.js +8 -2
- package/i18n/zh-TW.properties +6 -2
- package/package.json +1 -1
- package/src/api/Metadata.js +110 -12
- package/src/api/__tests__/Metadata.test.js +120 -0
- package/src/elements/common/__tests__/withBlueprintModernization.test.tsx +91 -0
- package/src/elements/common/messages.js +25 -0
- package/src/elements/common/withBlueprintModernization.tsx +24 -0
- package/src/elements/content-explorer/Content.tsx +1 -0
- package/src/elements/content-explorer/ContentExplorer.tsx +224 -182
- package/src/elements/content-explorer/MetadataQueryAPIHelper.ts +89 -4
- package/src/elements/content-explorer/MetadataSidePanel.tsx +55 -14
- package/src/elements/content-explorer/MetadataViewContainer.tsx +61 -1
- package/src/elements/content-explorer/__tests__/ContentExplorer.test.tsx +36 -2
- package/src/elements/content-explorer/__tests__/MetadataQueryAPIHelper.test.ts +8 -5
- package/src/elements/content-explorer/__tests__/MetadataSidePanel.test.tsx +145 -3
- package/src/elements/content-explorer/stories/tests/ContentExplorer-visual.stories.js +6 -0
- package/src/elements/content-explorer/stories/tests/MetadataView-visual.stories.tsx +54 -8
- package/src/elements/content-explorer/utils.ts +150 -13
- package/src/elements/content-picker/ContentPicker.js +4 -1
- package/src/elements/content-picker/stories/tests/ContentPicker-visual.stories.js +6 -0
- package/src/elements/content-preview/ContentPreview.js +3 -0
- package/src/elements/content-preview/stories/tests/ContentPreview-visual.stories.js +7 -1
- package/src/elements/content-sharing/ContentSharing.js +4 -1
- package/src/elements/content-sidebar/ContentSidebar.js +3 -0
- package/src/elements/content-sidebar/stories/tests/ContentSidebar-visual.stories.tsx +6 -0
- package/src/elements/content-uploader/ContentUploader.tsx +3 -1
- package/src/elements/content-uploader/stories/tests/ContentUploader-visual.stories.js +6 -0
- package/src/features/classification/applied-by-ai-classification-reason/AppliedByAiClassificationReason.scss +29 -0
- package/src/features/classification/applied-by-ai-classification-reason/AppliedByAiClassificationReason.tsx +55 -0
- package/src/features/classification/applied-by-ai-classification-reason/__tests__/AppliedByAiClassificationReason.test.tsx +105 -0
- package/src/features/classification/applied-by-ai-classification-reason/messages.ts +18 -0
- package/src/features/classification/types.ts +7 -0
package/i18n/tr-TR.js
CHANGED
|
@@ -109,7 +109,7 @@ export default {
|
|
|
109
109
|
"be.contentSidebar.activityFeed.commentForm.commentCancel": "İptal",
|
|
110
110
|
"be.contentSidebar.activityFeed.commentForm.commentLabel": "Bir yorum yazın",
|
|
111
111
|
"be.contentSidebar.activityFeed.commentForm.commentPost": "Gönder",
|
|
112
|
-
"be.contentSidebar.activityFeed.commentForm.commentTimestampLabel": "
|
|
112
|
+
"be.contentSidebar.activityFeed.commentForm.commentTimestampLabel": "Zaman damgasıyla yorum yapın",
|
|
113
113
|
"be.contentSidebar.activityFeed.commentForm.commentWrite": "Bir yorum yazın",
|
|
114
114
|
"be.contentSidebar.activityFeed.commmon.showOriginalMessage": "Orijinali Göster",
|
|
115
115
|
"be.contentSidebar.activityFeed.common.activityStatusResolved": "Çözüldü",
|
|
@@ -291,9 +291,12 @@ export default {
|
|
|
291
291
|
"be.messageCenter.previewError": "Üzgünüz, bu görüntüyü göstermekte sorun yaşıyoruz.",
|
|
292
292
|
"be.messageCenter.product": "Ürün",
|
|
293
293
|
"be.messageCenter.title": "Yenilikler",
|
|
294
|
+
"be.metadataUpdateErrorNotification": "Unable to save changes. Please try again.",
|
|
295
|
+
"be.metadataUpdateSuccessNotification": " {numSelected, plural, =1 {1 document updated} other {# documents updated} } ",
|
|
294
296
|
"be.modifiedDate": "{date} tarihinde değiştirildi",
|
|
295
297
|
"be.modifiedDateBy": "{name} tarafından {date} tarihinde değiştirildi",
|
|
296
298
|
"be.moreOptions": "Daha Fazla Seçenek",
|
|
299
|
+
"be.multipleValues": "Multiple Values",
|
|
297
300
|
"be.nameASC": "Ad: A → Z",
|
|
298
301
|
"be.nameDESC": "Ad: Z → A",
|
|
299
302
|
"be.nameDate": "{name} tarafından {date} tarihinde",
|
|
@@ -417,6 +420,7 @@ export default {
|
|
|
417
420
|
"be.skillUnknownError": "Bu Skill özelliği kullanılırken veya ilgili veriler getirilirken bir hata oluştu.",
|
|
418
421
|
"be.sort": "Sırala",
|
|
419
422
|
"be.statusSkill": "Durum",
|
|
423
|
+
"be.success": "Success",
|
|
420
424
|
"be.today": "bugün",
|
|
421
425
|
"be.topicsSkill": "Konular",
|
|
422
426
|
"be.transcriptEdit": "Düzenlemek için bir bölüme tıklayın.",
|
|
@@ -483,6 +487,8 @@ export default {
|
|
|
483
487
|
"boxui.categorySelector.label.more": "Daha fazla",
|
|
484
488
|
"boxui.checkboxTooltip.iconInfoText": "Bilgi",
|
|
485
489
|
"boxui.classification.add": "Ekle",
|
|
490
|
+
"boxui.classification.appliedByBoxAi": "Box IA",
|
|
491
|
+
"boxui.classification.appliedByBoxAiOnDate": "Box AI on {modifiedAt}",
|
|
486
492
|
"boxui.classification.classification": "Sınıflandırma",
|
|
487
493
|
"boxui.classification.classificationDarkBlue": "Koyu Mavi",
|
|
488
494
|
"boxui.classification.classificationGreen": "Yeşil",
|
|
@@ -913,7 +919,7 @@ export default {
|
|
|
913
919
|
"boxui.shareMenu.shortcutOnly": "Yalnızca Kısayol",
|
|
914
920
|
"boxui.shareMenu.viewAndDownload": "Görüntüleme ve İndirme",
|
|
915
921
|
"boxui.shareMenu.viewOnly": "Yalnızca Görüntüleme",
|
|
916
|
-
"boxui.subHeader.bulkItemActionMenuAriaLabel": "
|
|
922
|
+
"boxui.subHeader.bulkItemActionMenuAriaLabel": "Toplu işlemler",
|
|
917
923
|
"boxui.subHeader.metadata": "Meta veri",
|
|
918
924
|
"boxui.timeInput.emptyTimeError": "Gerekli alan. Saati SS.DD biçiminde girin.",
|
|
919
925
|
"boxui.timeInput.invalidTimeError": "Geçersiz saat biçimi. Saati SS.DD biçiminde girin.",
|
package/i18n/tr-TR.properties
CHANGED
|
@@ -219,7 +219,7 @@ be.contentSidebar.activityFeed.commentForm.commentLabel = Bir yorum yazın
|
|
|
219
219
|
# Text for post button
|
|
220
220
|
be.contentSidebar.activityFeed.commentForm.commentPost = Gönder
|
|
221
221
|
# Label for toggle to add video timestamp to comment
|
|
222
|
-
be.contentSidebar.activityFeed.commentForm.commentTimestampLabel =
|
|
222
|
+
be.contentSidebar.activityFeed.commentForm.commentTimestampLabel = Zaman damgasıyla yorum yapın
|
|
223
223
|
# Placeholder for comment input
|
|
224
224
|
be.contentSidebar.activityFeed.commentForm.commentWrite = Bir yorum yazın
|
|
225
225
|
# Show original button for showing original comment
|
|
@@ -966,6 +966,10 @@ boxui.categorySelector.label.more = Daha fazla
|
|
|
966
966
|
boxui.checkboxTooltip.iconInfoText = Bilgi
|
|
967
967
|
# Button to add classification on an item
|
|
968
968
|
boxui.classification.add = Ekle
|
|
969
|
+
# Title of the card that shows the reason why the AI classification was applied when no date is available.
|
|
970
|
+
boxui.classification.appliedByBoxAi = Box IA
|
|
971
|
+
# Title of the card that shows the reason why the AI classification was applied on a specific date.
|
|
972
|
+
boxui.classification.appliedByBoxAiOnDate = Box AI on {modifiedAt}
|
|
969
973
|
# Header for classification section in sidebar
|
|
970
974
|
boxui.classification.classification = Sınıflandırma
|
|
971
975
|
# Classification label color name as dark blue
|
|
@@ -1827,7 +1831,7 @@ boxui.shareMenu.viewAndDownload = Görüntüleme ve İndirme
|
|
|
1827
1831
|
# Description of permissions granted to users who have access to the shared link
|
|
1828
1832
|
boxui.shareMenu.viewOnly = Yalnızca Görüntüleme
|
|
1829
1833
|
# Aria-label for the dropdown menu that shows actions for selected items
|
|
1830
|
-
boxui.subHeader.bulkItemActionMenuAriaLabel =
|
|
1834
|
+
boxui.subHeader.bulkItemActionMenuAriaLabel = Toplu işlemler
|
|
1831
1835
|
# Text for metadata button that will open the metadata side panel
|
|
1832
1836
|
boxui.subHeader.metadata = Meta veri
|
|
1833
1837
|
# Error message for empty time formats. "HH:MM A" should be localized.
|
package/i18n/zh-CN.js
CHANGED
|
@@ -109,7 +109,7 @@ export default {
|
|
|
109
109
|
"be.contentSidebar.activityFeed.commentForm.commentCancel": "取消",
|
|
110
110
|
"be.contentSidebar.activityFeed.commentForm.commentLabel": "留下评论",
|
|
111
111
|
"be.contentSidebar.activityFeed.commentForm.commentPost": "发布",
|
|
112
|
-
"be.contentSidebar.activityFeed.commentForm.commentTimestampLabel": "
|
|
112
|
+
"be.contentSidebar.activityFeed.commentForm.commentTimestampLabel": "带时间戳的评论",
|
|
113
113
|
"be.contentSidebar.activityFeed.commentForm.commentWrite": "留下评论",
|
|
114
114
|
"be.contentSidebar.activityFeed.commmon.showOriginalMessage": "显示原始评论",
|
|
115
115
|
"be.contentSidebar.activityFeed.common.activityStatusResolved": "Resolved",
|
|
@@ -291,9 +291,12 @@ export default {
|
|
|
291
291
|
"be.messageCenter.previewError": "抱歉,无法显示此图像。",
|
|
292
292
|
"be.messageCenter.product": "产品",
|
|
293
293
|
"be.messageCenter.title": "新增功能",
|
|
294
|
+
"be.metadataUpdateErrorNotification": "Unable to save changes. Please try again.",
|
|
295
|
+
"be.metadataUpdateSuccessNotification": " {numSelected, plural, =1 {1 document updated} other {# documents updated} } ",
|
|
294
296
|
"be.modifiedDate": "修改日期:{date}",
|
|
295
297
|
"be.modifiedDateBy": "{name} 于 {date} 修改",
|
|
296
298
|
"be.moreOptions": "更多选项",
|
|
299
|
+
"be.multipleValues": "Multiple Values",
|
|
297
300
|
"be.nameASC": "名称:A → Z",
|
|
298
301
|
"be.nameDESC": "名称:Z → A",
|
|
299
302
|
"be.nameDate": "{name} 于 {date} 修改",
|
|
@@ -417,6 +420,7 @@ export default {
|
|
|
417
420
|
"be.skillUnknownError": "运行此技能或获取其数据时出错。",
|
|
418
421
|
"be.sort": "排序",
|
|
419
422
|
"be.statusSkill": "状态",
|
|
423
|
+
"be.success": "Success",
|
|
420
424
|
"be.today": "今天",
|
|
421
425
|
"be.topicsSkill": "主题",
|
|
422
426
|
"be.transcriptEdit": "单击任何部分开始编辑。",
|
|
@@ -483,6 +487,8 @@ export default {
|
|
|
483
487
|
"boxui.categorySelector.label.more": "更多",
|
|
484
488
|
"boxui.checkboxTooltip.iconInfoText": "信息",
|
|
485
489
|
"boxui.classification.add": "添加",
|
|
490
|
+
"boxui.classification.appliedByBoxAi": "Box AI",
|
|
491
|
+
"boxui.classification.appliedByBoxAiOnDate": "Box AI on {modifiedAt}",
|
|
486
492
|
"boxui.classification.classification": "分类",
|
|
487
493
|
"boxui.classification.classificationDarkBlue": "深蓝色",
|
|
488
494
|
"boxui.classification.classificationGreen": "绿色",
|
|
@@ -913,7 +919,7 @@ export default {
|
|
|
913
919
|
"boxui.shareMenu.shortcutOnly": "仅快捷键",
|
|
914
920
|
"boxui.shareMenu.viewAndDownload": "查看和下载",
|
|
915
921
|
"boxui.shareMenu.viewOnly": "仅查看",
|
|
916
|
-
"boxui.subHeader.bulkItemActionMenuAriaLabel": "
|
|
922
|
+
"boxui.subHeader.bulkItemActionMenuAriaLabel": "批量操作",
|
|
917
923
|
"boxui.subHeader.metadata": "元数据",
|
|
918
924
|
"boxui.timeInput.emptyTimeError": "必填字段。请以“上午小时:分钟”格式输入时间。",
|
|
919
925
|
"boxui.timeInput.invalidTimeError": "时间格式无效。请以“上午小时:分钟”格式输入时间。",
|
package/i18n/zh-CN.properties
CHANGED
|
@@ -219,7 +219,7 @@ be.contentSidebar.activityFeed.commentForm.commentLabel = 留下评论
|
|
|
219
219
|
# Text for post button
|
|
220
220
|
be.contentSidebar.activityFeed.commentForm.commentPost = 发布
|
|
221
221
|
# Label for toggle to add video timestamp to comment
|
|
222
|
-
be.contentSidebar.activityFeed.commentForm.commentTimestampLabel =
|
|
222
|
+
be.contentSidebar.activityFeed.commentForm.commentTimestampLabel = 带时间戳的评论
|
|
223
223
|
# Placeholder for comment input
|
|
224
224
|
be.contentSidebar.activityFeed.commentForm.commentWrite = 留下评论
|
|
225
225
|
# Show original button for showing original comment
|
|
@@ -966,6 +966,10 @@ boxui.categorySelector.label.more = 更多
|
|
|
966
966
|
boxui.checkboxTooltip.iconInfoText = 信息
|
|
967
967
|
# Button to add classification on an item
|
|
968
968
|
boxui.classification.add = 添加
|
|
969
|
+
# Title of the card that shows the reason why the AI classification was applied when no date is available.
|
|
970
|
+
boxui.classification.appliedByBoxAi = Box AI
|
|
971
|
+
# Title of the card that shows the reason why the AI classification was applied on a specific date.
|
|
972
|
+
boxui.classification.appliedByBoxAiOnDate = Box AI on {modifiedAt}
|
|
969
973
|
# Header for classification section in sidebar
|
|
970
974
|
boxui.classification.classification = 分类
|
|
971
975
|
# Classification label color name as dark blue
|
|
@@ -1827,7 +1831,7 @@ boxui.shareMenu.viewAndDownload = 查看和下载
|
|
|
1827
1831
|
# Description of permissions granted to users who have access to the shared link
|
|
1828
1832
|
boxui.shareMenu.viewOnly = 仅查看
|
|
1829
1833
|
# Aria-label for the dropdown menu that shows actions for selected items
|
|
1830
|
-
boxui.subHeader.bulkItemActionMenuAriaLabel =
|
|
1834
|
+
boxui.subHeader.bulkItemActionMenuAriaLabel = 批量操作
|
|
1831
1835
|
# Text for metadata button that will open the metadata side panel
|
|
1832
1836
|
boxui.subHeader.metadata = 元数据
|
|
1833
1837
|
# Error message for empty time formats. "HH:MM A" should be localized.
|
package/i18n/zh-TW.js
CHANGED
|
@@ -109,7 +109,7 @@ export default {
|
|
|
109
109
|
"be.contentSidebar.activityFeed.commentForm.commentCancel": "取消",
|
|
110
110
|
"be.contentSidebar.activityFeed.commentForm.commentLabel": "撰寫留言",
|
|
111
111
|
"be.contentSidebar.activityFeed.commentForm.commentPost": "張貼",
|
|
112
|
-
"be.contentSidebar.activityFeed.commentForm.commentTimestampLabel": "
|
|
112
|
+
"be.contentSidebar.activityFeed.commentForm.commentTimestampLabel": "帶時間戳的留言",
|
|
113
113
|
"be.contentSidebar.activityFeed.commentForm.commentWrite": "撰寫留言",
|
|
114
114
|
"be.contentSidebar.activityFeed.commmon.showOriginalMessage": "顯示原始留言",
|
|
115
115
|
"be.contentSidebar.activityFeed.common.activityStatusResolved": "已解決",
|
|
@@ -291,9 +291,12 @@ export default {
|
|
|
291
291
|
"be.messageCenter.previewError": "很抱歉,顯示此影像時發生問題。",
|
|
292
292
|
"be.messageCenter.product": "產品",
|
|
293
293
|
"be.messageCenter.title": "新增內容",
|
|
294
|
+
"be.metadataUpdateErrorNotification": "Unable to save changes. Please try again.",
|
|
295
|
+
"be.metadataUpdateSuccessNotification": " {numSelected, plural, =1 {1 document updated} other {# documents updated} } ",
|
|
294
296
|
"be.modifiedDate": "於 {date} 修改",
|
|
295
297
|
"be.modifiedDateBy": "{name} 於 {date} 修改",
|
|
296
298
|
"be.moreOptions": "更多選項",
|
|
299
|
+
"be.multipleValues": "Multiple Values",
|
|
297
300
|
"be.nameASC": "名稱:A → Z",
|
|
298
301
|
"be.nameDESC": "名稱:Z → A",
|
|
299
302
|
"be.nameDate": "{name} 於 {date}",
|
|
@@ -417,6 +420,7 @@ export default {
|
|
|
417
420
|
"be.skillUnknownError": "執行這個技能或擷取其資料時發生錯誤。",
|
|
418
421
|
"be.sort": "排序",
|
|
419
422
|
"be.statusSkill": "狀態",
|
|
423
|
+
"be.success": "Success",
|
|
420
424
|
"be.today": "今天",
|
|
421
425
|
"be.topicsSkill": "主題",
|
|
422
426
|
"be.transcriptEdit": "按一下任一區段以編輯。",
|
|
@@ -483,6 +487,8 @@ export default {
|
|
|
483
487
|
"boxui.categorySelector.label.more": "更多",
|
|
484
488
|
"boxui.checkboxTooltip.iconInfoText": "資訊",
|
|
485
489
|
"boxui.classification.add": "新增",
|
|
490
|
+
"boxui.classification.appliedByBoxAi": "Box AI",
|
|
491
|
+
"boxui.classification.appliedByBoxAiOnDate": "Box AI on {modifiedAt}",
|
|
486
492
|
"boxui.classification.classification": "分類",
|
|
487
493
|
"boxui.classification.classificationDarkBlue": "深藍色",
|
|
488
494
|
"boxui.classification.classificationGreen": "綠色",
|
|
@@ -913,7 +919,7 @@ export default {
|
|
|
913
919
|
"boxui.shareMenu.shortcutOnly": "僅捷徑",
|
|
914
920
|
"boxui.shareMenu.viewAndDownload": "檢視與下載",
|
|
915
921
|
"boxui.shareMenu.viewOnly": "僅檢視",
|
|
916
|
-
"boxui.subHeader.bulkItemActionMenuAriaLabel": "
|
|
922
|
+
"boxui.subHeader.bulkItemActionMenuAriaLabel": "大量動作",
|
|
917
923
|
"boxui.subHeader.metadata": "中繼資料",
|
|
918
924
|
"boxui.timeInput.emptyTimeError": "必填欄位。請以「上午 時時:分分」的格式輸入時間。",
|
|
919
925
|
"boxui.timeInput.invalidTimeError": "無效的時間格式。請以「上午 時時:分分」的格式輸入時間。",
|
package/i18n/zh-TW.properties
CHANGED
|
@@ -219,7 +219,7 @@ be.contentSidebar.activityFeed.commentForm.commentLabel = 撰寫留言
|
|
|
219
219
|
# Text for post button
|
|
220
220
|
be.contentSidebar.activityFeed.commentForm.commentPost = 張貼
|
|
221
221
|
# Label for toggle to add video timestamp to comment
|
|
222
|
-
be.contentSidebar.activityFeed.commentForm.commentTimestampLabel =
|
|
222
|
+
be.contentSidebar.activityFeed.commentForm.commentTimestampLabel = 帶時間戳的留言
|
|
223
223
|
# Placeholder for comment input
|
|
224
224
|
be.contentSidebar.activityFeed.commentForm.commentWrite = 撰寫留言
|
|
225
225
|
# Show original button for showing original comment
|
|
@@ -966,6 +966,10 @@ boxui.categorySelector.label.more = 更多
|
|
|
966
966
|
boxui.checkboxTooltip.iconInfoText = 資訊
|
|
967
967
|
# Button to add classification on an item
|
|
968
968
|
boxui.classification.add = 新增
|
|
969
|
+
# Title of the card that shows the reason why the AI classification was applied when no date is available.
|
|
970
|
+
boxui.classification.appliedByBoxAi = Box AI
|
|
971
|
+
# Title of the card that shows the reason why the AI classification was applied on a specific date.
|
|
972
|
+
boxui.classification.appliedByBoxAiOnDate = Box AI on {modifiedAt}
|
|
969
973
|
# Header for classification section in sidebar
|
|
970
974
|
boxui.classification.classification = 分類
|
|
971
975
|
# Classification label color name as dark blue
|
|
@@ -1827,7 +1831,7 @@ boxui.shareMenu.viewAndDownload = 檢視與下載
|
|
|
1827
1831
|
# Description of permissions granted to users who have access to the shared link
|
|
1828
1832
|
boxui.shareMenu.viewOnly = 僅檢視
|
|
1829
1833
|
# Aria-label for the dropdown menu that shows actions for selected items
|
|
1830
|
-
boxui.subHeader.bulkItemActionMenuAriaLabel =
|
|
1834
|
+
boxui.subHeader.bulkItemActionMenuAriaLabel = 大量動作
|
|
1831
1835
|
# Text for metadata button that will open the metadata side panel
|
|
1832
1836
|
boxui.subHeader.metadata = 中繼資料
|
|
1833
1837
|
# Error message for empty time formats. "HH:MM A" should be localized.
|
package/package.json
CHANGED
package/src/api/Metadata.js
CHANGED
|
@@ -16,7 +16,7 @@ import partition from 'lodash/partition';
|
|
|
16
16
|
import uniq from 'lodash/uniq';
|
|
17
17
|
import uniqueId from 'lodash/uniqueId';
|
|
18
18
|
import { getBadItemError, getBadPermissionsError, isUserCorrectableError } from '../utils/error';
|
|
19
|
-
import { getTypedFileId } from '../utils/file';
|
|
19
|
+
import { getTypedFileId, getTypedFolderId } from '../utils/file';
|
|
20
20
|
import { handleOnAbort, formatMetadataFieldValue } from './utils';
|
|
21
21
|
import File from './File';
|
|
22
22
|
import {
|
|
@@ -90,6 +90,16 @@ class Metadata extends File {
|
|
|
90
90
|
return `${this.getMetadataCacheKey(id)}_classification`;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
+
/**
|
|
94
|
+
* Creates a key for the metadata template schema cache
|
|
95
|
+
*
|
|
96
|
+
* @param {string} templateKey - template key
|
|
97
|
+
* @return {string} key
|
|
98
|
+
*/
|
|
99
|
+
getMetadataTemplateSchemaCacheKey(templateKey: string): string {
|
|
100
|
+
return `${CACHE_PREFIX_METADATA}template_schema_${templateKey}`;
|
|
101
|
+
}
|
|
102
|
+
|
|
93
103
|
/**
|
|
94
104
|
* API URL for metadata
|
|
95
105
|
*
|
|
@@ -105,6 +115,21 @@ class Metadata extends File {
|
|
|
105
115
|
return baseUrl;
|
|
106
116
|
}
|
|
107
117
|
|
|
118
|
+
/**
|
|
119
|
+
* API URL for metadata
|
|
120
|
+
*
|
|
121
|
+
* @param {string} id - a Box folder id
|
|
122
|
+
* @param {string} field - metadata field
|
|
123
|
+
* @return {string} base url for files
|
|
124
|
+
*/
|
|
125
|
+
getMetadataUrlForFolder(id: string, scope?: string, template?: string): string {
|
|
126
|
+
const baseUrl = `${this.getBaseApiUrl()}/folders/${id}/metadata`;
|
|
127
|
+
if (scope && template) {
|
|
128
|
+
return `${baseUrl}/${scope}/${template}`;
|
|
129
|
+
}
|
|
130
|
+
return baseUrl;
|
|
131
|
+
}
|
|
132
|
+
|
|
108
133
|
/**
|
|
109
134
|
* API URL for metadata templates for a scope
|
|
110
135
|
*
|
|
@@ -337,9 +362,23 @@ class Metadata extends File {
|
|
|
337
362
|
* @param {string} templateKey - template key
|
|
338
363
|
* @return {Promise} Promise object of metadata template
|
|
339
364
|
*/
|
|
340
|
-
getSchemaByTemplateKey(templateKey: string): Promise<MetadataTemplateSchemaResponse> {
|
|
365
|
+
async getSchemaByTemplateKey(templateKey: string): Promise<MetadataTemplateSchemaResponse> {
|
|
366
|
+
const cache: APICache = this.getCache();
|
|
367
|
+
const key = this.getMetadataTemplateSchemaCacheKey(templateKey);
|
|
368
|
+
|
|
369
|
+
// Return cached value if it exists
|
|
370
|
+
if (cache.has(key)) {
|
|
371
|
+
return cache.get(key);
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
// Fetch from API if not cached
|
|
341
375
|
const url = this.getMetadataTemplateSchemaUrl(templateKey);
|
|
342
|
-
|
|
376
|
+
const response = await this.xhr.get({ url });
|
|
377
|
+
|
|
378
|
+
// Cache the response
|
|
379
|
+
cache.set(key, response);
|
|
380
|
+
|
|
381
|
+
return response;
|
|
343
382
|
}
|
|
344
383
|
|
|
345
384
|
/**
|
|
@@ -786,27 +825,33 @@ class Metadata extends File {
|
|
|
786
825
|
}
|
|
787
826
|
|
|
788
827
|
/**
|
|
789
|
-
* API for patching metadata on file
|
|
828
|
+
* API for patching metadata on item (file/folder)
|
|
790
829
|
*
|
|
791
|
-
* @param {BoxItem}
|
|
830
|
+
* @param {BoxItem} item - File/Folder object for which we are changing the description
|
|
792
831
|
* @param {Object} template - Metadata template
|
|
793
832
|
* @param {Array} operations - Array of JSON patch operations
|
|
794
833
|
* @param {Function} successCallback - Success callback
|
|
795
834
|
* @param {Function} errorCallback - Error callback
|
|
835
|
+
* @param {boolean} suppressCallbacks - Boolean to decide whether suppress callbacks or not
|
|
796
836
|
* @return {Promise}
|
|
797
837
|
*/
|
|
798
838
|
async updateMetadata(
|
|
799
|
-
|
|
839
|
+
item: BoxItem,
|
|
800
840
|
template: MetadataTemplate,
|
|
801
841
|
operations: JSONPatchOperations,
|
|
802
842
|
successCallback: Function,
|
|
803
843
|
errorCallback: ElementsErrorCallback,
|
|
844
|
+
suppressCallbacks?: boolean,
|
|
804
845
|
): Promise<void> {
|
|
805
846
|
this.errorCode = ERROR_CODE_UPDATE_METADATA;
|
|
806
|
-
|
|
807
|
-
|
|
847
|
+
if (!suppressCallbacks) {
|
|
848
|
+
// Only set callbacks when we intend to invoke them for this call
|
|
849
|
+
// so that callers performing bulk operations can suppress per-item callbacks
|
|
850
|
+
this.successCallback = successCallback;
|
|
851
|
+
this.errorCallback = errorCallback;
|
|
852
|
+
}
|
|
808
853
|
|
|
809
|
-
const { id, permissions } =
|
|
854
|
+
const { id, permissions, type } = item;
|
|
810
855
|
if (!id || !permissions) {
|
|
811
856
|
this.errorHandler(getBadItemError());
|
|
812
857
|
return;
|
|
@@ -821,11 +866,14 @@ class Metadata extends File {
|
|
|
821
866
|
|
|
822
867
|
try {
|
|
823
868
|
const metadata = await this.xhr.put({
|
|
824
|
-
url:
|
|
869
|
+
url:
|
|
870
|
+
type === 'file'
|
|
871
|
+
? this.getMetadataUrl(id, template.scope, template.templateKey)
|
|
872
|
+
: this.getMetadataUrlForFolder(id, template.scope, template.templateKey),
|
|
825
873
|
headers: {
|
|
826
874
|
[HEADER_CONTENT_TYPE]: 'application/json-patch+json',
|
|
827
875
|
},
|
|
828
|
-
id: getTypedFileId(id),
|
|
876
|
+
id: type === 'file' ? getTypedFileId(id) : getTypedFolderId(id),
|
|
829
877
|
data: operations,
|
|
830
878
|
});
|
|
831
879
|
if (!this.isDestroyed()) {
|
|
@@ -840,13 +888,63 @@ class Metadata extends File {
|
|
|
840
888
|
editor,
|
|
841
889
|
);
|
|
842
890
|
}
|
|
843
|
-
|
|
891
|
+
if (!suppressCallbacks) {
|
|
892
|
+
this.successHandler(editor);
|
|
893
|
+
}
|
|
844
894
|
}
|
|
845
895
|
} catch (e) {
|
|
896
|
+
if (suppressCallbacks) {
|
|
897
|
+
// Let the caller decide how to handle errors (e.g., aggregate for bulk operations)
|
|
898
|
+
throw e;
|
|
899
|
+
}
|
|
846
900
|
this.errorHandler(e);
|
|
847
901
|
}
|
|
848
902
|
}
|
|
849
903
|
|
|
904
|
+
/**
|
|
905
|
+
* API for bulk patching metadata on items (file/folder)
|
|
906
|
+
*
|
|
907
|
+
* @param {BoxItem[]} items - File/Folder object for which we are changing the description
|
|
908
|
+
* @param {Object} template - Metadata template
|
|
909
|
+
* @param {Array} operations - Array of JSON patch operations for each item
|
|
910
|
+
* @param {Function} successCallback - Success callback
|
|
911
|
+
* @param {Function} errorCallback - Error callback
|
|
912
|
+
* @return {Promise}
|
|
913
|
+
*/
|
|
914
|
+
async bulkUpdateMetadata(
|
|
915
|
+
items: BoxItem[],
|
|
916
|
+
template: MetadataTemplate,
|
|
917
|
+
operations: JSONPatchOperations[],
|
|
918
|
+
successCallback: Function,
|
|
919
|
+
errorCallback: ElementsErrorCallback,
|
|
920
|
+
): Promise<void> {
|
|
921
|
+
this.errorCode = ERROR_CODE_UPDATE_METADATA;
|
|
922
|
+
this.successCallback = successCallback;
|
|
923
|
+
this.errorCallback = errorCallback;
|
|
924
|
+
|
|
925
|
+
try {
|
|
926
|
+
const updatePromises = items.map(async (item, index) => {
|
|
927
|
+
try {
|
|
928
|
+
// Suppress per-item callbacks; aggregate outcome at the bulk level only
|
|
929
|
+
await this.updateMetadata(item, template, operations[index], successCallback, errorCallback, true);
|
|
930
|
+
} catch (e) {
|
|
931
|
+
// Re-throw to be caught by Promise.all and handled once below
|
|
932
|
+
throw new Error(`Failed to update metadata: ${e.message || e}`);
|
|
933
|
+
}
|
|
934
|
+
});
|
|
935
|
+
|
|
936
|
+
await Promise.all(updatePromises);
|
|
937
|
+
|
|
938
|
+
if (!this.isDestroyed()) {
|
|
939
|
+
this.successHandler();
|
|
940
|
+
}
|
|
941
|
+
} catch (e) {
|
|
942
|
+
if (!this.isDestroyed()) {
|
|
943
|
+
this.errorHandler(e);
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
|
|
850
948
|
/**
|
|
851
949
|
* API for patching metadata on file
|
|
852
950
|
*
|
|
@@ -1700,6 +1700,7 @@ describe('api/Metadata', () => {
|
|
|
1700
1700
|
permissions: {
|
|
1701
1701
|
can_upload: true,
|
|
1702
1702
|
},
|
|
1703
|
+
type: 'file',
|
|
1703
1704
|
};
|
|
1704
1705
|
const ops = [{ op: 'add' }, { op: 'test' }];
|
|
1705
1706
|
const cache = new Cache();
|
|
@@ -1767,6 +1768,7 @@ describe('api/Metadata', () => {
|
|
|
1767
1768
|
permissions: {
|
|
1768
1769
|
can_upload: true,
|
|
1769
1770
|
},
|
|
1771
|
+
type: 'file',
|
|
1770
1772
|
};
|
|
1771
1773
|
const ops = [{ op: 'add' }, { op: 'test' }];
|
|
1772
1774
|
const cache = new Cache();
|
|
@@ -1833,6 +1835,7 @@ describe('api/Metadata', () => {
|
|
|
1833
1835
|
permissions: {
|
|
1834
1836
|
can_upload: true,
|
|
1835
1837
|
},
|
|
1838
|
+
type: 'file',
|
|
1836
1839
|
};
|
|
1837
1840
|
const ops = [{ op: 'add' }, { op: 'test' }];
|
|
1838
1841
|
const cache = new Cache();
|
|
@@ -1894,6 +1897,123 @@ describe('api/Metadata', () => {
|
|
|
1894
1897
|
});
|
|
1895
1898
|
});
|
|
1896
1899
|
|
|
1900
|
+
describe('bulkUpdateMetadata()', () => {
|
|
1901
|
+
test('should call updateMetadata for each item and call successHandler when all succeed', async () => {
|
|
1902
|
+
const success = jest.fn();
|
|
1903
|
+
const error = jest.fn();
|
|
1904
|
+
const items = [
|
|
1905
|
+
{ id: '1', name: 'file1', permissions: { can_upload: true }, type: 'file' },
|
|
1906
|
+
{ id: '2', name: 'file2', permissions: { can_upload: true }, type: 'file' },
|
|
1907
|
+
];
|
|
1908
|
+
const template = { scope: 'scope', templateKey: 'templateKey' };
|
|
1909
|
+
const ops = [[{ op: 'replace', path: '/foo', value: 'a' }], [{ op: 'replace', path: '/foo', value: 'b' }]];
|
|
1910
|
+
|
|
1911
|
+
metadata.updateMetadata = jest.fn().mockResolvedValue(undefined);
|
|
1912
|
+
metadata.isDestroyed = jest.fn().mockReturnValue(false);
|
|
1913
|
+
metadata.successHandler = jest.fn();
|
|
1914
|
+
metadata.errorHandler = jest.fn();
|
|
1915
|
+
|
|
1916
|
+
await metadata.bulkUpdateMetadata(items, template, ops, success, error);
|
|
1917
|
+
|
|
1918
|
+
expect(metadata.errorCode).toBe(ERROR_CODE_UPDATE_METADATA);
|
|
1919
|
+
expect(metadata.successCallback).toBe(success);
|
|
1920
|
+
expect(metadata.errorCallback).toBe(error);
|
|
1921
|
+
expect(metadata.updateMetadata).toHaveBeenCalledTimes(2);
|
|
1922
|
+
expect(metadata.updateMetadata).toHaveBeenNthCalledWith(
|
|
1923
|
+
1,
|
|
1924
|
+
items[0],
|
|
1925
|
+
template,
|
|
1926
|
+
ops[0],
|
|
1927
|
+
success,
|
|
1928
|
+
error,
|
|
1929
|
+
true,
|
|
1930
|
+
);
|
|
1931
|
+
expect(metadata.updateMetadata).toHaveBeenNthCalledWith(
|
|
1932
|
+
2,
|
|
1933
|
+
items[1],
|
|
1934
|
+
template,
|
|
1935
|
+
ops[1],
|
|
1936
|
+
success,
|
|
1937
|
+
error,
|
|
1938
|
+
true,
|
|
1939
|
+
);
|
|
1940
|
+
expect(metadata.isDestroyed).toHaveBeenCalledTimes(1);
|
|
1941
|
+
expect(metadata.successHandler).toHaveBeenCalledTimes(1);
|
|
1942
|
+
expect(metadata.errorHandler).not.toHaveBeenCalled();
|
|
1943
|
+
});
|
|
1944
|
+
|
|
1945
|
+
test('should call errorHandler with aggregated error when any update fails', async () => {
|
|
1946
|
+
const success = jest.fn();
|
|
1947
|
+
const error = jest.fn();
|
|
1948
|
+
const items = [
|
|
1949
|
+
{ id: '1', name: 'file1', permissions: { can_upload: true }, type: 'file' },
|
|
1950
|
+
{ id: '2', name: 'file2', permissions: { can_upload: true }, type: 'file' },
|
|
1951
|
+
];
|
|
1952
|
+
const template = { scope: 'scope', templateKey: 'templateKey' };
|
|
1953
|
+
const ops = [[], []];
|
|
1954
|
+
|
|
1955
|
+
metadata.updateMetadata = jest
|
|
1956
|
+
.fn()
|
|
1957
|
+
.mockResolvedValueOnce(undefined)
|
|
1958
|
+
.mockRejectedValueOnce(new Error('mock error'));
|
|
1959
|
+
metadata.isDestroyed = jest.fn().mockReturnValue(false);
|
|
1960
|
+
metadata.successHandler = jest.fn();
|
|
1961
|
+
metadata.errorHandler = jest.fn();
|
|
1962
|
+
|
|
1963
|
+
await metadata.bulkUpdateMetadata(items, template, ops, success, error);
|
|
1964
|
+
|
|
1965
|
+
expect(metadata.updateMetadata).toHaveBeenCalledTimes(2);
|
|
1966
|
+
expect(metadata.errorHandler).toHaveBeenCalledTimes(1);
|
|
1967
|
+
const errArg = metadata.errorHandler.mock.calls[0][0];
|
|
1968
|
+
expect(errArg).toBeInstanceOf(Error);
|
|
1969
|
+
expect(errArg.message).toContain('Failed to update metadata');
|
|
1970
|
+
expect(errArg.message).toContain('mock error');
|
|
1971
|
+
expect(metadata.successHandler).not.toHaveBeenCalled();
|
|
1972
|
+
});
|
|
1973
|
+
|
|
1974
|
+
test('should not call successHandler when destroyed after successful updates', async () => {
|
|
1975
|
+
const success = jest.fn();
|
|
1976
|
+
const error = jest.fn();
|
|
1977
|
+
const items = [
|
|
1978
|
+
{ id: '1', name: 'file1', permissions: { can_upload: true }, type: 'file' },
|
|
1979
|
+
{ id: '2', name: 'file2', permissions: { can_upload: true }, type: 'file' },
|
|
1980
|
+
];
|
|
1981
|
+
const template = { scope: 'scope', templateKey: 'templateKey' };
|
|
1982
|
+
const ops = [[], []];
|
|
1983
|
+
|
|
1984
|
+
metadata.updateMetadata = jest.fn().mockResolvedValue(undefined);
|
|
1985
|
+
metadata.isDestroyed = jest.fn().mockReturnValue(true);
|
|
1986
|
+
metadata.successHandler = jest.fn();
|
|
1987
|
+
metadata.errorHandler = jest.fn();
|
|
1988
|
+
|
|
1989
|
+
await metadata.bulkUpdateMetadata(items, template, ops, success, error);
|
|
1990
|
+
|
|
1991
|
+
expect(metadata.successHandler).not.toHaveBeenCalled();
|
|
1992
|
+
expect(metadata.errorHandler).not.toHaveBeenCalled();
|
|
1993
|
+
});
|
|
1994
|
+
|
|
1995
|
+
test('should not call errorHandler when destroyed after failure', async () => {
|
|
1996
|
+
const success = jest.fn();
|
|
1997
|
+
const error = jest.fn();
|
|
1998
|
+
const items = [
|
|
1999
|
+
{ id: '1', name: 'file1', permissions: { can_upload: true }, type: 'file' },
|
|
2000
|
+
{ id: '2', name: 'file2', permissions: { can_upload: true }, type: 'file' },
|
|
2001
|
+
];
|
|
2002
|
+
const template = { scope: 'scope', templateKey: 'templateKey' };
|
|
2003
|
+
const ops = [[], []];
|
|
2004
|
+
|
|
2005
|
+
metadata.updateMetadata = jest.fn().mockRejectedValue(new Error('mock error'));
|
|
2006
|
+
metadata.isDestroyed = jest.fn().mockReturnValue(true);
|
|
2007
|
+
metadata.successHandler = jest.fn();
|
|
2008
|
+
metadata.errorHandler = jest.fn();
|
|
2009
|
+
|
|
2010
|
+
await metadata.bulkUpdateMetadata(items, template, ops, success, error);
|
|
2011
|
+
|
|
2012
|
+
expect(metadata.successHandler).not.toHaveBeenCalled();
|
|
2013
|
+
expect(metadata.errorHandler).not.toHaveBeenCalled();
|
|
2014
|
+
});
|
|
2015
|
+
});
|
|
2016
|
+
|
|
1897
2017
|
describe('updateMetadataRedesign()', () => {
|
|
1898
2018
|
test('should call error callback with a bad item error when no id', () => {
|
|
1899
2019
|
jest.spyOn(ErrorUtil, 'getBadItemError').mockReturnValueOnce('error');
|