All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.js.commands.openInUseModal.ts Maven / Gradle / Ivy

The newest version!
/**
 * SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
 * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
 */

import {ModalStatus, openModal} from 'frontend-js-components-web';
import {navigate, sub} from 'frontend-js-web';

type Props = {
	assetType: string;
	onCancel?: () => void;
	status: ModalStatus;
	viewUsagesURL: string;
};

export default function openInUseModal({
	assetType,
	status,
	viewUsagesURL,
}: Props) {
	openModal({
		bodyHTML: `
			

${sub( Liferay.Language.get( 'the-content-type-cannot-be-changed-because-this-display-page-is-assigned-to-one-or-more-assets-with-the-type-x' ), assetType )}

${sub( Liferay.Language.get( 'to-change-the-content-type-unassign-this-display-page-from-the-assets-affected-and-try-again' ), assetType )}

`, buttons: [ { autoFocus: true, displayType: 'secondary', label: Liferay.Language.get('cancel'), type: 'cancel', }, { displayType: status, label: Liferay.Language.get('view-display-page-usages'), onClick: () => { navigate(viewUsagesURL); }, }, ], status, title: Liferay.Language.get('display-page-in-use'), }); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy