box-ui-elements 23.4.0-beta.37 → 23.4.0-beta.39

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 (67) hide show
  1. package/dist/explorer.css +1 -1
  2. package/dist/explorer.js +1 -1
  3. package/dist/preview.css +1 -1
  4. package/dist/preview.js +1 -1
  5. package/dist/sidebar.css +1 -1
  6. package/dist/sidebar.js +1 -1
  7. package/es/common/types/metadata.js.flow +5 -4
  8. package/es/common/types/metadata.js.map +1 -1
  9. package/es/elements/content-explorer/stories/tests/MetadataView-visual.stories.js +43 -22
  10. package/es/elements/content-explorer/stories/tests/MetadataView-visual.stories.js.map +1 -1
  11. package/es/features/metadata-instance-editor/CascadePolicy.js +6 -3
  12. package/es/features/metadata-instance-editor/CascadePolicy.js.flow +8 -2
  13. package/es/features/metadata-instance-editor/CascadePolicy.js.map +1 -1
  14. package/es/features/metadata-instance-editor/Instance.js +1 -0
  15. package/es/features/metadata-instance-editor/Instance.js.flow +1 -0
  16. package/es/features/metadata-instance-editor/Instance.js.map +1 -1
  17. package/es/src/elements/content-explorer/stories/tests/MetadataView-visual.stories.d.ts +1 -1
  18. package/i18n/bn-IN.js +2 -2
  19. package/i18n/bn-IN.properties +2 -2
  20. package/i18n/da-DK.js +2 -2
  21. package/i18n/da-DK.properties +2 -2
  22. package/i18n/de-DE.js +2 -2
  23. package/i18n/de-DE.properties +2 -2
  24. package/i18n/en-AU.js +1 -1
  25. package/i18n/en-AU.properties +1 -1
  26. package/i18n/en-GB.js +1 -1
  27. package/i18n/en-GB.properties +1 -1
  28. package/i18n/es-419.js +2 -2
  29. package/i18n/es-419.properties +2 -2
  30. package/i18n/es-ES.js +2 -2
  31. package/i18n/es-ES.properties +2 -2
  32. package/i18n/fi-FI.js +2 -2
  33. package/i18n/fi-FI.properties +2 -2
  34. package/i18n/fr-CA.js +2 -2
  35. package/i18n/fr-CA.properties +2 -2
  36. package/i18n/fr-FR.js +2 -2
  37. package/i18n/fr-FR.properties +2 -2
  38. package/i18n/hi-IN.js +2 -2
  39. package/i18n/hi-IN.properties +2 -2
  40. package/i18n/it-IT.js +2 -2
  41. package/i18n/it-IT.properties +2 -2
  42. package/i18n/ko-KR.js +2 -2
  43. package/i18n/ko-KR.properties +2 -2
  44. package/i18n/nb-NO.js +2 -2
  45. package/i18n/nb-NO.properties +2 -2
  46. package/i18n/nl-NL.js +2 -2
  47. package/i18n/nl-NL.properties +2 -2
  48. package/i18n/pl-PL.js +2 -2
  49. package/i18n/pl-PL.properties +2 -2
  50. package/i18n/pt-BR.js +2 -2
  51. package/i18n/pt-BR.properties +2 -2
  52. package/i18n/ru-RU.js +2 -2
  53. package/i18n/ru-RU.properties +2 -2
  54. package/i18n/sv-SE.js +2 -2
  55. package/i18n/sv-SE.properties +2 -2
  56. package/i18n/tr-TR.js +2 -2
  57. package/i18n/tr-TR.properties +2 -2
  58. package/i18n/zh-CN.js +2 -2
  59. package/i18n/zh-CN.properties +2 -2
  60. package/i18n/zh-TW.js +2 -2
  61. package/i18n/zh-TW.properties +2 -2
  62. package/package.json +3 -3
  63. package/src/common/types/metadata.js +5 -4
  64. package/src/elements/content-explorer/stories/tests/MetadataView-visual.stories.tsx +47 -31
  65. package/src/features/metadata-instance-editor/CascadePolicy.js +8 -2
  66. package/src/features/metadata-instance-editor/Instance.js +1 -0
  67. package/src/features/metadata-instance-editor/__tests__/CascadePolicy.test.js +45 -0
