From 1acecbb5e810e4bdc4c9ec2cf421dec263ce7d2b Mon Sep 17 00:00:00 2001 From: Pavel Samusev Date: Wed, 20 Nov 2024 13:41:39 +0300 Subject: [PATCH 1/2] chore: update to newly shared components version --- package.json | 2 +- src/components/shared/Panel.styles.ts | 2 +- .../variables/VariablesPanel.styles.ts | 2 +- .../imageVariable/useMediaDetails.test.ts | 16 ++++++++-------- yarn.lock | 7 +++---- 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index 2400daf9..ccb120be 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "validate-versions": "node validate_versions.cjs" }, "dependencies": { - "@chili-publish/grafx-shared-components": "^0.85.4", + "@chili-publish/grafx-shared-components": "https://stgrafxstudiodevpublic.blob.core.windows.net/grafx-shared-components/dev-shared-components/449/grafx-shared-components.tgz", "@chili-publish/studio-sdk": "^1.16.0-rc.12", "axios": "^1.6.0", "react": "^18.2.0", diff --git a/src/components/shared/Panel.styles.ts b/src/components/shared/Panel.styles.ts index 9a9aa0df..532a3143 100644 --- a/src/components/shared/Panel.styles.ts +++ b/src/components/shared/Panel.styles.ts @@ -2,7 +2,7 @@ import { FontSizes, ITheme } from '@chili-publish/grafx-shared-components'; import styled from 'styled-components'; export const PanelTitle = styled.h2<{ margin?: string; panelTheme: ITheme['panel'] }>` - font-size: ${FontSizes.heading2}; + font-size: ${FontSizes.header}; font-weight: 500; ${(props) => props.margin && `margin: ${props.margin};`}; color: ${(props) => props.panelTheme.color}; diff --git a/src/components/variables/VariablesPanel.styles.ts b/src/components/variables/VariablesPanel.styles.ts index 75328ac3..04dbb8a8 100644 --- a/src/components/variables/VariablesPanel.styles.ts +++ b/src/components/variables/VariablesPanel.styles.ts @@ -12,7 +12,7 @@ export const VariablesContainer = styled.div<{ height?: string }>` height: ${(props) => props.height ?? '100%'}; `; export const TrayPanelTitle = styled.h2<{ margin?: string; panelTheme: ITheme['panel'] }>` - font-size: ${FontSizes.heading2}; + font-size: ${FontSizes.header}; font-weight: 500; ${(props) => props.margin && `margin: ${props.margin};`}; color: ${(props) => props.panelTheme.color}; diff --git a/src/tests/components/variablesComponents/imageVariable/useMediaDetails.test.ts b/src/tests/components/variablesComponents/imageVariable/useMediaDetails.test.ts index 19088340..ef4b2800 100644 --- a/src/tests/components/variablesComponents/imageVariable/useMediaDetails.test.ts +++ b/src/tests/components/variablesComponents/imageVariable/useMediaDetails.test.ts @@ -1,9 +1,9 @@ +import { ConnectorMappingDirection, Variable } from '@chili-publish/studio-sdk'; import { renderHook, waitFor } from '@testing-library/react'; import { act } from 'react-dom/test-utils'; -import { ConnectorMappingDirection, Variable } from '@chili-publish/studio-sdk'; import { useMediaDetails } from '../../../../components/variablesComponents/imageVariable/useMediaDetails'; -import { useVariablePanelContext } from '../../../../contexts/VariablePanelContext'; import { useSubscriberContext } from '../../../../contexts/Subscriber'; +import { useVariablePanelContext } from '../../../../contexts/VariablePanelContext'; import { Subscriber } from '../../../../utils/subscriber'; jest.mock('../../../../contexts/VariablePanelContext', () => ({ @@ -155,7 +155,7 @@ describe('"useMediaDetails" hook', () => { const variableChange = { id: '7377E97A-5FD9-46B1-A8CF-0C7C776C7DC2', value: '1234' } as unknown as Variable; mockSubscriber.emit('onVariableListChanged', [variableChange]); - await act(() => { + await waitFor(() => { expect(window.StudioUISDK.mediaConnector.query).toHaveBeenCalledTimes(1); }); }); @@ -181,7 +181,7 @@ describe('"useMediaDetails" hook', () => { const variableChange = { id: '2', value: '1234' } as unknown as Variable; mockSubscriber.emit('onVariableListChanged', [variableChange]); - await act(() => { + await waitFor(() => { expect(window.StudioUISDK.mediaConnector.query).toHaveBeenCalledTimes(1); }); }); @@ -207,7 +207,7 @@ describe('"useMediaDetails" hook', () => { const variableChange = { id: '8A59BB89-898D-4BAC-9C8F-F40F6C83479E', value: '1234' } as unknown as Variable; mockSubscriber.emit('onVariableListChanged', [variableChange]); - await act(() => { + await waitFor(() => { expect(window.StudioUISDK.mediaConnector.query).not.toHaveBeenCalled(); expect(result.current).toEqual(null); }); @@ -248,7 +248,7 @@ describe('"useMediaDetails" hook', () => { expect(window.StudioUISDK.mediaConnector.query).toHaveBeenCalledTimes(2); - await act(() => { + await waitFor(() => { expect(result.current).toEqual(null); }); }); @@ -288,7 +288,7 @@ describe('"useMediaDetails" hook', () => { expect(window.StudioUISDK.mediaConnector.query).toHaveBeenCalledTimes(2); - await act(() => { + await waitFor(() => { expect(result.current).toEqual({ id: 'media', name: 'name', @@ -320,7 +320,7 @@ describe('"useMediaDetails" hook', () => { expect(window.StudioUISDK.mediaConnector.query).toHaveBeenCalledWith('grafx-media', {}, {}), ); - await act(() => { + await waitFor(() => { expect(result.current).toEqual({ id: 'media', name: 'name', diff --git a/yarn.lock b/yarn.lock index 6586e40d..f23f28e5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1225,10 +1225,9 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@chili-publish/grafx-shared-components@^0.85.4": - version "0.85.4" - resolved "https://npm.pkg.github.com/download/@chili-publish/grafx-shared-components/0.85.4/f4519cc0af29a890251232df7f1d3772a29b1d69#f4519cc0af29a890251232df7f1d3772a29b1d69" - integrity sha512-p22W3O3wpV9n2BUF0g1FvYfZLA7AroYYc2wJmLDoHKxLU1WT5ONrVEnpA5M9QibIk+D5gLRgBn3npktd6HQalQ== +"@chili-publish/grafx-shared-components@https://stgrafxstudiodevpublic.blob.core.windows.net/grafx-shared-components/dev-shared-components/449/grafx-shared-components.tgz": + version "0.85.6" + resolved "https://stgrafxstudiodevpublic.blob.core.windows.net/grafx-shared-components/dev-shared-components/449/grafx-shared-components.tgz#d7c0a4699af34dcdeb3bf5b2873bc68f57cd41fc" dependencies: "@fortawesome/fontawesome-svg-core" "^6.4.0" "@fortawesome/pro-light-svg-icons" "^6.4.0" From e4042d7ce905cc4c95fb9700bd56bdd40330d097 Mon Sep 17 00:00:00 2001 From: Pavel Samusev Date: Thu, 21 Nov 2024 12:50:04 +0300 Subject: [PATCH 2/2] chore: update version --- yarn.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yarn.lock b/yarn.lock index f23f28e5..d2288491 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1226,8 +1226,8 @@ integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== "@chili-publish/grafx-shared-components@https://stgrafxstudiodevpublic.blob.core.windows.net/grafx-shared-components/dev-shared-components/449/grafx-shared-components.tgz": - version "0.85.6" - resolved "https://stgrafxstudiodevpublic.blob.core.windows.net/grafx-shared-components/dev-shared-components/449/grafx-shared-components.tgz#d7c0a4699af34dcdeb3bf5b2873bc68f57cd41fc" + version "0.85.8" + resolved "https://stgrafxstudiodevpublic.blob.core.windows.net/grafx-shared-components/dev-shared-components/449/grafx-shared-components.tgz#954ff45a0d94db783248c1791946582b66071fea" dependencies: "@fortawesome/fontawesome-svg-core" "^6.4.0" "@fortawesome/pro-light-svg-icons" "^6.4.0"