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