@@ -93,7 +93,7 @@ be.cancel = Cancelar
93
93
  # Label for choose action.
94
94
  be.choose = Escolher
95
95
  # Aria label for the clear selection button.
96
- be.clearSelection = Clear selection
96
+ be.clearSelection = Limpar seleção
97
97
  # Label for close action.
98
98
  be.close = Fechar
99
99
  # Icon title for a Box item of type folder that has collaborators
@@ -605,7 +605,7 @@ be.noActivityAnnotationPrompt = Passe o mouse sobre a pré-visualização e use
605
605
  # Message shown in
606
606
  be.noActivityCommentPrompt = Comente e @mencione pessoas para notificá-las.
607
607
  # Text shown to indicate the number of files selected
608
- be.numFilesSelected = {numSelected, plural, =0 {0 files selected} one {1 file selected} other {# files selected} }
608
+ be.numFilesSelected = {numSelected,plural,=0{0 arquivos selecionados} one{1 arquivo selecionado} other{# arquivos selecionados}}
609
609
  # Label for open action.
610
610
  be.open = Abrir
611
611
  # Next page button tooltip
package/i18n/ru-RU.js CHANGED
@@ -46,7 +46,7 @@ export default {
46
46
  "be.breadcrumb.breadcrumbLabel": "Навигационная цепочка",
47
47
  "be.cancel": "Отмена",
48
48
  "be.choose": "Выбрать",
49
- "be.clearSelection": "Clear selection",
49
+ "be.clearSelection": "Отменить выбор",
50
50
  "be.close": "Закрыть",
51
51
  "be.collaboratedFolder": "Папка совместной работы",
52
52
  "be.collapse": "Свернуть",
@@ -302,7 +302,7 @@ export default {
302
302
  "be.noActivity": "Нет действий",
303
303
  "be.noActivityAnnotationPrompt": "Наведите курсор на предпросмотр и используйте элементы управления в нижней части для добавления примечаний в файл.",
304
304
  "be.noActivityCommentPrompt": "Комментируйте и упоминайте пользователей, добавляя перед их именем символ «@».",
305
- "be.numFilesSelected": "{numSelected, plural, =0 {0 files selected} one {1 file selected} other {# files selected} } ",
305
+ "be.numFilesSelected": "{numSelected,plural,=0{0 файлов выбрано} one{1 файл выбран} few{# файла выбрано} many{# файлов выбрано} other{# файлов выбрано}} ",
306
306
  "be.open": "Открыть",
307
307
  "be.pagination.nextPage": "Следующая страница",
308
308
  "be.pagination.nextPageButton": "Далее",
@@ -93,7 +93,7 @@ be.cancel = Отмена
93
93
  # Label for choose action.
94
94
  be.choose = Выбрать
95
95
  # Aria label for the clear selection button.
96
- be.clearSelection = Clear selection
96
+ be.clearSelection = Отменить выбор
97
97
  # Label for close action.
98
98
  be.close = Закрыть
99
99
  # Icon title for a Box item of type folder that has collaborators
@@ -605,7 +605,7 @@ be.noActivityAnnotationPrompt = Наведите курсор на предпр
605
605
  # Message shown in
606
606
  be.noActivityCommentPrompt = Комментируйте и упоминайте пользователей, добавляя перед их именем символ «@».
607
607
  # Text shown to indicate the number of files selected
608
- be.numFilesSelected = {numSelected, plural, =0 {0 files selected} one {1 file selected} other {# files selected} }
608
+ be.numFilesSelected = {numSelected,plural,=0{0 файлов выбрано} one{1 файл выбран} few{# файла выбрано} many{# файлов выбрано} other{# файлов выбрано}}
609
609
  # Label for open action.
610
610
  be.open = Открыть
611
611
  # Next page button tooltip
package/i18n/sv-SE.js CHANGED
@@ -46,7 +46,7 @@ export default {
46
46
  "be.breadcrumb.breadcrumbLabel": "Länkstig",
47
47
  "be.cancel": "Avbryt",
48
48
  "be.choose": "Välj",
49
- "be.clearSelection": "Clear selection",
49
+ "be.clearSelection": "Rensa markering",
50
50
  "be.close": "Stäng",
51
51
  "be.collaboratedFolder": "Samlad mapp",
52
52
  "be.collapse": "Komprimera",
@@ -302,7 +302,7 @@ export default {
302
302
  "be.noActivity": "Ingen aktivitet att visa",
303
303
  "be.noActivityAnnotationPrompt": "Håll markören över förhandsgranskningen och använd reglagen längst ned för att göra anteckningar i filen.",
304
304
  "be.noActivityCommentPrompt": "Kommentera och @nämn personer för att meddela dem.",
305
- "be.numFilesSelected": "{numSelected, plural, =0 {0 files selected} one {1 file selected} other {# files selected} } ",
305
+ "be.numFilesSelected": "{numSelected,plural,=0{0 filer valda} one{1 fil vald} other{# filer valda}} ",
306
306
  "be.open": "Öppna",
307
307
  "be.pagination.nextPage": "Nästa sida",
308
308
  "be.pagination.nextPageButton": "Nästa",
@@ -93,7 +93,7 @@ be.cancel = Avbryt
93
93
  # Label for choose action.
94
94
  be.choose = Välj
95
95
  # Aria label for the clear selection button.
96
- be.clearSelection = Clear selection
96
+ be.clearSelection = Rensa markering
97
97
  # Label for close action.
98
98
  be.close = Stäng
99
99
  # Icon title for a Box item of type folder that has collaborators
@@ -605,7 +605,7 @@ be.noActivityAnnotationPrompt = Håll markören över förhandsgranskningen och
605
605
  # Message shown in
606
606
  be.noActivityCommentPrompt = Kommentera och @nämn personer för att meddela dem.
607
607
  # Text shown to indicate the number of files selected
608
- be.numFilesSelected = {numSelected, plural, =0 {0 files selected} one {1 file selected} other {# files selected} }
608
+ be.numFilesSelected = {numSelected,plural,=0{0 filer valda} one{1 fil vald} other{# filer valda}}
609
609
  # Label for open action.
610
610
  be.open = Öppna
611
611
  # Next page button tooltip
package/i18n/tr-TR.js CHANGED
@@ -46,7 +46,7 @@ export default {
46
46
  "be.breadcrumb.breadcrumbLabel": "İçerik Haritası",
47
47
  "be.cancel": "İptal",
48
48
  "be.choose": "Seç",
49
- "be.clearSelection": "Clear selection",
49
+ "be.clearSelection": "Seçimi temizle",
50
50
  "be.close": "Kapat",
51
51
  "be.collaboratedFolder": "İşbirliği Klasörü",
52
52
  "be.collapse": "Daralt",
@@ -302,7 +302,7 @@ export default {
302
302
  "be.noActivity": "Gösterilecek etkinlik yok",
303
303
  "be.noActivityAnnotationPrompt": "İmleci ön görüntülemenin üzerine getirin ve dosyaya açıklama eklemek için alttaki kontrolleri kullanın.",
304
304
  "be.noActivityCommentPrompt": "Bildirim alması için birinden @bahsedin ve hakkında yorum yapın.",
305
- "be.numFilesSelected": "{numSelected, plural, =0 {0 files selected} one {1 file selected} other {# files selected} } ",
305
+ "be.numFilesSelected": "{numSelected,plural,=0{0 dosya seçildi} one{1 dosya seçildi} other{# dosya seçildi}} ",
306
306
  "be.open": "Aç",
307
307
  "be.pagination.nextPage": "Sonraki Sayfa",
308
308
  "be.pagination.nextPageButton": "İleri",
@@ -93,7 +93,7 @@ be.cancel = İptal
93
93
  # Label for choose action.
94
94
  be.choose = Seç
95
95
  # Aria label for the clear selection button.
96
- be.clearSelection = Clear selection
96
+ be.clearSelection = Seçimi temizle
97
97
  # Label for close action.
98
98
  be.close = Kapat
99
99
  # Icon title for a Box item of type folder that has collaborators
@@ -605,7 +605,7 @@ be.noActivityAnnotationPrompt = İmleci ön görüntülemenin üzerine getirin v
605
605
  # Message shown in
606
606
  be.noActivityCommentPrompt = Bildirim alması için birinden @bahsedin ve hakkında yorum yapın.
607
607
  # Text shown to indicate the number of files selected
608
- be.numFilesSelected = {numSelected, plural, =0 {0 files selected} one {1 file selected} other {# files selected} }
608
+ be.numFilesSelected = {numSelected,plural,=0{0 dosya seçildi} one{1 dosya seçildi} other{# dosya seçildi}}
609
609
  # Label for open action.
610
610
  be.open = Aç
611
611
  # Next page button tooltip
package/i18n/zh-CN.js CHANGED
@@ -46,7 +46,7 @@ export default {
46
46
  "be.breadcrumb.breadcrumbLabel": "阶层连结",
47
47
  "be.cancel": "取消",
48
48
  "be.choose": "选择",
49
- "be.clearSelection": "Clear selection",
49
+ "be.clearSelection": "清除选择",
50
50
  "be.close": "关闭",
51
51
  "be.collaboratedFolder": "协作文件夹",
52
52
  "be.collapse": "折叠",
@@ -302,7 +302,7 @@ export default {
302
302
  "be.noActivity": "没有要显示的活动",
303
303
  "be.noActivityAnnotationPrompt": "将鼠标指针悬停在预览上,然后使用底部的控件为文件添加批注。",
304
304
  "be.noActivityCommentPrompt": "评论并用 @ 通知相关人员。",
305
- "be.numFilesSelected": "{numSelected, plural, =0 {0 files selected} one {1 file selected} other {# files selected} } ",
305
+ "be.numFilesSelected": "{numSelected,plural,=0{已选择 0 个文件} other{已选择 # 个文件}} ",
306
306
  "be.open": "打开",
307
307
  "be.pagination.nextPage": "下一页",
308
308
  "be.pagination.nextPageButton": "下一页",
@@ -93,7 +93,7 @@ be.cancel = 取消
93
93
  # Label for choose action.
94
94
  be.choose = 选择
95
95
  # Aria label for the clear selection button.
96
- be.clearSelection = Clear selection
96
+ be.clearSelection = 清除选择
97
97
  # Label for close action.
98
98
  be.close = 关闭
99
99
  # Icon title for a Box item of type folder that has collaborators
@@ -605,7 +605,7 @@ be.noActivityAnnotationPrompt = 将鼠标指针悬停在预览上,然后使用
605
605
  # Message shown in
606
606
  be.noActivityCommentPrompt = 评论并用 @ 通知相关人员。
607
607
  # Text shown to indicate the number of files selected
608
- be.numFilesSelected = {numSelected, plural, =0 {0 files selected} one {1 file selected} other {# files selected} }
608
+ be.numFilesSelected = {numSelected,plural,=0{已选择 0 个文件} other{已选择 # 个文件}}
609
609
  # Label for open action.
610
610
  be.open = 打开
611
611
  # Next page button tooltip
package/i18n/zh-TW.js CHANGED
@@ -46,7 +46,7 @@ export default {
46
46
  "be.breadcrumb.breadcrumbLabel": "階層連結",
47
47
  "be.cancel": "取消",
48
48
  "be.choose": "選擇",
49
- "be.clearSelection": "Clear selection",
49
+ "be.clearSelection": "清除選擇",
50
50
  "be.close": "關閉",
51
51
  "be.collaboratedFolder": "共同作業資料夾",
52
52
  "be.collapse": "摺疊",
@@ -302,7 +302,7 @@ export default {
302
302
  "be.noActivity": "沒有可顯示的活動",
303
303
  "be.noActivityAnnotationPrompt": "將游標停留在預覽上方,並使用底部的控制項為檔案新增註解。",
304
304
  "be.noActivityCommentPrompt": "留言並「@提及」人員來通知人員。",
305
- "be.numFilesSelected": "{numSelected, plural, =0 {0 files selected} one {1 file selected} other {# files selected} } ",
305
+ "be.numFilesSelected": "{numSelected,plural,=0{0 個檔案已選取} one{1 個檔案已選取} other{# 個檔案已選取}} ",
306
306
  "be.open": "開啟",
307
307
  "be.pagination.nextPage": "下一頁",
308
308
  "be.pagination.nextPageButton": "下一步",
@@ -93,7 +93,7 @@ be.cancel = 取消
93
93
  # Label for choose action.
94
94
  be.choose = 選擇
95
95
  # Aria label for the clear selection button.
96
- be.clearSelection = Clear selection
96
+ be.clearSelection = 清除選擇
97
97
  # Label for close action.
98
98
  be.close = 關閉
99
99
  # Icon title for a Box item of type folder that has collaborators
@@ -605,7 +605,7 @@ be.noActivityAnnotationPrompt = 將游標停留在預覽上方,並使用底部
605
605
  # Message shown in
606
606
  be.noActivityCommentPrompt = 留言並「@提及」人員來通知人員。
607
607
  # Text shown to indicate the number of files selected
608
- be.numFilesSelected = {numSelected, plural, =0 {0 files selected} one {1 file selected} other {# files selected} }
608
+ be.numFilesSelected = {numSelected,plural,=0{0 個檔案已選取} one{1 個檔案已選取} other{# 個檔案已選取}}
609
609
  # Label for open action.
610
610
  be.open = 開啟
611
611
  # Next page button tooltip
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "box-ui-elements",
3
- "version": "23.4.0-beta.37",
3
+ "version": "23.4.0-beta.39",
4
4
  "description": "Box UI Elements",
5
5
  "author": "Box (https://www.box.com/)",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -130,7 +130,7 @@
130
130
  "@babel/types": "^7.24.7",
131
131
  "@box/blueprint-web": "12.43.0",
132
132
  "@box/blueprint-web-assets": "4.61.5",
133
- "@box/box-ai-agent-selector": "^0.48.5",
133
+ "@box/box-ai-agent-selector": "^0.52.0",
134
134
  "@box/box-ai-content-answers": "^0.124.1",
135
135
  "@box/box-item-type-selector": "^0.61.12",
136
136
  "@box/cldr-data": "^34.2.0",
@@ -299,7 +299,7 @@
299
299
  "peerDependencies": {
300
300
  "@box/blueprint-web": "12.43.0",
301
301
  "@box/blueprint-web-assets": "4.61.5",
302
- "@box/box-ai-agent-selector": "^0.48.5",
302
+ "@box/box-ai-agent-selector": "^0.52.0",
303
303
  "@box/box-ai-content-answers": "^0.124.1",
304
304
  "@box/box-item-type-selector": "^0.61.12",
305
305
  "@box/cldr-data": ">=34.2.0",
@@ -87,14 +87,15 @@ type MetadataType = {
87
87
  global?: MetadataSkillsTemplate,
88
88
  };
89
89
 
90
+ type MetadataCascadePolicyConfiguration = {
91
+ agent: string,
92
+ };
93
+
90
94
  type MetadataCascadePolicy = {
91
95
  canEdit?: boolean,
92
96
  id?: string,
93
97
  cascadePolicyType?: string,
94
- };
95
-
96
- type MetadataCascadePolicyConfiguration = {
97
- agent: string,
98
+ cascadePolicyConfiguration?: MetadataCascadePolicyConfiguration,
98
99
  };
99
100
 
100
101
  type MetadataCascadingPolicyData = {
@@ -5,45 +5,61 @@ import ContentExplorer from '../../ContentExplorer';
5
5
  import { DEFAULT_HOSTNAME_API } from '../../../../constants';
6
6
  import { mockMetadata, mockSchema } from '../../../common/__mocks__/mockMetadata';
7
7
 
8
- const EID = '0';
9
- const templateName = 'templateName';
10
- const metadataSource = `enterprise_${EID}.${templateName}`;
11
- const metadataSourceFieldName = `metadata.${metadataSource}`;
8
+ // The intent behind relying on mockMetadata is to allow a developer to paste in their own metadata template schema for use with live API calls.
9
+ const { scope: templateScope, templateKey } = mockSchema;
12
10
 
13
- const metadataQuery = {
14
- from: metadataSource,
15
-
16
- // // Filter items in the folder by existing metadata key
17
- // query: 'key = :arg1',
18
- //
19
- // // Display items with value
20
- // query_params: { arg1: 'value' },
11
+ const metadataScopeAndKey = `${templateScope}.${templateKey}`;
12
+ const metadataFieldNamePrefix = `metadata.${metadataScopeAndKey}`;
21
13
 
22
- ancestor_folder_id: '313259567207',
14
+ // This is the body of the metadata query API call.
15
+ // https://developer.box.com/guides/metadata/queries/syntax/
16
+ const metadataQuery = {
17
+ from: metadataScopeAndKey,
18
+ ancestor_folder_id: '0',
19
+ sort_by: [
20
+ {
21
+ field_key: `${metadataFieldNamePrefix}.${mockSchema.fields[0].key}`, // Default to sorting by the first field in the schema
22
+ direction: 'asc',
23
+ },
24
+ ],
23
25
  fields: [
24
- `${metadataSourceFieldName}.name`,
25
- `${metadataSourceFieldName}.industry`,
26
- `${metadataSourceFieldName}.last_contacted_at`,
27
- `${metadataSourceFieldName}.role`,
26
+ // Default to returning all fields in the metadata template schema, and name as a standalone (non-metadata) field
27
+ ...mockSchema.fields.map(field => `${metadataFieldNamePrefix}.${field.key}`),
28
+ 'name',
28
29
  ],
29
30
  };
30
31
 
32
+ // Used for metadata view v1
31
33
  const fieldsToShow = [
32
- { key: `${metadataSourceFieldName}.name`, canEdit: false, displayName: 'Alias' },
33
- { key: `${metadataSourceFieldName}.industry`, canEdit: true },
34
- { key: `${metadataSourceFieldName}.last_contacted_at`, canEdit: true },
35
- { key: `${metadataSourceFieldName}.role`, canEdit: true },
34
+ { key: `${metadataFieldNamePrefix}.name`, canEdit: false, displayName: 'Alias' },
35
+ { key: `${metadataFieldNamePrefix}.industry`, canEdit: true },
36
+ { key: `${metadataFieldNamePrefix}.last_contacted_at`, canEdit: true },
37
+ { key: `${metadataFieldNamePrefix}.role`, canEdit: true },
38
+ ];
39
+
40
+ // Used for metadata view v2
41
+ const columns = [
42
+ {
43
+ // Always include the name column
44
+ textValue: 'Name',
45
+ id: 'name',
46
+ type: 'string',
47
+ allowSorting: true,
48
+ minWidth: 150,
49
+ maxWidth: 150,
50
+ },
51
+ ...mockSchema.fields.map(field => ({
52
+ textValue: field.displayName,
53
+ id: `${metadataFieldNamePrefix}.${field.key}`,
54
+ type: field.type,
55
+ allowSorting: true,
56
+ minWidth: 150,
57
+ maxWidth: 150,
58
+ })),
36
59
  ];
37
60
 
38
- const columns = mockSchema.fields.map(field => ({
39
- textValue: field.displayName,
40
- id: `${metadataSourceFieldName}.${field.key}`,
41
- type: field.type,
42
- allowSorting: true,
43
- minWidth: 150,
44
- maxWidth: 150,
45
- }));
46
- const defaultView = 'metadata'; // Required prop to paint the metadata view. If not provided, you'll get regular folder view.
61
+ // Switches ContentExplorer to use Metadata View over standard, folder-based view.
62
+ const defaultView = 'metadata';
47
63
 
48
64
  type Story = StoryObj<typeof ContentExplorer>;
49
65
 
@@ -55,7 +71,7 @@ export const metadataView: Story = {
55
71
  },
56
72
  };
57
73
 
58
- export const withNewMetadataView: Story = {
74
+ export const metadataViewV2: Story = {
59
75
  args: {
60
76
  metadataViewProps: {
61
77
  columns,
@@ -18,7 +18,8 @@ import Link from '../../components/link/Link';
18
18
  import IconAlertDefault from '../../icons/general/IconAlertDefault';
19
19
  import messages from './messages';
20
20
  import './CascadePolicy.scss';
21
- import { STANDARD_AGENT_ID, ENHANCED_AGENT_ID } from './constants';
21
+ import { STANDARD_AGENT_ID, ENHANCED_AGENT_ID, ENHANCED_AGENT_CONFIGURATION } from './constants';
22
+ import type { MetadataCascadePolicyConfiguration } from '../../common/types/metadata';
22
23
 
23
24
  const COMMUNITY_LINK = 'https://support.box.com/hc/en-us/articles/360044195873-Cascading-metadata-in-folders';
24
25
  const AI_LINK = 'https://www.box.com/ai';
@@ -27,6 +28,7 @@ type Props = {
27
28
  canEdit: boolean,
28
29
  canUseAIFolderExtraction: boolean,
29
30
  canUseAIFolderExtractionAgentSelector: boolean,
31
+ cascadePolicyConfiguration?: MetadataCascadePolicyConfiguration,
30
32
  isAIFolderExtractionEnabled: boolean,
31
33
  isCascadingEnabled: boolean,
32
34
  isCascadingOverwritten: boolean,
@@ -43,6 +45,7 @@ const CascadePolicy = ({
43
45
  canEdit,
44
46
  canUseAIFolderExtraction,
45
47
  canUseAIFolderExtractionAgentSelector,
48
+ cascadePolicyConfiguration,
46
49
  isCascadingEnabled,
47
50
  isCascadingOverwritten,
48
51
  isCustomMetadata,
@@ -62,6 +65,8 @@ const CascadePolicy = ({
62
65
  </div>
63
66
  ) : null;
64
67
 
68
+ const isEnhancedAgentSelected = cascadePolicyConfiguration?.agent === ENHANCED_AGENT_CONFIGURATION;
69
+
65
70
  const agents = React.useMemo(
66
71
  () => [
67
72
  {
@@ -74,9 +79,10 @@ const CascadePolicy = ({
74
79
  name: formatMessage(messages.enhancedAgentName),
75
80
  isEnterpriseDefault: false,
76
81
  customIcon: BoxAiAdvancedColor,
82
+ isSelected: isEnhancedAgentSelected,
77
83
  },
78
84
  ],
79
- [formatMessage],
85
+ [formatMessage, isEnhancedAgentSelected],
80
86
  );
81
87
 
82
88
  // BoxAiAgentSelectorWithApiContainer expects a function that returns a Promise<AgentListResponse>
@@ -700,6 +700,7 @@ class Instance extends React.PureComponent<Props, State> {
700
700
  <div className="metadata-instance-editor-instance">
701
701
  {isCascadingPolicyApplicable && (
702
702
  <CascadePolicy
703
+ cascadePolicyConfiguration={cascadePolicy?.cascadePolicyConfiguration}
703
704
  canEdit={isEditing && !!cascadePolicy.canEdit}
704
705
  canUseAIFolderExtraction={canUseAIFolderExtraction}
705
706
  canUseAIFolderExtractionAgentSelector={
@@ -176,6 +176,51 @@ describe('features/metadata-instance-editor/CascadePolicy', () => {
176
176
 
177
177
  expect(onAIAgentSelect).toHaveBeenCalledWith(expectedAgent);
178
178
  });
179
+
180
+ test('should render with cascadePolicyConfiguration prop and select enhanced agent if configured', async () => {
181
+ const cascadePolicyConfiguration = {
182
+ agent: 'enhanced_extract_agent',
183
+ };
184
+ render(
185
+ <CascadePolicy
186
+ canEdit
187
+ canUseAIFolderExtraction
188
+ canUseAIFolderExtractionAgentSelector
189
+ shouldShowCascadeOptions
190
+ isAIFolderExtractionEnabled
191
+ cascadePolicyConfiguration={cascadePolicyConfiguration}
192
+ onAIFolderExtractionToggle={jest.fn()}
193
+ />,
194
+ );
195
+ const aiToggle = screen.getByRole('switch', { name: 'Box AI Autofill' });
196
+ await userEvent.click(aiToggle); // Enable AI
197
+
198
+ expect(aiToggle).toBeChecked();
199
+
200
+ // The Enhanced agent should be selected in the combobox
201
+ const combobox = screen.getByRole('combobox', { name: 'Enhanced' });
202
+ expect(combobox).toBeInTheDocument();
203
+ });
204
+
205
+ test('should render standard agent if cascadePolicyConfiguration is undefined', async () => {
206
+ render(
207
+ <CascadePolicy
208
+ canEdit
209
+ canUseAIFolderExtraction
210
+ canUseAIFolderExtractionAgentSelector
211
+ shouldShowCascadeOptions
212
+ isAIFolderExtractionEnabled
213
+ onAIFolderExtractionToggle={jest.fn()}
214
+ />,
215
+ );
216
+ const aiToggle = screen.getByRole('switch', { name: 'Box AI Autofill' });
217
+ await userEvent.click(aiToggle); // Enable AI
218
+
219
+ expect(aiToggle).toBeChecked();
220
+
221
+ // Should default to Standard agent
222
+ expect(screen.getByRole('combobox', { name: 'Standard' })).toBeInTheDocument();
223
+ });
179
224
  });
180
225
 
181
226
  describe('AI Autofill Toggle', () => {