snapshot of https://github.com/RocketChat/Rocket.Chat.git (develop, 2026-09-16; blobs > 131072B omitted)
Some checks failed
Create issues from TODOs / todos (push) Failing after 3s
Close inactive issues / close-issues (push) Has been cancelled
Deploy GitHub Pages / deploy-preview (push) Has been cancelled
CI / ⚙️ Variables Setup (push) Has been cancelled
CI / ⚙️ Test Guard (push) Has been cancelled
CI / 🚀 Notify external services - draft (push) Has been cancelled
CI / 📦 Build Packages (push) Has been cancelled
CI / 📦 Meteor Build (coverage) (push) Has been cancelled
CI / 📦 Meteor Build (production) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [account-service presence-service omnichannel-transcript-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [account-service presence-service omnichannel-transcript-service], fips) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [authorization-service queue-worker-service ddp-streamer-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [authorization-service queue-worker-service ddp-streamer-service], fips) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], coverage) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], fips) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [account-service presence-service omnichannel-transcript-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [authorization-service queue-worker-service ddp-streamer-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [rocketchat], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [rocketchat], coverage) (push) Has been cancelled
CI / 🚢 Publish Docker Images (ghcr.io) (push) Has been cancelled
CI / 📦 Track Image Sizes (push) Has been cancelled
CI / 🔎 Code Check - Action Lint (push) Has been cancelled
CI / 🔎 Code Check (push) Has been cancelled
CI / 🔨 Test Storybook (push) Has been cancelled
CI / 🔨 Test Unit (push) Has been cancelled
CI / 🔨 Test API (CE) (push) Has been cancelled
CI / 🔨 Test API Livechat (CE) (push) Has been cancelled
CI / 🔨 Test UI (CE) (push) Has been cancelled
CI / 🔨 Test API (EE) (push) Has been cancelled
CI / 🔨 Test API Livechat (EE) (push) Has been cancelled
CI / 🔨 Test API Apps (deno-runtime - EE) (push) Has been cancelled
CI / 🔨 Test UI (EE) (push) Has been cancelled
CI / 🔨 Test API (FIPS) (push) Has been cancelled
CI / 🔨 Test API Livechat (FIPS) (push) Has been cancelled
CI / 🔨 Test UI (FIPS) (push) Has been cancelled
CI / 🔨 Test Federation Matrix (push) Has been cancelled
CI / 📊 Report Coverage (push) Has been cancelled
CI / ✅ Tests Done (push) Has been cancelled
CI / 🚀 Publish build assets (push) Has been cancelled
CI / 🚀 Publish Docker Images (DockerHub) (push) Has been cancelled
CI / 🚀 Notify external services (push) Has been cancelled
CI / Update Version Durability (push) Has been cancelled
Release / Release (push) Has been cancelled
Auto-close duplicate issues / auto-close-duplicates (push) Failing after 1s
Code scanning - action / CodeQL-Build (push) Failing after 1s

This commit is contained in:
upstream-mirror
2026-09-16 01:21:02 +05:00
commit 30810eecd7
10161 changed files with 987110 additions and 0 deletions

View File

@@ -0,0 +1,57 @@
import { css } from '@rocket.chat/css-in-js';
import { Box, Button, Palette } from '@rocket.chat/fuselage';
import { useTranslation } from 'react-i18next';
export type OutlookSettingItemProps = {
id: string;
title: string;
subTitle: string;
enabled: boolean;
handleEnable: (value: boolean) => void;
};
const OutlookSettingItem = ({ id, title, subTitle, enabled, handleEnable }: OutlookSettingItemProps) => {
const { t } = useTranslation();
const hovered = css`
&:hover,
&:focus {
background: ${Palette.surface['surface-hover']};
.rcx-message {
background: ${Palette.surface['surface-hover']};
}
}
`;
return (
<Box
borderBlockEndWidth={1}
borderBlockEndColor='stroke-extra-light'
borderBlockEndStyle='solid'
className={hovered}
paddingInline={24}
paddingBlock={16}
display='flex'
justifyContent='space-between'
>
<Box marginInlineEnd={8}>
<Box fontScale='h4'>{title}</Box>
<Box fontScale='p2'>{subTitle}</Box>
</Box>
<Box>
{id === 'authentication' && (
<Button small onClick={() => handleEnable(!enabled)}>
{t('Disable')}
</Button>
)}
{id !== 'authentication' && (
<Button primary={!enabled} small onClick={() => handleEnable(!enabled)}>
{enabled ? t('Disable') : t('Enable')}
</Button>
)}
</Box>
</Box>
);
};
export default OutlookSettingItem;

View File

@@ -0,0 +1,87 @@
import { ButtonGroup, Button } from '@rocket.chat/fuselage';
import {
ContextualbarHeader,
ContextualbarIcon,
ContextualbarTitle,
ContextualbarClose,
ContextualbarContent,
ContextualbarFooter,
ContextualbarDialog,
} from '@rocket.chat/ui-client';
import { useTranslation, useUserPreference, useEndpoint, useToastMessageDispatch } from '@rocket.chat/ui-contexts';
import { useCallback } from 'react';
import OutlookSettingItem from './OutlookSettingItem';
import { useOutlookAuthentication, useOutlookAuthenticationMutationLogout } from '../hooks/useOutlookAuthentication';
export type OutlookSettingsListProps = {
onClose: () => void;
changeRoute: () => void;
};
const OutlookSettingsList = ({ onClose, changeRoute }: OutlookSettingsListProps) => {
const t = useTranslation();
const dispatchToastMessage = useToastMessageDispatch();
const saveUserPreferences = useEndpoint('POST', '/v1/users.setPreferences');
const notifyCalendarEvents = useUserPreference('notifyCalendarEvents') as boolean;
const { authEnabled } = useOutlookAuthentication();
const handleDisableAuth = useOutlookAuthenticationMutationLogout();
const handleNotifyCalendarEvents = useCallback(
(value: boolean) => {
try {
saveUserPreferences({ data: { notifyCalendarEvents: value } });
dispatchToastMessage({ type: 'success', message: t('Preferences_saved') });
} catch (error) {
dispatchToastMessage({ type: 'error', message: error });
}
},
[saveUserPreferences, dispatchToastMessage, t],
);
const calendarSettings = [
{
id: 'notification',
title: t('Event_notifications'),
subTitle: t('Event_notifications_description'),
enabled: notifyCalendarEvents,
handleEnable: handleNotifyCalendarEvents,
},
{
id: 'authentication',
title: t('Outlook_authentication'),
subTitle: t('Outlook_authentication_description'),
enabled: authEnabled,
handleEnable: () =>
handleDisableAuth.mutate(undefined, {
onSuccess: changeRoute,
}),
},
];
return (
<ContextualbarDialog>
<ContextualbarHeader>
<ContextualbarIcon name='calendar' />
<ContextualbarTitle>{t('Outlook_calendar_settings')}</ContextualbarTitle>
<ContextualbarClose onClick={onClose} />
</ContextualbarHeader>
<ContextualbarContent paddingInline={0} color='default'>
{calendarSettings.map((setting, index) => {
if (setting.id === 'authentication' && !setting.enabled) {
return;
}
return <OutlookSettingItem key={index} {...setting} />;
})}
</ContextualbarContent>
<ContextualbarFooter>
<ButtonGroup stretch>
<Button onClick={changeRoute}>{t('Back_to_calendar')}</Button>
</ButtonGroup>
</ContextualbarFooter>
</ContextualbarDialog>
);
};
export default OutlookSettingsList;

View File

@@ -0,0 +1 @@
export { default } from './OutlookSettingsList';