Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion apps/meteor/client/views/home/cards/AddUsersCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const AddUsersCard = (props: Omit<ComponentProps<typeof Card>, 'type'>): ReactEl
title={t('Add_users')}
body={t('Invite_and_add_members_to_this_workspace_to_start_communicating')}
buttons={[<GenericCardButton key={1} onClick={handleOpenUsersRoute} children={t('Add_users')} primary />]}
data-qa-id='homepage-add-users-card'
width='x340'
{...props}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const CreateChannelsCard = (props: Omit<ComponentProps<typeof Card>, 'type'>): R
title={t('Create_channels')}
body={t('Create_a_public_channel_that_new_workspace_members_can_join')}
buttons={[<GenericCardButton key={1} onClick={openCreateChannelModal} children={t('Create_channel')} />]}
data-qa-id='homepage-create-channels-card'
width='x340'
{...props}
/>
Expand Down
7 changes: 4 additions & 3 deletions apps/meteor/client/views/home/cards/CustomContentCard.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { Box, Button, Card, CardBody, CardControls, CardHeader, Icon, Tag } from '@rocket.chat/fuselage';
import { useRole, useSettingSetValue, useSetting, useToastMessageDispatch, useTranslation, useRouter } from '@rocket.chat/ui-contexts';
import { useRole, useSettingSetValue, useSetting, useToastMessageDispatch, useRouter } from '@rocket.chat/ui-contexts';
import type { ComponentProps, ReactElement } from 'react';
import { useTranslation } from 'react-i18next';

import { useIsEnterprise } from '../../../hooks/useIsEnterprise';
import CustomHomepageContent from '../CustomHomePageContent';

const CustomContentCard = (props: Omit<ComponentProps<typeof Card>, 'type'>): ReactElement | null => {
const t = useTranslation();
const { t } = useTranslation();
const dispatchToastMessage = useToastMessageDispatch();
const router = useRouter();

Expand Down Expand Up @@ -50,7 +51,7 @@ const CustomContentCard = (props: Omit<ComponentProps<typeof Card>, 'type'>): Re

if (isAdmin) {
return (
<Card data-qa-id='homepage-custom-card' {...props}>
<Card role='region' aria-label={t('Custom_content', 'Custom content')} {...props}>
<CardHeader>
<Tag>
<Icon mie={4} name={willNotShowCustomContent ? 'eye-off' : 'eye'} size='x12' />
Expand Down
1 change: 0 additions & 1 deletion apps/meteor/client/views/home/cards/DesktopAppsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const DesktopAppsCard = (props: Omit<ComponentProps<typeof Card>, 'type'>): Reac
<GenericCardButton key={3} onClick={() => handleOpenLink(MAC_APP_URL)} children={t('Platform_Mac')} role='link' />,
]}
width='x340'
data-qa-id='homepage-desktop-apps-card'
{...props}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const DocumentationCard = (props: Omit<ComponentProps<typeof Card>, 'type'>): Re
title={t('Documentation')}
body={t('Learn_how_to_unlock_the_myriad_possibilities_of_rocket_chat')}
buttons={[<GenericCardButton key={1} onClick={() => handleOpenLink(DOCS_URL)} children={t('See_documentation')} role='link' />]}
data-qa-id='homepage-documentation-card'
width='x340'
{...props}
/>
Expand Down
1 change: 0 additions & 1 deletion apps/meteor/client/views/home/cards/JoinRoomsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const JoinRoomsCard = (props: Omit<ComponentProps<typeof Card>, 'type'>): ReactE
title={t('Join_rooms')}
body={t('Discover_public_channels_and_teams_in_the_workspace_directory')}
buttons={[<GenericCardButton key={1} onClick={handleDirectory} children={t('Open_directory')} />]}
data-qa-id='homepage-join-rooms-card'
width='x340'
{...props}
/>
Expand Down
1 change: 0 additions & 1 deletion apps/meteor/client/views/home/cards/MobileAppsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ const MobileAppsCard = (props: Omit<ComponentProps<typeof Card>, 'type'>): React
<GenericCardButton key={1} onClick={() => handleOpenLink(GOOGLE_PLAY_URL)} children={t('Google_Play')} role='link' />,
<GenericCardButton key={2} onClick={() => handleOpenLink(APP_STORE_URL)} children={t('App_Store')} role='link' />,
]}
data-qa-id='homepage-mobile-apps-card'
width='x340'
{...props}
/>
Expand Down
28 changes: 14 additions & 14 deletions apps/meteor/tests/e2e/homepage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import { IS_EE } from './config/constants';
import { Users } from './fixtures/userStates';
import { expect, test } from './utils/test';

