UNPKG

@craftercms/studio-ui

Version:

Services, components, models & utils to build CrafterCMS authoring extensions.

129 lines (127 loc) 4.7 kB
/* * Copyright (C) 2007-2022 Crafter Software Corporation. All Rights Reserved. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 3 as published by * the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* * Copyright (C) 2007-2022 Crafter Software Corporation. All Rights Reserved. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3 as published by * the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ import Grid from '@mui/material/Grid'; import DependencySelection from '../DependencySelection/DependencySelection'; import PublishDialogForm from './PublishDialogForm'; import React from 'react'; import Alert from '@mui/material/Alert'; import { FormattedMessage } from 'react-intl'; import { Typography } from '@mui/material'; export function PublishDialogContentUI(props) { // region { ... } = props const { resource, published, selectedItems, onItemClicked, dependencies, onSelectAll, onSelectAllSoftDependencies, state, isRequestPublish, showRequestApproval, publishingTargetsStatus, onPublishingChannelsFailRetry, mixedPublishingDates, mixedPublishingTargets, submissionCommentRequired, onPublishingArgumentChange, isSubmitting } = props; // endregion const { items, publishingTargets } = resource.read(); return React.createElement( React.Fragment, null, React.createElement( Grid, { container: true, spacing: 3 }, React.createElement( Grid, { item: true, xs: 12, sm: 7, md: 7, lg: 7, xl: 7 }, published ? React.createElement( React.Fragment, null, isRequestPublish && React.createElement( Alert, { severity: 'info', sx: { mb: '10px' } }, React.createElement( Typography, null, React.createElement(FormattedMessage, { id: 'publishDialog.requestPublishHint', defaultMessage: 'Items will be submitted for review and published upon approval' }) ) ), React.createElement(DependencySelection, { items: items, selectedItems: selectedItems, onItemClicked: onItemClicked, dependencies: dependencies, onSelectAllClicked: onSelectAll, onSelectAllSoftClicked: onSelectAllSoftDependencies, disabled: isSubmitting }) ) : React.createElement( Alert, { severity: 'warning' }, React.createElement(FormattedMessage, { id: 'publishDialog.firstPublish', defaultMessage: 'The entire project will be published since this is the first publish request' }) ) ), React.createElement( Grid, { item: true, xs: 12, sm: 5, md: 5, lg: 5, xl: 5 }, React.createElement(PublishDialogForm, { state: state, published: published, isRequestPublish: isRequestPublish, showRequestApproval: showRequestApproval, publishingChannels: publishingTargets, publishingTargetsStatus: publishingTargetsStatus, onPublishingChannelsFailRetry: onPublishingChannelsFailRetry, disabled: isSubmitting, mixedPublishingDates: mixedPublishingDates, mixedPublishingTargets: mixedPublishingTargets, submissionCommentRequired: submissionCommentRequired, onChange: onPublishingArgumentChange }) ) ) ); } export default PublishDialogContentUI;