mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-01 05:03:10 +00:00
Show preview alert only for preview apps (#15926)
* show alert for only preview apps * update tests
This commit is contained in:
parent
67f01625b0
commit
92962c43ae
@ -143,7 +143,6 @@ const MarketPlaceAppDetails = () => {
|
|||||||
{t('label.browse-app-plural')}
|
{t('label.browse-app-plural')}
|
||||||
</Typography.Text>
|
</Typography.Text>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<div className="flex-center m-t-md">
|
<div className="flex-center m-t-md">
|
||||||
<AppLogo appName={appData?.fullyQualifiedName ?? ''} />
|
<AppLogo appName={appData?.fullyQualifiedName ?? ''} />
|
||||||
</div>
|
</div>
|
||||||
@ -159,37 +158,37 @@ const MarketPlaceAppDetails = () => {
|
|||||||
</Button>
|
</Button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
|
||||||
<Alert
|
{isPreviewApp && (
|
||||||
className="m-t-md text-xs d-flex items-start p-xs"
|
<Alert
|
||||||
message={
|
className="m-t-md text-xs d-flex items-start p-xs"
|
||||||
<>
|
message={
|
||||||
<Typography.Text>
|
<>
|
||||||
<Transi18next
|
<Typography.Text>
|
||||||
i18nKey="message.paid-addon-description"
|
<Transi18next
|
||||||
renderElement={
|
i18nKey="message.paid-addon-description"
|
||||||
<span data-testid="appName" style={{ fontWeight: 600 }} />
|
renderElement={
|
||||||
}
|
<span data-testid="appName" style={{ fontWeight: 600 }} />
|
||||||
values={{
|
}
|
||||||
app: appData?.displayName,
|
values={{
|
||||||
}}
|
app: appData?.displayName,
|
||||||
/>
|
}}
|
||||||
</Typography.Text>
|
/>
|
||||||
|
</Typography.Text>
|
||||||
<Typography.Text className="d-block">
|
|
||||||
{t('message.please-contact-us')}
|
|
||||||
</Typography.Text>
|
|
||||||
</>
|
|
||||||
}
|
|
||||||
type="info"
|
|
||||||
/>
|
|
||||||
|
|
||||||
|
<Typography.Text className="d-block">
|
||||||
|
{t('message.please-contact-us')}
|
||||||
|
</Typography.Text>
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
type="info"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
<div className="m-t-md">
|
<div className="m-t-md">
|
||||||
<CheckMarkIcon className="v-middle m-r-xss" />
|
<CheckMarkIcon className="v-middle m-r-xss" />
|
||||||
<Typography.Text className="text-xs font-medium text-grey-muted">
|
<Typography.Text className="text-xs font-medium text-grey-muted">
|
||||||
{t('message.marketplace-verify-msg')}
|
{t('message.marketplace-verify-msg')}
|
||||||
</Typography.Text>
|
</Typography.Text>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Space className="p-t-lg" direction="vertical" size={8}>
|
<Space className="p-t-lg" direction="vertical" size={8}>
|
||||||
<Typography.Text>
|
<Typography.Text>
|
||||||
{appData?.supportEmail && (
|
{appData?.supportEmail && (
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
import {
|
import {
|
||||||
|
queryByTestId,
|
||||||
render,
|
render,
|
||||||
screen,
|
screen,
|
||||||
waitForElementToBeRemoved,
|
waitForElementToBeRemoved,
|
||||||
@ -95,7 +96,7 @@ jest.mock('../AppLogo/AppLogo.component', () =>
|
|||||||
|
|
||||||
describe('MarketPlaceAppDetails component', () => {
|
describe('MarketPlaceAppDetails component', () => {
|
||||||
it('should render all necessary elements if app details fetch successfully', async () => {
|
it('should render all necessary elements if app details fetch successfully', async () => {
|
||||||
render(<MarketPlaceAppDetails />);
|
const { container } = render(<MarketPlaceAppDetails />);
|
||||||
|
|
||||||
await waitForElementToBeRemoved(() => screen.getByText('Loader'));
|
await waitForElementToBeRemoved(() => screen.getByText('Loader'));
|
||||||
|
|
||||||
@ -116,6 +117,10 @@ describe('MarketPlaceAppDetails component', () => {
|
|||||||
expect(screen.getByText('label.privacy-policy')).toBeInTheDocument();
|
expect(screen.getByText('label.privacy-policy')).toBeInTheDocument();
|
||||||
expect(screen.getByText('label.get-app-support')).toBeInTheDocument();
|
expect(screen.getByText('label.get-app-support')).toBeInTheDocument();
|
||||||
|
|
||||||
|
const appName = queryByTestId(container, 'appName');
|
||||||
|
|
||||||
|
expect(appName).not.toBeInTheDocument();
|
||||||
|
|
||||||
// actions check
|
// actions check
|
||||||
userEvent.click(
|
userEvent.click(
|
||||||
screen.getByRole('button', { name: 'left label.browse-app-plural' })
|
screen.getByRole('button', { name: 'left label.browse-app-plural' })
|
||||||
|
Loading…
x
Reference in New Issue
Block a user