const CardIds = {
Users: 'homepage-add-users-card',
Chan: 'homepage-create-channels-card',
Rooms: 'homepage-join-rooms-card',
Mobile: 'homepage-mobile-apps-card',
Desktop: 'homepage-desktop-apps-card',
Docs: 'homepage-documentation-card',
Custom: 'homepage-custom-card',
const CardNames = {
Users: 'Add users',
Chan: 'Create channels',
Rooms: 'Join rooms',
Mobile: 'Mobile apps',
Desktop: 'Desktop apps',
Docs: 'Documentation',
Custom: 'Custom content',
};
test.use({ storageState: Users.admin.state });

Expand All @@ -38,7 +38,7 @@ test.describe.serial('homepage', () => {
});

await test.step('expect all cards to be visible', async () => {
await Promise.all(Object.values(CardIds).map((id) => expect(adminPage.locator(`[data-qa-id="${id}"]`)).toBeVisible()));
await Promise.all(Object.values(CardNames).map((name) => expect(adminPage.getByRole('region', { name })).toBeVisible()));
});
});

Expand Down Expand Up @@ -107,7 +107,7 @@ test.describe.serial('homepage', () => {
});

test.describe('for regular users', () => {
const notVisibleCards = [CardIds.Users, CardIds.Custom];
const notVisibleCards = [CardNames.Users, CardNames.Custom];

test.beforeAll(async ({ api, browser }) => {
expect((await api.post('/settings/Layout_Home_Body', { value: '' })).status()).toBe(200);
Expand All @@ -126,14 +126,14 @@ test.describe.serial('homepage', () => {
});

await test.step(`expect ${notVisibleCards.join(' and ')} cards to not be visible`, async () => {
await Promise.all(notVisibleCards.map((id) => expect(regularUserPage.locator(`[data-qa-id="${id}"]`)).not.toBeVisible()));
await Promise.all(notVisibleCards.map((name) => expect(regularUserPage.getByRole('region', { name })).not.toBeVisible()));
});

await test.step('expect all other cards to be visible', async () => {
await Promise.all(
Object.values(CardIds)
.filter((id) => !notVisibleCards.includes(id))
.map((id) => expect(regularUserPage.locator(`[data-qa-id="${id}"]`)).toBeVisible()),
Object.values(CardNames)
.filter((name) => !notVisibleCards.includes(name))
.map((name) => expect(regularUserPage.getByRole('region', { name })).toBeVisible()),
);
});

Expand Down
1 change: 0 additions & 1 deletion apps/meteor/tests/e2e/settings-int.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ test.describe.serial('settings-int', () => {

await pageTitle.waitFor();
await expect(pageTitle).toBeVisible();
await expect(pageTitle).toHaveText('Message');
});

test('expect not being able to set int value as empty string', async ({ page }) => {
Expand Down
1 change: 1 addition & 0 deletions packages/i18n/src/locales/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -1626,6 +1626,7 @@
"Custom_User_Status_Info": "Custom User Status Info",
"Custom_User_Status_Updated_Successfully": "Custom User Status Updated Successfully",
"Custom_agent": "Custom agent",
"Custom_content": "Custom content",
"Custom_dates": "Custom Dates",
"Custom_oauth_helper": "When setting up your OAuth Provider, you'll have to inform a Callback URL. Use <pre>%s</pre> .",
"Custom_roles": "Custom roles",
Expand Down
Loading