Skip to content

Commit 12427ab

Browse files
authored
Merge pull request #41 from Flowpack/task/add-fusion-object-for-ContentStore-actions
TASK: Add Fusion object for ContentStore actions
2 parents 2fb304c + 9e1c60c commit 12427ab

File tree

1 file changed

+66
-39
lines changed

1 file changed

+66
-39
lines changed

Resources/Private/BackendFusion/Integration/Backend.Index.fusion

Lines changed: 66 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,6 @@ Flowpack.DecoupledContentStore.BackendController.index = Neos.Fusion:Component {
1010
// - showToggleConfigEpochButton: boolean
1111

1212
renderer = Neos.Fusion:Component {
13-
_publishAllWithoutValidationUri = Neos.Fusion:UriBuilder {
14-
action = 'publishAllWithoutValidation'
15-
}
16-
17-
_pruneContentStoreUri = Neos.Fusion:UriBuilder {
18-
action = 'pruneContentStore'
19-
arguments = Neos.Fusion:DataStructure {
20-
redisInstanceIdentifier = ${contentStore}
21-
}
22-
}
23-
24-
_cancelRunningReleaseUri = Neos.Fusion:UriBuilder {
25-
action = 'cancelRunningRelease'
26-
arguments = Neos.Fusion:DataStructure {
27-
redisInstanceIdentifier = ${contentStore}
28-
}
29-
}
30-
31-
_toggleConfigEpoch = Neos.Fusion:UriBuilder {
32-
action = 'toggleConfigEpoch'
33-
arguments = Neos.Fusion:DataStructure {
34-
redisInstanceIdentifier = ${contentStore}
35-
}
36-
}
37-
3813
_renderedTableBody = Neos.Fusion:Loop {
3914
items = ${overviewData}
4015
itemRenderer = Neos.Fusion:Component {
@@ -114,20 +89,7 @@ Flowpack.DecoupledContentStore.BackendController.index = Neos.Fusion:Component {
11489
<span class="neos-badge neos-badge-info">{storeSize}</span>
11590
</div>
11691

117-
<div style="margin-top: 5rem; display: flex; gap: 1rem;">
118-
<button form="postHelper" formaction={props._publishAllWithoutValidationUri} type="submit" class="neos-button neos-button-danger">
119-
Publish all without validation
120-
</button>
121-
<button form="postHelper" formaction={props._pruneContentStoreUri} type="submit" class="neos-button neos-button-warning">
122-
Prune content store
123-
</button>
124-
<button form="postHelper" formaction={props._cancelRunningReleaseUri} type="submit" class="neos-button neos-button-warning">
125-
Cancel running release
126-
</button>
127-
<button @if.showToggleConfigEpochButton={showToggleConfigEpochButton} form="postHelper" formaction={props._toggleConfigEpoch} type="submit" class="neos-button neos-button-danger" style="margin-top: 300px;">
128-
{'Toggle config epoch: ' + toggleFromConfigEpoch + ' to ' + toggleToConfigEpoch}
129-
</button>
130-
</div>
92+
<Flowpack.DecoupledContentStore:ContentStoreActions />
13193

13294
<div class="neos-footer !h-full">
13395
<Flowpack.DecoupledContentStore:ListFooter />
@@ -138,6 +100,71 @@ Flowpack.DecoupledContentStore.BackendController.index = Neos.Fusion:Component {
138100
}
139101
}
140102

103+
prototype(Flowpack.DecoupledContentStore:ContentStoreActions) < prototype(Neos.Fusion:Join) {
104+
@process.wrap = afx`
105+
<div style="margin-top: 5rem; display: flex; gap: 1rem;">
106+
{value}
107+
</div>
108+
`
109+
110+
publishAllWithoutValidation = Neos.Fusion:Component {
111+
_publishAllWithoutValidationUri = Neos.Fusion:UriBuilder {
112+
action = 'publishAllWithoutValidation'
113+
}
114+
115+
renderer = afx`
116+
<button form="postHelper" formaction={props._publishAllWithoutValidationUri} type="submit" class="neos-button neos-button-danger">
117+
Publish all without validation
118+
</button>
119+
`
120+
}
121+
122+
pruneContentStore = Neos.Fusion:Component {
123+
_pruneContentStoreUri = Neos.Fusion:UriBuilder {
124+
action = 'pruneContentStore'
125+
arguments = Neos.Fusion:DataStructure {
126+
redisInstanceIdentifier = ${contentStore}
127+
}
128+
}
129+
130+
renderer = afx`
131+
<button form="postHelper" formaction={props._pruneContentStoreUri} type="submit" class="neos-button neos-button-warning">
132+
Prune content store
133+
</button>
134+
`
135+
}
136+
137+
cancelRunningRelease = Neos.Fusion:Component {
138+
_cancelRunningReleaseUri = Neos.Fusion:UriBuilder {
139+
action = 'cancelRunningRelease'
140+
arguments = Neos.Fusion:DataStructure {
141+
redisInstanceIdentifier = ${contentStore}
142+
}
143+
}
144+
145+
renderer = afx`
146+
<button form="postHelper" formaction={props._cancelRunningReleaseUri} type="submit" class="neos-button neos-button-warning">
147+
Cancel running release
148+
</button>
149+
`
150+
}
151+
152+
toggleConfigEpoch = Neos.Fusion:Component {
153+
_toggleConfigEpochUri = Neos.Fusion:UriBuilder {
154+
action = 'toggleConfigEpoch'
155+
arguments = Neos.Fusion:DataStructure {
156+
redisInstanceIdentifier = ${contentStore}
157+
}
158+
}
159+
160+
renderer = afx`
161+
<button @if.showToggleConfigEpochButton={showToggleConfigEpochButton} form="postHelper" formaction={props._toggleConfigEpochUri} type="submit" class="neos-button neos-button-danger" style="margin-top: 300px;">
162+
{'Toggle config epoch: ' + toggleFromConfigEpoch + ' to ' + toggleToConfigEpoch}
163+
</button>
164+
`
165+
}
166+
}
167+
141168
prototype(Flowpack.DecoupledContentStore:ListFooter) < prototype(Neos.Fusion:Join) {
142169
reload = afx`
143170
<Neos.Fusion:Link.Action href.action="index" class="neos-button">

0 commit comments

Comments
 (0)