Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feat/add-remark-plugin-to-keep-all-linebreaks
Browse files Browse the repository at this point in the history
arnautov-anton authored Nov 27, 2023
2 parents 3b31c92 + 3dd8dab commit 9cb86a1
Showing 19 changed files with 511 additions and 168 deletions.
45 changes: 0 additions & 45 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -23,51 +23,6 @@ jobs:
- name: 🧪 tsc
run: yarn types --noEmit

e2e:
runs-on: ubuntu-latest
name: End-to-end tests
steps:
- uses: actions/checkout@v3

- name: 💾 Cache Dependencies
uses: actions/cache@v3
with:
path: ./node_modules
key: ${{ runner.os }}-${{ matrix.node }}-modules-${{ hashFiles('**/yarn.lock') }}

- name: 🔨 Install Dependencies
run: yarn install --frozen-lockfile --ignore-engines --ignore-scripts

- name: ⚗️ End-to-end tests
run: |
npx playwright install
npx playwright install-deps
yarn e2e-fixtures
# running with --browser=all causes failures
yarn e2e --browser=chromium
yarn e2e --browser=webkit
yarn e2e --browser=firefox
env:
E2E_JUMP_TO_MESSAGE_CHANNEL: jump-to-message
E2E_ADD_MESSAGE_CHANNEL: add-message
E2E_TEST_USER_1: test-user-1
E2E_TEST_USER_2: test-user-2
E2E_APP_KEY: ${{ secrets.E2E_APP_KEY }}
E2E_APP_SECRET: ${{ secrets.E2E_APP_SECRET }}
E2E_TEST_USER_1_TOKEN: ${{ secrets.E2E_TEST_USER_1_TOKEN }}
E2E_TEST_USER_2_TOKEN: ${{ secrets.E2E_TEST_USER_2_TOKEN }}
E2E_ADDITIONAL_CHANNELS: mr-channel-1, mr-channel-2, edit-message-channel, pin-message-channel
E2E_LONG_MESSAGE_LISTS_CHANNEL: navigate-long-message-lists
E2E_ATTACHMENT_SIZING_CHANNEL: attachment-sizing

- name: 🎥 Upload Artifacts
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: E2E_Artifacts
path: ./test-results
retention-days: 1

test:
runs-on: ubuntu-latest
strategy:
49 changes: 49 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: E2E

on: [push]

jobs:
e2e:
runs-on: ubuntu-latest
name: End-to-end tests
steps:
- uses: actions/checkout@v3

- name: 💾 Cache Dependencies
uses: actions/cache@v3
with:
path: ./node_modules
key: ${{ runner.os }}-${{ matrix.node }}-modules-${{ hashFiles('**/yarn.lock') }}

- name: 🔨 Install Dependencies
run: yarn install --frozen-lockfile --ignore-engines --ignore-scripts

- name: ⚗️ End-to-end tests
run: |
npx playwright install
npx playwright install-deps
yarn e2e-fixtures
# running with --browser=all causes failures
yarn e2e --browser=chromium
yarn e2e --browser=webkit
yarn e2e --browser=firefox
env:
E2E_JUMP_TO_MESSAGE_CHANNEL: jump-to-message
E2E_ADD_MESSAGE_CHANNEL: add-message
E2E_TEST_USER_1: test-user-1
E2E_TEST_USER_2: test-user-2
E2E_APP_KEY: ${{ secrets.E2E_APP_KEY }}
E2E_APP_SECRET: ${{ secrets.E2E_APP_SECRET }}
E2E_TEST_USER_1_TOKEN: ${{ secrets.E2E_TEST_USER_1_TOKEN }}
E2E_TEST_USER_2_TOKEN: ${{ secrets.E2E_TEST_USER_2_TOKEN }}
E2E_ADDITIONAL_CHANNELS: mr-channel-1, mr-channel-2, edit-message-channel, pin-message-channel
E2E_LONG_MESSAGE_LISTS_CHANNEL: navigate-long-message-lists
E2E_ATTACHMENT_SIZING_CHANNEL: attachment-sizing

- name: 🎥 Upload Artifacts
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: E2E_Artifacts
path: ./test-results
retention-days: 1
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
## [10.20.1](https://github.com/GetStream/stream-chat-react/compare/v10.20.0...v10.20.1) (2023-11-20)


### Bug Fixes

