-
-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Add basic popup for partial publish
- Loading branch information
Showing
7 changed files
with
230 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Neos.Neos.Ui package. | ||
* | ||
* (c) Contributors of the Neos Project - www.neos.io | ||
* | ||
* This package is Open Source Software. For the full copyright and license | ||
* information, please view the LICENSE file which was distributed with this | ||
* source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Neos\Neos\Ui\Application\Shared; | ||
|
||
use Neos\Flow\Annotations as Flow; | ||
|
||
/** | ||
* @internal for communication within the Neos UI only | ||
*/ | ||
#[Flow\Proxy(false)] | ||
final readonly class PartialPublishFailed implements \JsonSerializable | ||
{ | ||
public function __construct( | ||
public ?string $baseWorkspaceName | ||
) { | ||
} | ||
|
||
public function jsonSerialize(): mixed | ||
{ | ||
return [ | ||
'partialPublishFail' => get_object_vars($this) | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
116 changes: 116 additions & 0 deletions
116
packages/neos-ui/src/Containers/Modals/PublishingDialog/PublishAllConfirmationDialog.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
/* | ||
* This file is part of the Neos.Neos.Ui package. | ||
* | ||
* (c) Contributors of the Neos Project - www.neos.io | ||
* | ||
* This package is Open Source Software. For the full copyright and license | ||
* information, please view the LICENSE file which was distributed with this | ||
* source code. | ||
*/ | ||
import React from 'react'; | ||
|
||
import {Button, Dialog, Icon} from '@neos-project/react-ui-components'; | ||
import I18n from '@neos-project/neos-ui-i18n'; | ||
import {PublishingMode, PublishingPhase, PublishingScope} from '@neos-project/neos-ui-redux-store/src/CR/Publishing'; | ||
|
||
import {Diagram} from './Diagram'; | ||
|
||
import style from './style.module.css'; | ||
|
||
type ConfirmationDialogProps = { | ||
mode: PublishingMode; | ||
scope: PublishingScope; | ||
scopeTitle: string; | ||
sourceWorkspaceName: string; | ||
targetWorkspaceName: null | string; | ||
numberOfChanges: number; | ||
onAbort: () => void; | ||
onConfirm: () => void; | ||
} | ||
|
||
export const PublishAllConfirmationDialog: React.FC<ConfirmationDialogProps> = (props) => { | ||
const variant = { | ||
id: '', | ||
style: 'error', | ||
icon: { | ||
title: 'exclamation-triangle', | ||
confirm: 'exclamation-triangle' | ||
}, | ||
label: { | ||
title: { | ||
id: 'Neos.Neos.Ui:PublishingDialog:partialPublishFailed.title', | ||
fallback: (props: { scopeTitle: string; }) => | ||
`Could not publish all changes in "${props.scopeTitle}"` | ||
}, | ||
message: { | ||
id: 'Neos.Neos.Ui:PublishingDialog:partialPublishFailed.message', | ||
fallback: (props: { scopeTitle: string; targetWorkspaceName: null | string; }) => | ||
`Some changes in this document are dependent on changes in other documents. Do you want to publish all changes to the workspace "${props.targetWorkspaceName}"?` | ||
}, | ||
cancel: { | ||
id: 'Neos.Neos.Ui:PublishingDialog:publish.all.confirmation.cancel', | ||
fallback: 'No, cancel' | ||
}, | ||
confirm: { | ||
id: 'Neos.Neos.Ui:PublishingDialog:partialPublishFailed.publishAll', | ||
fallback: 'Yes, publish all changes' | ||
} | ||
} | ||
} | ||
|
||
return ( | ||
<Dialog | ||
actions={[ | ||
<Button | ||
id={`${variant.id}-Cancel`} | ||
key="cancel" | ||
style="lighter" | ||
hoverStyle="brand" | ||
onClick={props.onAbort} | ||
> | ||
<I18n {...variant.label.cancel} /> | ||
</Button>, | ||
<Button | ||
id={`${variant.id}-Confirm`} | ||
key="confirm" | ||
style={variant.style} | ||
hoverStyle={variant.style} | ||
onClick={props.onConfirm} | ||
> | ||
<Icon icon={variant.icon.confirm} className={style.buttonIcon} /> | ||
<I18n {...variant.label.confirm} /> | ||
</Button> | ||
]} | ||
title={<div> | ||
<Icon icon={variant.icon.title} /> | ||
<span className={style.modalTitle}> | ||
<I18n | ||
id={variant.label.title.id} | ||
params={props} | ||
fallback={variant.label.title.fallback(props)} | ||
/> | ||
</span> | ||
</div>} | ||
onRequestClose={props.onAbort} | ||
type={variant.style} | ||
isOpen | ||
autoFocus | ||
theme={undefined as any} | ||
style={undefined as any} | ||
> | ||
<div className={style.modalContents}> | ||
<Diagram | ||
phase={PublishingPhase.START} | ||
sourceWorkspaceName={props.sourceWorkspaceName} | ||
targetWorkspaceName={props.targetWorkspaceName} | ||
numberOfChanges={props.numberOfChanges} | ||
/> | ||
<I18n | ||
id={variant.label.message.id} | ||
params={props} | ||
fallback={variant.label.message.fallback(props)} | ||
/> | ||
</div> | ||
</Dialog> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters