-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feat/cloud-workspace-id
- Loading branch information
Showing
34 changed files
with
794 additions
and
215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@rocket.chat/meteor': patch | ||
--- | ||
|
||
Fixed a problem in how server was processing errors that was sending 2 ephemeral error messages when @all or @here were used while they were disabled via permissions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@rocket.chat/meteor": patch | ||
"@rocket.chat/i18n": patch | ||
--- | ||
|
||
Fixed an issue with object storage settings that was not allowing admins to decide if files generated via "Export conversation" feature were being proxied through server or not. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@rocket.chat/fuselage-ui-kit': patch | ||
--- | ||
|
||
Fix translation param on video conf joined message |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { mockAppRoot } from '@rocket.chat/mock-providers'; | ||
import { render, screen } from '@testing-library/react'; | ||
import React from 'react'; | ||
|
||
import WarningModal from './WarningModal'; | ||
|
||
import '@testing-library/jest-dom'; | ||
|
||
it('should look good', async () => { | ||
render(<WarningModal text='text' confirmText='confirm' cancelText='cancel' confirm={() => undefined} close={() => undefined} />, { | ||
wrapper: mockAppRoot().build(), | ||
}); | ||
|
||
expect(screen.getByRole('heading')).toHaveTextContent('Are_you_sure'); | ||
expect(screen.getByRole('button', { name: 'cancel' })).toBeInTheDocument(); | ||
expect(screen.getByRole('button', { name: 'confirm' })).toBeInTheDocument(); | ||
expect(screen.getByText('text')).toBeInTheDocument(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppStatus/AppStatus.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { faker } from '@faker-js/faker'; | ||
import { mockAppRoot } from '@rocket.chat/mock-providers'; | ||
import { render, screen } from '@testing-library/react'; | ||
import React from 'react'; | ||
import '@testing-library/jest-dom'; | ||
|
||
import { mockedAppsContext } from '../../../../../../tests/mocks/client/marketplace'; | ||
import { createFakeApp, createFakeLicenseInfo } from '../../../../../../tests/mocks/data'; | ||
import AppStatus from './AppStatus'; | ||
|
||
it('should look good', async () => { | ||
const app = createFakeApp(); | ||
|
||
render(<AppStatus app={app} showStatus isAppDetailsPage />, { | ||
wrapper: mockAppRoot() | ||
.withJohnDoe() | ||
.withEndpoint('GET', '/apps/count', async () => ({ | ||
maxMarketplaceApps: faker.number.int({ min: 0 }), | ||
installedApps: faker.number.int({ min: 0 }), | ||
maxPrivateApps: faker.number.int({ min: 0 }), | ||
totalMarketplaceEnabled: faker.number.int({ min: 0 }), | ||
totalPrivateEnabled: faker.number.int({ min: 0 }), | ||
})) | ||
.withEndpoint('GET', '/v1/licenses.info', async () => ({ | ||
license: createFakeLicenseInfo(), | ||
})) | ||
.wrap(mockedAppsContext) | ||
.build(), | ||
}); | ||
|
||
screen.getByRole('button', { name: 'Request' }).click(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { faker } from '@faker-js/faker'; | ||
import { mockAppRoot } from '@rocket.chat/mock-providers'; | ||
import { render, screen } from '@testing-library/react'; | ||
import React from 'react'; | ||
import '@testing-library/jest-dom'; | ||
|
||
import { mockedAppsContext } from '../../../tests/mocks/client/marketplace'; | ||
import { createFakeApp } from '../../../tests/mocks/data'; | ||
import AppMenu from './AppMenu'; | ||
|
||
describe('without app details', () => { | ||
it('should look good', async () => { | ||
const app = createFakeApp(); | ||
|
||
render(<AppMenu app={app} isAppDetailsPage={false} />, { | ||
wrapper: mockAppRoot() | ||
.withEndpoint('GET', '/apps/count', async () => ({ | ||
maxMarketplaceApps: faker.number.int({ min: 0 }), | ||
installedApps: faker.number.int({ min: 0 }), | ||
maxPrivateApps: faker.number.int({ min: 0 }), | ||
totalMarketplaceEnabled: faker.number.int({ min: 0 }), | ||
totalPrivateEnabled: faker.number.int({ min: 0 }), | ||
})) | ||
.wrap(mockedAppsContext) | ||
.build(), | ||
}); | ||
|
||
expect(screen.getByRole('button', { name: 'More_options' })).toBeInTheDocument(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import type { App } from '@rocket.chat/core-typings'; | ||
import { MenuItem, MenuItemContent, MenuSection, MenuV2, Skeleton } from '@rocket.chat/fuselage'; | ||
import { useTranslation } from '@rocket.chat/ui-contexts'; | ||
import React, { memo } from 'react'; | ||
|
||
import { useHandleMenuAction } from '../../components/GenericMenu/hooks/useHandleMenuAction'; | ||
import type { AppMenuOption } from './hooks/useAppMenu'; | ||
import { useAppMenu } from './hooks/useAppMenu'; | ||
|
||
type AppMenuProps = { | ||
app: App; | ||
isAppDetailsPage: boolean; | ||
}; | ||
|
||
const AppMenu = ({ app, isAppDetailsPage }: AppMenuProps) => { | ||
const t = useTranslation(); | ||
|
||
const { isLoading, isAdminUser, sections } = useAppMenu(app, isAppDetailsPage); | ||
|
||
const itemsList = sections.reduce((acc, { items }) => [...acc, ...items], [] as AppMenuOption[]); | ||
|
||
const onAction = useHandleMenuAction(itemsList); | ||
const disabledKeys = itemsList.filter((item) => item.disabled).map((item) => item.id); | ||
|
||
if (isLoading) { | ||
return <Skeleton variant='rect' height='x28' width='x28' />; | ||
} | ||
|
||
if (!isAdminUser && app?.installed && sections.length === 0) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<MenuV2 title={t('More_options')} onAction={onAction} disabledKeys={disabledKeys} detached> | ||
{sections.map(({ items }, idx) => ( | ||
<MenuSection key={idx} items={items}> | ||
{items.map((option) => ( | ||
<MenuItem key={option.id}> | ||
<MenuItemContent>{option.content}</MenuItemContent> | ||
</MenuItem> | ||
))} | ||
</MenuSection> | ||
))} | ||
</MenuV2> | ||
); | ||
}; | ||
|
||
export default memo(AppMenu); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.