mirror of
https://github.com/RocketChat/Rocket.Chat.git
synced 2025-12-27 22:40:49 +00:00
chore: minor deps (#33795)
This commit is contained in:
parent
9925816155
commit
0b396dcd3e
2
.github/workflows/ci-test-e2e.yml
vendored
2
.github/workflows/ci-test-e2e.yml
vendored
@ -210,7 +210,7 @@ jobs:
|
||||
path: |
|
||||
~/.cache/ms-playwright
|
||||
# This is the version of Playwright that we are using, if you are willing to upgrade, you should update this.
|
||||
key: playwright-1.40.1
|
||||
key: playwright-1.48.2
|
||||
|
||||
- name: Install Playwright
|
||||
if: inputs.type == 'ui' && steps.cache-playwright.outputs.cache-hit != 'true'
|
||||
|
||||
@ -12,3 +12,4 @@
|
||||
!/.storybook/
|
||||
!/client/.eslintrc.js
|
||||
!/ee/client/.eslintrc.js
|
||||
/storybook-static/
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
app/theme/client/vendor/fontello/css/fontello.css
|
||||
app/meteor-autocomplete/client/autocomplete.css
|
||||
app/emoji-emojione/client/*.css
|
||||
storybook-static
|
||||
|
||||
@ -189,10 +189,13 @@ export class APIClass<TBasePath extends string = ''> extends Restivus {
|
||||
}
|
||||
|
||||
public setLimitedCustomFields(customFields: string[]): void {
|
||||
const nonPublicFieds = customFields.reduce((acc, customField) => {
|
||||
acc[`customFields.${customField}`] = 0;
|
||||
return acc;
|
||||
}, {} as Record<string, any>);
|
||||
const nonPublicFieds = customFields.reduce(
|
||||
(acc, customField) => {
|
||||
acc[`customFields.${customField}`] = 0;
|
||||
return acc;
|
||||
},
|
||||
{} as Record<string, any>,
|
||||
);
|
||||
this.limitedUserFieldsToExclude = {
|
||||
...this.defaultLimitedUserFieldsToExclude,
|
||||
...nonPublicFieds,
|
||||
|
||||
@ -22,7 +22,7 @@ export type FailureResult<T, TStack = undefined, TErrorType = undefined, TErrorD
|
||||
errorType?: TErrorType;
|
||||
details?: TErrorDetails;
|
||||
message?: string;
|
||||
} & (undefined extends TErrorType ? object : { errorType: TErrorType }) &
|
||||
} & (undefined extends TErrorType ? object : { errorType: TErrorType }) &
|
||||
(undefined extends TErrorDetails ? object : { details: TErrorDetails extends string ? unknown : TErrorDetails });
|
||||
};
|
||||
|
||||
@ -130,20 +130,20 @@ export type ActionThis<TMethod extends Method, TPathPattern extends PathPattern,
|
||||
? TOptions extends { validateParams: ValidateFunction<infer T> }
|
||||
? T
|
||||
: TOptions extends { validateParams: { GET: ValidateFunction<infer T> } }
|
||||
? T
|
||||
: Partial<OperationParams<TMethod, TPathPattern>> & { offset?: number; count?: number }
|
||||
? T
|
||||
: Partial<OperationParams<TMethod, TPathPattern>> & { offset?: number; count?: number }
|
||||
: Record<string, string>;
|
||||
// TODO make it unsafe
|
||||
readonly bodyParams: TMethod extends 'GET'
|
||||
? Record<string, unknown>
|
||||
: TOptions extends { validateParams: ValidateFunction<infer T> }
|
||||
? T
|
||||
: TOptions extends { validateParams: infer V }
|
||||
? V extends { [key in TMethod]: ValidateFunction<infer T> }
|
||||
? T
|
||||
: Partial<OperationParams<TMethod, TPathPattern>>
|
||||
: // TODO remove the extra (optionals) params when all the endpoints that use these are typed correctly
|
||||
Partial<OperationParams<TMethod, TPathPattern>>;
|
||||
: TOptions extends { validateParams: infer V }
|
||||
? V extends { [key in TMethod]: ValidateFunction<infer T> }
|
||||
? T
|
||||
: Partial<OperationParams<TMethod, TPathPattern>>
|
||||
: // TODO remove the extra (optionals) params when all the endpoints that use these are typed correctly
|
||||
Partial<OperationParams<TMethod, TPathPattern>>;
|
||||
readonly request: Request;
|
||||
|
||||
readonly queryOperations: TOptions extends { queryOperations: infer T } ? T : never;
|
||||
@ -163,18 +163,18 @@ export type ActionThis<TMethod extends Method, TPathPattern extends PathPattern,
|
||||
user: IUser;
|
||||
userId: string;
|
||||
readonly token: string;
|
||||
}
|
||||
}
|
||||
: TOptions extends { authOrAnonRequired: true }
|
||||
? {
|
||||
user?: IUser;
|
||||
userId?: string;
|
||||
readonly token?: string;
|
||||
}
|
||||
: {
|
||||
user?: IUser | null;
|
||||
userId?: string | undefined;
|
||||
readonly token?: string;
|
||||
});
|
||||
? {
|
||||
user?: IUser;
|
||||
userId?: string;
|
||||
readonly token?: string;
|
||||
}
|
||||
: {
|
||||
user?: IUser | null;
|
||||
userId?: string | undefined;
|
||||
readonly token?: string;
|
||||
});
|
||||
|
||||
export type ResultFor<TMethod extends Method, TPathPattern extends PathPattern> =
|
||||
| SuccessResult<OperationResult<TMethod, TPathPattern>>
|
||||
|
||||
@ -35,7 +35,7 @@ API.v1.addRoute(
|
||||
? {
|
||||
update: result,
|
||||
remove: [],
|
||||
}
|
||||
}
|
||||
: result,
|
||||
);
|
||||
},
|
||||
|
||||
@ -155,7 +155,7 @@ API.v1.addRoute(
|
||||
: {
|
||||
twoFactorCode: userData.typedPassword,
|
||||
twoFactorMethod: 'password',
|
||||
};
|
||||
};
|
||||
|
||||
await Meteor.callAsync('saveUserProfile', userData, this.bodyParams.customFields, twoFactorOptions);
|
||||
|
||||
@ -512,7 +512,7 @@ API.v1.addRoute(
|
||||
{
|
||||
$limit: count,
|
||||
},
|
||||
]
|
||||
]
|
||||
: [];
|
||||
|
||||
const result = await Users.col
|
||||
|
||||
@ -67,8 +67,8 @@ export const transformMappedData = async <
|
||||
-readonly [p in keyof MapType]: MapType[p] extends keyof DataType
|
||||
? DataType[MapType[p]]
|
||||
: MapType[p] extends (...args: any[]) => any
|
||||
? Awaited<ReturnType<MapType[p]>>
|
||||
: never;
|
||||
? Awaited<ReturnType<MapType[p]>>
|
||||
: never;
|
||||
},
|
||||
DataType extends Record<string, any>,
|
||||
MapType extends { [p in string]: string | ((data: DataType) => Promise<unknown>) | ((data: DataType) => unknown) },
|
||||
|
||||
@ -34,7 +34,7 @@ export const wrapPromise = <T>(
|
||||
}
|
||||
> =>
|
||||
promise
|
||||
.then((result) => ({ success: true, result } as const))
|
||||
.then((result) => ({ success: true, result }) as const)
|
||||
.catch((error) => ({
|
||||
success: false,
|
||||
error,
|
||||
|
||||
@ -27,7 +27,10 @@ export class CustomOAuth implements IOAuthProvider {
|
||||
|
||||
public responseType: string;
|
||||
|
||||
constructor(public readonly name: string, options: OauthConfig) {
|
||||
constructor(
|
||||
public readonly name: string,
|
||||
options: OauthConfig,
|
||||
) {
|
||||
this.name = name;
|
||||
if (!Match.test(this.name, String)) {
|
||||
throw new Meteor.Error('CustomOAuth: Name is required and must be String');
|
||||
|
||||
@ -57,10 +57,13 @@ export const getFederatedRoomData = async (
|
||||
|
||||
// Find all subscriptions of this room
|
||||
const s = await Subscriptions.findByRoomIdWhenUsernameExists(room._id).toArray();
|
||||
const subscriptions = s.reduce((acc, s) => {
|
||||
acc[s.u._id] = s;
|
||||
return acc;
|
||||
}, {} as { [k: string]: ISubscription });
|
||||
const subscriptions = s.reduce(
|
||||
(acc, s) => {
|
||||
acc[s.u._id] = s;
|
||||
return acc;
|
||||
},
|
||||
{} as { [k: string]: ISubscription },
|
||||
);
|
||||
|
||||
// Get all user ids
|
||||
const userIds = Object.keys(subscriptions);
|
||||
|
||||
@ -384,7 +384,7 @@ export const FileUpload = {
|
||||
? {
|
||||
width,
|
||||
height,
|
||||
}
|
||||
}
|
||||
: undefined,
|
||||
};
|
||||
|
||||
|
||||
@ -545,13 +545,16 @@ export class SlackImporter extends Importer {
|
||||
|
||||
// Process the reactions
|
||||
if (message.reactions && message.reactions.length > 0) {
|
||||
newMessage.reactions = message.reactions.reduce((newReactions, reaction) => {
|
||||
const name = `:${reaction.name}:`;
|
||||
return {
|
||||
...newReactions,
|
||||
...(reaction.users?.length ? { name: { name, users: this._replaceSlackUserIds(reaction.users) } } : {}),
|
||||
};
|
||||
}, {} as Required<IImportMessage>['reactions']);
|
||||
newMessage.reactions = message.reactions.reduce(
|
||||
(newReactions, reaction) => {
|
||||
const name = `:${reaction.name}:`;
|
||||
return {
|
||||
...newReactions,
|
||||
...(reaction.users?.length ? { name: { name, users: this._replaceSlackUserIds(reaction.users) } } : {}),
|
||||
};
|
||||
},
|
||||
{} as Required<IImportMessage>['reactions'],
|
||||
);
|
||||
}
|
||||
|
||||
if (message.type === 'message') {
|
||||
|
||||
@ -376,7 +376,7 @@ export class UserConverter extends RecordConverter<IImportUserRecord, UserConver
|
||||
enabled: true,
|
||||
changedAt: new Date(),
|
||||
},
|
||||
}
|
||||
}
|
||||
: {}),
|
||||
},
|
||||
} as IUser;
|
||||
|
||||
@ -60,7 +60,7 @@ export const updateHistory = async ({
|
||||
...(userData ? { user: omit(userData, 'services') } : {}),
|
||||
...(roomData ? { room: roomData } : {}),
|
||||
},
|
||||
}
|
||||
}
|
||||
: {}),
|
||||
...(triggerWord ? { triggerWord } : {}),
|
||||
...(typeof ranPrepareScript !== 'undefined' ? { ranPrepareScript } : {}),
|
||||
|
||||
@ -181,7 +181,7 @@ Meteor.methods<ServerMethods>({
|
||||
script: integration.script,
|
||||
scriptEnabled: integration.scriptEnabled,
|
||||
scriptEngine,
|
||||
}),
|
||||
}),
|
||||
...(typeof integration.overrideDestinationChannelEnabled !== 'undefined' && {
|
||||
overrideDestinationChannelEnabled: integration.overrideDestinationChannelEnabled,
|
||||
}),
|
||||
|
||||
@ -91,7 +91,7 @@ Meteor.methods<ServerMethods>({
|
||||
scriptEnabled: integration.scriptEnabled,
|
||||
scriptEngine,
|
||||
...(integration.scriptCompiled ? { scriptCompiled: integration.scriptCompiled } : { scriptError: integration.scriptError }),
|
||||
}),
|
||||
}),
|
||||
triggerWords: integration.triggerWords,
|
||||
retryFailedCalls: integration.retryFailedCalls,
|
||||
retryCount: integration.retryCount,
|
||||
@ -107,7 +107,7 @@ Meteor.methods<ServerMethods>({
|
||||
$unset: {
|
||||
...(integration.scriptCompiled ? { scriptError: 1 as const } : { scriptCompiled: 1 as const }),
|
||||
},
|
||||
}),
|
||||
}),
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
@ -67,12 +67,12 @@ export const closeLivechatRoom = async (
|
||||
requestedBy: user,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
: {
|
||||
emailTranscript: {
|
||||
sendToVisitor: false,
|
||||
},
|
||||
}),
|
||||
}),
|
||||
}),
|
||||
};
|
||||
|
||||
|
||||
@ -49,7 +49,7 @@ export async function loadMessageHistory({
|
||||
hiddenMessageTypes,
|
||||
options,
|
||||
showThreadMessages,
|
||||
).toArray()
|
||||
).toArray()
|
||||
: await Messages.findVisibleByRoomIdNotContainingTypes(rid, hiddenMessageTypes, options, showThreadMessages).toArray();
|
||||
const messages = await normalizeMessagesForUser(records, userId);
|
||||
let unreadNotLoaded = 0;
|
||||
|
||||
@ -127,10 +127,13 @@ export class POP3Helper {
|
||||
|
||||
start() {
|
||||
this.log('POP3 started');
|
||||
this.running = setInterval(() => {
|
||||
// get new emails and process
|
||||
this.POP3 = new POP3Intercepter();
|
||||
}, Math.max(this.frequency * 60 * 1000, 2 * 60 * 1000));
|
||||
this.running = setInterval(
|
||||
() => {
|
||||
// get new emails and process
|
||||
this.POP3 = new POP3Intercepter();
|
||||
},
|
||||
Math.max(this.frequency * 60 * 1000, 2 * 60 * 1000),
|
||||
);
|
||||
}
|
||||
|
||||
log(...args) {
|
||||
|
||||
@ -89,7 +89,7 @@ Meteor.methods<ServerMethods>({
|
||||
options,
|
||||
showThreadMessages,
|
||||
inclusive,
|
||||
).toArray()
|
||||
).toArray()
|
||||
: await Messages.findVisibleByRoomIdBetweenTimestampsNotContainingTypes(
|
||||
rid,
|
||||
oldest,
|
||||
@ -98,7 +98,7 @@ Meteor.methods<ServerMethods>({
|
||||
options,
|
||||
showThreadMessages,
|
||||
inclusive,
|
||||
).toArray();
|
||||
).toArray();
|
||||
|
||||
const messages = await normalizeMessagesForUser(records, fromUserId);
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@ export const getSecondsSinceLastAgentResponse = async (room: IOmnichannelRoom, a
|
||||
const department = room.departmentId
|
||||
? await LivechatDepartment.findOneById<Pick<ILivechatDepartment, 'businessHourId'>>(room.departmentId, {
|
||||
projection: { businessHourId: 1 },
|
||||
})
|
||||
})
|
||||
: null;
|
||||
if (department?.businessHourId) {
|
||||
const businessHour = await LivechatBusinessHours.findOneById(department.businessHourId);
|
||||
|
||||
@ -108,7 +108,7 @@ export async function sendTranscript({
|
||||
messageType.data
|
||||
? { ...messageType.data(message), interpolation: { escapeValue: false } }
|
||||
: { interpolation: { escapeValue: false } },
|
||||
)}</i>`
|
||||
)}</i>`
|
||||
: message.msg;
|
||||
|
||||
let filesHTML = '';
|
||||
|
||||
@ -77,7 +77,7 @@ Meteor.startup(async () => {
|
||||
process.env.TEST_MODE === 'true'
|
||||
? {
|
||||
debounce: 10,
|
||||
}
|
||||
}
|
||||
: undefined,
|
||||
);
|
||||
|
||||
|
||||
@ -44,7 +44,7 @@ export const replace = (str: string, data: { [key: string]: unknown } = {}): str
|
||||
? {
|
||||
fname: strLeft(String(data.name), ' '),
|
||||
lname: strRightBack(String(data.name), ' '),
|
||||
}
|
||||
}
|
||||
: {}),
|
||||
...data,
|
||||
};
|
||||
|
||||
@ -484,14 +484,14 @@ class PushClass {
|
||||
apn: {
|
||||
...pick(options.apn, 'category'),
|
||||
},
|
||||
}
|
||||
}
|
||||
: {}),
|
||||
...(this.hasGcmOptions(options)
|
||||
? {
|
||||
gcm: {
|
||||
...pick(options.gcm, 'image', 'style'),
|
||||
},
|
||||
}
|
||||
}
|
||||
: {}),
|
||||
};
|
||||
|
||||
|
||||
@ -987,7 +987,7 @@ export default class SlackAdapter {
|
||||
const rocketChannel = await this.rocket.getChannel(slackMessage);
|
||||
const rocketUser = slackMessage.previous_message.user
|
||||
? (await this.rocket.findUser(slackMessage.previous_message.user)) ||
|
||||
(await this.rocket.addUser(slackMessage.previous_message.user))
|
||||
(await this.rocket.addUser(slackMessage.previous_message.user))
|
||||
: null;
|
||||
|
||||
const rocketMsgObj = {
|
||||
|
||||
@ -41,7 +41,7 @@ slashCommands.add({
|
||||
: await Rooms.findOne({
|
||||
t: 'd',
|
||||
usernames: { $all: [user.username, strippedRoom] },
|
||||
});
|
||||
});
|
||||
if (!roomObject) {
|
||||
void api.broadcast('notify.ephemeralMessage', user._id, message.rid, {
|
||||
msg: i18n.t('Channel_doesnt_exist', {
|
||||
|
||||
@ -326,8 +326,7 @@ export const statistics = {
|
||||
room: IRoom,
|
||||
) {
|
||||
return num + (room.prid ? room.msgs : 0);
|
||||
},
|
||||
0);
|
||||
}, 0);
|
||||
statistics.totalPrivateGroupMessages =
|
||||
(await privateGroups.reduce(function _countPrivateGroupMessages(num: number, room: IRoom) {
|
||||
return num + room.msgs;
|
||||
|
||||
@ -48,13 +48,16 @@ class MessageBoxActions {
|
||||
|
||||
get(group?: TranslationKey) {
|
||||
if (!group) {
|
||||
return [...this.actions.entries()].reduce<Record<TranslationKey, MessageBoxAction[]>>((ret, [group, actions]) => {
|
||||
const filteredActions = actions.filter((action) => !action.condition || action.condition());
|
||||
if (filteredActions.length) {
|
||||
ret[group] = filteredActions;
|
||||
}
|
||||
return ret;
|
||||
}, {} as Record<TranslationKey, MessageBoxAction[]>);
|
||||
return [...this.actions.entries()].reduce<Record<TranslationKey, MessageBoxAction[]>>(
|
||||
(ret, [group, actions]) => {
|
||||
const filteredActions = actions.filter((action) => !action.condition || action.condition());
|
||||
if (filteredActions.length) {
|
||||
ret[group] = filteredActions;
|
||||
}
|
||||
return ret;
|
||||
},
|
||||
{} as Record<TranslationKey, MessageBoxAction[]>,
|
||||
);
|
||||
}
|
||||
|
||||
return this.actions.get(group)?.filter((action) => !action.condition || action.condition());
|
||||
|
||||
@ -24,7 +24,7 @@ type DeepWritable<T> = T extends (...args: any) => any
|
||||
? T
|
||||
: {
|
||||
-readonly [P in keyof T]: DeepWritable<T[P]>;
|
||||
};
|
||||
};
|
||||
|
||||
export class ChatMessages implements ChatAPI {
|
||||
public uid: string | null;
|
||||
|
||||
@ -20,7 +20,7 @@ export const normalizeMessageFileUpload = async (message: Omit<IMessage, '_updat
|
||||
? getURL(`${FileUpload.getPath(`${file._id}/${encodeURI(file.name)}`).substring(1)}${jwt ? `?token=${jwt}` : ''}`, {
|
||||
cdn: false,
|
||||
full: true,
|
||||
})
|
||||
})
|
||||
: '',
|
||||
type: file.type,
|
||||
size: file.size,
|
||||
|
||||
@ -6,6 +6,6 @@ export function getWebdavCredentials(account: WebDAVClientOptions): WebDAVClient
|
||||
: {
|
||||
username: account.username,
|
||||
password: account.password,
|
||||
};
|
||||
};
|
||||
return cred;
|
||||
}
|
||||
|
||||
@ -257,7 +257,11 @@ class WebRTCClass {
|
||||
|
||||
media: MediaStreamConstraints;
|
||||
|
||||
constructor(public selfId: string, public room: string, public autoAccept = false) {
|
||||
constructor(
|
||||
public selfId: string,
|
||||
public room: string,
|
||||
public autoAccept = false,
|
||||
) {
|
||||
this.config = {
|
||||
iceServers: [],
|
||||
};
|
||||
|
||||
@ -79,7 +79,7 @@ export const useStatusItems = (): GenericMenuItemProps[] => {
|
||||
</Box>
|
||||
),
|
||||
},
|
||||
]
|
||||
]
|
||||
: []),
|
||||
...(statuses ?? []),
|
||||
{ id: 'custom-status', icon: 'emoji', content: t('Custom_Status'), onClick: handleCustomStatus, disabled: presenceDisabled },
|
||||
|
||||
@ -63,7 +63,7 @@ const AutoCompleteDepartmentMultiple = ({
|
||||
return;
|
||||
}
|
||||
return loadMoreDepartments(start, Math.min(50, departmentsTotal));
|
||||
}
|
||||
}
|
||||
}
|
||||
renderItem={({ label, ...props }) => (
|
||||
<CheckOption
|
||||
|
||||
@ -3,20 +3,19 @@ import { FeaturePreview, FeaturePreviewOff, FeaturePreviewOn } from '@rocket.cha
|
||||
import type { ComponentProps } from 'react';
|
||||
import React, { forwardRef, memo } from 'react';
|
||||
|
||||
const ContextualbarContent = forwardRef<HTMLElement, ComponentProps<typeof ContextualbarContentComponent>>(function ContextualbarContent(
|
||||
props,
|
||||
ref,
|
||||
) {
|
||||
return (
|
||||
<FeaturePreview feature='newNavigation'>
|
||||
<FeaturePreviewOff>
|
||||
<ContextualbarContentComponent ref={ref} {...props} />
|
||||
</FeaturePreviewOff>
|
||||
<FeaturePreviewOn>
|
||||
<ContextualbarV2Content ref={ref} {...props} />
|
||||
</FeaturePreviewOn>
|
||||
</FeaturePreview>
|
||||
);
|
||||
});
|
||||
const ContextualbarContent = forwardRef<HTMLElement, ComponentProps<typeof ContextualbarContentComponent>>(
|
||||
function ContextualbarContent(props, ref) {
|
||||
return (
|
||||
<FeaturePreview feature='newNavigation'>
|
||||
<FeaturePreviewOff>
|
||||
<ContextualbarContentComponent ref={ref} {...props} />
|
||||
</FeaturePreviewOff>
|
||||
<FeaturePreviewOn>
|
||||
<ContextualbarV2Content ref={ref} {...props} />
|
||||
</FeaturePreviewOn>
|
||||
</FeaturePreview>
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
export default memo(ContextualbarContent);
|
||||
|
||||
@ -3,20 +3,19 @@ import { FeaturePreview, FeaturePreviewOff, FeaturePreviewOn } from '@rocket.cha
|
||||
import type { ComponentProps } from 'react';
|
||||
import React, { forwardRef, memo } from 'react';
|
||||
|
||||
const ContextualbarFooter = forwardRef<HTMLElement, ComponentProps<typeof ContextualbarFooterComponent>>(function ContextualbarFooter(
|
||||
props,
|
||||
ref,
|
||||
) {
|
||||
return (
|
||||
<FeaturePreview feature='newNavigation'>
|
||||
<FeaturePreviewOff>
|
||||
<ContextualbarFooterComponent ref={ref} {...props} />
|
||||
</FeaturePreviewOff>
|
||||
<FeaturePreviewOn>
|
||||
<ContextualbarV2Footer ref={ref} {...props} />
|
||||
</FeaturePreviewOn>
|
||||
</FeaturePreview>
|
||||
);
|
||||
});
|
||||
const ContextualbarFooter = forwardRef<HTMLElement, ComponentProps<typeof ContextualbarFooterComponent>>(
|
||||
function ContextualbarFooter(props, ref) {
|
||||
return (
|
||||
<FeaturePreview feature='newNavigation'>
|
||||
<FeaturePreviewOff>
|
||||
<ContextualbarFooterComponent ref={ref} {...props} />
|
||||
</FeaturePreviewOff>
|
||||
<FeaturePreviewOn>
|
||||
<ContextualbarV2Footer ref={ref} {...props} />
|
||||
</FeaturePreviewOn>
|
||||
</FeaturePreview>
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
export default memo(ContextualbarFooter);
|
||||
|
||||
@ -3,20 +3,19 @@ import { FeaturePreview, FeaturePreviewOff, FeaturePreviewOn } from '@rocket.cha
|
||||
import type { ComponentProps } from 'react';
|
||||
import React, { forwardRef, memo } from 'react';
|
||||
|
||||
const ContextualbarSection = forwardRef<HTMLElement, ComponentProps<typeof ContextualbarSectionComponent>>(function ContextualbarSection(
|
||||
props,
|
||||
ref,
|
||||
) {
|
||||
return (
|
||||
<FeaturePreview feature='newNavigation'>
|
||||
<FeaturePreviewOff>
|
||||
<ContextualbarSectionComponent ref={ref} {...props} />
|
||||
</FeaturePreviewOff>
|
||||
<FeaturePreviewOn>
|
||||
<ContextualbarV2Section ref={ref} {...props} />
|
||||
</FeaturePreviewOn>
|
||||
</FeaturePreview>
|
||||
);
|
||||
});
|
||||
const ContextualbarSection = forwardRef<HTMLElement, ComponentProps<typeof ContextualbarSectionComponent>>(
|
||||
function ContextualbarSection(props, ref) {
|
||||
return (
|
||||
<FeaturePreview feature='newNavigation'>
|
||||
<FeaturePreviewOff>
|
||||
<ContextualbarSectionComponent ref={ref} {...props} />
|
||||
</FeaturePreviewOff>
|
||||
<FeaturePreviewOn>
|
||||
<ContextualbarV2Section ref={ref} {...props} />
|
||||
</FeaturePreviewOn>
|
||||
</FeaturePreview>
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
export default memo(ContextualbarSection);
|
||||
|
||||
@ -8,20 +8,19 @@ import {
|
||||
import type { ComponentProps } from 'react';
|
||||
import React, { forwardRef, memo } from 'react';
|
||||
|
||||
const HeaderToolbarAction = forwardRef<HTMLButtonElement, ComponentProps<typeof HeaderToolbarActionComponent>>(function HeaderToolbarAction(
|
||||
props,
|
||||
ref,
|
||||
) {
|
||||
return (
|
||||
<FeaturePreview feature='newNavigation'>
|
||||
<FeaturePreviewOff>
|
||||
<HeaderToolbarActionComponent ref={ref} {...props} />
|
||||
</FeaturePreviewOff>
|
||||
<FeaturePreviewOn>
|
||||
<HeaderV2ToolbarAction ref={ref} {...props} />
|
||||
</FeaturePreviewOn>
|
||||
</FeaturePreview>
|
||||
);
|
||||
});
|
||||
const HeaderToolbarAction = forwardRef<HTMLButtonElement, ComponentProps<typeof HeaderToolbarActionComponent>>(
|
||||
function HeaderToolbarAction(props, ref) {
|
||||
return (
|
||||
<FeaturePreview feature='newNavigation'>
|
||||
<FeaturePreviewOff>
|
||||
<HeaderToolbarActionComponent ref={ref} {...props} />
|
||||
</FeaturePreviewOff>
|
||||
<FeaturePreviewOn>
|
||||
<HeaderV2ToolbarAction ref={ref} {...props} />
|
||||
</FeaturePreviewOn>
|
||||
</FeaturePreview>
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
export default memo(HeaderToolbarAction);
|
||||
|
||||
@ -27,7 +27,7 @@ const PageHeader = ({ children = undefined, title, onClickBack, borderBlockEndCo
|
||||
is='header'
|
||||
borderBlockEndWidth='default'
|
||||
pb={8}
|
||||
borderBlockEndColor={borderBlockEndColor ?? border ? 'extra-light' : 'transparent'}
|
||||
borderBlockEndColor={(borderBlockEndColor ?? border) ? 'extra-light' : 'transparent'}
|
||||
{...props}
|
||||
>
|
||||
<Box
|
||||
|
||||
@ -51,7 +51,7 @@ const RoomAutoComplete = ({ value, onChange, scope = 'regular', renderRoomIcon,
|
||||
? result.data.items.map(({ name, fname, _id, avatarETag, t, encrypted }) => ({
|
||||
value: _id,
|
||||
label: { name: fname || name, avatarETag, type: t, encrypted },
|
||||
}))
|
||||
}))
|
||||
: [],
|
||||
[result.data?.items, result.isSuccess],
|
||||
);
|
||||
|
||||
@ -31,7 +31,7 @@ const RoomAutoCompleteMultiple = ({ value, onChange, ...props }: RoomAutoComplet
|
||||
? result.data.items.map(({ fname, name, _id, avatarETag, t }) => ({
|
||||
value: _id,
|
||||
label: { name: fname || name, avatarETag, type: t },
|
||||
}))
|
||||
}))
|
||||
: [],
|
||||
[result.data?.items, result.isSuccess],
|
||||
);
|
||||
|
||||
@ -14,8 +14,9 @@ export default {
|
||||
},
|
||||
} satisfies Meta<typeof ConnectionStatusBar>;
|
||||
|
||||
const stateDecorator = (value: ContextType<typeof ConnectionStatusContext>) => (fn: () => ReactElement) =>
|
||||
<ConnectionStatusContext.Provider value={value}>{fn()}</ConnectionStatusContext.Provider>;
|
||||
const stateDecorator = (value: ContextType<typeof ConnectionStatusContext>) => (fn: () => ReactElement) => (
|
||||
<ConnectionStatusContext.Provider value={value}>{fn()}</ConnectionStatusContext.Provider>
|
||||
);
|
||||
|
||||
const Template: StoryFn<typeof ConnectionStatusBar> = () => <ConnectionStatusBar />;
|
||||
|
||||
|
||||
@ -42,7 +42,7 @@ const StatusIndicators = ({ message }: StatusIndicatorsProps): ReactElement => {
|
||||
: t('Message_has_been_edited_by_at', {
|
||||
username: message.editedBy.username || '?',
|
||||
date: formatter(message.editedAt),
|
||||
})
|
||||
})
|
||||
}
|
||||
/>
|
||||
)}
|
||||
|
||||
@ -10,13 +10,7 @@ type AttachmentsProps = {
|
||||
};
|
||||
|
||||
const Attachments = ({ attachments, id }: AttachmentsProps): ReactElement => {
|
||||
return (
|
||||
<>
|
||||
{attachments?.map((attachment, index) => (
|
||||
<AttachmentsItem key={index} id={id} attachment={{ ...attachment }} />
|
||||
))}
|
||||
</>
|
||||
);
|
||||
return <>{attachments?.map((attachment, index) => <AttachmentsItem key={index} id={id} attachment={{ ...attachment }} />)}</>;
|
||||
};
|
||||
|
||||
export default Attachments;
|
||||
|
||||
@ -11,12 +11,11 @@ export type MessageListContextValue = {
|
||||
showRoles: boolean;
|
||||
showRealName: boolean;
|
||||
showUsername: boolean;
|
||||
highlights?:
|
||||
| {
|
||||
highlight: string;
|
||||
regex: RegExp;
|
||||
urlRegex: RegExp;
|
||||
}[];
|
||||
highlights?: {
|
||||
highlight: string;
|
||||
regex: RegExp;
|
||||
urlRegex: RegExp;
|
||||
}[];
|
||||
katex?: {
|
||||
dollarSyntaxEnabled: boolean;
|
||||
parenthesisSyntaxEnabled: boolean;
|
||||
|
||||
@ -38,18 +38,21 @@ const MessageActionMenu = ({ options, onChangeMenuVisibility, context, isMessage
|
||||
...(option.disabled &&
|
||||
option?.disabled?.(context) && { tooltip: t('Action_not_available_encrypted_content', { action: t(option.label) }) }),
|
||||
}))
|
||||
.reduce((acc, option) => {
|
||||
const group = option.type ? option.type : '';
|
||||
const section = acc.find((section: { id: string }) => section.id === group);
|
||||
if (section) {
|
||||
section.items.push(option);
|
||||
return acc;
|
||||
}
|
||||
const newSection = { id: group, title: group === 'apps' ? t('Apps') : '', items: [option] };
|
||||
acc.push(newSection);
|
||||
.reduce(
|
||||
(acc, option) => {
|
||||
const group = option.type ? option.type : '';
|
||||
const section = acc.find((section: { id: string }) => section.id === group);
|
||||
if (section) {
|
||||
section.items.push(option);
|
||||
return acc;
|
||||
}
|
||||
const newSection = { id: group, title: group === 'apps' ? t('Apps') : '', items: [option] };
|
||||
acc.push(newSection);
|
||||
|
||||
return acc;
|
||||
}, [] as unknown as MessageActionSection[])
|
||||
return acc;
|
||||
},
|
||||
[] as unknown as MessageActionSection[],
|
||||
)
|
||||
.map((section) => {
|
||||
if (section.id !== 'apps') {
|
||||
return section;
|
||||
|
||||
@ -6,10 +6,10 @@ import { useMutation } from '@tanstack/react-query';
|
||||
type UseEndpointActionOptions<TPathPattern extends PathPattern> = (undefined extends UrlParams<TPathPattern>
|
||||
? {
|
||||
keys?: UrlParams<TPathPattern>;
|
||||
}
|
||||
}
|
||||
: {
|
||||
keys: UrlParams<TPathPattern>;
|
||||
}) & {
|
||||
}) & {
|
||||
successMessage?: string;
|
||||
};
|
||||
export function useEndpointAction<TMethod extends Method, TPathPattern extends PathPattern>(
|
||||
|
||||
@ -17,10 +17,13 @@ const handleFeaturePreviewEnableQuery = (item: FeaturePreviewProps, _: any, feat
|
||||
|
||||
const groupFeaturePreview = (features: FeaturePreviewProps[]) =>
|
||||
Object.entries(
|
||||
features.reduce((result, currentValue) => {
|
||||
(result[currentValue.group] = result[currentValue.group] || []).push(currentValue);
|
||||
return result;
|
||||
}, {} as Record<FeaturePreviewProps['group'], FeaturePreviewProps[]>),
|
||||
features.reduce(
|
||||
(result, currentValue) => {
|
||||
(result[currentValue.group] = result[currentValue.group] || []).push(currentValue);
|
||||
return result;
|
||||
},
|
||||
{} as Record<FeaturePreviewProps['group'], FeaturePreviewProps[]>,
|
||||
),
|
||||
);
|
||||
|
||||
export const useFeaturePreviewEnableQuery = (features: FeaturePreviewProps[]) => {
|
||||
|
||||
@ -25,10 +25,10 @@ export const useLicenseLimitsByBehavior = () => {
|
||||
.map((key) => {
|
||||
const rule = license.limits[key]
|
||||
?.filter((limit) => validateWarnLimit(limit.max, limits[key].value ?? 0, limit.behavior))
|
||||
.reduce<{ max: number; behavior: LicenseBehavior } | null>(
|
||||
(maxLimit, currentLimit) => (!maxLimit || currentLimit.max > maxLimit.max ? currentLimit : maxLimit),
|
||||
null,
|
||||
);
|
||||
.reduce<{
|
||||
max: number;
|
||||
behavior: LicenseBehavior;
|
||||
} | null>((maxLimit, currentLimit) => (!maxLimit || currentLimit.max > maxLimit.max ? currentLimit : maxLimit), null);
|
||||
|
||||
if (!rule) {
|
||||
return undefined;
|
||||
|
||||
@ -49,7 +49,7 @@ export const parseMessageTextToAstMarkdown = <
|
||||
md:
|
||||
isE2EEMessage(message) || isOTRMessage(message) || isOTRAckMessage(message) || translated
|
||||
? textToMessageToken(text, parseOptions)
|
||||
: msg.md ?? textToMessageToken(text, parseOptions),
|
||||
: (msg.md ?? textToMessageToken(text, parseOptions)),
|
||||
...(msg.attachments && {
|
||||
attachments: parseMessageAttachments(msg.attachments, parseOptions, { autoTranslateLanguage, translated }),
|
||||
}),
|
||||
@ -79,12 +79,12 @@ export const parseMessageAttachment = <T extends MessageAttachment>(
|
||||
if (isFileAttachment(attachment) && attachment.description) {
|
||||
attachment.descriptionMd = translated
|
||||
? textToMessageToken(text, parseOptions)
|
||||
: attachment.descriptionMd ?? textToMessageToken(text, parseOptions);
|
||||
: (attachment.descriptionMd ?? textToMessageToken(text, parseOptions));
|
||||
}
|
||||
|
||||
return {
|
||||
...attachment,
|
||||
md: translated ? textToMessageToken(text, parseOptions) : attachment.md ?? textToMessageToken(text, parseOptions),
|
||||
md: translated ? textToMessageToken(text, parseOptions) : (attachment.md ?? textToMessageToken(text, parseOptions)),
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@ -111,7 +111,7 @@ export const synchronizeUserData = async (uid: IUser['_id']): Promise<RawUserDat
|
||||
})),
|
||||
}),
|
||||
},
|
||||
}
|
||||
}
|
||||
: {}),
|
||||
...(cloud
|
||||
? {
|
||||
@ -119,7 +119,7 @@ export const synchronizeUserData = async (uid: IUser['_id']): Promise<RawUserDat
|
||||
...cloud,
|
||||
expiresAt: new Date(cloud.expiresAt),
|
||||
},
|
||||
}
|
||||
}
|
||||
: {}),
|
||||
...(emailCode ? { ...emailCode, expire: new Date(emailCode.expire) } : {}),
|
||||
...(email2fa ? { email2fa: { ...email2fa, changedAt: new Date(email2fa.changedAt) } } : {}),
|
||||
|
||||
@ -43,7 +43,7 @@ const createGetEmojiClassNameAndDataTitle =
|
||||
? emojiElement.style.backgroundImage
|
||||
: (Object.fromEntries((emojiElement.getAttribute('style') || '')?.split(';').map((s) => s.split(':'))) as Record<string, string>)[
|
||||
'background-image'
|
||||
];
|
||||
];
|
||||
|
||||
return {
|
||||
'className': emojiElement.getAttribute('class') || '',
|
||||
|
||||
@ -91,7 +91,10 @@ export class VoIPUser extends Emitter<VoipEvents> {
|
||||
return this._userState;
|
||||
}
|
||||
|
||||
constructor(private readonly config: VoIPUserConfiguration, mediaRenderer?: IMediaStreamRenderer) {
|
||||
constructor(
|
||||
private readonly config: VoIPUserConfiguration,
|
||||
mediaRenderer?: IMediaStreamRenderer,
|
||||
) {
|
||||
super();
|
||||
this.mediaStreamRendered = mediaRenderer;
|
||||
this.networkEmitter = new Emitter<SignalingSocketEvents>();
|
||||
|
||||
@ -12,13 +12,12 @@ declare module 'meteor/meteor' {
|
||||
// eslint-disable-next-line @typescript-eslint/no-namespace
|
||||
namespace Meteor {
|
||||
function loginWithGoogle(
|
||||
options?:
|
||||
| Meteor.LoginWithExternalServiceOptions & {
|
||||
loginUrlParameters?: {
|
||||
include_granted_scopes?: boolean;
|
||||
hd?: string;
|
||||
};
|
||||
},
|
||||
options?: Meteor.LoginWithExternalServiceOptions & {
|
||||
loginUrlParameters?: {
|
||||
include_granted_scopes?: boolean;
|
||||
hd?: string;
|
||||
};
|
||||
},
|
||||
callback?: LoginCallback,
|
||||
): void;
|
||||
}
|
||||
|
||||
@ -63,7 +63,7 @@ export const DepartmentForwarding = ({ departmentId, value = [], handler, label
|
||||
return;
|
||||
}
|
||||
loadMoreDepartments(start, Math.min(50, departmentsTotal));
|
||||
}
|
||||
}
|
||||
}
|
||||
renderItem={({ label, ...props }) => (
|
||||
<CheckOption
|
||||
|
||||
@ -66,9 +66,7 @@ const BusinessHoursTable = () => {
|
||||
<GenericTable>
|
||||
<GenericTableHeader>{headers}</GenericTableHeader>
|
||||
<GenericTableBody>
|
||||
{data?.businessHours.map((businessHour) => (
|
||||
<BusinessHoursRow key={businessHour._id} {...businessHour} />
|
||||
))}
|
||||
{data?.businessHours.map((businessHour) => <BusinessHoursRow key={businessHour._id} {...businessHour} />)}
|
||||
</GenericTableBody>
|
||||
</GenericTable>
|
||||
<Pagination
|
||||
|
||||
@ -37,10 +37,13 @@ const AuthorizationProvider = ({ children }: AuthorizationProviderProps) => {
|
||||
() =>
|
||||
Roles.find()
|
||||
.fetch()
|
||||
.reduce((ret, obj) => {
|
||||
ret[obj._id] = obj;
|
||||
return ret;
|
||||
}, {} as Record<string, IRole>),
|
||||
.reduce(
|
||||
(ret, obj) => {
|
||||
ret[obj._id] = obj;
|
||||
return ret;
|
||||
},
|
||||
{} as Record<string, IRole>,
|
||||
),
|
||||
[],
|
||||
),
|
||||
);
|
||||
|
||||
@ -57,7 +57,7 @@ const EmojiPickerProvider = ({ children }: { children: ReactNode }): ReactElemen
|
||||
list: createEmojiList(category.key, null, recentEmojis, setRecentEmojis),
|
||||
limit: category.key === CUSTOM_CATEGORY ? limit | customItemsLimit : null,
|
||||
},
|
||||
}
|
||||
}
|
||||
: category,
|
||||
),
|
||||
);
|
||||
|
||||
@ -191,7 +191,7 @@ const OmnichannelProvider = ({ children }: OmnichannelProviderProps) => {
|
||||
? {
|
||||
enabled: true,
|
||||
queue,
|
||||
}
|
||||
}
|
||||
: { enabled: false },
|
||||
showOmnichannelQueueLink: showOmnichannelQueueLink && !!agentAvailable,
|
||||
livechatPriorities,
|
||||
|
||||
@ -74,7 +74,7 @@ const SettingsProvider = ({ children, privileged = false }: SettingsProviderProp
|
||||
? { section: query.section }
|
||||
: {
|
||||
$or: [{ section: { $exists: false } }, { section: undefined }],
|
||||
})),
|
||||
})),
|
||||
},
|
||||
{
|
||||
sort: {
|
||||
|
||||
@ -126,7 +126,9 @@ const useAutoLanguage = () => {
|
||||
const defaultUserLanguage = browserLanguage || serverLanguage || 'en';
|
||||
|
||||
// if the language is supported, if not remove the region
|
||||
const suggestedLanguage = languages.includes(defaultUserLanguage) ? defaultUserLanguage : defaultUserLanguage.split('-').shift() ?? 'en';
|
||||
const suggestedLanguage = languages.includes(defaultUserLanguage)
|
||||
? defaultUserLanguage
|
||||
: (defaultUserLanguage.split('-').shift() ?? 'en');
|
||||
|
||||
// usually that value is set based on the user's config language
|
||||
const [language] = useLocalStorage('userLanguage', suggestedLanguage);
|
||||
|
||||
@ -215,7 +215,7 @@ const RoomMenu = ({
|
||||
label: { label: t('Hide'), icon: 'eye-off' },
|
||||
action: handleHide,
|
||||
},
|
||||
}),
|
||||
}),
|
||||
toggleRead: {
|
||||
label: { label: isUnread ? t('Mark_read') : t('Mark_unread'), icon: 'flag' },
|
||||
action: handleToggleRead,
|
||||
@ -229,7 +229,7 @@ const RoomMenu = ({
|
||||
},
|
||||
action: handleToggleFavorite,
|
||||
},
|
||||
}
|
||||
}
|
||||
: {}),
|
||||
...(canLeave && {
|
||||
leaveRoom: {
|
||||
|
||||
@ -56,7 +56,7 @@ export const VoipFooter = ({
|
||||
callerState === 'IN_CALL' || callerState === 'ON_HOLD'
|
||||
? css`
|
||||
cursor: pointer;
|
||||
`
|
||||
`
|
||||
: '';
|
||||
|
||||
const handleHold = (e: MouseEvent<HTMLButtonElement>): void => {
|
||||
|
||||
@ -79,7 +79,7 @@ export const useStatusItems = (): GenericMenuItemProps[] => {
|
||||
</Box>
|
||||
),
|
||||
},
|
||||
]
|
||||
]
|
||||
: []),
|
||||
...(statuses ?? []),
|
||||
{ id: 'custom-status', icon: 'emoji', content: t('Custom_Status'), onClick: handleCustomStatus, disabled: presenceDisabled },
|
||||
|
||||
@ -225,7 +225,7 @@ const RoomMenu = ({
|
||||
},
|
||||
action: handleToggleFavorite,
|
||||
},
|
||||
}
|
||||
}
|
||||
: {}),
|
||||
...(canLeave && {
|
||||
leaveRoom: {
|
||||
|
||||
@ -56,7 +56,7 @@ const VoipFooter = ({
|
||||
callerState === 'IN_CALL' || callerState === 'ON_HOLD'
|
||||
? css`
|
||||
cursor: pointer;
|
||||
`
|
||||
`
|
||||
: '';
|
||||
|
||||
const handleHold = (e: MouseEvent<HTMLButtonElement>): void => {
|
||||
|
||||
@ -19,10 +19,13 @@ const commands = {
|
||||
}
|
||||
const newUrl = new URL(`${rtrim(baseURI, '/')}/${ltrim(data.path, '/')}`);
|
||||
|
||||
const newParams = Array.from(newUrl.searchParams.entries()).reduce((ret, [key, value]) => {
|
||||
ret[key] = value;
|
||||
return ret;
|
||||
}, {} as Record<string, string>);
|
||||
const newParams = Array.from(newUrl.searchParams.entries()).reduce(
|
||||
(ret, [key, value]) => {
|
||||
ret[key] = value;
|
||||
return ret;
|
||||
},
|
||||
{} as Record<string, string>,
|
||||
);
|
||||
|
||||
const newPath = newUrl.pathname.replace(
|
||||
new RegExp(`^${escapeRegExp(__meteor_runtime_config__.ROOT_URL_PATH_PREFIX)}`),
|
||||
|
||||
@ -23,7 +23,7 @@ const ModalContextMock = ({ children }: ModalContextMockProps): ReactElement =>
|
||||
},
|
||||
},
|
||||
currentModal: context.currentModal,
|
||||
}
|
||||
}
|
||||
: undefined,
|
||||
[context],
|
||||
);
|
||||
|
||||
@ -45,7 +45,7 @@ type Operations = {
|
||||
fn: (
|
||||
params: void extends OperationParams<TMethod, TPathPattern> ? void : OperationParams<TMethod, TPathPattern>,
|
||||
) => Promise<void extends OperationResult<TMethod, TPathPattern> ? Serialized<OperationResult<TMethod, TPathPattern>> : void>;
|
||||
}
|
||||
}
|
||||
: never
|
||||
: never
|
||||
: never
|
||||
|
||||
@ -35,7 +35,7 @@ const PreferencesMyDataSection = () => {
|
||||
const text = result.url
|
||||
? t('UserDataDownload_CompletedRequestExistedWithLink_Text', {
|
||||
download_link: result.url,
|
||||
})
|
||||
})
|
||||
: t('UserDataDownload_CompletedRequestExisted_Text');
|
||||
|
||||
setModal(
|
||||
|
||||
@ -92,9 +92,7 @@ const CustomUserStatus = ({ reload, onClick }: CustomUserStatusProps): ReactElem
|
||||
</GenericTableHeader>
|
||||
<GenericTableBody>
|
||||
{isLoading && <GenericTableLoadingTable headerCells={2} />}
|
||||
{data?.map((status) => (
|
||||
<CustomUserStatusRow key={status._id} status={status} onClick={onClick} />
|
||||
))}
|
||||
{data?.map((status) => <CustomUserStatusRow key={status._id} status={status} onClick={onClick} />)}
|
||||
</GenericTableBody>
|
||||
</GenericTable>
|
||||
{isFetched && (
|
||||
|
||||
@ -32,7 +32,7 @@ export const useChannelsList = ({ period, offset, count }: UseChannelsListOption
|
||||
...response,
|
||||
start,
|
||||
end,
|
||||
}
|
||||
}
|
||||
: undefined;
|
||||
},
|
||||
{
|
||||
|
||||
@ -25,7 +25,7 @@ export const useMessageOrigins = ({ period }: UseMessageOriginsOptions) => {
|
||||
...response,
|
||||
start,
|
||||
end,
|
||||
}
|
||||
}
|
||||
: undefined;
|
||||
},
|
||||
{
|
||||
|
||||
@ -25,7 +25,7 @@ export const useMessagesSent = ({ period }: UseMessagesSentOptions) => {
|
||||
...response,
|
||||
start,
|
||||
end,
|
||||
}
|
||||
}
|
||||
: undefined;
|
||||
},
|
||||
{
|
||||
|
||||
@ -25,7 +25,7 @@ export const useTopFivePopularChannels = ({ period }: UseTopFivePopularChannelsO
|
||||
...response,
|
||||
start,
|
||||
end,
|
||||
}
|
||||
}
|
||||
: undefined;
|
||||
},
|
||||
{
|
||||
|
||||
@ -24,7 +24,7 @@ export const useActiveUsers = ({ utc }: UseActiveUsersOptions) => {
|
||||
...response,
|
||||
start,
|
||||
end,
|
||||
}
|
||||
}
|
||||
: undefined;
|
||||
},
|
||||
{
|
||||
|
||||
@ -24,7 +24,7 @@ export const useHourlyChatActivity = ({ displacement, utc }: UseHourlyChatActivi
|
||||
? {
|
||||
...response,
|
||||
day,
|
||||
}
|
||||
}
|
||||
: undefined;
|
||||
},
|
||||
{
|
||||
|
||||
@ -22,7 +22,7 @@ export const useNewUsers = ({ period, utc }: { period: Period['key']; utc: boole
|
||||
...response,
|
||||
start,
|
||||
end,
|
||||
}
|
||||
}
|
||||
: undefined;
|
||||
},
|
||||
{
|
||||
|
||||
@ -25,7 +25,7 @@ export const useUsersByTimeOfTheDay = ({ period, utc }: UseUsersByTimeOfTheDayOp
|
||||
...response,
|
||||
start,
|
||||
end,
|
||||
}
|
||||
}
|
||||
: undefined;
|
||||
},
|
||||
{
|
||||
|
||||
@ -24,7 +24,7 @@ export const useWeeklyChatActivity = ({ displacement, utc }: UseWeeklyChatActivi
|
||||
? {
|
||||
...response,
|
||||
day,
|
||||
}
|
||||
}
|
||||
: undefined;
|
||||
},
|
||||
{
|
||||
|
||||
@ -180,9 +180,7 @@ function ImportHistoryPage() {
|
||||
{latestOperations.data
|
||||
.filter(({ _id }) => !currentOperation.data.valid || currentOperation.data._id !== _id)
|
||||
// Forcing valid=false as the current API only accept preparation/progress over currentOperation
|
||||
?.map((operation) => (
|
||||
<ImportOperationSummary key={operation._id} {...operation} valid={false} small={small} />
|
||||
))}
|
||||
?.map((operation) => <ImportOperationSummary key={operation._id} {...operation} valid={false} small={small} />)}
|
||||
</>
|
||||
)}
|
||||
</TableBody>
|
||||
|
||||
@ -90,7 +90,7 @@ function ImportOperationSummary({
|
||||
role: 'link',
|
||||
action: true,
|
||||
onClick: handleClick,
|
||||
}
|
||||
}
|
||||
: {};
|
||||
|
||||
return (
|
||||
|
||||
@ -102,9 +102,7 @@ const UsersInRoleTable = ({ rid, roleId, roleName, description }: UsersInRoleTab
|
||||
<GenericTable>
|
||||
<GenericTableHeader>{headers}</GenericTableHeader>
|
||||
<GenericTableBody>
|
||||
{users?.map((user) => (
|
||||
<UsersInRoleTableRow onRemove={handleRemove} key={user?._id} user={user} />
|
||||
))}
|
||||
{users?.map((user) => <UsersInRoleTableRow onRemove={handleRemove} key={user?._id} user={user} />)}
|
||||
</GenericTableBody>
|
||||
</GenericTable>
|
||||
<Pagination
|
||||
|
||||
@ -134,11 +134,7 @@ const RoomsTable = ({ reload }: { reload: MutableRefObject<() => void> }): React
|
||||
<>
|
||||
<GenericTable>
|
||||
<GenericTableHeader>{headers}</GenericTableHeader>
|
||||
<GenericTableBody>
|
||||
{data.rooms?.map((room) => (
|
||||
<RoomRow key={room._id} room={room} />
|
||||
))}
|
||||
</GenericTableBody>
|
||||
<GenericTableBody>{data.rooms?.map((room) => <RoomRow key={room._id} room={room} />)}</GenericTableBody>
|
||||
</GenericTable>
|
||||
<Pagination
|
||||
divider
|
||||
|
||||
@ -86,7 +86,7 @@ const EditableSettingsProvider = ({ children, query = defaultQuery }: EditableSe
|
||||
? { section: query.section }
|
||||
: {
|
||||
$or: [{ section: { $exists: false } }, { section: '' }],
|
||||
})),
|
||||
})),
|
||||
},
|
||||
{
|
||||
...('tab' in query &&
|
||||
@ -94,7 +94,7 @@ const EditableSettingsProvider = ({ children, query = defaultQuery }: EditableSe
|
||||
? { tab: query.tab }
|
||||
: {
|
||||
$or: [{ tab: { $exists: false } }, { tab: '' }],
|
||||
})),
|
||||
})),
|
||||
},
|
||||
],
|
||||
},
|
||||
@ -124,7 +124,7 @@ const EditableSettingsProvider = ({ children, query = defaultQuery }: EditableSe
|
||||
? { tab }
|
||||
: {
|
||||
$or: [{ tab: { $exists: false } }, { tab: '' }],
|
||||
}),
|
||||
}),
|
||||
},
|
||||
{
|
||||
fields: {
|
||||
|
||||
@ -52,7 +52,7 @@ const UsersTableFilters = ({ roleData, setUsersFilters }: UsersTableFiltersProps
|
||||
id: role._id,
|
||||
text: role.description || role.name || role._id,
|
||||
checked: false,
|
||||
}))
|
||||
}))
|
||||
: []),
|
||||
],
|
||||
[roleData],
|
||||
|
||||
@ -26,6 +26,6 @@ export const useChangeAdminStatusAction = (userId: IUser['_id'], isAdmin: boolea
|
||||
icon: 'key',
|
||||
label: isAdmin ? t('Remove_Admin') : t('Make_Admin'),
|
||||
action: changeAdminStatus,
|
||||
}
|
||||
}
|
||||
: undefined;
|
||||
};
|
||||
|
||||
@ -48,6 +48,6 @@ export const useChangeUserStatusAction = (userId: IUser['_id'], isActive: boolea
|
||||
icon: 'user',
|
||||
label: isActive ? t('Deactivate') : t('Activate'),
|
||||
action: changeActiveStatus,
|
||||
}
|
||||
}
|
||||
: undefined;
|
||||
};
|
||||
|
||||
@ -69,6 +69,6 @@ export const useDeleteUserAction = (userId: IUser['_id'], onChange: () => void,
|
||||
icon: 'trash',
|
||||
label: t('Delete'),
|
||||
action: confirmDeleteUser,
|
||||
}
|
||||
}
|
||||
: undefined;
|
||||
};
|
||||
|
||||
@ -36,6 +36,6 @@ export const useResetE2EEKeyAction = (userId: IUser['_id']): Action | undefined
|
||||
icon: 'key',
|
||||
label: t('Reset_E2E_Key'),
|
||||
action: confirmResetE2EEKey,
|
||||
}
|
||||
}
|
||||
: undefined;
|
||||
};
|
||||
|
||||
@ -37,6 +37,6 @@ export const useResetTOTPAction = (userId: IUser['_id']): Action | undefined =>
|
||||
icon: 'key',
|
||||
label: t('Reset_TOTP'),
|
||||
action: confirmResetTOTP,
|
||||
}
|
||||
}
|
||||
: undefined;
|
||||
};
|
||||
|
||||
@ -33,6 +33,6 @@ export const useVoipExtensionAction = ({ name, username, extension }: VoipExtens
|
||||
icon: extension ? 'phone-disabled' : 'phone',
|
||||
label: extension ? t('Unassign_extension') : t('Assign_extension'),
|
||||
action: handleExtensionAssignment,
|
||||
}
|
||||
}
|
||||
: undefined;
|
||||
};
|
||||
|
||||
@ -32,6 +32,6 @@ export const useVoipExtensionAction = ({ name, username, extension, enabled }: V
|
||||
icon: extension ? 'phone-disabled' : 'phone',
|
||||
label: extension ? t('Unassign_extension') : t('Assign_extension'),
|
||||
action: handleExtensionAssignment,
|
||||
}
|
||||
}
|
||||
: undefined;
|
||||
};
|
||||
|
||||
@ -116,11 +116,11 @@ const VersionCard = ({ serverInfo }: VersionCardProps): ReactElement => {
|
||||
danger: true,
|
||||
icon: 'warning',
|
||||
label: t('Plan_limits_reached'),
|
||||
}
|
||||
}
|
||||
: {
|
||||
icon: 'check',
|
||||
label: t('Operating_withing_plan_limits'),
|
||||
},
|
||||
},
|
||||
(isAirgapped || !versions) && {
|
||||
icon: 'warning',
|
||||
label: (
|
||||
@ -157,12 +157,12 @@ const VersionCard = ({ serverInfo }: VersionCardProps): ReactElement => {
|
||||
? {
|
||||
icon: 'check',
|
||||
label: t('Workspace_registered'),
|
||||
}
|
||||
}
|
||||
: {
|
||||
danger: true,
|
||||
icon: 'warning',
|
||||
label: t('Workspace_not_registered'),
|
||||
},
|
||||
},
|
||||
].filter(Boolean) as VersionActionItem[]
|
||||
).sort((a) => (a.danger ? -1 : 1));
|
||||
}, [isOverLimits, t, isAirgapped, versions, versionStatus?.label, versionStatus?.expiration, formatDate, isRegistered]);
|
||||
|
||||
@ -167,7 +167,7 @@ const DateRangePicker = ({ value, onChange, ...props }: DateRangePickerProps): R
|
||||
label: t('Previous_month'),
|
||||
action: () => dispatch('last-month'),
|
||||
},
|
||||
} as const),
|
||||
}) as const,
|
||||
[dispatch, t],
|
||||
);
|
||||
|
||||
|
||||
@ -35,13 +35,7 @@ const AppReleases = ({ id }: { id: App['id'] }): ReactElement => {
|
||||
<>
|
||||
<Accordion width='100%' alignSelf='center'>
|
||||
{isLoading && <AccordionLoading />}
|
||||
{isFetched && (
|
||||
<>
|
||||
{data?.map((release) => (
|
||||
<AppReleasesItem release={release} key={release.version} />
|
||||
))}
|
||||
</>
|
||||
)}
|
||||
{isFetched && <>{data?.map((release) => <AppReleasesItem release={release} key={release.version} />)}</>}
|
||||
</Accordion>
|
||||
</>
|
||||
);
|
||||
|
||||
@ -30,11 +30,11 @@ const ScreenshotCarousel = ({
|
||||
opacity: '1',
|
||||
transitionDuration: '1s',
|
||||
transform: 'scale(1.08)',
|
||||
}
|
||||
}
|
||||
: {
|
||||
opacity: '0',
|
||||
transitionDuration: '1s ease',
|
||||
};
|
||||
};
|
||||
|
||||
return (
|
||||
<Box style={screenshotWrapperStyle} key={currentScreenshot.id}>
|
||||
|
||||
@ -186,21 +186,21 @@ export const appStatusSpanProps = (
|
||||
? {
|
||||
label: 'Enabled*',
|
||||
tooltipText: t('Grandfathered_app'),
|
||||
}
|
||||
}
|
||||
: {
|
||||
label: 'Enabled',
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
return migrated && !isEnterprise
|
||||
? {
|
||||
label: 'Disabled*',
|
||||
tooltipText: t('Grandfathered_app'),
|
||||
}
|
||||
}
|
||||
: {
|
||||
type: 'warning',
|
||||
label: 'Disabled',
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
const isFailed = status && appErroredStatuses.includes(status);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user