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

META-INF.resources.js.components.ObjectField.Tabs.Advanced.AdvancedTab.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 {SidebarCategory} from '@liferay/object-js-components-web';
import {ILearnResourceContext} from 'frontend-js-components-web';
import React, {ElementType} from 'react';

import {ObjectFieldErrors} from '../../ObjectFieldFormBase';
import {DefaultValueContainer} from './DefaultValueContainer';
import {ReadOnlyContainer} from './ReadOnlyContainer';

interface AdvancedTabProps {
	containerWrapper: ElementType;
	creationLanguageId: Liferay.Language.Locale;
	errors: ObjectFieldErrors;
	isDefaultStorageType: boolean;
	isRootDescendantNode: boolean;
	learnResources: ILearnResourceContext;
	modelBuilder?: boolean;
	onSubmit?: () => void;
	readOnlySidebarElements: SidebarCategory[];
	setValues: (value: Partial) => void;
	sidebarElements: SidebarCategory[];
	values: Partial;
}

export function AdvancedTab({
	containerWrapper: ContainerWrapper,
	creationLanguageId,
	errors,
	isDefaultStorageType,
	isRootDescendantNode,
	learnResources,
	modelBuilder = false,
	onSubmit,
	readOnlySidebarElements,
	setValues,
	sidebarElements,
	values,
}: AdvancedTabProps) {
	const disabledReadyOnly =
		values.businessType === 'Aggregation' ||
		values.businessType === 'AutoIncrement' ||
		values.businessType === 'Formula' ||
		(values.businessType === 'Relationship' && isRootDescendantNode) ||
		values.required ||
		values.system;

	return (
		<>
			{isDefaultStorageType && (
				
					
				
			)}

			{values.businessType === 'Picklist' && (
				
					
				
			)}
		
	);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy