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

META-INF.resources.js.components.ObjectAction.tabs.BasicInfo.tsx 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 ClayForm from '@clayui/form';
import {
	Card,
	FormError,
	Input,
	Toggle,
} from '@liferay/object-js-components-web';
import {InputLocalized} from 'frontend-js-components-web';
import React from 'react';

import {defaultLanguageId} from '../../../utils/constants';
import {toCamelCase} from '../../../utils/string';
import {DisabledGroovyScriptAlert} from '../../DisabledGroovyScriptAlert';

import './ActionBuilder.scss';

interface BasicInfoProps {
	disableGroovyAction: boolean;
	errors: FormError;
	handleChange: React.ChangeEventHandler;
	isApproved: boolean;
	readOnly?: boolean;
	scriptManagementConfigurationPortletURL: string;
	setValues: (values: Partial) => void;
	values: Partial;
}

export default function BasicInfo({
	disableGroovyAction,
	errors,
	handleChange,
	isApproved,
	readOnly,
	scriptManagementConfigurationPortletURL,
	setValues,
	values,
}: BasicInfoProps) {
	return (
		<>
			{disableGroovyAction && (
				
			)}

			
				
						setValues({
							...values,
							...(!isApproved &&
								!values.system && {
									name: toCamelCase(
										label[defaultLanguageId] ?? ''
									),
								}),
							label,
						})
					}
					required
					translations={values.label ?? {[defaultLanguageId]: ''}}
				/>

				

				

				
					 setValues({active})}
						toggled={values.active}
					/>
				
			
		
	);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy