-
-
Notifications
You must be signed in to change notification settings - Fork 223
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FEATURE: Set basic visibility on workspace creation
- Loading branch information
Showing
6 changed files
with
162 additions
and
95 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
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
103 changes: 11 additions & 92 deletions
103
Neos.Workspace.Ui/Resources/Private/Fusion/Features/Workspace/Actions/New.fusion
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 |
---|---|---|
@@ -1,97 +1,16 @@ | ||
Neos.Workspace.Ui.WorkspaceController.new = Neos.Fusion:Component { | ||
/// array<string> | ||
baseWorkspaceOptions = ${baseWorkspaceOptions} | ||
workspace = ${workspace} | ||
i18n = ${I18n.id('').source('Main').package('Neos.Workspace.Ui')} | ||
popoverId = 'create-workspace-popover' | ||
|
||
prototype(Neos.Fusion.Form:LabelRenderer) { | ||
translationPackage = 'Neos.Workspace.Ui' | ||
translationSource = 'Main' | ||
renderer = Neos.Fusion:Match { | ||
@subject = ${request.httpRequest.method} | ||
# Render the create modal | ||
@default = afx` | ||
<Neos.Workspace.Ui:Component.Modal.Create | ||
baseWorkspaceOptions={props.baseWorkspaceOptions} | ||
/> | ||
` | ||
# Empty template for the delete response as the payload is contained in the HTTP headers | ||
POST = '' | ||
} | ||
|
||
prototype(Neos.Fusion.Form:Neos.BackendModule.FieldContainer) { | ||
translation.label { | ||
package = 'Neos.Workspace.Ui' | ||
source = 'Main' | ||
} | ||
} | ||
|
||
renderer = afx` | ||
<div popover id={props.popoverId}> | ||
<header> | ||
<button | ||
type="button" | ||
class="neos-close neos-button" | ||
popovertarget={props.popoverId} | ||
popovertargetaction="close" | ||
> | ||
<Neos.Workspace.Ui:Component.Icon icon="times"/> | ||
</button> | ||
<div class="neos-header"> | ||
{props.i18n.id('workspaces.createNewWorkspace')} | ||
</div> | ||
</header> | ||
<Neos.Fusion.Form:Form | ||
form.target.action="create" | ||
form.target.format="htmx" | ||
attributes.hx-post={form.getTarget()} | ||
attributes.hx-disabled-elt="find button" | ||
attributes.hx-on--after-request={'document.getElementById("' + props.popoverId + '").hidePopover()'} | ||
> | ||
<section> | ||
<fieldset> | ||
<!-- todo adjust labels to be not that nested --> | ||
<Neos.Fusion.Form:Neos.BackendModule.FieldContainer | ||
field.name="title" | ||
label="workspaces.workspace.title" | ||
class="neos-control-group" | ||
> | ||
<Neos.Fusion.Form:Textfield | ||
attributes.required | ||
attributes.pattern="/^[\p{L}\p{P}\d \.]{1,200}$/u" | ||
attributes.autofocus | ||
/> | ||
</Neos.Fusion.Form:Neos.BackendModule.FieldContainer> | ||
|
||
<Neos.Fusion.Form:Neos.BackendModule.FieldContainer | ||
field.name="description" | ||
label="workspaces.workspace.description" | ||
class="neos-control-group" | ||
> | ||
<Neos.Fusion.Form:Textfield | ||
attributes.pattern="/^[\p{L}\p{P}\d \.]{0,500}$/u" | ||
/> | ||
</Neos.Fusion.Form:Neos.BackendModule.FieldContainer> | ||
|
||
<Neos.Fusion.Form:Neos.BackendModule.FieldContainer | ||
field.name="baseWorkspace" | ||
field.value="live" | ||
label="workspaces.workspace.baseWorkspace" | ||
class="neos-control-group" | ||
> | ||
<Neos.Fusion.Form:Select> | ||
<Neos.Fusion:Loop items={props.baseWorkspaceOptions} itemName="workspaceTitle" itemKey="workspaceName"> | ||
<Neos.Fusion.Form:Select.Option | ||
option.value={workspaceName}>{workspaceTitle}</Neos.Fusion.Form:Select.Option> | ||
</Neos.Fusion:Loop> | ||
</Neos.Fusion.Form:Select> | ||
</Neos.Fusion.Form:Neos.BackendModule.FieldContainer> | ||
</fieldset> | ||
</section> | ||
<footer> | ||
<button | ||
type="button" | ||
class="neos-button" | ||
popovertarget={props.popoverId} | ||
popovertargetaction="close" | ||
> | ||
{props.i18n.id('cancel')} | ||
</button> | ||
<Neos.Fusion.Form:Button attributes.class="neos-button neos-button-primary"> | ||
{props.i18n.id('workspaces.createWorkspace')} | ||
</Neos.Fusion.Form:Button> | ||
</footer> | ||
</Neos.Fusion.Form:Form> | ||
</div> | ||
` | ||
} |
125 changes: 125 additions & 0 deletions
125
Neos.Workspace.Ui/Resources/Private/Fusion/Features/Workspace/Modals/Create.fusion
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,125 @@ | ||
prototype(Neos.Workspace.Ui:Component.Modal.Create) < prototype(Neos.Fusion:Component) { | ||
/// array<string> | ||
baseWorkspaceOptions = null | ||
|
||
@private { | ||
i18n = ${I18n.id('').source('Main').package('Neos.Workspace.Ui')} | ||
popoverId = 'create-workspace-popover' | ||
} | ||
|
||
prototype(Neos.Fusion.Form:LabelRenderer) { | ||
translationPackage = 'Neos.Workspace.Ui' | ||
translationSource = 'Main' | ||
} | ||
|
||
prototype(Neos.Fusion.Form:Neos.BackendModule.FieldContainer) { | ||
translation.label { | ||
package = 'Neos.Workspace.Ui' | ||
source = 'Main' | ||
} | ||
} | ||
|
||
renderer = afx` | ||
<div popover id={private.popoverId}> | ||
<header> | ||
<button | ||
type="button" | ||
class="neos-close neos-button" | ||
popovertarget={private.popoverId} | ||
popovertargetaction="close" | ||
> | ||
<Neos.Workspace.Ui:Component.Icon icon="times"/> | ||
</button> | ||
<div class="neos-header"> | ||
{private.i18n.id('workspaces.createNewWorkspace')} | ||
</div> | ||
</header> | ||
<Neos.Fusion.Form:Form | ||
form.target.action="create" | ||
form.target.format="htmx" | ||
attributes.hx-post={form.getTarget()} | ||
attributes.hx-disabled-elt="find button" | ||
attributes.hx-on--after-request={'document.getElementById("' + private.popoverId + '").hidePopover()'} | ||
> | ||
<section> | ||
<fieldset> | ||
<Neos.Fusion.Form:Neos.BackendModule.FieldContainer | ||
field.name="title" | ||
label="workspaces.workspace.title" | ||
class="neos-control-group" | ||
> | ||
<Neos.Fusion.Form:Textfield | ||
attributes.required | ||
attributes.pattern="/^[\p{L}\p{P}\d \.]{1,200}$/u" | ||
attributes.autofocus | ||
/> | ||
</Neos.Fusion.Form:Neos.BackendModule.FieldContainer> | ||
|
||
<Neos.Fusion.Form:Neos.BackendModule.FieldContainer | ||
field.name="description" | ||
label="workspaces.workspace.description" | ||
class="neos-control-group" | ||
> | ||
<Neos.Fusion.Form:Textfield | ||
attributes.pattern="/^[\p{L}\p{P}\d \.]{0,500}$/u" | ||
/> | ||
</Neos.Fusion.Form:Neos.BackendModule.FieldContainer> | ||
|
||
<Neos.Fusion.Form:Neos.BackendModule.FieldContainer | ||
field.name="baseWorkspace" | ||
field.value="live" | ||
label="workspaces.workspace.baseWorkspace" | ||
class="neos-control-group" | ||
> | ||
<Neos.Fusion.Form:Select> | ||
<Neos.Fusion:Loop items={props.baseWorkspaceOptions} itemName="workspaceTitle" itemKey="workspaceName"> | ||
<Neos.Fusion.Form:Select.Option | ||
option.value={workspaceName}>{workspaceTitle}</Neos.Fusion.Form:Select.Option> | ||
</Neos.Fusion:Loop> | ||
</Neos.Fusion.Form:Select> | ||
</Neos.Fusion.Form:Neos.BackendModule.FieldContainer> | ||
|
||
<Neos.Fusion.Form:Neos.BackendModule.FieldContainer | ||
label="workspaces.workspace.visibility" | ||
class="neos-control-group" | ||
> | ||
<Neos.Fusion.Form:Radio | ||
renderer.checked | ||
field.name="visibility" | ||
field.value="shared" | ||
> | ||
{private.i18n.id('workspaces.workspace.visibility.internal')} | ||
</Neos.Fusion.Form:Radio> | ||
<p> | ||
{private.i18n.id('workspaces.workspace.visibility.internal.help')} | ||
</p> | ||
<br/> | ||
<Neos.Fusion.Form:Radio | ||
field.name="visibility" | ||
field.value="private" | ||
> | ||
{private.i18n.id('workspaces.workspace.visibility.private')} | ||
</Neos.Fusion.Form:Radio> | ||
<p> | ||
{private.i18n.id('workspaces.workspace.visibility.private.help')} | ||
</p> | ||
</Neos.Fusion.Form:Neos.BackendModule.FieldContainer> | ||
</fieldset> | ||
</section> | ||
<footer> | ||
<button | ||
type="button" | ||
class="neos-button" | ||
popovertarget={private.popoverId} | ||
popovertargetaction="close" | ||
> | ||
{private.i18n.id('cancel')} | ||
</button> | ||
<Neos.Fusion.Form:Button attributes.class="neos-button neos-button-primary"> | ||
{private.i18n.id('workspaces.createWorkspace')} | ||
</Neos.Fusion.Form:Button> | ||
</footer> | ||
</Neos.Fusion.Form:Form> | ||
</div> | ||
` | ||
} |
2 changes: 2 additions & 0 deletions
2
Neos.Workspace.Ui/Resources/Private/Fusion/Features/Workspace/Modals/Delete.fusion
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