* calculate pagination stop from custom channel query message limit ([#2180](https://github.com/GetStream/stream-chat-react/issues/2180)) ([8374af1](https://github.com/GetStream/stream-chat-react/commit/8374af1048b81c307d0687d7730df6a96633b7e6))

## [10.20.0](https://github.com/GetStream/stream-chat-react/compare/v10.19.0...v10.20.0) (2023-11-16)


### Bug Fixes

* lift notifications above modal overlay ([#2175](https://github.com/GetStream/stream-chat-react/issues/2175)) ([17d98f4](https://github.com/GetStream/stream-chat-react/commit/17d98f40eaea0a134a501deea14605b71d965871))


### Features

* allow to configure channel query options ([#2177](https://github.com/GetStream/stream-chat-react/issues/2177)) ([4f91d9a](https://github.com/GetStream/stream-chat-react/commit/4f91d9a65e752f4bcab2000f5d633b57ae4d6b0e))

## [10.19.0](https://github.com/GetStream/stream-chat-react/compare/v10.18.0...v10.19.0) (2023-11-14)


### Features

* expose optional remark plugin to keep all line breaks and keep HTML in message text ([#2170](https://github.com/GetStream/stream-chat-react/issues/2170)) ([5b191c9](https://github.com/GetStream/stream-chat-react/commit/5b191c94de6ec4ff483be65b15ea00e754e0eb47))
* introduce MessageListContext ([#2166](https://github.com/GetStream/stream-chat-react/issues/2166)) ([8dcb1ac](https://github.com/GetStream/stream-chat-react/commit/8dcb1acd5e8e3465d6b457b07f5de2923ac2daed))

## [10.18.0](https://github.com/GetStream/stream-chat-react/compare/v10.17.0...v10.18.0) (2023-11-07)


2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
> building chat applications.
[![NPM](https://img.shields.io/npm/v/stream-chat-react.svg)](https://www.npmjs.com/package/stream-chat-react)
[![build](https://github.com/GetStream/stream-chat-react/workflows/test/badge.svg)](https://github.com/GetStream/stream-chat-react/actions)
[![build](https://github.com/GetStream/stream-chat-react/actions/workflows/ci.yml/badge.svg)](https://github.com/GetStream/stream-chat-react/actions)
[![Component Reference](https://img.shields.io/badge/docs-component%20reference-blue.svg)](https://getstream.io/chat/docs/sdk/react/)
[![codecov](https://codecov.io/gh/GetStream/stream-chat-react/branch/master/graph/badge.svg)](https://codecov.io/gh/GetStream/stream-chat-react)

33 changes: 33 additions & 0 deletions docusaurus/docs/React/components/core-components/channel.mdx
Original file line number Diff line number Diff line change
@@ -176,6 +176,39 @@ Custom UI component to display a user's avatar.
| --------- | ---------------------------------------------------------- |
| component | <GHComponentLink text='Avatar' path='/Avatar/Avatar.tsx'/> |

### channelQueryOptions

Optional configuration parameters used for the initial channel query. Applied only if the value of `channel.initialized` is false. If the channel instance has already been initialized (channel has been queried), then the channel query will be skipped and channelQueryOptions will not be applied.

In the example below, we specify, that the first page of messages when a channel is queried should have 20 messages (the default is 100). Note that the `channel` prop has to be passed along `channelQueryOptions`.

```tsx
import {ChannelQueryOptions} from "stream-chat";
import {Channel, useChatContext} from "stream-chat-react";

const channelQueryOptions: ChannelQueryOptions = {
messages: { limit: 20 },
};

type ChannelRendererProps = {
id: string;
type: string;
};

const ChannelRenderer = ({id, type}: ChannelRendererProps) => {
const { client } = useChatContext();
return (
<Channel channel={client.channel(type, id)} channelQueryOptions={channelQueryOptions}>
{/* Channel children */}
</Channel>
);
}
```

| Type |
|-----------------------|
| `ChannelQueryOptions` |

### CooldownTimer

Custom UI component to display the slow mode cooldown timer.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@
"dependencies": {
"@braintree/sanitize-url": "^6.0.4",
"@popperjs/core": "^2.11.5",
"@stream-io/stream-chat-css": "^3.13.0",
"@stream-io/stream-chat-css": "^3.14.2",
"clsx": "^2.0.0",
"dayjs": "^1.10.4",
"emoji-mart": "3.0.1",
Loading

0 comments on commit 9cb86a1

Please sign in to comment.