-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEmailActionButtons.fusion
107 lines (104 loc) · 4.14 KB
/
EmailActionButtons.fusion
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
prototype(Garagist.Mautic:Backend.Module.EmailActionButtons) < prototype(Neos.Fusion:Component) {
action = ${Configuration.Setting('Garagist.Mautic.action')}
detailView = false
ping = ${ping}
@if.hasPing = ${this.ping}
@private {
buttonClass = 'whitespace-nowrap neos-button !bg-neos-gray-medium '
default = 'hover:!bg-neos-blue focus:!bg-neos-blue'
canResend = ${props.action.resend && private.canResend}
actions = Neos.Fusion:DataStructure {
@if.ping = ${props.ping}
@process.filter = ${Array.filter(value)}
mailProperties = afx`
<Garagist.Mautic:Component.MailProperties
@if={props.action.edit && props.canEdit}
subject={props.subject}
previewText={props.previewText}
segments={props.segments}
class={private.buttonClass + private.default}
detailView={props.detailView}
{...props.hrefArguments}
/>
`
sendTestMail = afx`
<Garagist.Mautic:Backend.Module.SendTestMail
@if={props.action.test}
@if={props.canTest || private.canResend}
detailView={props.detailView}
{...props.hrefArguments}
/>
`
update = Neos.Fusion:DataStructure {
@if.set = ${props.action.update && props.canUpdate}
labelKey = 'email.update'
action = 'update'
icon = 'fa-sync'
type = 'warning'
}
publish = Neos.Fusion:DataStructure {
@if.set = ${props.action.publish && props.canPublish}
labelKey = 'email.publish'
action = 'publish'
icon = 'fa-upload'
}
send = afx`
<Garagist.Mautic:Backend.Module.SendMail
@if={(props.action.send && props.canSend) || private.canResend}
action='send'
resend={props.canResend}
detailView={props.detailView}
segments={props.segments}
{...props.hrefArguments}
/>
`
unpublish = Neos.Fusion:DataStructure {
@if.set = ${props.action.unpublish && props.canUnpublish}
labelKey = 'email.unpublish'
action = 'unpublish'
icon = 'fa-download'
}
publishAndSend = afx`
<Garagist.Mautic:Backend.Module.SendMail
@if={props.action.publishAndSend && props.canPublishAndSend}
action='publishAndSend'
detailView={props.detailView}
segments={props.segments}
{...props.hrefArguments}
/>
`
unpublishAndUpdate = Neos.Fusion:DataStructure {
@if.set = ${props.action.unpublishAndUpdate && props.canUnpublishAndUpdate}
labelKey = 'email.update'
action = 'unpublishAndUpdate'
icon = 'fa-sync'
}
unlock = Neos.Fusion:DataStructure {
@if.set = ${props.isFailed}
labelKey = 'task.unlock'
action = 'unlock'
type = 'warning'
icon = 'fa-unlock'
}
delete = Neos.Fusion:DataStructure {
@if.set = ${props.action.delete && props.canDelete}
labelKey = 'email.delete'
action = 'delete'
icon = 'fa-trash'
type = 'danger'
confirm = true
}
}
}
renderer = afx`
<Neos.Fusion:Loop items={private.actions}>
{Type.isString(item) ? item : ''}
<Garagist.Mautic:Backend.Block.ActionButton
@if={!Type.isString(item)}
showText={props.detailView}
actionArguments={props.hrefArguments}
{...item}
/>
</Neos.Fusion:Loop>
`
}