Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:RocketChat/Rocket.Chat into fix/…
Browse files Browse the repository at this point in the history
…lists

* 'develop' of github.com:RocketChat/Rocket.Chat:
  Chore: Migrate NotFoundPage to TS (#25509)
  [FIX] Unable to see channel member list by authorized channel roles (#25412)
  Regression: Fix services-image-build-check (#25519)
  Chore: Migrate spotify to ts (#25507)
  [Chore] Reorder unreleased migrations (#25508)
  [FIX] Spotlight results showing usernames instead of real names (#25471)
  [FIX] LDAP sync removing users from channels when multiple groups are mapped to it (#25434)
  • Loading branch information
gabriellsh committed May 16, 2022
2 parents 943be61 + 394b4aa commit f1bb2fc
Show file tree
Hide file tree
Showing 12 changed files with 214 additions and 120 deletions.
62 changes: 36 additions & 26 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
release:
types: [published]
pull_request:
branches: "**"
branches: '**'
push:
branches:
- develop
Expand Down Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Use Node.js 14.18.3
uses: actions/setup-node@v3
with:
node-version: "14.18.3"
node-version: '14.18.3'

- uses: actions/checkout@v3

Expand Down Expand Up @@ -175,8 +175,8 @@ jobs:

strategy:
matrix:
node-version: ["14.18.3"]
mongodb-version: ["3.6", "4.0", "4.2", "4.4", "5.0"]
node-version: ['14.18.3']
mongodb-version: ['3.6', '4.0', '4.2', '4.4', '5.0']

steps:
- name: Launch MongoDB
Expand Down Expand Up @@ -247,7 +247,7 @@ jobs:
- name: E2E Test API
env:
TEST_MODE: "true"
TEST_MODE: 'true'
MONGO_URL: mongodb://localhost:27017/rocketchat
MONGO_OPLOG_URL: mongodb://localhost:27017/local
run: |
Expand All @@ -258,7 +258,7 @@ jobs:
- name: E2E Test UI (Legacy - Cypress)
env:
TEST_MODE: "true"
TEST_MODE: 'true'
MONGO_URL: mongodb://localhost:27017/rocketchat
MONGO_OPLOG_URL: mongodb://localhost:27017/local
run: |
Expand All @@ -269,7 +269,7 @@ jobs:
- name: E2E Test UI
env:
TEST_MODE: "true"
TEST_MODE: 'true'
MONGO_URL: mongodb://localhost:27017/rocketchat
MONGO_OPLOG_URL: mongodb://localhost:27017/local
run: |
Expand Down Expand Up @@ -305,8 +305,8 @@ jobs:

strategy:
matrix:
node-version: ["14.18.3"]
mongodb-version: ["4.4"]
node-version: ['14.18.3']
mongodb-version: ['4.4']

steps:
- name: Launch MongoDB
Expand Down Expand Up @@ -372,12 +372,12 @@ jobs:

- name: E2E Test API
env:
TEST_MODE: "true"
TEST_MODE: 'true'
MONGO_URL: mongodb://localhost:27017/rocketchat
MONGO_OPLOG_URL: mongodb://localhost:27017/local
ENTERPRISE_LICENSE: ${{ secrets.ENTERPRISE_LICENSE }}
TRANSPORTER: nats://localhost:4222
SKIP_PROCESS_EVENT_REGISTRATION: "true"
SKIP_PROCESS_EVENT_REGISTRATION: 'true'
run: |
echo -e 'pcm.!default {\n type hw\n card 0\n}\n\nctl.!default {\n type hw\n card 0\n}' > ~/.asoundrc
Xvfb -screen 0 1024x768x24 :99 &
Expand All @@ -388,15 +388,15 @@ jobs:
- name: E2E Test UI (Legacy - Cypress)
env:
TEST_MODE: "true"
TEST_MODE: 'true'
MONGO_URL: mongodb://localhost:27017/rocketchat
MONGO_OPLOG_URL: mongodb://localhost:27017/local
ENTERPRISE_LICENSE: ${{ secrets.ENTERPRISE_LICENSE }}
TRANSPORTER: nats://localhost:4222
CYPRESS_BASE_URL: http://localhost:4000
CYPRESS_TEST_API_URL: http://localhost:4000
OVERWRITE_SETTING_Site_Url: http://localhost:4000
SKIP_PROCESS_EVENT_REGISTRATION: "true"
SKIP_PROCESS_EVENT_REGISTRATION: 'true'
run: |
echo -e 'pcm.!default {\n type hw\n card 0\n}\n\nctl.!default {\n type hw\n card 0\n}' > ~/.asoundrc
Xvfb -screen 0 1024x768x24 :99 &
Expand All @@ -412,15 +412,15 @@ jobs:
- name: E2E Test UI
env:
TEST_MODE: "true"
TEST_MODE: 'true'
MONGO_URL: mongodb://localhost:27017/rocketchat
MONGO_OPLOG_URL: mongodb://localhost:27017/local
ENTERPRISE_LICENSE: ${{ secrets.ENTERPRISE_LICENSE }}
TRANSPORTER: nats://localhost:4222
CYPRESS_BASE_URL: http://localhost:4000
CYPRESS_TEST_API_URL: http://localhost:4000
OVERWRITE_SETTING_Site_Url: http://localhost:4000
SKIP_PROCESS_EVENT_REGISTRATION: "true"
SKIP_PROCESS_EVENT_REGISTRATION: 'true'
run: |
echo -e 'pcm.!default {\n type hw\n card 0\n}\n\nctl.!default {\n type hw\n card 0\n}' > ~/.asoundrc
Xvfb -screen 0 1024x768x24 :99 &
Expand Down Expand Up @@ -469,7 +469,7 @@ jobs:

strategy:
matrix:
release: ["official", "preview"]
release: ['official', 'preview']

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -519,7 +519,7 @@ jobs:
- name: Use Node.js 14.18.3
uses: actions/setup-node@v3
with:
node-version: "14.18.3"
node-version: '14.18.3'

- name: Install Meteor
run: |
Expand Down Expand Up @@ -601,16 +601,27 @@ jobs:

strategy:
matrix:
service:
["ddp-streamer"]
service: ['ddp-streamer']

steps:
- uses: actions/checkout@v3

- name: Use Node.js 14.18.3
uses: actions/setup-node@v3
with:
node-version: "14.18.3"
node-version: '14.18.3'

- uses: c-hive/gha-yarn-cache@v2
- name: Cache turbo
id: cache-turbo
uses: actions/cache@v2
with:
path: |
./node_modules/.turbo
key: ${{ runner.OS }}-turbo-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-turbo-
${{ runner.os }}-
- name: Build Docker images
env:
Expand Down Expand Up @@ -670,7 +681,7 @@ jobs:
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: "us-east-1"
AWS_DEFAULT_REGION: 'us-east-1'
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
REDHAT_REGISTRY_PID: ${{ secrets.REDHAT_REGISTRY_PID }}
REDHAT_REGISTRY_KEY: ${{ secrets.REDHAT_REGISTRY_KEY }}
Expand Down Expand Up @@ -738,10 +749,10 @@ jobs:
strategy:
matrix:
# this is current a mix of variants and different images
release: ["official", "preview", "alpine"]
release: ['official', 'preview', 'alpine']

env:
IMAGE_NAME: "rocketchat/rocket.chat"
IMAGE_NAME: 'rocketchat/rocket.chat'

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -844,16 +855,15 @@ jobs:

strategy:
matrix:
service:
["account", "authorization", "ddp-streamer", "presence", "stream-hub"]
service: ['account', 'authorization', 'ddp-streamer', 'presence', 'stream-hub']

steps:
- uses: actions/checkout@v3

- name: Use Node.js 14.18.3
uses: actions/setup-node@v3
with:
node-version: "14.18.3"
node-version: '14.18.3'

- name: Login to DockerHub
uses: docker/login-action@v1
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/api/server/v1/channels.js
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ API.v1.addRoute(
checkedArchived: false,
});

if (findResult.broadcast && !hasPermission(this.userId, 'view-broadcast-member-list')) {
if (findResult.broadcast && !hasPermission(this.userId, 'view-broadcast-member-list', findResult._id)) {
return API.v1.unauthorized();
}

Expand Down
3 changes: 0 additions & 3 deletions apps/meteor/app/settings/server/startup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ import { ICachedSettings } from './CachedSettings';

export function initializeSettings({ SettingsModel, settings }: { SettingsModel: Settings; settings: ICachedSettings }): void {
SettingsModel.find().forEach((record: ISetting) => {
if (record._id.startsWith('Prometheus')) {
console.log('store cache', record);
}
settings.set(record);
});

Expand Down
38 changes: 0 additions & 38 deletions apps/meteor/app/spotify/lib/spotify.js

This file was deleted.

46 changes: 46 additions & 0 deletions apps/meteor/app/spotify/lib/spotify.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { IMessage } from '@rocket.chat/core-typings';

const process = (
message: IMessage,
source: string,
callback: (msg: IMessage, msgParts: string[], index: number, part: string) => void,
): void => {
if (!source?.trim()) {
return;
}

const msgParts = source.split(/(```\w*[\n ]?[\s\S]*?```+?)|(`(?:[^`]+)`)/);
for (let index = 0; index < msgParts.length; index++) {
const part = msgParts[index];
if (!/(?:```(\w*)[\n ]?([\s\S]*?)```+?)|(?:`(?:[^`]+)`)/.test(part)) {
callback(message, msgParts, index, part);
}
}
};

export const createSpotifyBeforeSaveMessageHandler =
(): ((msg: IMessage) => IMessage) =>
(message: IMessage): IMessage => {
const urls = Array.isArray(message.urls) ? message.urls : [];

let changed = false;

process(message, message.msg, (_message: IMessage, _msgParts: string[], _index: number, part: string) => {
const re = /(?:^|\s)spotify:([^:\s]+):([^:\s]+)(?::([^:\s]+))?(?::(\S+))?(?:\s|$)/g;

let match;
while ((match = re.exec(part)) != null) {
const data = match.slice(1).filter(Boolean);
const path = data.map((value) => encodeURI(value)).join('/');
const url = `https://open.spotify.com/${path}`;
urls.push({ url, source: `spotify:${data.join(':')}`, meta: {} });
changed = true;
}
});

if (changed) {
message.urls = urls;
}

return message;
};
File renamed without changes.
6 changes: 3 additions & 3 deletions apps/meteor/client/sidebar/search/SearchList.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ const SearchList = forwardRef(function SearchList({ onClose }, ref) {
const itemIndexRef = useRef(0);

const sidebarViewMode = useUserPreference('sidebarViewMode');
const showRealName = useSetting('UI_Use_Real_Name');
const useRealName = useSetting('UI_Use_Real_Name');

const sideBarItemTemplate = useTemplateByViewMode();
const avatarTemplate = useAvatarTemplate();
Expand All @@ -164,11 +164,11 @@ const SearchList = forwardRef(function SearchList({ onClose }, ref) {
t,
SideBarItemTemplate: sideBarItemTemplate,
avatarTemplate,
showRealName,
useRealName,
extended,
sidebarViewMode,
}),
[avatarTemplate, extended, items, showRealName, sideBarItemTemplate, sidebarViewMode, t],
[avatarTemplate, extended, items, useRealName, sideBarItemTemplate, sidebarViewMode, t],
);

const changeSelection = useMutableCallback((dir) => {
Expand Down
63 changes: 63 additions & 0 deletions apps/meteor/client/views/notFound/NotFoundPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import { Box, Button, ButtonGroup, Flex, Margins } from '@rocket.chat/fuselage';
import { useRoute, useTranslation } from '@rocket.chat/ui-contexts';
import React, { ReactElement } from 'react';

const NotFoundPage = (): ReactElement => {
const t = useTranslation();
const homeRoute = useRoute('home');

const handleGoToPreviousPageClick = (): void => {
window.history.back();
};

const handleGoHomeClick = (): void => {
homeRoute.push();
};

return (
<Flex.Container direction='column' justifyContent='center' alignItems='center'>
<Box
is='section'
width='full'
minHeight='sh'
textAlign='center'
backgroundColor='neutral-800'
style={{
backgroundImage: "url('/images/404.svg')",
backgroundRepeat: 'no-repeat',
backgroundPosition: 'center',
backgroundSize: 'cover',
}}
>
<Flex.Item>
<Box>
<Margins all='x12'>
<Box fontWeight='p2m' fontSize='x64' color='alternative'>
404
</Box>

<Box role='heading' aria-level={1} fontScale='h2' color='alternative'>
{t('Oops_page_not_found')}
</Box>

<Box role='status' aria-label='Sorry_page_you_requested_does_not_exist_or_was_deleted' fontScale='p2' color='alternative'>
{t('Sorry_page_you_requested_does_not_exist_or_was_deleted')}
</Box>
</Margins>

<ButtonGroup align='center' margin='x64'>
<Button type='button' primary onClick={handleGoToPreviousPageClick}>
{t('Return_to_previous_page')}
</Button>
<Button type='button' primary onClick={handleGoHomeClick}>
{t('Return_to_home')}
</Button>
</ButtonGroup>
</Box>
</Flex.Item>
</Box>
</Flex.Container>
);
};

export default NotFoundPage;
Loading

0 comments on commit f1bb2fc

Please sign in to comment.