From 7678befeee729228ba5e0363934f2b404d9e7c38 Mon Sep 17 00:00:00 2001 From: Zita Szupera Date: Fri, 9 Sep 2022 11:22:21 +0200 Subject: [PATCH 1/3] chore: fix docusaurus publish --- .github/workflows/docusaurus.yml | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/docusaurus.yml b/.github/workflows/docusaurus.yml index 0b4884579a..8dabf9f590 100644 --- a/.github/workflows/docusaurus.yml +++ b/.github/workflows/docusaurus.yml @@ -6,6 +6,7 @@ on: - develop paths: - docusaurus/** + - .github/workflows/docusaurus.yml env: branch_map: '{"refs/heads/master": "production", "refs/heads/develop": "staging"}' @@ -17,18 +18,10 @@ jobs: steps: - name: Pull stream-chat-react uses: actions/checkout@v3 - # This part here is cloning a second repository - # While cloning the repository: - # - it clones the repo into the given `path` - # - it checks out the branch defined at `ref` (version tag) - - name: Pull stream-chat-css - uses: actions/checkout@v3 - with: - repository: GetStream/stream-chat-css - path: stream-chat-css - ref: v${{ node -e 'pkg=require("./package.json"); console.log(pkg.dependencies["@stream-io/stream-chat-css"])' }} + - name: 🔨 Install Dependencies + run: yarn install --frozen-lockfile --ignore-engines --ignore-scripts - name: Merge docs stream-chat-css - run: bash scripts/merge-stream-chat-css-docs.sh stream-chat-css/docs + run: bash scripts/merge-stream-chat-css-docs.sh node_modules/@stream-io/stream-chat-css/docs - name: Push to stream-chat-docusaurus uses: GetStream/push-stream-chat-docusaurus-action@main with: From 14bfeb6c5f5c90f8fea1cb1f3e1bb67dce11ecf6 Mon Sep 17 00:00:00 2001 From: Anton Arnautov <43254280+arnautov-anton@users.noreply.github.com> Date: Mon, 12 Sep 2022 09:03:26 +0200 Subject: [PATCH 2/3] fix: remove useId from LoadingIndicatorIcon (#1744) --- src/components/MessageInput/icons.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/MessageInput/icons.tsx b/src/components/MessageInput/icons.tsx index 9764c6306d..54ac1b7c41 100644 --- a/src/components/MessageInput/icons.tsx +++ b/src/components/MessageInput/icons.tsx @@ -1,4 +1,5 @@ -import React, { useId } from 'react'; +import React, { useMemo } from 'react'; +import { nanoid } from 'nanoid'; import { useTranslationContext } from '../../context/TranslationContext'; import { useChatContext } from '../../context/ChatContext'; @@ -76,7 +77,7 @@ export const FileUploadIconFlat = () => { }; export const LoadingIndicatorIcon = ({ size = 20 }: { size?: number }) => { - const id = useId(); + const id = useMemo(() => nanoid(), []); return (
From 8d5743517576b3799c283b4df932601c13f3152f Mon Sep 17 00:00:00 2001 From: Anton Arnautov <43254280+arnautov-anton@users.noreply.github.com> Date: Mon, 12 Sep 2022 13:11:30 +0200 Subject: [PATCH 3/3] test: add nanoid mock to AttachmentPreviewList (#1745) --- .../MessageInput/__tests__/AttachmentPreviewList.test.js | 4 ++++ .../__snapshots__/AttachmentPreviewList.test.js.snap | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/MessageInput/__tests__/AttachmentPreviewList.test.js b/src/components/MessageInput/__tests__/AttachmentPreviewList.test.js index 29fcd735dd..b2f2ebdbe9 100644 --- a/src/components/MessageInput/__tests__/AttachmentPreviewList.test.js +++ b/src/components/MessageInput/__tests__/AttachmentPreviewList.test.js @@ -43,6 +43,10 @@ const renderComponent = (value = {}, renderFunction = render) => , ); +jest.mock('nanoid', () => ({ + nanoid: () => '', +})); + describe('AttachmentPreviewList', () => { it('renders without any attachments', () => { const { getByTestId } = renderComponent(); diff --git a/src/components/MessageInput/__tests__/__snapshots__/AttachmentPreviewList.test.js.snap b/src/components/MessageInput/__tests__/__snapshots__/AttachmentPreviewList.test.js.snap index 5f2d55f7a0..367003da57 100644 --- a/src/components/MessageInput/__tests__/__snapshots__/AttachmentPreviewList.test.js.snap +++ b/src/components/MessageInput/__tests__/__snapshots__/AttachmentPreviewList.test.js.snap @@ -374,7 +374,7 @@ exports[`AttachmentPreviewList renders with one image and one file with state "u > @@ -508,7 +508,7 @@ exports[`AttachmentPreviewList renders with one image and one file with state "u >