@imposium-hub/components 2.15.0-3 → 2.16.0-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/cjs/components/app-wrapper/AppWrapper.d.ts +0 -1
- package/dist/cjs/components/app-wrapper/AppWrapper.js +1 -1
- package/dist/cjs/components/app-wrapper/AppWrapper.js.map +1 -1
- package/dist/cjs/components/assets/AssetsTypeIcon.js +2 -0
- package/dist/cjs/components/assets/AssetsTypeIcon.js.map +1 -1
- package/dist/cjs/components/change-report/ChangeReportTree.js +65 -10
- package/dist/cjs/components/change-report/ChangeReportTree.js.map +1 -1
- package/dist/cjs/components/number-field/NumberField.d.ts +2 -2
- package/dist/cjs/components/number-field/NumberField.js +7 -4
- package/dist/cjs/components/number-field/NumberField.js.map +1 -1
- package/dist/cjs/components/publish-wizard/PublishWizard.js +36 -38
- package/dist/cjs/components/publish-wizard/PublishWizard.js.map +1 -1
- package/dist/cjs/constants/copy.d.ts +1 -0
- package/dist/cjs/constants/copy.js +3 -2
- package/dist/cjs/constants/copy.js.map +1 -1
- package/dist/cjs/constants/icons.d.ts +5 -0
- package/dist/cjs/constants/icons.js +12 -2
- package/dist/cjs/constants/icons.js.map +1 -1
- package/dist/cjs/constants/snippets.d.ts +2 -0
- package/dist/cjs/redux/actions/publish.d.ts +1 -1
- package/dist/cjs/redux/actions/publish.js +2 -2
- package/dist/cjs/redux/actions/publish.js.map +1 -1
- package/dist/esm/components/app-wrapper/AppWrapper.d.ts +0 -1
- package/dist/esm/components/app-wrapper/AppWrapper.js +1 -1
- package/dist/esm/components/app-wrapper/AppWrapper.js.map +1 -1
- package/dist/esm/components/assets/AssetsTypeIcon.js +2 -0
- package/dist/esm/components/assets/AssetsTypeIcon.js.map +1 -1
- package/dist/esm/components/change-report/ChangeReportTree.js +64 -10
- package/dist/esm/components/change-report/ChangeReportTree.js.map +1 -1
- package/dist/esm/components/number-field/NumberField.d.ts +2 -2
- package/dist/esm/components/number-field/NumberField.js +5 -4
- package/dist/esm/components/number-field/NumberField.js.map +1 -1
- package/dist/esm/components/publish-wizard/PublishWizard.js +36 -38
- package/dist/esm/components/publish-wizard/PublishWizard.js.map +1 -1
- package/dist/esm/constants/copy.d.ts +1 -0
- package/dist/esm/constants/copy.js +3 -2
- package/dist/esm/constants/copy.js.map +1 -1
- package/dist/esm/constants/icons.d.ts +5 -0
- package/dist/esm/constants/icons.js +10 -0
- package/dist/esm/constants/icons.js.map +1 -1
- package/dist/esm/constants/snippets.d.ts +2 -0
- package/dist/esm/redux/actions/publish.d.ts +1 -1
- package/dist/esm/redux/actions/publish.js +2 -2
- package/dist/esm/redux/actions/publish.js.map +1 -1
- package/dist/styles.css +54 -10
- package/dist/styles.less +65 -13
- package/less/components/change-report.less +50 -9
- package/less/components/publish-wizard.less +15 -4
- package/package.json +5 -1
- package/src/components/advanced-number-field/AdvancedNumberField.test.tsx +704 -0
- package/src/components/anchor-field/AnchorField.test.tsx +130 -0
- package/src/components/app-wrapper/AppWrapper.tsx +1 -6
- package/src/components/asset-details/AssetDetails.test.tsx +494 -0
- package/src/components/assets/AssetField.test.tsx +439 -0
- package/src/components/assets/AssetsTableAssetIdCell.test.tsx +134 -0
- package/src/components/assets/AssetsTableAssetIdFilter.test.tsx +95 -0
- package/src/components/assets/AssetsTableComplexTagCell.test.tsx +159 -0
- package/src/components/assets/AssetsTableDateCell.test.tsx +106 -0
- package/src/components/assets/AssetsTypeIcon.tsx +2 -0
- package/src/components/change-report/ChangeReportTree.tsx +104 -16
- package/src/components/number-field/NumberField.test.tsx +383 -0
- package/src/components/number-field/NumberField.tsx +15 -9
- package/src/components/publish-wizard/PublishWizard.tsx +52 -53
- package/src/components/text-field/TextField.test.tsx +988 -0
- package/src/constants/copy.ts +3 -2
- package/src/constants/icons.tsx +10 -0
- package/src/constants/snippets.ts +2 -0
- package/src/redux/actions/publish.ts +7 -2
- package/src/test/setup.ts +91 -0
- package/src/test/utils.tsx +44 -0
- package/tsconfig.eslint.json +8 -0
- package/tsconfig.json +1 -1
- package/vitest.config.ts +31 -0
- package/src/components/service-icon/ServiceIcon.test.tsx +0 -0
package/src/constants/copy.ts
CHANGED
|
@@ -155,6 +155,7 @@ export const publish = {
|
|
|
155
155
|
loadingChangesMessage: 'Loading changes...',
|
|
156
156
|
publishNotesLabel: 'Publish notes',
|
|
157
157
|
publishNotesPlaceholder: 'Describe the changes in this version...',
|
|
158
|
+
publishNotesMaxLength: 2000,
|
|
158
159
|
|
|
159
160
|
// change report status labels
|
|
160
161
|
statusAdded: 'Added',
|
|
@@ -162,13 +163,13 @@ export const publish = {
|
|
|
162
163
|
statusModified: 'Modified',
|
|
163
164
|
|
|
164
165
|
// publish
|
|
165
|
-
publishStepTitle: 'STEP
|
|
166
|
+
publishStepTitle: 'STEP 1: Publish your Project',
|
|
166
167
|
publishStepTitleFromCrM: 'STEP 1: Publish your Project to selected Creatives',
|
|
167
168
|
publishStepDesc:
|
|
168
169
|
"Your project needs to be published before your changes can be seen. If you haven't made any changes since the last time you published, you can skip to the next step.",
|
|
169
170
|
|
|
170
171
|
// distribute
|
|
171
|
-
distributeStepTitle: 'STEP
|
|
172
|
+
distributeStepTitle: 'STEP 2: How do you want your users to view their video?',
|
|
172
173
|
distributeStepTitleFromCrM: 'STEP 2: Run a test batch or return to Creative Manager?',
|
|
173
174
|
distributeStepDesc:
|
|
174
175
|
'Select which Composition you want to deliver, access credentials you want to use, and distribution channel.',
|
package/src/constants/icons.tsx
CHANGED
|
@@ -60,6 +60,11 @@ import { faJs } from '@fortawesome/free-brands-svg-icons/faJs';
|
|
|
60
60
|
import { faDownload } from '@fortawesome/free-solid-svg-icons/faDownload';
|
|
61
61
|
import { faUpload } from '@fortawesome/free-solid-svg-icons/faUpload';
|
|
62
62
|
import { faCode } from '@fortawesome/free-solid-svg-icons/faCode';
|
|
63
|
+
import { faHashtag } from '@fortawesome/free-solid-svg-icons/faHashtag';
|
|
64
|
+
import { faToggleOn } from '@fortawesome/free-solid-svg-icons/faToggleOn';
|
|
65
|
+
import { faVolumeUp } from '@fortawesome/free-solid-svg-icons/faVolumeUp';
|
|
66
|
+
import { faPalette } from '@fortawesome/free-solid-svg-icons/faPalette';
|
|
67
|
+
import { faQrcode } from '@fortawesome/free-solid-svg-icons/faQrcode';
|
|
63
68
|
import { faEye } from '@fortawesome/free-solid-svg-icons/faEye';
|
|
64
69
|
import {
|
|
65
70
|
faArrowDown,
|
|
@@ -162,6 +167,11 @@ export const ICON_ALIGN_RIGHT = <FontAwesomeIcon icon={faAlignRight} />;
|
|
|
162
167
|
export const ICON_ALIGN_CENTER = <FontAwesomeIcon icon={faAlignCenter} />;
|
|
163
168
|
|
|
164
169
|
export const ICON_BARS = <FontAwesomeIcon icon={faBars} />;
|
|
170
|
+
export const ICON_HASHTAG = <FontAwesomeIcon icon={faHashtag} />;
|
|
171
|
+
export const ICON_TOGGLE_ON = <FontAwesomeIcon icon={faToggleOn} />;
|
|
172
|
+
export const ICON_VOLUME_UP = <FontAwesomeIcon icon={faVolumeUp} />;
|
|
173
|
+
export const ICON_PALETTE = <FontAwesomeIcon icon={faPalette} />;
|
|
174
|
+
export const ICON_QRCODE = <FontAwesomeIcon icon={faQrcode} />;
|
|
165
175
|
|
|
166
176
|
export const ICON_ARROW_UP = <FontAwesomeIcon icon={faArrowToTop} />;
|
|
167
177
|
|
|
@@ -74,10 +74,15 @@ export const cancelPublish = (api: IImposiumAPI, storyId: string) => {
|
|
|
74
74
|
};
|
|
75
75
|
};
|
|
76
76
|
|
|
77
|
-
export const publishVersion = (
|
|
77
|
+
export const publishVersion = (
|
|
78
|
+
api: IImposiumAPI,
|
|
79
|
+
storyId: string,
|
|
80
|
+
message?: string,
|
|
81
|
+
creativeIds?: string[]
|
|
82
|
+
) => {
|
|
78
83
|
return (dispatch) => {
|
|
79
84
|
return new Promise((resolve, reject) => {
|
|
80
|
-
api.runPublish(storyId, '', creativeIds)
|
|
85
|
+
api.runPublish(storyId, message || '', creativeIds)
|
|
81
86
|
.then((d) => {
|
|
82
87
|
dispatch(getStoryPublishStatus(api, storyId))
|
|
83
88
|
.then()
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
// Test setup file for Vitest
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { beforeAll, vi } from 'vitest';
|
|
4
|
+
|
|
5
|
+
// Mock hotkeys-js
|
|
6
|
+
vi.mock('hotkeys-js', () => {
|
|
7
|
+
const mockHotkeys = vi.fn();
|
|
8
|
+
mockHotkeys.filter = vi.fn();
|
|
9
|
+
mockHotkeys.unbind = vi.fn();
|
|
10
|
+
return {
|
|
11
|
+
default: mockHotkeys
|
|
12
|
+
};
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
// Mock Font Awesome icons - return simple div elements
|
|
16
|
+
vi.mock('../../constants/icons', () => ({
|
|
17
|
+
ICON_CHECK: '<div data-testid="icon-check">✓</div>',
|
|
18
|
+
ICON_EDIT: '<div data-testid="icon-edit">✎</div>',
|
|
19
|
+
ICON_SEARCH: '<div data-testid="icon-search">🔍</div>',
|
|
20
|
+
ICON_PLUS: '<div data-testid="icon-plus">+</div>',
|
|
21
|
+
ICON_CLIPBOARD: '<div data-testid="icon-clipboard">📋</div>',
|
|
22
|
+
ICON_TIMES: '<div data-testid="icon-times">×</div>',
|
|
23
|
+
ICON_CIRCLE_NOTCH: '<div data-testid="icon-loading">⟳</div>',
|
|
24
|
+
ICON_CARET_UP: '<div data-testid="icon-caret-up">▲</div>',
|
|
25
|
+
ICON_CARET_DOWN: '<div data-testid="icon-caret-down">▼</div>'
|
|
26
|
+
}));
|
|
27
|
+
|
|
28
|
+
// Mock react-textarea-autocomplete
|
|
29
|
+
vi.mock('@imposium-hub/react-textarea-autocomplete', () => ({
|
|
30
|
+
default: vi.fn(() => 'input')
|
|
31
|
+
}));
|
|
32
|
+
|
|
33
|
+
// Mock utility functions
|
|
34
|
+
vi.mock('../../Util', () => ({
|
|
35
|
+
generateUUID: vi.fn(() => 'test-uuid-123'),
|
|
36
|
+
filterHotkeys: vi.fn(() => true)
|
|
37
|
+
}));
|
|
38
|
+
|
|
39
|
+
// Mock FieldWrapper to simplify testing
|
|
40
|
+
vi.mock('../../components/field-wrapper/FieldWrapper', () => ({
|
|
41
|
+
default: ({ children, customClass, buttons, info, label }) =>
|
|
42
|
+
React.createElement(
|
|
43
|
+
'div',
|
|
44
|
+
{
|
|
45
|
+
'className': `field-wrapper ${customClass || ''}`,
|
|
46
|
+
'data-testid': 'field-wrapper'
|
|
47
|
+
},
|
|
48
|
+
[
|
|
49
|
+
label && React.createElement('label', { key: 'label' }, label),
|
|
50
|
+
children,
|
|
51
|
+
info && React.createElement('div', { key: 'info', className: 'field-info' }, info),
|
|
52
|
+
buttons &&
|
|
53
|
+
React.createElement(
|
|
54
|
+
'div',
|
|
55
|
+
{ key: 'buttons', className: 'field-buttons' },
|
|
56
|
+
buttons
|
|
57
|
+
)
|
|
58
|
+
]
|
|
59
|
+
)
|
|
60
|
+
}));
|
|
61
|
+
|
|
62
|
+
// Mock Button component to include proper accessibility
|
|
63
|
+
vi.mock('../../components/button/Button', () => ({
|
|
64
|
+
default: ({ children, onClick, tooltip, style, color, ...props }) =>
|
|
65
|
+
React.createElement(
|
|
66
|
+
'button',
|
|
67
|
+
{
|
|
68
|
+
'role': 'button',
|
|
69
|
+
'className': `imposium-btn btn-${style || 'default'} ${color || ''}`,
|
|
70
|
+
onClick,
|
|
71
|
+
'data-tooltip-content': typeof tooltip === 'string' ? tooltip : tooltip?.content,
|
|
72
|
+
...props
|
|
73
|
+
},
|
|
74
|
+
children
|
|
75
|
+
)
|
|
76
|
+
}));
|
|
77
|
+
|
|
78
|
+
// Setup global mocks
|
|
79
|
+
beforeAll(() => {
|
|
80
|
+
// Mock clipboard API
|
|
81
|
+
Object.assign(navigator, {
|
|
82
|
+
clipboard: {
|
|
83
|
+
writeText: vi.fn(() => Promise.resolve())
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
// Mock hotkeys global object
|
|
88
|
+
global.hotkeys = vi.fn();
|
|
89
|
+
global.hotkeys.filter = vi.fn();
|
|
90
|
+
global.hotkeys.unbind = vi.fn();
|
|
91
|
+
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, RenderOptions } from '@testing-library/react';
|
|
3
|
+
import { vi, MockedFunction } from 'vitest';
|
|
4
|
+
|
|
5
|
+
// Interface for mock props with common component callbacks
|
|
6
|
+
interface IMockProps {
|
|
7
|
+
onChange: MockedFunction<any>;
|
|
8
|
+
onSubmit: MockedFunction<any>;
|
|
9
|
+
onBlur: MockedFunction<any>;
|
|
10
|
+
onFocus: MockedFunction<any>;
|
|
11
|
+
onNotification: MockedFunction<any>;
|
|
12
|
+
onError: MockedFunction<any>;
|
|
13
|
+
doSubmit: MockedFunction<any>;
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Custom render function that can be extended with providers if needed
|
|
18
|
+
const customRender = (ui: React.ReactElement, options?: Omit<RenderOptions, 'wrapper'>) => {
|
|
19
|
+
return render(ui, {
|
|
20
|
+
// Add any global providers here if needed in the future
|
|
21
|
+
...options
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
// Re-export everything from React Testing Library
|
|
26
|
+
export * from '@testing-library/react';
|
|
27
|
+
|
|
28
|
+
// Override render method
|
|
29
|
+
export { customRender as render };
|
|
30
|
+
|
|
31
|
+
// Helper functions for common test scenarios
|
|
32
|
+
export const createMockProps = (overrides: IMockProps) => ({
|
|
33
|
+
onChange: vi.fn(),
|
|
34
|
+
onSubmit: vi.fn(),
|
|
35
|
+
onBlur: vi.fn(),
|
|
36
|
+
onFocus: vi.fn(),
|
|
37
|
+
onNotification: vi.fn(),
|
|
38
|
+
onError: vi.fn(),
|
|
39
|
+
doSubmit: vi.fn(),
|
|
40
|
+
...overrides
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
// Helper to wait for async updates
|
|
44
|
+
export const waitForUpdate = () => new Promise((resolve) => setTimeout(resolve, 0));
|
package/tsconfig.json
CHANGED
package/vitest.config.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/// <reference types="vitest" />
|
|
2
|
+
import { defineConfig } from 'vitest/config';
|
|
3
|
+
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
test: {
|
|
6
|
+
environment: 'jsdom',
|
|
7
|
+
setupFiles: ['./src/test/setup.ts'],
|
|
8
|
+
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
|
9
|
+
exclude: ['node_modules', 'dist', '.git', '.storybook'],
|
|
10
|
+
globals: true,
|
|
11
|
+
coverage: {
|
|
12
|
+
provider: 'v8',
|
|
13
|
+
reporter: ['text'],
|
|
14
|
+
reportsDirectory: './coverage',
|
|
15
|
+
include: ['src/components/**/*.{ts,tsx}'],
|
|
16
|
+
exclude: [
|
|
17
|
+
'src/**/*.test.{ts,tsx}',
|
|
18
|
+
'src/**/*.stories.{ts,tsx}',
|
|
19
|
+
'src/test/**',
|
|
20
|
+
'src/constants/**',
|
|
21
|
+
'src/utils/**'
|
|
22
|
+
],
|
|
23
|
+
skipFull: false
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
resolve: {
|
|
27
|
+
alias: {
|
|
28
|
+
'@': '/src'
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
});
|
|
File without changes
|