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

META-INF.resources.js.props_transformers.DeliveryGroupFDSPropsTransformer.js Maven / Gradle / Ivy

There is a newer version: 5.0.100
Show newest version
/**
 * SPDX-FileCopyrightText: (c) 2024 Liferay, Inc. https://liferay.com
 * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
 */

import {createPortletURL, openModal} from 'frontend-js-web';

const DeliveryGroupFDSPropsTransformer = (props) => ({
	...props,
	onActionDropdownItemClick: ({
		action: {
			data: {action: actionId, viewDeliveryGroupURL},
		},
		itemData: {addressId, deliveryDate, name},
	}) => {
		if (actionId === 'view') {
			openModal({
				buttons: [
					{
						autofocus: true,
						label: Liferay.Language.get('ok'),
						onClick: ({processClose}) => {
							processClose();
						},
						type: 'button',
					},
				],
				height: '32rem',
				iframeBodyCssClass: '',
				size: 'default',
				title: name,
				url: createPortletURL(viewDeliveryGroupURL, {
					addressId,
					deliveryDate,
					deliveryGroupName: name,
				}),
			});
		}
	},
});

export default DeliveryGroupFDSPropsTransformer;




© 2015 - 2025 Weber Informatics LLC | Privacy Policy