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
…importer-messages-not-shown

* 'develop' of github.com:RocketChat/Rocket.Chat:
  fix: Room history scroll position (#29335)
  fix: check for $addToSet to be not empty before passing update params (#29378)
  chore: update `badge-level-0` color (#29460)
  fix: Saving Business hour throws an alert (#29449)
  regression: emojiPicker position (#29408)
  chore: Update codeowners to add ownership of rest typings package to backend (#29437)
  fix: Removed agent access to already taken rooms (#28979)
  fix: `queuedForUser` endpoint not filtering by status (#29189)
  regression: Marketplace Selectors (#29443)
  chore: fix contextualbar size (#29441)
  chore: `ComposerBoxPopup` Items alignment (#29320)
  feat: add support for `MONOLITH_TRANSPORTER` env var (#29373)
  fix: Import progress page stuck at 0% (#29421)
  feat: access-marketplace permission (#29203)
  chore(ddp-client): freeze data emitted by the sdk (#29430)
  refactor: `Table` on Integrations Page (#29428)
  regression: Update `LoadingIndicator` colors (#29424)
  chore(meteor): Update mention style (#29426)
  • Loading branch information
gabriellsh committed Jun 6, 2023
2 parents a30df55 + cebe359 commit a356d53
Show file tree
Hide file tree
Showing 64 changed files with 905 additions and 494 deletions.
5 changes: 5 additions & 0 deletions .changeset/curvy-hounds-sniff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rocket.chat/meteor': minor
---

feat: access-marketplace permission
5 changes: 5 additions & 0 deletions .changeset/honest-coins-bow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/meteor": patch
---

fix: `queuedForUser` endpoint not filtering by status
11 changes: 11 additions & 0 deletions .changeset/mean-guests-love.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
'@rocket.chat/meteor': minor
---

feat: *Enterprise* Add support for different transporters to connect multiple monolith instances.

To use that, you can use the `TRANSPORTER` env var adding "monolith+" to the transporter value. To use NATS for example, your env var should be:

```bash
export TRANSPORTER="monolith+nats://localhost:4222"
```
5 changes: 5 additions & 0 deletions .changeset/modern-terms-jump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/agenda": patch
---

fix: Saving Business hour throws an alert
5 changes: 5 additions & 0 deletions .changeset/pretty-dots-leave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rocket.chat/meteor': minor
---

fix: Room history scrollbar position
5 changes: 5 additions & 0 deletions .changeset/quiet-bottles-fry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/meteor": patch
---

fix: Import progress page stuck at 0%
5 changes: 5 additions & 0 deletions .changeset/tough-knives-rescue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rocket.chat/meteor': patch
---

fix: Remove room from UI when another agent takes it
5 changes: 5 additions & 0 deletions .changeset/violet-beans-breathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/meteor": patch
---

Fix visitor's query when both email & phone number are empty
5 changes: 5 additions & 0 deletions .changeset/warm-scissors-itch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/gazzodown": patch
---

chore(meteor): Update mention style
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/packages/* @RocketChat/Architecture
/packages/core-typings/ @RocketChat/Architecture
/packages/rest-typings/ @RocketChat/Architecture
/packages/rest-typings/ @RocketChat/Architecture @RocketChat/backend
/packages/ui-contexts/ @RocketChat/frontend
/packages/eslint-config/ @RocketChat/Architecture
/packages/livechat/ @RocketChat/frontend @RocketChat/Architecture
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// 2. admin, moderator, and user roles should not be deleted as they are referenced in the code.
export const permissions = [
{ _id: 'access-permissions', roles: ['admin'] },
{ _id: 'access-marketplace', roles: ['admin', 'user'] },
{ _id: 'access-setting-permissions', roles: ['admin'] },
{ _id: 'add-oauth-service', roles: ['admin'] },
{ _id: 'add-user-to-joined-room', roles: ['admin', 'owner', 'moderator'] },
Expand Down
12 changes: 7 additions & 5 deletions apps/meteor/app/livechat/client/lib/stream/queueManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { ILivechatDepartment, ILivechatInquiryRecord, IOmnichannelAgent } f

import { LivechatInquiry } from '../../collections/LivechatInquiry';
import { callWithErrorHandling } from '../../../../../client/lib/utils/callWithErrorHandling';
import { queryClient } from '../../../../../client/lib/queryClient';
import { sdk } from '../../../../utils/client/lib/SDKClient';

const departments = new Set();
Expand All @@ -10,12 +11,13 @@ const events = {
added: (inquiry: ILivechatInquiryRecord) => {
departments.has(inquiry.department) && LivechatInquiry.insert({ ...inquiry, alert: true, _updatedAt: new Date(inquiry._updatedAt) });
},
changed: (inquiry: ILivechatInquiryRecord) => {
changed: async (inquiry: ILivechatInquiryRecord) => {
if (inquiry.status !== 'queued' || (inquiry.department && !departments.has(inquiry.department))) {
return LivechatInquiry.remove(inquiry._id);
}

LivechatInquiry.upsert({ _id: inquiry._id }, { ...inquiry, alert: true, _updatedAt: new Date(inquiry._updatedAt) });
await queryClient.invalidateQueries({ queryKey: ['rooms', inquiry.rid], exact: true });
},
removed: (inquiry: ILivechatInquiryRecord) => LivechatInquiry.remove(inquiry._id),
};
Expand All @@ -32,12 +34,12 @@ const removeListenerOfDepartment = (departmentId: ILivechatDepartment['_id']) =>

const appendListenerToDepartment = (departmentId: ILivechatDepartment['_id']) => {
departments.add(departmentId);
sdk.stream('livechat-inquiry-queue-observer', [`department/${departmentId}`], (args) => {
sdk.stream('livechat-inquiry-queue-observer', [`department/${departmentId}`], async (args) => {
if (!('type' in args)) {
return;
}
const { type, ...inquiry } = args;
events[args.type](inquiry);
await events[args.type](inquiry);
});
return () => removeListenerOfDepartment(departmentId);
};
Expand All @@ -57,12 +59,12 @@ const getAgentsDepartments = async (userId: IOmnichannelAgent['_id']) => {
const removeGlobalListener = () => sdk.stop('livechat-inquiry-queue-observer', 'public');

const addGlobalListener = () => {
sdk.stream('livechat-inquiry-queue-observer', ['public'], (args) => {
sdk.stream('livechat-inquiry-queue-observer', ['public'], async (args) => {
if (!('type' in args)) {
return;
}
const { type, ...inquiry } = args;
events[args.type](inquiry);
await events[args.type](inquiry);
});
return removeGlobalListener;
};
Expand Down
3 changes: 2 additions & 1 deletion apps/meteor/app/livechat/server/api/lib/inquiries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ export async function findInquiries({
};

const filter: Filter<ILivechatInquiryRecord> = {
...(status && status in LivechatInquiryStatus && { status }),
// V in Enum only works for numeric enums
...(status && Object.values(LivechatInquiryStatus).includes(status) && { status }),
$or: [
{
$and: [{ defaultAgent: { $exists: true } }, { 'defaultAgent.agentId': userId }],
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/livechat/server/lib/Livechat.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export const Livechat = {
if (guest.name) {
message.alias = guest.name;
}
return Object.assign(sendMessage(guest, message, room), {
return Object.assign(await sendMessage(guest, message, room), {
newRoom,
showConnecting: this.showConnecting(),
});
Expand Down
61 changes: 61 additions & 0 deletions apps/meteor/app/theme/client/imports/components/loading.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
.loading__animation {
display: flex;
align-items: center;
justify-content: center;
}

.loading__animation__bounce {
display: inline-block;

width: 1rem;
height: 1rem;
margin: 2px;

animation: loading-bouncedelay 1.4s infinite ease-in-out both;

-webkit-animation-delay: -0.32s;
animation-delay: -0.32s;

border-radius: 100%;
background-color: var(--loading-bounce-color-light);

@media (prefers-color-scheme: dark) {
background: var(--loading-bounce-color-dark);
}
}

.loading__animation__bounce--medium {
display: inline-block;

width: 1.25rem;
height: 1.25rem;
}

.loading__animation__bounce--large {
display: inline-block;

width: 1.5rem;
height: 1.5rem;
}

.loading__animation__bounce + .loading__animation__bounce {
-webkit-animation-delay: -0.16s;
animation-delay: -0.16s;
}

.loading__animation__bounce + .loading__animation__bounce + .loading__animation__bounce {
-webkit-animation-delay: 0s;
animation-delay: 0s;
}

@keyframes loading-bouncedelay {
0%,
80%,
100% {
transform: scale(0);
}

40% {
transform: scale(1);
}
}
2 changes: 0 additions & 2 deletions apps/meteor/app/theme/client/imports/general/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ body {
height: 100%;
padding: 0;

background-color: var(--rc-color-primary);

font-family: var(--body-font-family);
font-size: var(--text-small-size);
-webkit-font-smoothing: antialiased;
Expand Down
20 changes: 18 additions & 2 deletions apps/meteor/app/theme/client/imports/general/base_old.css
Original file line number Diff line number Diff line change
Expand Up @@ -824,9 +824,25 @@
flex-grow: 1;
}

.full-page,
.page-loading {
background-color: var(--rc-color-primary);
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;

display: flex;

text-align: center;

background-color: var(--page-loading-background-light);

align-items: center;
justify-content: center;

@media (prefers-color-scheme: dark) {
background: var(--page-loading-background-dark);
}
}

.rc-old.full-page {
Expand Down
8 changes: 8 additions & 0 deletions apps/meteor/app/theme/client/imports/general/variables.css
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,14 @@
--tooltip-text-color: var(--color-white);
--tooltip-text-size: 0.75rem;
--tooltip-radius: var(--border-radius);

/*
* Loading
*/
--page-loading-background-light: var(--rcx-color-surface-tint, #f7f8fa);
--page-loading-background-dark: var(--rcx-color-surface-tint, #1f2329);
--loading-bounce-color-light: var(--rcx-color-font-default, #2f343d);
--loading-bounce-color-dark: var(--rcx-color-font-default, #e4e7ea);
}

.rcx-sidebar--main {
Expand Down
1 change: 1 addition & 0 deletions apps/meteor/app/theme/client/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
@import 'imports/components/modal.css';
@import 'imports/components/messages.css';
@import 'imports/components/emoji.css';
@import 'imports/components/loading.css';

/* Legacy theming */
@import 'imports/general/theme_old.css';
10 changes: 5 additions & 5 deletions apps/meteor/app/ui-master/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,11 @@ injectIntoBody(
You need to enable JavaScript to run this app.
</noscript>
<div id="react-root">
<div class="page-loading">
<div class="loading-animation">
<div class="bounce bounce1"></div>
<div class="bounce bounce2"></div>
<div class="bounce bounce3"></div>
<div class="page-loading" role="alert" aria-busy="true" aria-live="polite" aria-label="loading">
<div class="loading__animation">
<div class="loading__animation__bounce"></div>
<div class="loading__animation__bounce"></div>
<div class="loading__animation__bounce"></div>
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/app/ui-message/client/popup/ComposerBoxPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,15 @@ const ComposerBoxPopup = <

return (
<Box className='message-popup-position' position='relative'>
<Tile className='message-popup' padding={0} role='menu' mbe='x8' aria-labelledby={id}>
<Tile className='message-popup' padding={0} role='menu' mbe='x8' overflow='hidden' aria-labelledby={id}>
{title && (
<Box bg='tint' pi='x16' pb='x8' id={id}>
{title}
</Box>
)}
<Box pb='x8' maxHeight='x320'>
{!isLoading && itemsFlat.length === 0 && <Option>{t('No_results_found')}</Option>}
{isLoading && <OptionSkeleton />}
{itemsFlat.map((item, index) => {
return (
<Option
Expand All @@ -81,7 +82,6 @@ const ComposerBoxPopup = <
</Option>
);
})}
{isLoading && <OptionSkeleton />}
</Box>
</Tile>
</Box>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { OptionColumn, OptionContent } from '@rocket.chat/fuselage';
import { OptionColumn, OptionContent, OptionDescription, OptionInput } from '@rocket.chat/fuselage';

export type ComposerBoxPopupSlashCommandProps = {
_id: string;
Expand All @@ -10,10 +10,12 @@ export type ComposerBoxPopupSlashCommandProps = {
const ComposerPopupSlashCommand = ({ _id, description, params }: ComposerBoxPopupSlashCommandProps) => {
return (
<>
<OptionContent>
{_id} <OptionDescription>{params}</OptionDescription>
</OptionContent>
<OptionColumn>
<strong>{_id}</strong> {params}
<OptionInput>{description}</OptionInput>
</OptionColumn>
<OptionContent>{description}</OptionContent>
</>
);
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { useTranslation } from '@rocket.chat/ui-contexts';
import { OptionAvatar, OptionColumn, OptionContent } from '@rocket.chat/fuselage';
import { OptionAvatar, OptionColumn, OptionContent, OptionInput } from '@rocket.chat/fuselage';

import UserAvatar from '../../../../../../client/components/avatar/UserAvatar';
import ReactiveUserStatus from '../../../../../../client/components/UserStatus/ReactiveUserStatus';
Expand Down Expand Up @@ -42,8 +42,16 @@ const ComposerBoxPopupUser = ({ _id, system, username, name, nickname, outside,
</OptionContent>
)}

{outside && <OptionColumn>{t('Not_in_channel')}</OptionColumn>}
{suggestion && <OptionColumn>{t('Suggestion_from_recent_messages')}</OptionColumn>}
{outside && (
<OptionColumn>
<OptionInput>{t('Not_in_channel')}</OptionInput>
</OptionColumn>
)}
{suggestion && (
<OptionColumn>
<OptionInput>{t('Suggestion_from_recent_messages')}</OptionInput>
</OptionColumn>
)}
</>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,7 @@ export const useComposerBoxPopup = <T extends { _id: string; sort?: number }>({
ariaActiveDescendant,
popup,
select,

suspended,

commandsRef,
callbackRef,
};
Expand Down
Loading

0 comments on commit a356d53

Please sign in to comment.