-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of github.com:RocketChat/Rocket.Chat into impr…
…ove/mentions * 'develop' of github.com:RocketChat/Rocket.Chat: chore: skip hook if HUSKY env var is set to 0 (#29283) ci: skip husky hooks on ci (#29279) chore: Add `roomName` on Composer placeholder (#29255) regression: fix console warnings (#29277) ci: fix Release Task chore: Add Changesets (#29275) feat(Marketplace): Scroll to the top of the marketplace apps list when page changed (#29095) fix: Members/Channels list infinite scroll (#28636)
- Loading branch information
Showing
21 changed files
with
1,002 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Changesets | ||
|
||
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works | ||
with multi-package repos, or single-package repos to help you version and publish your code. You can | ||
find the full documentation for it [in our repository](https://github.com/changesets/changesets) | ||
|
||
We have a quick list of common questions to get you started engaging with this project in | ||
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json", | ||
"changelog": ["@changesets/changelog-github", { "repo": "RocketChat/Rocket.Chat" }], | ||
"commit": false, | ||
"fixed": [ | ||
["@rocket.chat/meteor", "@rocket.chat/core-typings", "@rocket.chat/rest-typings"] | ||
], | ||
"linked": [], | ||
"access": "public", | ||
"baseBranch": "develop", | ||
"updateInternalDependencies": "patch", | ||
"ignore": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@rocket.chat/meteor": minor | ||
--- | ||
|
||
chore: Add `roomName` on Composer placeholder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Changesets | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
|
||
concurrency: ${{ github.workflow }}-${{ github.ref }} | ||
|
||
jobs: | ||
release-versions: | ||
name: ⚙️ Variables Setup | ||
runs-on: ubuntu-latest | ||
outputs: | ||
node-version: ${{ steps.var.outputs.node-version }} | ||
steps: | ||
- uses: Bhacaz/checkout-files@v2 | ||
with: | ||
files: package.json | ||
branch: ${{ github.ref }} | ||
|
||
- id: var | ||
run: | | ||
NODE_VERSION=$(node -p "require('./package.json').engines.node") | ||
echo "NODE_VERSION: ${NODE_VERSION}" | ||
echo "node-version=${NODE_VERSION}" >> $GITHUB_OUTPUT | ||
release: | ||
name: Release | ||
needs: [release-versions] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup NodeJS | ||
uses: ./.github/actions/setup-node | ||
with: | ||
node-version: ${{ needs.release-versions.outputs.node-version }} | ||
cache-modules: true | ||
install: true | ||
|
||
- uses: dtinth/setup-github-actions-caching-for-turbo@v1 | ||
|
||
- name: Create Release Pull Request | ||
uses: changesets/action@v1 | ||
with: | ||
title: 'chore: Bump packages' | ||
env: | ||
HUSKY: 0 | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
[ "$HUSKY" = "0" ] && echo "skipping push hook" && exit 0 | ||
|
||
yarn lint && \ | ||
yarn testunit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { Box } from '@rocket.chat/fuselage'; | ||
import type { ComponentProps } from 'react'; | ||
import React, { useEffect, useRef } from 'react'; | ||
|
||
type InfiniteListAnchorProps = { | ||
loadMore: () => void; | ||
} & ComponentProps<typeof Box>; | ||
|
||
const InfiniteListAnchor = ({ loadMore, ...props }: InfiniteListAnchorProps) => { | ||
const ref = useRef<HTMLDivElement | null>(null); | ||
|
||
useEffect(() => { | ||
const target = ref.current; | ||
|
||
if (!target) { | ||
return; | ||
} | ||
|
||
const observer = new IntersectionObserver( | ||
(e) => { | ||
if (e[0].isIntersecting) { | ||
loadMore(); | ||
} | ||
}, | ||
{ | ||
root: null, | ||
threshold: 0.1, | ||
}, | ||
); | ||
|
||
observer.observe(target); | ||
|
||
return () => observer.disconnect(); | ||
}, [loadMore]); | ||
|
||
return <Box width={5} height={5} ref={ref} {...props} />; | ||
}; | ||
|
||
export default InfiniteListAnchor; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import type { IRoom } from '@rocket.chat/core-typings'; | ||
import { isDirectMessageRoom } from '@rocket.chat/core-typings'; | ||
import { useUserSubscription } from '@rocket.chat/ui-contexts'; | ||
|
||
import { useUserDisplayName } from './useUserDisplayName'; | ||
|
||
/** | ||
* | ||
* Hook to get the name of the room | ||
* | ||
* @param room - Room object | ||
* @returns Room name | ||
* @public | ||
* | ||
*/ | ||
export const useRoomName = (room: IRoom) => { | ||
const subscription = useUserSubscription(room._id); | ||
const username = useUserDisplayName({ name: subscription?.fname, username: subscription?.name }); | ||
|
||
if (isDirectMessageRoom(room)) { | ||
return username; | ||
} | ||
|
||
return room.fname || room.name; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...r/client/views/room/components/body/composer/messageBox/hooks/useMessageBoxPlaceholder.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import type { IRoom } from '@rocket.chat/core-typings'; | ||
import { isDirectMessageRoom } from '@rocket.chat/core-typings'; | ||
|
||
import { useRoomName } from '../../../../../../../hooks/useRoomName'; | ||
|
||
export const useMessageBoxPlaceholder = (placeholder: string, room?: IRoom) => { | ||
if (!room) { | ||
throw new Error('In order to get the placeholder a `room` must be provided'); | ||
} | ||
|
||
const roomName = useRoomName(room); | ||
|
||
if (isDirectMessageRoom(room)) { | ||
return `${placeholder} @${roomName}`; | ||
} | ||
|
||
return `${placeholder} #${roomName}`; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.