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,19 @@
import { composeStories } from '@storybook/react';
import { render } from '@testing-library/react';
import { axe } from 'jest-axe';
import * as stories from './OmnichannelBadges.stories';
const testCases = Object.values(composeStories(stories)).map((Story) => [Story.storyName || 'Story', Story]);
test.each(testCases)(`renders %s without crashing`, (_storyname, Story) => {
const { baseElement } = render(<Story />);
expect(baseElement).toMatchSnapshot();
});
test.each(testCases)('%s should have no a11y violations', async (_storyname, Story) => {
const { container } = render(<Story />);
const results = await axe(container);
expect(results).toHaveNoViolations();
});

View File

@@ -0,0 +1,68 @@
import { LivechatPriorityWeight } from '@rocket.chat/core-typings';
import type { IRoom, ISubscription } from '@rocket.chat/core-typings';
import { mockAppRoot } from '@rocket.chat/mock-providers';
import type { Meta } from '@storybook/react';
import OmnichannelBadges from './OmnichannelBadges';
import { createFakeSubscription } from '../../../../../tests/mocks/data';
import type { OmnichannelContextValue } from '../../../../contexts/OmnichannelContext';
import { OmnichannelContext } from '../../../../contexts/OmnichannelContext';
const meta = {
component: OmnichannelBadges,
parameters: {
layout: 'centered',
},
args: {
room: createFakeSubscription({ t: 'l' }) as unknown as ISubscription & IRoom,
},
decorators: [
(Story, context) => {
const { isOverMacLimit = false } = context.parameters;
const AppRoot = mockAppRoot().build();
const contextValue = {
enabled: true,
isOverMacLimit,
livechatPriorities: {
enabled: true,
data: [{ name: 'Highest', i18n: 'highest', sortItem: LivechatPriorityWeight.HIGHEST, dirty: false }],
},
} as OmnichannelContextValue;
return (
<OmnichannelContext.Provider value={contextValue}>
<AppRoot>
<Story />
</AppRoot>
</OmnichannelContext.Provider>
);
},
],
} satisfies Meta<Omit<typeof OmnichannelBadges, 'room'>>;
export default meta;
export const WithPriority = {
args: {
room: createFakeSubscription({
t: 'l',
priorityWeight: LivechatPriorityWeight.HIGHEST,
}),
},
parameters: {
isOverMacLimit: false,
},
};
export const OverMacLimit = {
args: {
room: createFakeSubscription({
t: 'l',
priorityWeight: LivechatPriorityWeight.NOT_SPECIFIED,
}),
},
parameters: {
isOverMacLimit: true,
},
};

View File

@@ -0,0 +1,25 @@
import type { IRoom, ISubscription } from '@rocket.chat/core-typings';
import { isOmnichannelRoom } from '@rocket.chat/core-typings';
import { useOmnichannelPriorities } from '../../hooks/useOmnichannelPriorities';
import { PriorityIcon } from '../../priorities/PriorityIcon';
import RoomActivityIcon from '../RoomActivityIcon';
export type OmnichannelBadgesProps = { room: ISubscription & IRoom };
const OmnichannelBadges = ({ room }: OmnichannelBadgesProps) => {
const { enabled: isPriorityEnabled } = useOmnichannelPriorities();
if (!isOmnichannelRoom(room)) {
return null;
}
return (
<>
{isPriorityEnabled ? <PriorityIcon level={room.priorityWeight} /> : null}
<RoomActivityIcon room={room} />
</>
);
};
export default OmnichannelBadges;

View File

@@ -0,0 +1,29 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`renders OverMacLimit without crashing 1`] = `
<body>
<div>
<i
aria-hidden="true"
class="rcx-box rcx-box--full rcx-icon--name-warning rcx-icon rcx-css-ayadvf"
title="Workspace_exceeded_MAC_limit_disclaimer"
>
</i>
</div>
</body>
`;
exports[`renders WithPriority without crashing 1`] = `
<body>
<div>
<i
aria-hidden="true"
class="rcx-box rcx-box--full rcx-icon--name-chevron-double-up rcx-icon rcx-css-aob2og"
title=""
>
</i>
</div>
</body>
`;

View File

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