box-ui-elements 23.4.0-beta.10 → 23.4.0-beta.12
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.css +1 -1
- package/dist/explorer.js +1 -1
- package/dist/picker.js +1 -1
- package/dist/preview.css +1 -1
- package/dist/preview.js +1 -1
- package/dist/preview.js.LICENSE.txt +0 -10
- package/dist/sidebar.css +1 -1
- package/dist/sidebar.js +1 -1
- package/dist/sidebar.js.LICENSE.txt +0 -10
- package/dist/uploader.js +1 -1
- package/es/api/uploads/FolderUploadNode.js +41 -6
- package/es/api/uploads/FolderUploadNode.js.flow +45 -5
- package/es/api/uploads/FolderUploadNode.js.map +1 -1
- package/es/elements/content-sidebar/MetadataInstanceEditor.js +4 -2
- package/es/elements/content-sidebar/MetadataInstanceEditor.js.map +1 -1
- package/es/elements/content-sidebar/MetadataSidebarRedesign.js +4 -1
- package/es/elements/content-sidebar/MetadataSidebarRedesign.js.map +1 -1
- package/es/elements/content-sidebar/stories/tests/MetadataSidebarRedesign-visual.stories.js +29 -0
- package/es/elements/content-sidebar/stories/tests/MetadataSidebarRedesign-visual.stories.js.map +1 -1
- package/es/src/elements/content-sidebar/MetadataInstanceEditor.d.ts +1 -0
- package/es/src/elements/content-sidebar/stories/tests/MetadataSidebarRedesign-visual.stories.d.ts +1 -0
- package/es/utils/sleep.js +3 -0
- package/es/utils/sleep.js.flow +2 -0
- package/es/utils/sleep.js.map +1 -0
- package/i18n/ja-JP.js +1 -1
- package/i18n/ja-JP.properties +1 -1
- package/package.json +5 -5
- package/src/api/uploads/FolderUploadNode.js +45 -5
- package/src/api/uploads/__tests__/FolderUploadNode.test.js +49 -0
- package/src/elements/content-sidebar/MetadataInstanceEditor.tsx +3 -0
- package/src/elements/content-sidebar/MetadataSidebarRedesign.tsx +3 -0
- package/src/elements/content-sidebar/stories/tests/MetadataSidebarRedesign-visual.stories.tsx +24 -0
- package/src/features/metadata-instance-editor/__tests__/CascadePolicy.test.js +7 -2
- package/src/features/metadata-instance-editor/__tests__/Instance.test.js +1 -1
- package/src/features/metadata-instance-editor/__tests__/Instances.test.js +3 -3
- package/src/features/metadata-instance-editor/__tests__/MetadataInstanceEditor.test.js +3 -3
- package/src/utils/sleep.js +2 -0
package/src/elements/content-sidebar/stories/tests/MetadataSidebarRedesign-visual.stories.tsx
CHANGED
|
@@ -425,6 +425,30 @@ export const MetadataInstanceEditorAIEnabled: StoryObj<typeof MetadataSidebarRed
|
|
|
425
425
|
},
|
|
426
426
|
};
|
|
427
427
|
|
|
428
|
+
export const MetadataInstanceEditorAIEnabledAdvancedExtractAgent: StoryObj<typeof MetadataSidebarRedesign> = {
|
|
429
|
+
args: {
|
|
430
|
+
features: {
|
|
431
|
+
...mockFeatures,
|
|
432
|
+
'metadata.aiSuggestions.enabled': true,
|
|
433
|
+
'metadata.extractAdvancedAgents.enabled': true,
|
|
434
|
+
},
|
|
435
|
+
},
|
|
436
|
+
play: async ({ canvasElement }) => {
|
|
437
|
+
const canvas = within(canvasElement);
|
|
438
|
+
// Edit one instance
|
|
439
|
+
const editButton = await canvas.findByRole('button', { name: 'Edit My Template' });
|
|
440
|
+
await userEvent.click(editButton);
|
|
441
|
+
|
|
442
|
+
// Find the SplitButton
|
|
443
|
+
const splitButton = await canvas.findByRole('button', { name: /Autofill/ });
|
|
444
|
+
expect(splitButton).toBeVisible();
|
|
445
|
+
|
|
446
|
+
await userEvent.hover(splitButton);
|
|
447
|
+
const dropdownButton = await canvas.findByRole('button', { name: 'See agent options.' });
|
|
448
|
+
expect(dropdownButton).toBeVisible();
|
|
449
|
+
},
|
|
450
|
+
};
|
|
451
|
+
|
|
428
452
|
export const ShowErrorWhenAIAPIIsUnavailable: StoryObj<typeof MetadataSidebarRedesign> = {
|
|
429
453
|
args: {
|
|
430
454
|
features: {
|
|
@@ -7,6 +7,11 @@ import { screen, render, within } from '../../../test-utils/testing-library';
|
|
|
7
7
|
import CascadePolicy from '../CascadePolicy';
|
|
8
8
|
|
|
9
9
|
describe('features/metadata-instance-editor/CascadePolicy', () => {
|
|
10
|
+
beforeEach(() => {
|
|
11
|
+
// reset any previous tests that may have set localStorage
|
|
12
|
+
localStorage.removeItem('aiAgent');
|
|
13
|
+
});
|
|
14
|
+
|
|
10
15
|
test('should correctly render cascade policy read only mode', () => {
|
|
11
16
|
const wrapper = shallow(<CascadePolicy id="fakeId" isCascadingEnabled shouldShowCascadeOptions />);
|
|
12
17
|
expect(wrapper).toMatchSnapshot();
|
|
@@ -100,12 +105,12 @@ describe('features/metadata-instance-editor/CascadePolicy', () => {
|
|
|
100
105
|
shouldShowCascadeOptions
|
|
101
106
|
/>,
|
|
102
107
|
);
|
|
103
|
-
expect(screen.getByRole('
|
|
108
|
+
expect(screen.getByRole('combobox', { name: 'Basic' })).toBeInTheDocument();
|
|
104
109
|
});
|
|
105
110
|
|
|
106
111
|
test('should not render AI agent selector when canUseAIFolderExtractionAgentSelector is false', () => {
|
|
107
112
|
render(<CascadePolicy canEdit canUseAIFolderExtraction shouldShowCascadeOptions />);
|
|
108
|
-
expect(screen.queryByRole('
|
|
113
|
+
expect(screen.queryByRole('combobox', { name: 'Basic' })).not.toBeInTheDocument();
|
|
109
114
|
});
|
|
110
115
|
});
|
|
111
116
|
|
|
@@ -863,7 +863,7 @@ describe('Instance Component - React Testing Library', () => {
|
|
|
863
863
|
const editButton = screen.queryByRole('button', { name: 'Edit Metadata' });
|
|
864
864
|
if (editButton) await userEvent.click(editButton); // Enter edit mode to ensure CascadePolicy options are visible
|
|
865
865
|
|
|
866
|
-
expect(screen.getByRole('
|
|
866
|
+
expect(screen.getByRole('combobox', { name: 'Basic' })).toBeInTheDocument();
|
|
867
867
|
});
|
|
868
868
|
|
|
869
869
|
test('should pass isExistingAIExtractionCascadePolicy=true to CascadePolicy if policy is ai_extract', async () => {
|
|
@@ -265,7 +265,7 @@ describe('Instances component - canUseAIFolderExtractionAgentSelector prop', ()
|
|
|
265
265
|
const editButton = screen.getByRole('button', { name: 'Edit Metadata' });
|
|
266
266
|
await userEvent.click(editButton);
|
|
267
267
|
|
|
268
|
-
expect(screen.getByRole('
|
|
268
|
+
expect(screen.getByRole('combobox', { name: 'Basic' })).toBeInTheDocument();
|
|
269
269
|
});
|
|
270
270
|
|
|
271
271
|
test('should not show agent selector in child Instance if canUseAIFolderExtractionAgentSelector is false', async () => {
|
|
@@ -280,7 +280,7 @@ describe('Instances component - canUseAIFolderExtractionAgentSelector prop', ()
|
|
|
280
280
|
const editButton = screen.getByRole('button', { name: 'Edit Metadata' });
|
|
281
281
|
await userEvent.click(editButton);
|
|
282
282
|
|
|
283
|
-
expect(screen.queryByRole('
|
|
283
|
+
expect(screen.queryByRole('combobox', { name: 'Basic' })).not.toBeInTheDocument();
|
|
284
284
|
});
|
|
285
285
|
|
|
286
286
|
test('should not show agent selector in child Instance if canUseAIFolderExtractionAgentSelector is undefined', async () => {
|
|
@@ -291,6 +291,6 @@ describe('Instances component - canUseAIFolderExtractionAgentSelector prop', ()
|
|
|
291
291
|
const editButton = screen.getByRole('button', { name: 'Edit Metadata' });
|
|
292
292
|
await userEvent.click(editButton);
|
|
293
293
|
|
|
294
|
-
expect(screen.queryByRole('
|
|
294
|
+
expect(screen.queryByRole('combobox', { name: 'Basic' })).not.toBeInTheDocument();
|
|
295
295
|
});
|
|
296
296
|
});
|
|
@@ -547,7 +547,7 @@ describe('MetadataInstanceEditor - canUseAIFolderExtractionAgentSelector prop',
|
|
|
547
547
|
const editButton = await screen.findByRole('button', { name: 'Edit Metadata' }, { timeout: 3000 });
|
|
548
548
|
await userEvent.click(editButton);
|
|
549
549
|
|
|
550
|
-
expect(screen.getByRole('
|
|
550
|
+
expect(screen.getByRole('combobox', { name: 'Basic' })).toBeInTheDocument();
|
|
551
551
|
});
|
|
552
552
|
|
|
553
553
|
test('should not show agent selector if canUseAIFolderExtractionAgentSelector is false', async () => {
|
|
@@ -562,7 +562,7 @@ describe('MetadataInstanceEditor - canUseAIFolderExtractionAgentSelector prop',
|
|
|
562
562
|
const editButton = await screen.findByRole('button', { name: 'Edit Metadata' });
|
|
563
563
|
await userEvent.click(editButton);
|
|
564
564
|
|
|
565
|
-
expect(screen.queryByRole('
|
|
565
|
+
expect(screen.queryByRole('combobox', { name: 'Basic' })).not.toBeInTheDocument();
|
|
566
566
|
});
|
|
567
567
|
|
|
568
568
|
test('should not show agent selector if canUseAIFolderExtractionAgentSelector is undefined', async () => {
|
|
@@ -573,6 +573,6 @@ describe('MetadataInstanceEditor - canUseAIFolderExtractionAgentSelector prop',
|
|
|
573
573
|
const editButton = await screen.findByRole('button', { name: 'Edit Metadata' });
|
|
574
574
|
await userEvent.click(editButton);
|
|
575
575
|
|
|
576
|
-
expect(screen.queryByRole('
|
|
576
|
+
expect(screen.queryByRole('combobox', { name: 'Basic' })).not.toBeInTheDocument();
|
|
577
577
|
});
|
|
578
578
|
});
|