box-ui-elements 23.3.0-beta.8 → 23.3.0
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/openwith.js +1 -1
- package/dist/picker.css +1 -1
- package/dist/picker.js +1 -1
- package/dist/preview.css +1 -1
- package/dist/preview.js +1 -1
- package/dist/sidebar.css +1 -1
- package/dist/sidebar.js +1 -1
- package/dist/uploader.css +1 -1
- package/dist/uploader.js +1 -1
- package/es/elements/content-explorer/stories/tests/MetadataView-visual.stories.js +2 -1
- package/es/elements/content-explorer/stories/tests/MetadataView-visual.stories.js.map +1 -1
- package/es/elements/content-sidebar/MetadataInstanceEditor.js.map +1 -1
- package/es/elements/content-sidebar/SidebarNav.js +2 -0
- package/es/elements/content-sidebar/SidebarNav.js.flow +2 -0
- package/es/elements/content-sidebar/SidebarNav.js.map +1 -1
- package/es/elements/content-sidebar/stories/MetadataSidebarRedesign.stories.js +2 -1
- package/es/elements/content-sidebar/stories/MetadataSidebarRedesign.stories.js.map +1 -1
- package/es/elements/content-sidebar/stories/tests/BoxAISidebar-visual.stories.js +2 -1
- package/es/elements/content-sidebar/stories/tests/BoxAISidebar-visual.stories.js.map +1 -1
- package/es/elements/content-sidebar/stories/tests/ContentSidebar-e2e.stories.js +2 -1
- package/es/elements/content-sidebar/stories/tests/ContentSidebar-e2e.stories.js.map +1 -1
- package/es/elements/content-sidebar/stories/tests/MetadataSidebarRedesign-visual.stories.js +2 -1
- package/es/elements/content-sidebar/stories/tests/MetadataSidebarRedesign-visual.stories.js.map +1 -1
- package/es/elements/content-uploader/IconInProgress.js +3 -2
- package/es/elements/content-uploader/IconInProgress.js.map +1 -1
- package/es/elements/content-uploader/ItemAction.js +4 -4
- package/es/elements/content-uploader/ItemAction.js.map +1 -1
- package/es/features/metadata-instance-editor/CascadePolicy.js +1 -0
- package/es/features/metadata-instance-editor/CascadePolicy.js.flow +1 -0
- package/es/features/metadata-instance-editor/CascadePolicy.js.map +1 -1
- package/es/icons/file-icon/FileIcon.js.map +1 -1
- package/es/src/elements/content-explorer/stories/tests/MetadataView-visual.stories.d.ts +7 -58
- package/es/src/elements/content-sidebar/MetadataInstanceEditor.d.ts +1 -1
- package/es/src/elements/content-sidebar/stories/MetadataSidebarRedesign.stories.d.ts +6 -22
- package/es/src/elements/content-sidebar/stories/__mocks__/TaxonomyMocks.d.ts +2 -1
- package/es/src/elements/content-sidebar/stories/tests/BoxAISidebar-visual.stories.d.ts +6 -50
- package/es/src/elements/content-sidebar/stories/tests/ContentSidebar-e2e.stories.d.ts +6 -21
- package/es/src/elements/content-sidebar/stories/tests/MetadataSidebarRedesign-visual.stories.d.ts +6 -25
- package/es/src/elements/content-uploader/IconInProgress.d.ts +2 -2
- package/package.json +5 -5
- package/src/elements/content-explorer/stories/tests/MetadataView-visual.stories.tsx +8 -3
- package/src/elements/content-sidebar/MetadataInstanceEditor.tsx +1 -1
- package/src/elements/content-sidebar/SidebarNav.js +2 -0
- package/src/elements/content-sidebar/additional-tabs/__tests__/__snapshots__/AdditionalTab.test.js.snap +1 -1
- package/src/elements/content-sidebar/stories/MetadataSidebarRedesign.stories.tsx +5 -2
- package/src/elements/content-sidebar/stories/__mocks__/TaxonomyMocks.ts +2 -1
- package/src/elements/content-sidebar/stories/tests/BoxAISidebar-visual.stories.tsx +5 -2
- package/src/elements/content-sidebar/stories/tests/ContentSidebar-e2e.stories.tsx +5 -1
- package/src/elements/content-sidebar/stories/tests/MetadataSidebarRedesign-visual.stories.tsx +5 -2
- package/src/elements/content-uploader/IconInProgress.tsx +13 -9
- package/src/elements/content-uploader/ItemAction.tsx +9 -6
- package/src/features/metadata-instance-editor/CascadePolicy.js +1 -0
- package/src/icons/file-icon/FileIcon.tsx +4 -1
|
@@ -1,58 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
fieldsToShow: ({
|
|
9
|
-
key: string;
|
|
10
|
-
canEdit: boolean;
|
|
11
|
-
displayName: string;
|
|
12
|
-
} | {
|
|
13
|
-
key: string;
|
|
14
|
-
canEdit: boolean;
|
|
15
|
-
displayName?: undefined;
|
|
16
|
-
})[];
|
|
17
|
-
defaultView: string;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
export declare const withNewMetadataView: {
|
|
21
|
-
args: {
|
|
22
|
-
metadataQuery: {
|
|
23
|
-
from: string;
|
|
24
|
-
ancestor_folder_id: string;
|
|
25
|
-
fields: string[];
|
|
26
|
-
};
|
|
27
|
-
fieldsToShow: ({
|
|
28
|
-
key: string;
|
|
29
|
-
canEdit: boolean;
|
|
30
|
-
displayName: string;
|
|
31
|
-
} | {
|
|
32
|
-
key: string;
|
|
33
|
-
canEdit: boolean;
|
|
34
|
-
displayName?: undefined;
|
|
35
|
-
})[];
|
|
36
|
-
defaultView: string;
|
|
37
|
-
features: {
|
|
38
|
-
contentExplorer: {
|
|
39
|
-
metadataViewV2: boolean;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
declare const _default: {
|
|
45
|
-
title: string;
|
|
46
|
-
component: any;
|
|
47
|
-
args: {
|
|
48
|
-
features: Record<string, boolean>;
|
|
49
|
-
rootFolderId: string;
|
|
50
|
-
token: string;
|
|
51
|
-
};
|
|
52
|
-
parameters: {
|
|
53
|
-
msw: {
|
|
54
|
-
handlers: import("msw/lib/core/handlers/HttpHandler").HttpHandler[];
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
export default _default;
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import ContentExplorer from '../../ContentExplorer';
|
|
3
|
+
type Story = StoryObj<typeof ContentExplorer>;
|
|
4
|
+
export declare const metadataView: Story;
|
|
5
|
+
export declare const withNewMetadataView: Story;
|
|
6
|
+
declare const meta: Meta<typeof ContentExplorer>;
|
|
7
|
+
export default meta;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type FormValues, type JSONPatchOperations, type MetadataTemplateInstance } from '@box/metadata-editor';
|
|
2
|
-
import {
|
|
2
|
+
import { TaxonomyOptionsFetcher } from '@box/metadata-editor/lib/components/metadata-editor-fields/components/metadata-taxonomy-field/types.js';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { ERROR_CODE_METADATA_AUTOFILL_TIMEOUT, ERROR_CODE_UNKNOWN, ERROR_CODE_METADATA_PRECONDITION_FAILED } from '../../constants';
|
|
5
5
|
export interface MetadataInstanceEditorProps {
|
|
@@ -1,29 +1,13 @@
|
|
|
1
|
-
import { type StoryObj } from '@storybook/react';
|
|
2
|
-
import
|
|
1
|
+
import { type StoryObj, Meta } from '@storybook/react';
|
|
2
|
+
import type { HttpHandler } from 'msw';
|
|
3
3
|
import MetadataSidebarRedesign from '../MetadataSidebarRedesign';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
component: any;
|
|
7
|
-
args: {
|
|
8
|
-
fileId: string;
|
|
9
|
-
features: {
|
|
10
|
-
'metadata.redesign.enabled': boolean;
|
|
11
|
-
};
|
|
12
|
-
logger: {
|
|
13
|
-
onReadyMetric: ({ endMarkName }: {
|
|
14
|
-
endMarkName: any;
|
|
15
|
-
}) => void;
|
|
16
|
-
};
|
|
17
|
-
hasMetadata: boolean;
|
|
18
|
-
token: string;
|
|
19
|
-
metadataSidebarProps: any;
|
|
20
|
-
};
|
|
4
|
+
import ContentSidebar from '../ContentSidebar';
|
|
5
|
+
declare const meta: Meta<typeof ContentSidebar> & {
|
|
21
6
|
parameters: {
|
|
22
7
|
msw: {
|
|
23
|
-
handlers:
|
|
8
|
+
handlers: HttpHandler[];
|
|
24
9
|
};
|
|
25
10
|
};
|
|
26
|
-
render: (args: any) => React.JSX.Element;
|
|
27
11
|
};
|
|
28
|
-
export default
|
|
12
|
+
export default meta;
|
|
29
13
|
export declare const Basic: StoryObj<typeof MetadataSidebarRedesign>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { HttpHandler } from 'msw';
|
|
1
2
|
export declare const multilevelTaxonomyLevels: ({
|
|
2
3
|
display_name: string;
|
|
3
4
|
description: string;
|
|
@@ -287,4 +288,4 @@ export declare const mockSinglelevelTaxonomyNodes: {
|
|
|
287
288
|
node_path: any[];
|
|
288
289
|
};
|
|
289
290
|
};
|
|
290
|
-
export declare const taxonomyMockHandlers:
|
|
291
|
+
export declare const taxonomyMockHandlers: HttpHandler[];
|
|
@@ -1,57 +1,13 @@
|
|
|
1
|
-
import { type StoryObj } from '@storybook/react';
|
|
1
|
+
import { type StoryObj, type Meta } from '@storybook/react';
|
|
2
|
+
import type { HttpHandler } from 'msw';
|
|
3
|
+
import ContentSidebar from '../../ContentSidebar';
|
|
2
4
|
import BoxAISidebar from '../../BoxAISidebar';
|
|
3
5
|
export declare const basic: StoryObj<typeof BoxAISidebar>;
|
|
4
|
-
declare const
|
|
5
|
-
title: string;
|
|
6
|
-
component: any;
|
|
7
|
-
args: {
|
|
8
|
-
features: {
|
|
9
|
-
'boxai.sidebar.enabled': boolean;
|
|
10
|
-
};
|
|
11
|
-
fileId: string;
|
|
12
|
-
token: string;
|
|
13
|
-
boxAISidebarProps: {
|
|
14
|
-
createSessionRequest: () => {
|
|
15
|
-
encodedSession: string;
|
|
16
|
-
};
|
|
17
|
-
fetchTimeout: {
|
|
18
|
-
initial: number;
|
|
19
|
-
};
|
|
20
|
-
getAgentConfig: () => {};
|
|
21
|
-
getAIStudioAgents: () => {};
|
|
22
|
-
getAnswer: () => {};
|
|
23
|
-
getAnswerStreaming: () => {};
|
|
24
|
-
getSuggestedQuestions: any;
|
|
25
|
-
hostAppName: string;
|
|
26
|
-
isAgentSelectorEnabled: boolean;
|
|
27
|
-
isAIStudioAgentSelectorEnabled: boolean;
|
|
28
|
-
isCitationsEnabled: boolean;
|
|
29
|
-
isFeedbackEnabled: boolean;
|
|
30
|
-
isDebugModeEnabled: boolean;
|
|
31
|
-
isIntelligentQueryMode: boolean;
|
|
32
|
-
isMarkdownEnabled: boolean;
|
|
33
|
-
isResetChatEnabled: boolean;
|
|
34
|
-
isStopResponseEnabled: boolean;
|
|
35
|
-
isStreamingEnabled: boolean;
|
|
36
|
-
items: {
|
|
37
|
-
id: string;
|
|
38
|
-
name: string;
|
|
39
|
-
type: string;
|
|
40
|
-
fileType: string;
|
|
41
|
-
status: string;
|
|
42
|
-
}[];
|
|
43
|
-
localizedQuestions: {
|
|
44
|
-
id: string;
|
|
45
|
-
label: string;
|
|
46
|
-
prompt: string;
|
|
47
|
-
}[];
|
|
48
|
-
recordAction: () => {};
|
|
49
|
-
};
|
|
50
|
-
};
|
|
6
|
+
declare const meta: Meta<typeof ContentSidebar> & {
|
|
51
7
|
parameters: {
|
|
52
8
|
msw: {
|
|
53
|
-
handlers:
|
|
9
|
+
handlers: HttpHandler[];
|
|
54
10
|
};
|
|
55
11
|
};
|
|
56
12
|
};
|
|
57
|
-
export default
|
|
13
|
+
export default meta;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import type { HttpHandler } from 'msw';
|
|
2
|
+
import type { Meta } from '@storybook/react';
|
|
3
|
+
import ContentSidebar from '../../ContentSidebar';
|
|
1
4
|
export declare const basic: {
|
|
2
5
|
args: {
|
|
3
6
|
fileId: any;
|
|
@@ -8,29 +11,11 @@ export declare const fileVersion: {
|
|
|
8
11
|
fileId: any;
|
|
9
12
|
};
|
|
10
13
|
};
|
|
11
|
-
declare const
|
|
12
|
-
title: string;
|
|
13
|
-
component: any;
|
|
14
|
-
args: {
|
|
15
|
-
detailsSidebarProps: {
|
|
16
|
-
hasAccessStats: boolean;
|
|
17
|
-
hasClassification: boolean;
|
|
18
|
-
hasNotices: boolean;
|
|
19
|
-
hasProperties: boolean;
|
|
20
|
-
hasRetentionPolicy: boolean;
|
|
21
|
-
};
|
|
22
|
-
features: Record<string, boolean>;
|
|
23
|
-
fileId: string;
|
|
24
|
-
hasActivityFeed: boolean;
|
|
25
|
-
hasMetadata: boolean;
|
|
26
|
-
hasSkills: boolean;
|
|
27
|
-
hasVersions: boolean;
|
|
28
|
-
token: string;
|
|
29
|
-
};
|
|
14
|
+
declare const meta: Meta<typeof ContentSidebar> & {
|
|
30
15
|
parameters: {
|
|
31
16
|
msw: {
|
|
32
|
-
handlers:
|
|
17
|
+
handlers: HttpHandler[];
|
|
33
18
|
};
|
|
34
19
|
};
|
|
35
20
|
};
|
|
36
|
-
export default
|
|
21
|
+
export default meta;
|
package/es/src/elements/content-sidebar/stories/tests/MetadataSidebarRedesign-visual.stories.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { type StoryObj } from '@storybook/react';
|
|
1
|
+
import { type StoryObj, Meta } from '@storybook/react';
|
|
2
|
+
import type { HttpHandler } from 'msw';
|
|
3
|
+
import ContentSidebar from '../../ContentSidebar';
|
|
2
4
|
import MetadataSidebarRedesign from '../../MetadataSidebarRedesign';
|
|
3
5
|
export declare const AddTemplateDropdownMenuOn: {
|
|
4
6
|
play: ({ canvasElement }: {
|
|
@@ -45,32 +47,11 @@ export declare const ViewMultilevelTaxonomy: StoryObj<typeof MetadataSidebarRede
|
|
|
45
47
|
export declare const ViewSinglelevelTaxonomy: StoryObj<typeof MetadataSidebarRedesign>;
|
|
46
48
|
export declare const EditMultilevelTaxonomy: StoryObj<typeof MetadataSidebarRedesign>;
|
|
47
49
|
export declare const EditSinglelevelTaxonomy: StoryObj<typeof MetadataSidebarRedesign>;
|
|
48
|
-
declare const
|
|
49
|
-
title: string;
|
|
50
|
-
component: any;
|
|
51
|
-
args: {
|
|
52
|
-
token: string;
|
|
53
|
-
metadataSidebarProps: {
|
|
54
|
-
fileId: string;
|
|
55
|
-
isFeatureEnabled: boolean;
|
|
56
|
-
onError: import("@vitest/spy").Mock<any, any>;
|
|
57
|
-
onSuccess: import("@vitest/spy").Mock<any, any>;
|
|
58
|
-
};
|
|
59
|
-
hasMetadata: boolean;
|
|
60
|
-
features: {
|
|
61
|
-
'metadata.redesign.enabled': boolean;
|
|
62
|
-
};
|
|
63
|
-
fileId: string;
|
|
64
|
-
logger: {
|
|
65
|
-
onReadyMetric: ({ endMarkName }: {
|
|
66
|
-
endMarkName: any;
|
|
67
|
-
}) => void;
|
|
68
|
-
};
|
|
69
|
-
};
|
|
50
|
+
declare const meta: Meta<typeof ContentSidebar> & {
|
|
70
51
|
parameters: {
|
|
71
52
|
msw: {
|
|
72
|
-
handlers:
|
|
53
|
+
handlers: HttpHandler[];
|
|
73
54
|
};
|
|
74
55
|
};
|
|
75
56
|
};
|
|
76
|
-
export default
|
|
57
|
+
export default meta;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
declare const IconInProgress:
|
|
1
|
+
import type { ForwardRefExoticComponent, RefAttributes, SVGProps } from 'react';
|
|
2
|
+
declare const IconInProgress: ForwardRefExoticComponent<SVGProps<SVGSVGElement> & RefAttributes<SVGSVGElement>>;
|
|
3
3
|
export default IconInProgress;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "box-ui-elements",
|
|
3
|
-
"version": "23.3.0
|
|
3
|
+
"version": "23.3.0",
|
|
4
4
|
"description": "Box UI Elements",
|
|
5
5
|
"author": "Box (https://www.box.com/)",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -129,8 +129,8 @@
|
|
|
129
129
|
"@babel/preset-typescript": "^7.24.7",
|
|
130
130
|
"@babel/template": "^7.24.7",
|
|
131
131
|
"@babel/types": "^7.24.7",
|
|
132
|
-
"@box/blueprint-web": "^
|
|
133
|
-
"@box/blueprint-web-assets": "4.
|
|
132
|
+
"@box/blueprint-web": "^11.12.0",
|
|
133
|
+
"@box/blueprint-web-assets": "^4.44.1",
|
|
134
134
|
"@box/box-ai-agent-selector": "^0.31.0",
|
|
135
135
|
"@box/box-ai-content-answers": "^0.124.1",
|
|
136
136
|
"@box/cldr-data": "^34.2.0",
|
|
@@ -303,8 +303,8 @@
|
|
|
303
303
|
"worker-farm": "^1.7.0"
|
|
304
304
|
},
|
|
305
305
|
"peerDependencies": {
|
|
306
|
-
"@box/blueprint-web": "^
|
|
307
|
-
"@box/blueprint-web-assets": "^4.
|
|
306
|
+
"@box/blueprint-web": "^11.12.0",
|
|
307
|
+
"@box/blueprint-web-assets": "^4.44.1",
|
|
308
308
|
"@box/box-ai-agent-selector": "^0.31.0",
|
|
309
309
|
"@box/box-ai-content-answers": "^0.124.1",
|
|
310
310
|
"@box/cldr-data": ">=34.2.0",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { http, HttpResponse } from 'msw';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
3
|
import ContentExplorer from '../../ContentExplorer';
|
|
3
4
|
import { DEFAULT_HOSTNAME_API } from '../../../../constants';
|
|
4
5
|
import { mockMetadata, mockSchema } from '../../../common/__mocks__/mockMetadata';
|
|
@@ -34,7 +35,9 @@ const fieldsToShow = [
|
|
|
34
35
|
];
|
|
35
36
|
const defaultView = 'metadata'; // Required prop to paint the metadata view. If not provided, you'll get regular folder view.
|
|
36
37
|
|
|
37
|
-
|
|
38
|
+
type Story = StoryObj<typeof ContentExplorer>;
|
|
39
|
+
|
|
40
|
+
export const metadataView: Story = {
|
|
38
41
|
args: {
|
|
39
42
|
metadataQuery,
|
|
40
43
|
fieldsToShow,
|
|
@@ -42,7 +45,7 @@ export const metadataView = {
|
|
|
42
45
|
},
|
|
43
46
|
};
|
|
44
47
|
|
|
45
|
-
export const withNewMetadataView = {
|
|
48
|
+
export const withNewMetadataView: Story = {
|
|
46
49
|
args: {
|
|
47
50
|
metadataQuery,
|
|
48
51
|
fieldsToShow,
|
|
@@ -55,7 +58,7 @@ export const withNewMetadataView = {
|
|
|
55
58
|
},
|
|
56
59
|
};
|
|
57
60
|
|
|
58
|
-
|
|
61
|
+
const meta: Meta<typeof ContentExplorer> = {
|
|
59
62
|
title: 'Elements/ContentExplorer/tests/ContentExplorer/visual/MetadataView',
|
|
60
63
|
component: ContentExplorer,
|
|
61
64
|
args: {
|
|
@@ -76,3 +79,5 @@ export default {
|
|
|
76
79
|
},
|
|
77
80
|
},
|
|
78
81
|
};
|
|
82
|
+
|
|
83
|
+
export default meta;
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
type JSONPatchOperations,
|
|
5
5
|
type MetadataTemplateInstance,
|
|
6
6
|
} from '@box/metadata-editor';
|
|
7
|
-
import {
|
|
7
|
+
import { TaxonomyOptionsFetcher } from '@box/metadata-editor/lib/components/metadata-editor-fields/components/metadata-taxonomy-field/types.js';
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import {
|
|
10
10
|
ERROR_CODE_METADATA_AUTOFILL_TIMEOUT,
|
|
@@ -8,7 +8,9 @@ import * as React from 'react';
|
|
|
8
8
|
import { injectIntl } from 'react-intl';
|
|
9
9
|
import type { IntlShape } from 'react-intl';
|
|
10
10
|
import noop from 'lodash/noop';
|
|
11
|
+
// $FlowFixMe
|
|
11
12
|
import { BoxAiLogo } from '@box/blueprint-web-assets/icons/Logo';
|
|
13
|
+
// $FlowFixMe
|
|
12
14
|
import { Size6 } from '@box/blueprint-web-assets/tokens/tokens';
|
|
13
15
|
import { usePromptFocus } from '@box/box-ai-content-answers';
|
|
14
16
|
import AdditionalTabs from './additional-tabs';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { type StoryObj } from '@storybook/react';
|
|
1
|
+
import { type StoryObj, Meta } from '@storybook/react';
|
|
2
2
|
import { fn, userEvent, within } from '@storybook/test';
|
|
3
3
|
import React, { type ComponentProps } from 'react';
|
|
4
4
|
import { http, HttpResponse } from 'msw';
|
|
5
|
+
import type { HttpHandler } from 'msw';
|
|
5
6
|
import MetadataSidebarRedesign from '../MetadataSidebarRedesign';
|
|
6
7
|
import ContentSidebar from '../ContentSidebar';
|
|
7
8
|
import {
|
|
@@ -32,7 +33,7 @@ const defaultMetadataSidebarProps: ComponentProps<typeof MetadataSidebarRedesign
|
|
|
32
33
|
onSuccess: fn(),
|
|
33
34
|
};
|
|
34
35
|
|
|
35
|
-
|
|
36
|
+
const meta: Meta<typeof ContentSidebar> & { parameters: { msw: { handlers: HttpHandler[] } } } = {
|
|
36
37
|
title: 'Elements/ContentSidebar/MetadataSidebarRedesign',
|
|
37
38
|
component: ContentSidebar,
|
|
38
39
|
args: {
|
|
@@ -66,6 +67,8 @@ export default {
|
|
|
66
67
|
},
|
|
67
68
|
};
|
|
68
69
|
|
|
70
|
+
export default meta;
|
|
71
|
+
|
|
69
72
|
export const Basic: StoryObj<typeof MetadataSidebarRedesign> = {
|
|
70
73
|
play: async ({ canvasElement }) => {
|
|
71
74
|
const canvas = within(canvasElement);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { http, HttpResponse } from 'msw';
|
|
2
|
+
import type { HttpHandler } from 'msw';
|
|
2
3
|
|
|
3
4
|
import { DEFAULT_HOSTNAME_API } from '../../../../constants';
|
|
4
5
|
import { fileIdWithMetadata, mockFileRequest } from './MetadataSidebarRedesignedMocks';
|
|
@@ -395,7 +396,7 @@ export const mockSinglelevelTaxonomyNodes = {
|
|
|
395
396
|
},
|
|
396
397
|
};
|
|
397
398
|
|
|
398
|
-
export const taxonomyMockHandlers = [
|
|
399
|
+
export const taxonomyMockHandlers: HttpHandler[] = [
|
|
399
400
|
http.get(mockFileRequest.url, () => {
|
|
400
401
|
return HttpResponse.json(mockFileRequest.response);
|
|
401
402
|
}),
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { expect, within } from '@storybook/test';
|
|
2
|
-
import { type StoryObj } from '@storybook/react';
|
|
2
|
+
import { type StoryObj, type Meta } from '@storybook/react';
|
|
3
3
|
import { http, HttpResponse } from 'msw';
|
|
4
|
+
import type { HttpHandler } from 'msw';
|
|
4
5
|
import ContentSidebar from '../../ContentSidebar';
|
|
5
6
|
import BoxAISidebar from '../../BoxAISidebar';
|
|
6
7
|
import { mockFileRequest, mockUserRequest } from '../../../common/__mocks__/mockRequests';
|
|
@@ -25,7 +26,7 @@ export const basic: StoryObj<typeof BoxAISidebar> = {
|
|
|
25
26
|
},
|
|
26
27
|
};
|
|
27
28
|
|
|
28
|
-
|
|
29
|
+
const meta: Meta<typeof ContentSidebar> & { parameters: { msw: { handlers: HttpHandler[] } } } = {
|
|
29
30
|
title: 'Elements/ContentSidebar/BoxAISidebar/tests/visual-regression-tests',
|
|
30
31
|
component: ContentSidebar,
|
|
31
32
|
args: {
|
|
@@ -90,3 +91,5 @@ export default {
|
|
|
90
91
|
},
|
|
91
92
|
},
|
|
92
93
|
};
|
|
94
|
+
|
|
95
|
+
export default meta;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
import { http, HttpResponse } from 'msw';
|
|
3
|
+
import type { HttpHandler } from 'msw';
|
|
4
|
+
import type { Meta } from '@storybook/react';
|
|
3
5
|
import ContentSidebar from '../../ContentSidebar';
|
|
4
6
|
import { mockFileRequest } from '../__mocks__/ContentSidebarMocks';
|
|
5
7
|
import { testFileIds } from '../../../../../test/support/constants';
|
|
@@ -33,7 +35,7 @@ export const fileVersion = {
|
|
|
33
35
|
},
|
|
34
36
|
};
|
|
35
37
|
|
|
36
|
-
|
|
38
|
+
const meta: Meta<typeof ContentSidebar> & { parameters: { msw: { handlers: HttpHandler[] } } } = {
|
|
37
39
|
title: 'Elements/ContentSidebar/tests/e2e',
|
|
38
40
|
component: ContentSidebar,
|
|
39
41
|
args: defaultArgs,
|
|
@@ -47,3 +49,5 @@ export default {
|
|
|
47
49
|
},
|
|
48
50
|
},
|
|
49
51
|
};
|
|
52
|
+
|
|
53
|
+
export default meta;
|
package/src/elements/content-sidebar/stories/tests/MetadataSidebarRedesign-visual.stories.tsx
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { act, type ComponentProps } from 'react';
|
|
2
2
|
import { http, HttpResponse } from 'msw';
|
|
3
3
|
import { expect, userEvent, waitFor, within, fn, screen } from '@storybook/test';
|
|
4
|
-
import { type StoryObj } from '@storybook/react';
|
|
4
|
+
import { type StoryObj, Meta } from '@storybook/react';
|
|
5
|
+
import type { HttpHandler } from 'msw';
|
|
5
6
|
import ContentSidebar from '../../ContentSidebar';
|
|
6
7
|
import MetadataSidebarRedesign from '../../MetadataSidebarRedesign';
|
|
7
8
|
import {
|
|
@@ -720,7 +721,7 @@ export const EditSinglelevelTaxonomy: StoryObj<typeof MetadataSidebarRedesign> =
|
|
|
720
721
|
},
|
|
721
722
|
};
|
|
722
723
|
|
|
723
|
-
|
|
724
|
+
const meta: Meta<typeof ContentSidebar> & { parameters: { msw: { handlers: HttpHandler[] } } } = {
|
|
724
725
|
title: 'Elements/ContentSidebar/MetadataSidebarRedesign/tests/visual-regression-tests',
|
|
725
726
|
component: ContentSidebar,
|
|
726
727
|
args: {
|
|
@@ -739,3 +740,5 @@ export default {
|
|
|
739
740
|
},
|
|
740
741
|
},
|
|
741
742
|
};
|
|
743
|
+
|
|
744
|
+
export default meta;
|
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import type { ForwardRefExoticComponent, RefAttributes, SVGProps } from 'react';
|
|
2
3
|
import { useIntl } from 'react-intl';
|
|
3
4
|
import { LoadingIndicator } from '@box/blueprint-web';
|
|
4
5
|
import { IconCtaIconHover, Size5 } from '@box/blueprint-web-assets/tokens/tokens';
|
|
5
6
|
import { XMark } from '@box/blueprint-web-assets/icons/Fill';
|
|
6
7
|
import messages from '../common/messages';
|
|
7
8
|
|
|
8
|
-
const IconInProgress
|
|
9
|
-
|
|
9
|
+
const IconInProgress: ForwardRefExoticComponent<SVGProps<SVGSVGElement> & RefAttributes<SVGSVGElement>> =
|
|
10
|
+
React.forwardRef(() => {
|
|
11
|
+
const { formatMessage } = useIntl();
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
13
|
+
return (
|
|
14
|
+
<div className="bcu-IconInProgress">
|
|
15
|
+
<XMark color={IconCtaIconHover} height={Size5} width={Size5} />
|
|
16
|
+
<LoadingIndicator aria-label={formatMessage(messages.loading)} className="bcu-IconInProgress-loading" />
|
|
17
|
+
</div>
|
|
18
|
+
);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
IconInProgress.displayName = 'IconInProgress';
|
|
18
22
|
|
|
19
23
|
export default IconInProgress;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import type { ForwardRefExoticComponent, RefAttributes, SVGProps } from 'react';
|
|
2
3
|
import { useIntl } from 'react-intl';
|
|
3
4
|
import { AxiosError } from 'axios';
|
|
4
5
|
import { Button, IconButton, LoadingIndicator, Tooltip } from '@box/blueprint-web';
|
|
@@ -30,6 +31,8 @@ export interface ItemActionProps {
|
|
|
30
31
|
status: UploadStatus;
|
|
31
32
|
}
|
|
32
33
|
|
|
34
|
+
type IconComponent = ForwardRefExoticComponent<SVGProps<SVGSVGElement> & RefAttributes<SVGSVGElement>>;
|
|
35
|
+
|
|
33
36
|
const ItemAction = ({
|
|
34
37
|
error,
|
|
35
38
|
isFolder = false,
|
|
@@ -41,11 +44,11 @@ const ItemAction = ({
|
|
|
41
44
|
const { formatMessage } = useIntl();
|
|
42
45
|
const { code } = error || {};
|
|
43
46
|
|
|
44
|
-
const LoadingIndicatorIcon = () => (
|
|
47
|
+
const LoadingIndicatorIcon = React.forwardRef<SVGSVGElement>(() => (
|
|
45
48
|
<LoadingIndicator aria-label={formatMessage(messages.loading)} className="bcu-ItemAction-loading" />
|
|
46
|
-
);
|
|
49
|
+
));
|
|
47
50
|
|
|
48
|
-
let Icon = XMark;
|
|
51
|
+
let Icon: IconComponent = XMark;
|
|
49
52
|
let tooltip;
|
|
50
53
|
|
|
51
54
|
if (isFolder && status !== STATUS_PENDING) {
|
|
@@ -54,14 +57,14 @@ const ItemAction = ({
|
|
|
54
57
|
|
|
55
58
|
switch (status) {
|
|
56
59
|
case STATUS_COMPLETE:
|
|
57
|
-
Icon = () => (
|
|
60
|
+
Icon = React.forwardRef<SVGSVGElement>(() => (
|
|
58
61
|
<Checkmark
|
|
59
62
|
aria-label={formatMessage(messages.complete)}
|
|
60
63
|
color={SurfaceStatusSurfaceSuccess}
|
|
61
64
|
height={Size5}
|
|
62
65
|
width={Size5}
|
|
63
66
|
/>
|
|
64
|
-
);
|
|
67
|
+
));
|
|
65
68
|
if (!isResumableUploadsEnabled) {
|
|
66
69
|
tooltip = messages.remove;
|
|
67
70
|
}
|
|
@@ -75,7 +78,7 @@ const ItemAction = ({
|
|
|
75
78
|
if (isResumableUploadsEnabled) {
|
|
76
79
|
Icon = LoadingIndicatorIcon;
|
|
77
80
|
} else {
|
|
78
|
-
Icon = IconInProgress;
|
|
81
|
+
Icon = IconInProgress as IconComponent;
|
|
79
82
|
tooltip = messages.uploadsCancelButtonTooltip;
|
|
80
83
|
}
|
|
81
84
|
break;
|
|
@@ -4,6 +4,7 @@ import { FormattedMessage } from 'react-intl';
|
|
|
4
4
|
|
|
5
5
|
import { BoxAiAgentSelector } from '@box/box-ai-agent-selector';
|
|
6
6
|
import { InlineNotice, TooltipProvider } from '@box/blueprint-web';
|
|
7
|
+
// $FlowFixMe
|
|
7
8
|
import BoxAiLogo from '@box/blueprint-web-assets/icons/Logo/BoxAiLogo';
|
|
8
9
|
|
|
9
10
|
import Toggle from '../../components/toggle';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import type { ForwardRefExoticComponent, RefAttributes, SVGProps } from 'react';
|
|
2
3
|
|
|
3
4
|
import {
|
|
4
5
|
FileAdobeExpress,
|
|
@@ -40,7 +41,9 @@ import { useIntl } from 'react-intl';
|
|
|
40
41
|
|
|
41
42
|
import messages from '../../elements/common/messages';
|
|
42
43
|
|
|
43
|
-
|
|
44
|
+
type FileIconComponent = ForwardRefExoticComponent<SVGProps<SVGSVGElement> & RefAttributes<SVGSVGElement>>;
|
|
45
|
+
|
|
46
|
+
const Components: { [key: string]: FileIconComponent } = {
|
|
44
47
|
FileAdobeExpress,
|
|
45
48
|
FileAudio,
|
|
46
49
|
FileBookmark,
|