-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: New marketplace state for out of support window workspaces (#33238
- Loading branch information
1 parent
065a742
commit 31eb47f
Showing
16 changed files
with
227 additions
and
60 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,6 @@ | ||
--- | ||
"@rocket.chat/meteor": major | ||
"@rocket.chat/i18n": major | ||
--- | ||
|
||
Adds new empty states for the marketplace view |
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
15 changes: 2 additions & 13 deletions
15
apps/meteor/client/views/marketplace/AppsPage/AppsPage.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
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
33 changes: 33 additions & 0 deletions
33
apps/meteor/client/views/marketplace/AppsPage/UnsupportedEmptyState.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,33 @@ | ||
import { mockAppRoot } from '@rocket.chat/mock-providers'; | ||
import { render, screen } from '@testing-library/react'; | ||
import React from 'react'; | ||
|
||
import { AppsContext } from '../../../contexts/AppsContext'; | ||
import { asyncState } from '../../../lib/asyncState'; | ||
import UnsupportedEmptyState from './UnsupportedEmptyState'; | ||
|
||
describe('with private apps enabled', () => { | ||
const appRoot = mockAppRoot() | ||
.withTranslations('en', 'core', { | ||
Marketplace_unavailable: 'Marketplace unavailable', | ||
}) | ||
.wrap((children) => ( | ||
<AppsContext.Provider | ||
value={{ | ||
installedApps: asyncState.resolved({ apps: [] }), | ||
marketplaceApps: asyncState.rejected(new Error('unsupported version')), | ||
privateApps: asyncState.resolved({ apps: [] }), | ||
reload: () => Promise.resolve(), | ||
orchestrator: undefined, | ||
}} | ||
> | ||
{children} | ||
</AppsContext.Provider> | ||
)); | ||
|
||
it('should inform that the marketplace is unavailable due unsupported version', () => { | ||
render(<UnsupportedEmptyState />, { wrapper: appRoot.build(), legacyRoot: true }); | ||
|
||
expect(screen.getByRole('heading', { name: 'Marketplace unavailable' })).toBeInTheDocument(); | ||
}); | ||
}); |
16 changes: 16 additions & 0 deletions
16
apps/meteor/client/views/marketplace/AppsPage/UnsupportedEmptyState.stories.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,16 @@ | ||
import type { ComponentMeta, ComponentStory } from '@storybook/react'; | ||
import React from 'react'; | ||
|
||
import UnsupportedEmptyState from './UnsupportedEmptyState'; | ||
|
||
export default { | ||
title: 'Marketplace/Components/UnsupportedEmptyState', | ||
component: UnsupportedEmptyState, | ||
parameters: { | ||
layout: 'fullscreen', | ||
controls: { hideNoControlsWarning: true }, | ||
}, | ||
} as ComponentMeta<typeof UnsupportedEmptyState>; | ||
|
||
export const Default: ComponentStory<typeof UnsupportedEmptyState> = () => <UnsupportedEmptyState />; | ||
Default.storyName = 'UnsupportedEmptyState'; |
Oops, something went wrong.