@webiny/webhooks 6.4.0-beta.1 → 6.4.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/admin/WebhookRoutes.js +21 -3
- package/admin/WebhookRoutes.js.map +1 -1
- package/admin/Webhooks.js +11 -0
- package/admin/Webhooks.js.map +1 -1
- package/admin/features/getWebhookSettings/GetWebhookSettingsGateway.d.ts +12 -0
- package/admin/features/getWebhookSettings/GetWebhookSettingsGateway.js +40 -0
- package/admin/features/getWebhookSettings/GetWebhookSettingsGateway.js.map +1 -0
- package/admin/features/getWebhookSettings/GetWebhookSettingsUseCase.d.ts +11 -0
- package/admin/features/getWebhookSettings/GetWebhookSettingsUseCase.js +18 -0
- package/admin/features/getWebhookSettings/GetWebhookSettingsUseCase.js.map +1 -0
- package/admin/features/getWebhookSettings/abstractions.d.ts +15 -0
- package/admin/features/getWebhookSettings/abstractions.js +6 -0
- package/admin/features/getWebhookSettings/abstractions.js.map +1 -0
- package/admin/features/getWebhookSettings/feature.d.ts +3 -0
- package/admin/features/getWebhookSettings/feature.js +19 -0
- package/admin/features/getWebhookSettings/feature.js.map +1 -0
- package/admin/features/getWebhookSettings/index.d.ts +2 -0
- package/admin/features/getWebhookSettings/index.js +2 -0
- package/admin/features/updateWebhookSettings/UpdateWebhookSettingsGateway.d.ts +12 -0
- package/admin/features/updateWebhookSettings/UpdateWebhookSettingsGateway.js +43 -0
- package/admin/features/updateWebhookSettings/UpdateWebhookSettingsGateway.js.map +1 -0
- package/admin/features/updateWebhookSettings/UpdateWebhookSettingsUseCase.d.ts +11 -0
- package/admin/features/updateWebhookSettings/UpdateWebhookSettingsUseCase.js +18 -0
- package/admin/features/updateWebhookSettings/UpdateWebhookSettingsUseCase.js.map +1 -0
- package/admin/features/updateWebhookSettings/abstractions.d.ts +18 -0
- package/admin/features/updateWebhookSettings/abstractions.js +6 -0
- package/admin/features/updateWebhookSettings/abstractions.js.map +1 -0
- package/admin/features/updateWebhookSettings/feature.d.ts +3 -0
- package/admin/features/updateWebhookSettings/feature.js +19 -0
- package/admin/features/updateWebhookSettings/feature.js.map +1 -0
- package/admin/features/updateWebhookSettings/index.d.ts +2 -0
- package/admin/features/updateWebhookSettings/index.js +2 -0
- package/admin/presentation/WebhookForm/WebhookFormPresenter.d.ts +6 -2
- package/admin/presentation/WebhookForm/WebhookFormPresenter.js +87 -14
- package/admin/presentation/WebhookForm/WebhookFormPresenter.js.map +1 -1
- package/admin/presentation/WebhookForm/abstractions.d.ts +0 -4
- package/admin/presentation/WebhookForm/abstractions.js.map +1 -1
- package/admin/presentation/WebhookForm/components/WebhookFormView.js +5 -11
- package/admin/presentation/WebhookForm/components/WebhookFormView.js.map +1 -1
- package/admin/presentation/WebhookList/components/WebhookListView.js +28 -21
- package/admin/presentation/WebhookList/components/WebhookListView.js.map +1 -1
- package/admin/presentation/WebhookSettings/WebhookSettingsPresenter.d.ts +21 -0
- package/admin/presentation/WebhookSettings/WebhookSettingsPresenter.js +83 -0
- package/admin/presentation/WebhookSettings/WebhookSettingsPresenter.js.map +1 -0
- package/admin/presentation/WebhookSettings/abstractions.d.ts +16 -0
- package/admin/presentation/WebhookSettings/abstractions.js +5 -0
- package/admin/presentation/WebhookSettings/abstractions.js.map +1 -0
- package/admin/presentation/WebhookSettings/components/WebhookSettingsView.d.ts +2 -0
- package/admin/presentation/WebhookSettings/components/WebhookSettingsView.js +56 -0
- package/admin/presentation/WebhookSettings/components/WebhookSettingsView.js.map +1 -0
- package/admin/presentation/WebhookSettings/feature.d.ts +3 -0
- package/admin/presentation/WebhookSettings/feature.js +17 -0
- package/admin/presentation/WebhookSettings/feature.js.map +1 -0
- package/admin/presentation/WebhookSettings/index.d.ts +2 -0
- package/admin/presentation/WebhookSettings/index.js +2 -0
- package/admin/routes.d.ts +1 -0
- package/admin/routes.js +4 -0
- package/admin/routes.js.map +1 -1
- package/admin/shared/types.d.ts +3 -0
- package/api/WebhooksFeature.js +10 -0
- package/api/WebhooksFeature.js.map +1 -1
- package/api/domain/WebhookSettings.d.ts +3 -0
- package/api/domain/WebhookSettings.js +0 -0
- package/api/domain/constants.d.ts +1 -0
- package/api/domain/constants.js +2 -1
- package/api/domain/constants.js.map +1 -1
- package/api/domain/errors.d.ts +7 -2
- package/api/domain/errors.js +16 -3
- package/api/domain/errors.js.map +1 -1
- package/api/features/CreateWebhook/CreateWebhookUseCase.d.ts +3 -3
- package/api/features/CreateWebhook/CreateWebhookUseCase.js +10 -19
- package/api/features/CreateWebhook/CreateWebhookUseCase.js.map +1 -1
- package/api/features/CreateWebhook/abstractions.d.ts +1 -1
- package/api/features/CreateWebhook/abstractions.js.map +1 -1
- package/api/features/CreateWebhook/schema.d.ts +10 -0
- package/api/features/CreateWebhook/schema.js +16 -0
- package/api/features/CreateWebhook/schema.js.map +1 -0
- package/api/features/DeleteWebhook/DeleteWebhookUseCase.d.ts +3 -3
- package/api/features/DeleteWebhook/DeleteWebhookUseCase.js +8 -3
- package/api/features/DeleteWebhook/DeleteWebhookUseCase.js.map +1 -1
- package/api/features/DeleteWebhook/abstractions.d.ts +2 -2
- package/api/features/DeleteWebhook/abstractions.js.map +1 -1
- package/api/features/DeleteWebhook/schema.d.ts +4 -0
- package/api/features/DeleteWebhook/schema.js +7 -0
- package/api/features/DeleteWebhook/schema.js.map +1 -0
- package/api/features/GetWebhook/GetWebhookUseCase.d.ts +2 -2
- package/api/features/GetWebhook/GetWebhookUseCase.js +7 -2
- package/api/features/GetWebhook/GetWebhookUseCase.js.map +1 -1
- package/api/features/GetWebhook/abstractions.d.ts +2 -2
- package/api/features/GetWebhook/abstractions.js.map +1 -1
- package/api/features/GetWebhook/schema.d.ts +4 -0
- package/api/features/GetWebhook/schema.js +7 -0
- package/api/features/GetWebhook/schema.js.map +1 -0
- package/api/features/GetWebhookDelivery/GetWebhookDeliveryUseCase.d.ts +2 -2
- package/api/features/GetWebhookDelivery/GetWebhookDeliveryUseCase.js +7 -2
- package/api/features/GetWebhookDelivery/GetWebhookDeliveryUseCase.js.map +1 -1
- package/api/features/GetWebhookDelivery/abstractions.d.ts +2 -2
- package/api/features/GetWebhookDelivery/abstractions.js.map +1 -1
- package/api/features/GetWebhookDelivery/schema.d.ts +4 -0
- package/api/features/GetWebhookDelivery/schema.js +7 -0
- package/api/features/GetWebhookDelivery/schema.js.map +1 -0
- package/api/features/GetWebhookSettings/GetWebhookSettingsRepository.d.ts +19 -0
- package/api/features/GetWebhookSettings/GetWebhookSettingsRepository.js +55 -0
- package/api/features/GetWebhookSettings/GetWebhookSettingsRepository.js.map +1 -0
- package/api/features/GetWebhookSettings/abstractions.d.ts +13 -0
- package/api/features/GetWebhookSettings/abstractions.js +5 -0
- package/api/features/GetWebhookSettings/abstractions.js.map +1 -0
- package/api/features/GetWebhookSettings/feature.d.ts +4 -0
- package/api/features/GetWebhookSettings/feature.js +11 -0
- package/api/features/GetWebhookSettings/feature.js.map +1 -0
- package/api/features/ListWebhookDeliveries/ListWebhookDeliveriesUseCase.d.ts +2 -2
- package/api/features/ListWebhookDeliveries/ListWebhookDeliveriesUseCase.js +4 -1
- package/api/features/ListWebhookDeliveries/ListWebhookDeliveriesUseCase.js.map +1 -1
- package/api/features/ListWebhookDeliveries/abstractions.d.ts +2 -2
- package/api/features/ListWebhookDeliveries/abstractions.js.map +1 -1
- package/api/features/ListWebhookDeliveries/schema.d.ts +7 -0
- package/api/features/ListWebhookDeliveries/schema.js +10 -0
- package/api/features/ListWebhookDeliveries/schema.js.map +1 -0
- package/api/features/ListWebhooks/ListWebhooksUseCase.d.ts +2 -2
- package/api/features/ListWebhooks/ListWebhooksUseCase.js +4 -1
- package/api/features/ListWebhooks/ListWebhooksUseCase.js.map +1 -1
- package/api/features/ListWebhooks/abstractions.d.ts +2 -2
- package/api/features/ListWebhooks/abstractions.js.map +1 -1
- package/api/features/ListWebhooks/schema.d.ts +7 -0
- package/api/features/ListWebhooks/schema.js +10 -0
- package/api/features/ListWebhooks/schema.js.map +1 -0
- package/api/features/ResendWebhookDelivery/ResendWebhookDeliveryUseCase.d.ts +5 -5
- package/api/features/ResendWebhookDelivery/ResendWebhookDeliveryUseCase.js +7 -2
- package/api/features/ResendWebhookDelivery/ResendWebhookDeliveryUseCase.js.map +1 -1
- package/api/features/ResendWebhookDelivery/abstractions.d.ts +2 -2
- package/api/features/ResendWebhookDelivery/abstractions.js.map +1 -1
- package/api/features/ResendWebhookDelivery/schema.d.ts +4 -0
- package/api/features/ResendWebhookDelivery/schema.js +7 -0
- package/api/features/ResendWebhookDelivery/schema.js.map +1 -0
- package/api/features/SendWebhookTask/SendWebhookTask.d.ts +6 -2
- package/api/features/SendWebhookTask/SendWebhookTask.js +45 -33
- package/api/features/SendWebhookTask/SendWebhookTask.js.map +1 -1
- package/api/features/SendWebhookTask/types.d.ts +1 -0
- package/api/features/TriggerWebhook/TriggerWebhookUseCase.js +8 -2
- package/api/features/TriggerWebhook/TriggerWebhookUseCase.js.map +1 -1
- package/api/features/TriggerWebhook/abstractions.d.ts +2 -2
- package/api/features/TriggerWebhook/abstractions.js.map +1 -1
- package/api/features/TriggerWebhook/schema.d.ts +5 -0
- package/api/features/TriggerWebhook/schema.js +8 -0
- package/api/features/TriggerWebhook/schema.js.map +1 -0
- package/api/features/UpdateWebhook/UpdateWebhookUseCase.d.ts +4 -4
- package/api/features/UpdateWebhook/UpdateWebhookUseCase.js +9 -33
- package/api/features/UpdateWebhook/UpdateWebhookUseCase.js.map +1 -1
- package/api/features/UpdateWebhook/abstractions.d.ts +0 -1
- package/api/features/UpdateWebhook/abstractions.js.map +1 -1
- package/api/features/UpdateWebhook/schema.d.ts +9 -0
- package/api/features/UpdateWebhook/schema.js +15 -0
- package/api/features/UpdateWebhook/schema.js.map +1 -0
- package/api/features/UpdateWebhookSettings/UpdateWebhookSettingsRepository.d.ts +21 -0
- package/api/features/UpdateWebhookSettings/UpdateWebhookSettingsRepository.js +60 -0
- package/api/features/UpdateWebhookSettings/UpdateWebhookSettingsRepository.js.map +1 -0
- package/api/features/UpdateWebhookSettings/UpdateWebhookSettingsUseCase.d.ts +14 -0
- package/api/features/UpdateWebhookSettings/UpdateWebhookSettingsUseCase.js +27 -0
- package/api/features/UpdateWebhookSettings/UpdateWebhookSettingsUseCase.js.map +1 -0
- package/api/features/UpdateWebhookSettings/abstractions.d.ts +26 -0
- package/api/features/UpdateWebhookSettings/abstractions.js +6 -0
- package/api/features/UpdateWebhookSettings/abstractions.js.map +1 -0
- package/api/features/UpdateWebhookSettings/feature.d.ts +4 -0
- package/api/features/UpdateWebhookSettings/feature.js +13 -0
- package/api/features/UpdateWebhookSettings/feature.js.map +1 -0
- package/api/features/UpdateWebhookSettings/schema.d.ts +4 -0
- package/api/features/UpdateWebhookSettings/schema.js +7 -0
- package/api/features/UpdateWebhookSettings/schema.js.map +1 -0
- package/api/features/WebhookDeliver/WebhookDeliver.d.ts +13 -0
- package/api/features/WebhookDeliver/WebhookDeliver.js +79 -0
- package/api/features/WebhookDeliver/WebhookDeliver.js.map +1 -0
- package/api/features/WebhookDeliver/abstractions.d.ts +24 -0
- package/api/features/WebhookDeliver/abstractions.js +5 -0
- package/api/features/WebhookDeliver/abstractions.js.map +1 -0
- package/api/features/WebhookDeliver/feature.d.ts +4 -0
- package/api/features/WebhookDeliver/feature.js +11 -0
- package/api/features/WebhookDeliver/feature.js.map +1 -0
- package/api/features/WebhookDeliver/index.d.ts +2 -0
- package/api/features/WebhookDeliver/index.js +2 -0
- package/api/features/WebhookSignPayload/WebhookSignPayload.d.ts +1 -0
- package/api/features/WebhookSignPayload/WebhookSignPayload.js +7 -1
- package/api/features/WebhookSignPayload/WebhookSignPayload.js.map +1 -1
- package/api/graphql/WebhookCrudSchema.js +1 -2
- package/api/graphql/WebhookCrudSchema.js.map +1 -1
- package/api/graphql/WebhookEventSchema.js +1 -0
- package/api/graphql/WebhookEventSchema.js.map +1 -1
- package/api/graphql/WebhookSettingsSchema.d.ts +8 -0
- package/api/graphql/WebhookSettingsSchema.js +60 -0
- package/api/graphql/WebhookSettingsSchema.js.map +1 -0
- package/api/models/WebhookDeliveryModel.js +4 -4
- package/api/models/WebhookDeliveryModel.js.map +1 -1
- package/api/models/WebhookModel.js +1 -1
- package/api/models/WebhookModel.js.map +1 -1
- package/api/models/WebhookSettingsModel.d.ts +8 -0
- package/api/models/WebhookSettingsModel.js +27 -0
- package/api/models/WebhookSettingsModel.js.map +1 -0
- package/api/utils/isValidEndpointUrl.d.ts +1 -0
- package/api/utils/isValidEndpointUrl.js +13 -0
- package/api/utils/isValidEndpointUrl.js.map +1 -0
- package/exports/api/webhooks.d.ts +0 -1
- package/exports/api/webhooks.js +0 -1
- package/package.json +22 -20
- package/admin/SecurityPermission.d.ts +0 -2
- package/admin/SecurityPermission.js +0 -15
- package/admin/SecurityPermission.js.map +0 -1
- package/admin/presentation/WebhookForm/components/EventsSelector.d.ts +0 -12
- package/admin/presentation/WebhookForm/components/EventsSelector.js +0 -44
- package/admin/presentation/WebhookForm/components/EventsSelector.js.map +0 -1
|
@@ -15,13 +15,11 @@ class WebhookFormPresenterImpl {
|
|
|
15
15
|
isNew: this._isNew,
|
|
16
16
|
webhook: this._webhook,
|
|
17
17
|
showDeliveries: this._showDeliveries,
|
|
18
|
-
availableEvents: this._availableEvents,
|
|
19
18
|
permissions: {
|
|
20
19
|
canEdit: this.permissions.canEdit("webhook"),
|
|
21
20
|
canDelete: this.permissions.canDelete("webhook")
|
|
22
21
|
},
|
|
23
|
-
form: this._form.vm
|
|
24
|
-
selectedEvents: Array.from(this._selectedEvents)
|
|
22
|
+
form: this._form.vm
|
|
25
23
|
};
|
|
26
24
|
}
|
|
27
25
|
constructor(formModelFactory, getWebhookUseCase, createWebhookUseCase, updateWebhookUseCase, deleteWebhookUseCase, listAvailableEventsUseCase, permissions){
|
|
@@ -37,9 +35,9 @@ class WebhookFormPresenterImpl {
|
|
|
37
35
|
this._isNew = false;
|
|
38
36
|
this._webhook = null;
|
|
39
37
|
this._showDeliveries = false;
|
|
40
|
-
this._availableEvents = [];
|
|
41
38
|
this._webhookId = null;
|
|
42
|
-
this.
|
|
39
|
+
this._eventFieldNames = [];
|
|
40
|
+
this._eventGroups = new Map();
|
|
43
41
|
this.actions = {
|
|
44
42
|
save: async ()=>{
|
|
45
43
|
const data = await this._form.submit();
|
|
@@ -52,7 +50,7 @@ class WebhookFormPresenterImpl {
|
|
|
52
50
|
endpointUrl: data.endpointUrl,
|
|
53
51
|
description: data.description || void 0,
|
|
54
52
|
enabled: data.enabled,
|
|
55
|
-
events:
|
|
53
|
+
events: this.collectEvents()
|
|
56
54
|
};
|
|
57
55
|
if (this._isNew) {
|
|
58
56
|
const created = await this.createWebhookUseCase.execute(merged);
|
|
@@ -83,10 +81,6 @@ class WebhookFormPresenterImpl {
|
|
|
83
81
|
},
|
|
84
82
|
closeDeliveries: ()=>{
|
|
85
83
|
this._showDeliveries = false;
|
|
86
|
-
},
|
|
87
|
-
toggleEvent: (eventName)=>{
|
|
88
|
-
if (this._selectedEvents.has(eventName)) this._selectedEvents.delete(eventName);
|
|
89
|
-
else this._selectedEvents.add(eventName);
|
|
90
84
|
}
|
|
91
85
|
};
|
|
92
86
|
this._form = this.buildForm();
|
|
@@ -98,7 +92,10 @@ class WebhookFormPresenterImpl {
|
|
|
98
92
|
return this.formModelFactory.create({
|
|
99
93
|
fields: (fields)=>({
|
|
100
94
|
name: fields.text().label("Name").required("Name is required"),
|
|
101
|
-
slug: fields.text().label("Slug").required("Slug is required")
|
|
95
|
+
slug: fields.text().label("Slug").required("Slug is required").computedUntilDirty((form)=>{
|
|
96
|
+
const name = String(form.field("name").getValue() ?? "");
|
|
97
|
+
return name.trim().toLowerCase().replace(/[^a-z0-9\s-]/g, "").replace(/\s+/g, "-");
|
|
98
|
+
}),
|
|
102
99
|
endpointUrl: fields.text().label("Endpoint URL").required("Endpoint URL is required").placeholder("https://"),
|
|
103
100
|
description: fields.text().label("Description").renderer("textarea"),
|
|
104
101
|
enabled: fields.boolean().label("Enabled").defaultValue(false)
|
|
@@ -111,6 +108,82 @@ class WebhookFormPresenterImpl {
|
|
|
111
108
|
]
|
|
112
109
|
});
|
|
113
110
|
}
|
|
111
|
+
eventFieldName(app) {
|
|
112
|
+
const slug = app.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_|_$/g, "");
|
|
113
|
+
return `events_${slug}`;
|
|
114
|
+
}
|
|
115
|
+
addEventFields(events) {
|
|
116
|
+
const grouped = new Map();
|
|
117
|
+
for (const event of events){
|
|
118
|
+
const existing = grouped.get(event.appLabel) ?? [];
|
|
119
|
+
existing.push(event);
|
|
120
|
+
grouped.set(event.appLabel, existing);
|
|
121
|
+
}
|
|
122
|
+
this._eventGroups = grouped;
|
|
123
|
+
this._eventFieldNames = [];
|
|
124
|
+
this._form.fields((fields)=>{
|
|
125
|
+
const result = {};
|
|
126
|
+
for (const [app, appEvents] of grouped){
|
|
127
|
+
const fieldName = this.eventFieldName(app);
|
|
128
|
+
this._eventFieldNames.push(fieldName);
|
|
129
|
+
result[fieldName] = fields.object().label(app).renderer("objectAccordionSingle").fields((f)=>({
|
|
130
|
+
selected: f.text().list().options(appEvents.map((e)=>({
|
|
131
|
+
label: e.label,
|
|
132
|
+
value: e.eventName
|
|
133
|
+
}))).renderer("checkboxes")
|
|
134
|
+
}));
|
|
135
|
+
}
|
|
136
|
+
return result;
|
|
137
|
+
});
|
|
138
|
+
this._form.setLayout((layout)=>[
|
|
139
|
+
layout.row("name", "slug"),
|
|
140
|
+
layout.row("endpointUrl"),
|
|
141
|
+
layout.row("description"),
|
|
142
|
+
layout.row("enabled"),
|
|
143
|
+
layout.separator(),
|
|
144
|
+
...this._eventFieldNames.map((name)=>layout.object(name, (inner)=>[
|
|
145
|
+
inner.row("selected")
|
|
146
|
+
]))
|
|
147
|
+
]);
|
|
148
|
+
this._form.addRule((form)=>{
|
|
149
|
+
if (0 === this._eventFieldNames.length) return [];
|
|
150
|
+
for (const fieldName of this._eventFieldNames){
|
|
151
|
+
const objectField = form.field(fieldName).as("object");
|
|
152
|
+
const selectedField = objectField.children.get("selected");
|
|
153
|
+
if (!selectedField) continue;
|
|
154
|
+
const values = selectedField.getValue();
|
|
155
|
+
if (values && values.length > 0) return [];
|
|
156
|
+
}
|
|
157
|
+
return [
|
|
158
|
+
{
|
|
159
|
+
path: "Events",
|
|
160
|
+
message: "At least one event must be selected."
|
|
161
|
+
}
|
|
162
|
+
];
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
collectEvents() {
|
|
166
|
+
const allEvents = [];
|
|
167
|
+
for (const fieldName of this._eventFieldNames){
|
|
168
|
+
const objectField = this._form.field(fieldName).as("object");
|
|
169
|
+
const selectedField = objectField.children.get("selected");
|
|
170
|
+
if (!selectedField) continue;
|
|
171
|
+
const values = selectedField.getValue();
|
|
172
|
+
if (values && values.length > 0) allEvents.push(...values);
|
|
173
|
+
}
|
|
174
|
+
return allEvents;
|
|
175
|
+
}
|
|
176
|
+
distributeEvents(webhookEvents) {
|
|
177
|
+
const eventSet = new Set(webhookEvents);
|
|
178
|
+
for (const [app, appEvents] of this._eventGroups){
|
|
179
|
+
const fieldName = this.eventFieldName(app);
|
|
180
|
+
const objectField = this._form.field(fieldName).as("object");
|
|
181
|
+
const selectedField = objectField.children.get("selected");
|
|
182
|
+
if (!selectedField) continue;
|
|
183
|
+
const selected = appEvents.filter((e)=>eventSet.has(e.eventName)).map((e)=>e.eventName);
|
|
184
|
+
selectedField.setValue(selected);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
114
187
|
async init(id) {
|
|
115
188
|
this._loading = true;
|
|
116
189
|
this._isNew = "new" === id;
|
|
@@ -119,8 +192,8 @@ class WebhookFormPresenterImpl {
|
|
|
119
192
|
if (this._isNew) {
|
|
120
193
|
const events = await eventsPromise;
|
|
121
194
|
runInAction(()=>{
|
|
122
|
-
this._availableEvents = events;
|
|
123
195
|
this._form = this.buildForm();
|
|
196
|
+
this.addEventFields(events);
|
|
124
197
|
this._loading = false;
|
|
125
198
|
});
|
|
126
199
|
} else {
|
|
@@ -130,8 +203,8 @@ class WebhookFormPresenterImpl {
|
|
|
130
203
|
]);
|
|
131
204
|
runInAction(()=>{
|
|
132
205
|
this._webhook = webhook;
|
|
133
|
-
this._availableEvents = events;
|
|
134
206
|
this._form = this.buildForm();
|
|
207
|
+
this.addEventFields(events);
|
|
135
208
|
this._form.setData({
|
|
136
209
|
name: webhook.name,
|
|
137
210
|
slug: webhook.slug,
|
|
@@ -140,7 +213,7 @@ class WebhookFormPresenterImpl {
|
|
|
140
213
|
enabled: webhook.enabled
|
|
141
214
|
});
|
|
142
215
|
this._form.field("slug").setDisabled(true);
|
|
143
|
-
this.
|
|
216
|
+
this.distributeEvents(webhook.events);
|
|
144
217
|
this._loading = false;
|
|
145
218
|
});
|
|
146
219
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin/presentation/WebhookForm/WebhookFormPresenter.js","sources":["../../../../src/admin/presentation/WebhookForm/WebhookFormPresenter.ts"],"sourcesContent":["import { computed, makeAutoObservable, runInAction } from \"mobx\";\nimport type { Webhook } from \"~/admin/shared/types.js\";\nimport type { WebhookEvent } from \"~/admin/shared/types.js\";\nimport {\n WebhookFormPresenter as Abstraction,\n type IWebhookFormPresenter,\n type IWebhookFormViewModel,\n type IWebhookFormActions\n} from \"./abstractions.js\";\nimport { GetWebhookUseCase } from \"~/admin/features/getWebhook/abstractions.js\";\nimport { CreateWebhookUseCase } from \"~/admin/features/createWebhook/abstractions.js\";\nimport { UpdateWebhookUseCase } from \"~/admin/features/updateWebhook/abstractions.js\";\nimport { DeleteWebhookUseCase } from \"~/admin/features/deleteWebhook/abstractions.js\";\nimport { ListAvailableEventsUseCase } from \"~/admin/features/listAvailableEvents/abstractions.js\";\nimport { WebhookPermissions } from \"~/admin/features/permissions/abstractions.js\";\nimport {\n FormModelFactory,\n type IFormModel\n} from \"@webiny/app-admin/features/formModel/abstractions.js\";\n\nclass WebhookFormPresenterImpl implements IWebhookFormPresenter {\n private _loading = false;\n private _saving = false;\n private _isNew = false;\n private _webhook: Webhook | null = null;\n private _showDeliveries = false;\n private _availableEvents: WebhookEvent[] = [];\n private _webhookId: string | null = null;\n private _form;\n private _selectedEvents: Set<string> = new Set();\n\n public get vm(): IWebhookFormViewModel {\n return {\n loading: this._loading,\n saving: this._saving,\n isNew: this._isNew,\n webhook: this._webhook,\n showDeliveries: this._showDeliveries,\n availableEvents: this._availableEvents,\n permissions: {\n canEdit: this.permissions.canEdit(\"webhook\"),\n canDelete: this.permissions.canDelete(\"webhook\")\n },\n form: this._form.vm,\n selectedEvents: Array.from(this._selectedEvents)\n };\n }\n\n public constructor(\n private readonly formModelFactory: FormModelFactory.Interface,\n private readonly getWebhookUseCase: GetWebhookUseCase.Interface,\n private readonly createWebhookUseCase: CreateWebhookUseCase.Interface,\n private readonly updateWebhookUseCase: UpdateWebhookUseCase.Interface,\n private readonly deleteWebhookUseCase: DeleteWebhookUseCase.Interface,\n private readonly listAvailableEventsUseCase: ListAvailableEventsUseCase.Interface,\n private readonly permissions: WebhookPermissions.Interface\n ) {\n this._form = this.buildForm();\n\n makeAutoObservable(this, { vm: computed });\n }\n\n private buildForm(): IFormModel {\n return this.formModelFactory.create({\n fields: fields => ({\n name: fields.text().label(\"Name\").required(\"Name is required\"),\n slug: fields.text().label(\"Slug\").required(\"Slug is required\"),\n endpointUrl: fields\n .text()\n .label(\"Endpoint URL\")\n .required(\"Endpoint URL is required\")\n .placeholder(\"https://\"),\n description: fields.text().label(\"Description\").renderer(\"textarea\"),\n enabled: fields.boolean().label(\"Enabled\").defaultValue(false)\n }),\n layout: layout => [\n layout.row(\"name\", \"slug\"),\n layout.row(\"endpointUrl\"),\n layout.row(\"description\"),\n layout.row(\"enabled\")\n ]\n });\n }\n\n public actions: IWebhookFormActions = {\n save: async () => {\n const data = await this._form.submit<Record<string, unknown>>();\n if (data === false) {\n return;\n }\n\n this._saving = true;\n\n try {\n const merged = {\n name: data.name as string,\n slug: data.slug as string,\n endpointUrl: data.endpointUrl as string,\n description: (data.description as string) || undefined,\n enabled: data.enabled as boolean,\n events: Array.from(this._selectedEvents)\n };\n\n if (this._isNew) {\n const created = await this.createWebhookUseCase.execute(merged);\n\n runInAction(() => {\n this._webhook = created;\n this._webhookId = created.id;\n this._isNew = false;\n this._form.field(\"slug\").setDisabled(true);\n });\n } else {\n const updated = await this.updateWebhookUseCase.execute(\n this._webhookId!,\n merged\n );\n\n runInAction(() => {\n this._webhook = updated;\n });\n }\n } finally {\n runInAction(() => {\n this._saving = false;\n });\n }\n },\n deleteWebhook: async () => {\n if (!this._webhookId || this._isNew) {\n return;\n }\n await this.deleteWebhookUseCase.execute(this._webhookId);\n },\n openDeliveries: () => {\n this._showDeliveries = true;\n },\n closeDeliveries: () => {\n this._showDeliveries = false;\n },\n toggleEvent: (eventName: string) => {\n if (this._selectedEvents.has(eventName)) {\n this._selectedEvents.delete(eventName);\n } else {\n this._selectedEvents.add(eventName);\n }\n }\n };\n\n public async init(id: string): Promise<void> {\n this._loading = true;\n this._isNew = id === \"new\";\n this._webhookId = id === \"new\" ? null : id;\n\n const eventsPromise = this.listAvailableEventsUseCase.execute();\n\n if (!this._isNew) {\n const [webhook, events] = await Promise.all([\n this.getWebhookUseCase.execute(id),\n eventsPromise\n ]);\n\n runInAction(() => {\n this._webhook = webhook;\n this._availableEvents = events;\n this._form = this.buildForm();\n this._form.setData({\n name: webhook.name,\n slug: webhook.slug,\n endpointUrl: webhook.endpointUrl,\n description: webhook.description ?? \"\",\n enabled: webhook.enabled\n });\n this._form.field(\"slug\").setDisabled(true);\n this._selectedEvents = new Set(webhook.events);\n this._loading = false;\n });\n } else {\n const events = await eventsPromise;\n\n runInAction(() => {\n this._availableEvents = events;\n this._form = this.buildForm();\n this._loading = false;\n });\n }\n }\n}\n\nexport const WebhookFormPresenter = Abstraction.createImplementation({\n implementation: WebhookFormPresenterImpl,\n dependencies: [\n FormModelFactory,\n GetWebhookUseCase,\n CreateWebhookUseCase,\n UpdateWebhookUseCase,\n DeleteWebhookUseCase,\n ListAvailableEventsUseCase,\n WebhookPermissions\n ]\n});\n"],"names":["WebhookFormPresenterImpl","Array","formModelFactory","getWebhookUseCase","createWebhookUseCase","updateWebhookUseCase","deleteWebhookUseCase","listAvailableEventsUseCase","permissions","Set","data","merged","undefined","created","runInAction","updated","eventName","makeAutoObservable","computed","fields","layout","id","eventsPromise","events","webhook","Promise","WebhookFormPresenter","Abstraction","FormModelFactory","GetWebhookUseCase","CreateWebhookUseCase","UpdateWebhookUseCase","DeleteWebhookUseCase","ListAvailableEventsUseCase","WebhookPermissions"],"mappings":";;;;;;;;;AAoBA,MAAMA;IAWF,IAAW,KAA4B;QACnC,OAAO;YACH,SAAS,IAAI,CAAC,QAAQ;YACtB,QAAQ,IAAI,CAAC,OAAO;YACpB,OAAO,IAAI,CAAC,MAAM;YAClB,SAAS,IAAI,CAAC,QAAQ;YACtB,gBAAgB,IAAI,CAAC,eAAe;YACpC,iBAAiB,IAAI,CAAC,gBAAgB;YACtC,aAAa;gBACT,SAAS,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC;gBAClC,WAAW,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC;YAC1C;YACA,MAAM,IAAI,CAAC,KAAK,CAAC,EAAE;YACnB,gBAAgBC,MAAM,IAAI,CAAC,IAAI,CAAC,eAAe;QACnD;IACJ;IAEA,YACqBC,gBAA4C,EAC5CC,iBAA8C,EAC9CC,oBAAoD,EACpDC,oBAAoD,EACpDC,oBAAoD,EACpDC,0BAAgE,EAChEC,WAAyC,CAC5D;aAPmBN,gBAAgB,GAAhBA;aACAC,iBAAiB,GAAjBA;aACAC,oBAAoB,GAApBA;aACAC,oBAAoB,GAApBA;aACAC,oBAAoB,GAApBA;aACAC,0BAA0B,GAA1BA;aACAC,WAAW,GAAXA;aAlCb,QAAQ,GAAG;aACX,OAAO,GAAG;aACV,MAAM,GAAG;aACT,QAAQ,GAAmB;aAC3B,eAAe,GAAG;aAClB,gBAAgB,GAAmB,EAAE;aACrC,UAAU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AAC,QAAQ,GAAG;YACpB;QACJ,OA7BkB;YACd,MAAM,CAACC,SAASD,OAAO,GAAG,MAAME,QAAQ,GAAG,CAAC;gBACxC,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAACJ;gBAC/BC;aACH;YAEDR,YAAY;gBACR,IAAI,CAAC,QAAQ,GAAGU;gBAChB,IAAI,CAAC,gBAAgB,GAAGD;gBACxB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,SAAS;gBAC3B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;oBACf,MAAMC,QAAQ,IAAI;oBAClB,MAAMA,QAAQ,IAAI;oBAClB,aAAaA,QAAQ,WAAW;oBAChC,aAAaA,QAAQ,WAAW,IAAI;oBACpC,SAASA,QAAQ,OAAO;gBAC5B;gBACA,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,WAAW,CAAC;gBACrC,IAAI,CAAC,eAAe,GAAG,IAAIf,IAAIe,QAAQ,MAAM;gBAC7C,IAAI,CAAC,QAAQ,GAAG;YACpB;QACJ;IASJ;AACJ;AAEO,MAAME,4CAAuBC,qBAAAA,oBAAgC,CAAC;IACjE,gBAAgB3B;IAChB,cAAc;QACV4B;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;KACH;AACL"}
|
|
1
|
+
{"version":3,"file":"admin/presentation/WebhookForm/WebhookFormPresenter.js","sources":["../../../../src/admin/presentation/WebhookForm/WebhookFormPresenter.ts"],"sourcesContent":["import { computed, makeAutoObservable, runInAction } from \"mobx\";\nimport type { Webhook } from \"~/admin/shared/types.js\";\nimport type { WebhookEvent } from \"~/admin/shared/types.js\";\nimport {\n WebhookFormPresenter as Abstraction,\n type IWebhookFormPresenter,\n type IWebhookFormViewModel,\n type IWebhookFormActions\n} from \"./abstractions.js\";\nimport { GetWebhookUseCase } from \"~/admin/features/getWebhook/abstractions.js\";\nimport { CreateWebhookUseCase } from \"~/admin/features/createWebhook/abstractions.js\";\nimport { UpdateWebhookUseCase } from \"~/admin/features/updateWebhook/abstractions.js\";\nimport { DeleteWebhookUseCase } from \"~/admin/features/deleteWebhook/abstractions.js\";\nimport { ListAvailableEventsUseCase } from \"~/admin/features/listAvailableEvents/abstractions.js\";\nimport { WebhookPermissions } from \"~/admin/features/permissions/abstractions.js\";\nimport {\n FormModelFactory,\n type IFormModel\n} from \"@webiny/app-admin/features/formModel/abstractions.js\";\n\nclass WebhookFormPresenterImpl implements IWebhookFormPresenter {\n private _loading = false;\n private _saving = false;\n private _isNew = false;\n private _webhook: Webhook | null = null;\n private _showDeliveries = false;\n private _webhookId: string | null = null;\n private _form: IFormModel;\n private _eventFieldNames: string[] = [];\n private _eventGroups: Map<string, WebhookEvent[]> = new Map();\n\n public get vm(): IWebhookFormViewModel {\n return {\n loading: this._loading,\n saving: this._saving,\n isNew: this._isNew,\n webhook: this._webhook,\n showDeliveries: this._showDeliveries,\n permissions: {\n canEdit: this.permissions.canEdit(\"webhook\"),\n canDelete: this.permissions.canDelete(\"webhook\")\n },\n form: this._form.vm\n };\n }\n\n public constructor(\n private readonly formModelFactory: FormModelFactory.Interface,\n private readonly getWebhookUseCase: GetWebhookUseCase.Interface,\n private readonly createWebhookUseCase: CreateWebhookUseCase.Interface,\n private readonly updateWebhookUseCase: UpdateWebhookUseCase.Interface,\n private readonly deleteWebhookUseCase: DeleteWebhookUseCase.Interface,\n private readonly listAvailableEventsUseCase: ListAvailableEventsUseCase.Interface,\n private readonly permissions: WebhookPermissions.Interface\n ) {\n this._form = this.buildForm();\n\n makeAutoObservable(this, { vm: computed });\n }\n\n private buildForm(): IFormModel {\n return this.formModelFactory.create({\n fields: fields => ({\n name: fields.text().label(\"Name\").required(\"Name is required\"),\n slug: fields\n .text()\n .label(\"Slug\")\n .required(\"Slug is required\")\n .computedUntilDirty(form => {\n const name = String(form.field(\"name\").getValue() ?? \"\");\n return name\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9\\s-]/g, \"\")\n .replace(/\\s+/g, \"-\");\n }),\n endpointUrl: fields\n .text()\n .label(\"Endpoint URL\")\n .required(\"Endpoint URL is required\")\n .placeholder(\"https://\"),\n description: fields.text().label(\"Description\").renderer(\"textarea\"),\n enabled: fields.boolean().label(\"Enabled\").defaultValue(false)\n }),\n layout: layout => [\n layout.row(\"name\", \"slug\"),\n layout.row(\"endpointUrl\"),\n layout.row(\"description\"),\n layout.row(\"enabled\")\n ]\n });\n }\n\n private eventFieldName(app: string): string {\n const slug = app\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, \"_\")\n .replace(/^_|_$/g, \"\");\n return `events_${slug}`;\n }\n\n private addEventFields(events: WebhookEvent[]): void {\n const grouped = new Map<string, WebhookEvent[]>();\n for (const event of events) {\n const existing = grouped.get(event.appLabel) ?? [];\n existing.push(event);\n grouped.set(event.appLabel, existing);\n }\n\n this._eventGroups = grouped;\n this._eventFieldNames = [];\n\n this._form.fields(fields => {\n const result: Record<string, ReturnType<typeof fields.object>> = {};\n\n for (const [app, appEvents] of grouped) {\n const fieldName = this.eventFieldName(app);\n this._eventFieldNames.push(fieldName);\n\n result[fieldName] = fields\n .object()\n .label(app)\n .renderer(\"objectAccordionSingle\")\n .fields(f => {\n return {\n selected: f\n .text()\n .list()\n .options(\n appEvents.map(e => ({\n label: e.label,\n value: e.eventName\n }))\n )\n .renderer(\"checkboxes\")\n };\n });\n }\n\n return result;\n });\n\n this._form.setLayout(layout => [\n layout.row(\"name\", \"slug\"),\n layout.row(\"endpointUrl\"),\n layout.row(\"description\"),\n layout.row(\"enabled\"),\n layout.separator(),\n ...this._eventFieldNames.map(name =>\n layout.object(name, inner => [inner.row(\"selected\")])\n )\n ]);\n\n this._form.addRule(form => {\n if (this._eventFieldNames.length === 0) {\n return [];\n }\n for (const fieldName of this._eventFieldNames) {\n const objectField = form.field(fieldName).as(\"object\");\n const selectedField = objectField.children.get(\"selected\");\n if (!selectedField) {\n continue;\n }\n const values = selectedField.getValue<string[]>();\n if (values && values.length > 0) {\n return [];\n }\n }\n\n return [{ path: \"Events\", message: \"At least one event must be selected.\" }];\n });\n }\n\n private collectEvents(): string[] {\n const allEvents: string[] = [];\n\n for (const fieldName of this._eventFieldNames) {\n const objectField = this._form.field(fieldName).as(\"object\");\n const selectedField = objectField.children.get(\"selected\");\n if (!selectedField) {\n continue;\n }\n const values = selectedField.getValue<string[]>();\n if (values && values.length > 0) {\n allEvents.push(...values);\n }\n }\n\n return allEvents;\n }\n\n private distributeEvents(webhookEvents: string[]): void {\n const eventSet = new Set(webhookEvents);\n\n for (const [app, appEvents] of this._eventGroups) {\n const fieldName = this.eventFieldName(app);\n const objectField = this._form.field(fieldName).as(\"object\");\n const selectedField = objectField.children.get(\"selected\");\n if (!selectedField) {\n continue;\n }\n\n const selected = appEvents.filter(e => eventSet.has(e.eventName)).map(e => e.eventName);\n selectedField.setValue(selected);\n }\n }\n\n public actions: IWebhookFormActions = {\n save: async () => {\n const data = await this._form.submit<Record<string, unknown>>();\n if (data === false) {\n return;\n }\n\n this._saving = true;\n\n try {\n const merged = {\n name: data.name as string,\n slug: data.slug as string,\n endpointUrl: data.endpointUrl as string,\n description: (data.description as string) || undefined,\n enabled: data.enabled as boolean,\n events: this.collectEvents()\n };\n\n if (this._isNew) {\n const created = await this.createWebhookUseCase.execute(merged);\n\n runInAction(() => {\n this._webhook = created;\n this._webhookId = created.id;\n this._isNew = false;\n this._form.field(\"slug\").setDisabled(true);\n });\n } else {\n const updated = await this.updateWebhookUseCase.execute(\n this._webhookId!,\n merged\n );\n\n runInAction(() => {\n this._webhook = updated;\n });\n }\n } finally {\n runInAction(() => {\n this._saving = false;\n });\n }\n },\n deleteWebhook: async () => {\n if (!this._webhookId || this._isNew) {\n return;\n }\n await this.deleteWebhookUseCase.execute(this._webhookId);\n },\n openDeliveries: () => {\n this._showDeliveries = true;\n },\n closeDeliveries: () => {\n this._showDeliveries = false;\n }\n };\n\n public async init(id: string): Promise<void> {\n this._loading = true;\n this._isNew = id === \"new\";\n this._webhookId = id === \"new\" ? null : id;\n\n const eventsPromise = this.listAvailableEventsUseCase.execute();\n\n if (!this._isNew) {\n const [webhook, events] = await Promise.all([\n this.getWebhookUseCase.execute(id),\n eventsPromise\n ]);\n\n runInAction(() => {\n this._webhook = webhook;\n this._form = this.buildForm();\n this.addEventFields(events);\n this._form.setData({\n name: webhook.name,\n slug: webhook.slug,\n endpointUrl: webhook.endpointUrl,\n description: webhook.description ?? \"\",\n enabled: webhook.enabled\n });\n this._form.field(\"slug\").setDisabled(true);\n this.distributeEvents(webhook.events);\n this._loading = false;\n });\n } else {\n const events = await eventsPromise;\n\n runInAction(() => {\n this._form = this.buildForm();\n this.addEventFields(events);\n this._loading = false;\n });\n }\n }\n}\n\nexport const WebhookFormPresenter = Abstraction.createImplementation({\n implementation: WebhookFormPresenterImpl,\n dependencies: [\n FormModelFactory,\n GetWebhookUseCase,\n CreateWebhookUseCase,\n UpdateWebhookUseCase,\n DeleteWebhookUseCase,\n ListAvailableEventsUseCase,\n WebhookPermissions\n ]\n});\n"],"names":["WebhookFormPresenterImpl","formModelFactory","getWebhookUseCase","createWebhookUseCase","updateWebhookUseCase","deleteWebhookUseCase","listAvailableEventsUseCase","permissions","Map","data","merged","undefined","created","runInAction","updated","makeAutoObservable","computed","fields","form","name","String","layout","app","slug","events","grouped","event","existing","result","appEvents","fieldName","f","e","inner","objectField","selectedField","values","allEvents","webhookEvents","eventSet","Set","selected","id","eventsPromise","webhook","Promise","WebhookFormPresenter","Abstraction","FormModelFactory","GetWebhookUseCase","CreateWebhookUseCase","UpdateWebhookUseCase","DeleteWebhookUseCase","ListAvailableEventsUseCase","WebhookPermissions"],"mappings":";;;;;;;;;AAoBA,MAAMA;IAWF,IAAW,KAA4B;QACnC,OAAO;YACH,SAAS,IAAI,CAAC,QAAQ;YACtB,QAAQ,IAAI,CAAC,OAAO;YACpB,OAAO,IAAI,CAAC,MAAM;YAClB,SAAS,IAAI,CAAC,QAAQ;YACtB,gBAAgB,IAAI,CAAC,eAAe;YACpC,aAAa;gBACT,SAAS,IAAI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AAQ,OAAO;gBAC5B;gBACA,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,WAAW,CAAC;gBACrC,IAAI,CAAC,gBAAgB,CAACA,QAAQ,MAAM;gBACpC,IAAI,CAAC,QAAQ,GAAG;YACpB;QACJ;IASJ;AACJ;AAEO,MAAME,4CAAuBC,qBAAAA,oBAAgC,CAAC;IACjE,gBAAgB/C;IAChB,cAAc;QACVgD;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;KACH;AACL"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { Webhook } from "../../../admin/shared/types.js";
|
|
2
|
-
import type { WebhookEvent } from "../../../admin/shared/types.js";
|
|
3
2
|
import type { IFormVM } from "@webiny/app-admin/features/formModel/abstractions.js";
|
|
4
3
|
export interface IWebhookFormViewModel {
|
|
5
4
|
loading: boolean;
|
|
@@ -7,20 +6,17 @@ export interface IWebhookFormViewModel {
|
|
|
7
6
|
isNew: boolean;
|
|
8
7
|
webhook: Webhook | null;
|
|
9
8
|
showDeliveries: boolean;
|
|
10
|
-
availableEvents: WebhookEvent[];
|
|
11
9
|
permissions: {
|
|
12
10
|
canEdit: boolean;
|
|
13
11
|
canDelete: boolean;
|
|
14
12
|
};
|
|
15
13
|
form: IFormVM;
|
|
16
|
-
selectedEvents: string[];
|
|
17
14
|
}
|
|
18
15
|
export interface IWebhookFormActions {
|
|
19
16
|
save(): Promise<void>;
|
|
20
17
|
deleteWebhook(): Promise<void>;
|
|
21
18
|
openDeliveries(): void;
|
|
22
19
|
closeDeliveries(): void;
|
|
23
|
-
toggleEvent(eventName: string): void;
|
|
24
20
|
}
|
|
25
21
|
export interface IWebhookFormPresenter {
|
|
26
22
|
vm: IWebhookFormViewModel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin/presentation/WebhookForm/abstractions.js","sources":["../../../../src/admin/presentation/WebhookForm/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/admin\";\nimport type { Webhook } from \"~/admin/shared/types.js\";\nimport type {
|
|
1
|
+
{"version":3,"file":"admin/presentation/WebhookForm/abstractions.js","sources":["../../../../src/admin/presentation/WebhookForm/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/admin\";\nimport type { Webhook } from \"~/admin/shared/types.js\";\nimport type { IFormVM } from \"@webiny/app-admin/features/formModel/abstractions.js\";\n\nexport interface IWebhookFormViewModel {\n loading: boolean;\n saving: boolean;\n isNew: boolean;\n webhook: Webhook | null;\n showDeliveries: boolean;\n permissions: {\n canEdit: boolean;\n canDelete: boolean;\n };\n form: IFormVM;\n}\n\nexport interface IWebhookFormActions {\n save(): Promise<void>;\n deleteWebhook(): Promise<void>;\n openDeliveries(): void;\n closeDeliveries(): void;\n}\n\nexport interface IWebhookFormPresenter {\n vm: IWebhookFormViewModel;\n actions: IWebhookFormActions;\n init(id: string): void;\n}\n\nexport const WebhookFormPresenter =\n createAbstraction<IWebhookFormPresenter>(\"WebhookFormPresenter\");\n\nexport namespace WebhookFormPresenter {\n export type Interface = IWebhookFormPresenter;\n export type ViewModel = IWebhookFormViewModel;\n export type Actions = IWebhookFormActions;\n}\n"],"names":["WebhookFormPresenter","createAbstraction"],"mappings":";AA8BO,MAAMA,uBACTC,kBAAyC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import react, { useEffect, useMemo } from "react";
|
|
2
2
|
import { observer } from "mobx-react-lite";
|
|
3
3
|
import { DiContainerProvider, useContainer, useFeature, useRoute } from "@webiny/app";
|
|
4
|
-
import { useRouter } from "@webiny/app-admin";
|
|
4
|
+
import { FormErrors, useRouter } from "@webiny/app-admin";
|
|
5
5
|
import { Button, Heading, OverlayLoader, Separator } from "@webiny/admin-ui";
|
|
6
6
|
import { FormView } from "@webiny/app-admin/features/formModel/FormView.js";
|
|
7
7
|
import { WebhookFormPresenterFeature } from "../feature.js";
|
|
@@ -12,7 +12,6 @@ import { DeleteWebhookFeature } from "../../../features/deleteWebhook/feature.js
|
|
|
12
12
|
import { ListAvailableEventsFeature } from "../../../features/listAvailableEvents/feature.js";
|
|
13
13
|
import { WebhookPermissionsFeature } from "../../../features/permissions/feature.js";
|
|
14
14
|
import { Routes } from "../../../routes.js";
|
|
15
|
-
import { EventsSelector } from "./EventsSelector.js";
|
|
16
15
|
import { SigningSecret } from "./SigningSecret.js";
|
|
17
16
|
import { WebhookDeliveriesDrawer } from "../../WebhookDeliveries/components/WebhookDeliveriesDrawer.js";
|
|
18
17
|
const WebhookFormView_WebhookFormViewInner = observer(function() {
|
|
@@ -47,17 +46,12 @@ const WebhookFormView_WebhookFormViewInner = observer(function() {
|
|
|
47
46
|
onClick: ()=>void actions.save(),
|
|
48
47
|
disabled: vm.saving
|
|
49
48
|
}, vm.saving ? "Saving..." : "Save"))), /*#__PURE__*/ react.createElement(Separator, null), /*#__PURE__*/ react.createElement("div", {
|
|
50
|
-
className: "
|
|
51
|
-
}, /*#__PURE__*/ react.createElement(
|
|
52
|
-
|
|
53
|
-
}, /*#__PURE__*/ react.createElement(FormView, {
|
|
49
|
+
className: "p-lg"
|
|
50
|
+
}, /*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(FormErrors, {
|
|
51
|
+
form: vm.form
|
|
52
|
+
}), /*#__PURE__*/ react.createElement(FormView, {
|
|
54
53
|
name: "Webhook",
|
|
55
54
|
form: vm.form
|
|
56
|
-
}), /*#__PURE__*/ react.createElement(EventsSelector, {
|
|
57
|
-
availableEvents: vm.availableEvents,
|
|
58
|
-
selectedEvents: vm.selectedEvents,
|
|
59
|
-
onToggle: actions.toggleEvent,
|
|
60
|
-
disabled: !vm.permissions.canEdit
|
|
61
55
|
}), !vm.isNew && vm.webhook?.signingSecret && /*#__PURE__*/ react.createElement(SigningSecret, {
|
|
62
56
|
secret: vm.webhook.signingSecret
|
|
63
57
|
})))), vm.showDeliveries && vm.webhook && /*#__PURE__*/ react.createElement(WebhookDeliveriesDrawer, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin/presentation/WebhookForm/components/WebhookFormView.js","sources":["../../../../../src/admin/presentation/WebhookForm/components/WebhookFormView.tsx"],"sourcesContent":["import React, {
|
|
1
|
+
{"version":3,"file":"admin/presentation/WebhookForm/components/WebhookFormView.js","sources":["../../../../../src/admin/presentation/WebhookForm/components/WebhookFormView.tsx"],"sourcesContent":["import React, { useEffect, useMemo } from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { DiContainerProvider, useContainer, useFeature, useRoute } from \"@webiny/app\";\nimport { FormErrors, useRouter } from \"@webiny/app-admin\";\nimport { Button, Heading, OverlayLoader, Separator } from \"@webiny/admin-ui\";\nimport { FormView } from \"@webiny/app-admin/features/formModel/FormView.js\";\nimport { WebhookFormPresenterFeature } from \"../feature.js\";\nimport { GetWebhookFeature } from \"~/admin/features/getWebhook/feature.js\";\nimport { CreateWebhookFeature } from \"~/admin/features/createWebhook/feature.js\";\nimport { UpdateWebhookFeature } from \"~/admin/features/updateWebhook/feature.js\";\nimport { DeleteWebhookFeature } from \"~/admin/features/deleteWebhook/feature.js\";\nimport { ListAvailableEventsFeature } from \"~/admin/features/listAvailableEvents/feature.js\";\nimport { WebhookPermissionsFeature } from \"~/admin/features/permissions/feature.js\";\nimport { Routes } from \"~/admin/routes.js\";\nimport { SigningSecret } from \"./SigningSecret.js\";\nimport { WebhookDeliveriesDrawer } from \"~/admin/presentation/WebhookDeliveries/components/WebhookDeliveriesDrawer.js\";\n\nconst WebhookFormViewInner = observer(function WebhookFormViewInner() {\n const { presenter } = useFeature(WebhookFormPresenterFeature);\n const { goToRoute } = useRouter();\n const { route } = useRoute(Routes.Form);\n const id = route.params.id;\n\n useEffect(() => {\n void presenter.init(id);\n }, [presenter, id]);\n\n const { vm, actions } = presenter;\n\n if (vm.loading) {\n return <OverlayLoader />;\n }\n\n return (\n <>\n <div className=\"flex flex-col h-main-content\">\n <div className=\"flex items-center justify-between py-sm px-md\">\n <Heading level={5}>\n {vm.isNew ? \"Create Webhook\" : (vm.webhook?.name ?? \"Edit Webhook\")}\n </Heading>\n <div className=\"flex gap-sm\">\n {!vm.isNew && (\n <Button variant=\"secondary\" onClick={() => actions.openDeliveries()}>\n Deliveries\n </Button>\n )}\n <Button variant=\"secondary\" onClick={() => goToRoute(Routes.List)}>\n Cancel\n </Button>\n {vm.permissions.canEdit && (\n <Button\n variant=\"primary\"\n onClick={() => void actions.save()}\n disabled={vm.saving}\n >\n {vm.saving ? \"Saving...\" : \"Save\"}\n </Button>\n )}\n </div>\n </div>\n <Separator />\n\n <div className=\"p-lg\">\n <>\n <FormErrors form={vm.form} />\n <FormView name=\"Webhook\" form={vm.form} />\n {!vm.isNew && vm.webhook?.signingSecret && (\n <SigningSecret secret={vm.webhook.signingSecret} />\n )}\n </>\n </div>\n </div>\n {vm.showDeliveries && vm.webhook && (\n <WebhookDeliveriesDrawer\n webhookId={vm.webhook.id}\n open={vm.showDeliveries}\n onClose={() => actions.closeDeliveries()}\n />\n )}\n </>\n );\n});\n\nexport const WebhookFormView = () => {\n const container = useContainer();\n\n const scopedContainer = useMemo(() => {\n const child = container.createChildContainer();\n GetWebhookFeature.register(child);\n CreateWebhookFeature.register(child);\n UpdateWebhookFeature.register(child);\n DeleteWebhookFeature.register(child);\n ListAvailableEventsFeature.register(child);\n WebhookPermissionsFeature.register(child);\n WebhookFormPresenterFeature.register(child);\n return child;\n }, []);\n\n return (\n <DiContainerProvider container={scopedContainer}>\n <WebhookFormViewInner />\n </DiContainerProvider>\n );\n};\n"],"names":["WebhookFormViewInner","observer","presenter","useFeature","WebhookFormPresenterFeature","goToRoute","useRouter","route","useRoute","Routes","id","useEffect","vm","actions","OverlayLoader","Heading","Button","Separator","FormErrors","FormView","SigningSecret","WebhookDeliveriesDrawer","WebhookFormView","container","useContainer","scopedContainer","useMemo","child","GetWebhookFeature","CreateWebhookFeature","UpdateWebhookFeature","DeleteWebhookFeature","ListAvailableEventsFeature","WebhookPermissionsFeature","DiContainerProvider"],"mappings":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QAAC,QAAQR,GAAG,OAAO,CAAC,aAAa;WAK9DA,GAAG,cAAc,IAAIA,GAAG,OAAO,IAAI,WAAJ,GAC5B,oBAACS,yBAAuBA;QACpB,WAAWT,GAAG,OAAO,CAAC,EAAE;QACxB,MAAMA,GAAG,cAAc;QACvB,SAAS,IAAMC,QAAQ,eAAe;;AAK1D;AAEO,MAAMS,kBAAkB;IAC3B,MAAMC,YAAYC;IAElB,MAAMC,kBAAkBC,QAAQ;QAC5B,MAAMC,QAAQJ,UAAU,oBAAoB;QAC5CK,kBAAkB,QAAQ,CAACD;QAC3BE,qBAAqB,QAAQ,CAACF;QAC9BG,qBAAqB,QAAQ,CAACH;QAC9BI,qBAAqB,QAAQ,CAACJ;QAC9BK,2BAA2B,QAAQ,CAACL;QACpCM,0BAA0B,QAAQ,CAACN;QACnCvB,4BAA4B,QAAQ,CAACuB;QACrC,OAAOA;IACX,GAAG,EAAE;IAEL,OAAO,WAAP,GACI,oBAACO,qBAAmBA;QAAC,WAAWT;qBAC5B,oBAACzB,sCAAoBA;AAGjC"}
|
|
@@ -5,12 +5,16 @@ import { useRouter } from "@webiny/app-admin";
|
|
|
5
5
|
import { Button, DataTable, DropdownMenu, Heading, IconButton, Separator, Tag, Text, TimeAgo } from "@webiny/admin-ui";
|
|
6
6
|
import { useConfirmationDialog, useSnackbar } from "@webiny/app-admin/hooks/index.js";
|
|
7
7
|
import { ReactComponent } from "@webiny/icons/more_vert.svg";
|
|
8
|
+
import { ReactComponent as add_svg_ReactComponent } from "@webiny/icons/add.svg";
|
|
8
9
|
import { WebhookListPresenterFeature } from "../feature.js";
|
|
9
10
|
import { ListWebhooksFeature } from "../../../features/ListWebhooks/feature.js";
|
|
10
11
|
import { DeleteWebhookFeature } from "../../../features/deleteWebhook/feature.js";
|
|
11
12
|
import { TriggerWebhookFeature } from "../../../features/triggerWebhook/feature.js";
|
|
12
13
|
import { WebhookPermissionsFeature } from "../../../features/permissions/feature.js";
|
|
13
14
|
import { Routes } from "../../../routes.js";
|
|
15
|
+
import { ReactComponent as edit_svg_ReactComponent } from "@webiny/icons/edit.svg";
|
|
16
|
+
import { ReactComponent as delete_svg_ReactComponent } from "@webiny/icons/delete.svg";
|
|
17
|
+
import { ReactComponent as webhook_svg_ReactComponent } from "@webiny/icons/webhook.svg";
|
|
14
18
|
const WebhookListView_WebhookListViewInner = observer(function() {
|
|
15
19
|
const { presenter } = useFeature(WebhookListPresenterFeature);
|
|
16
20
|
const { goToRoute } = useRouter();
|
|
@@ -95,20 +99,26 @@ const WebhookListView_WebhookListViewInner = observer(function() {
|
|
|
95
99
|
"aria-label": "Actions"
|
|
96
100
|
})
|
|
97
101
|
}, /*#__PURE__*/ react.createElement(DropdownMenu.Item, {
|
|
98
|
-
|
|
102
|
+
icon: /*#__PURE__*/ react.createElement(edit_svg_ReactComponent, null),
|
|
103
|
+
onClick: ()=>goToRoute(Routes.Form, {
|
|
99
104
|
id: row.id
|
|
100
|
-
})
|
|
101
|
-
|
|
102
|
-
|
|
105
|
+
}),
|
|
106
|
+
text: "Edit"
|
|
107
|
+
}), vm.permissions.canEdit && /*#__PURE__*/ react.createElement(DropdownMenu.Item, {
|
|
108
|
+
icon: /*#__PURE__*/ react.createElement(webhook_svg_ReactComponent, null),
|
|
109
|
+
onClick: ()=>{
|
|
103
110
|
presenter.actions.triggerWebhook(row.id).then(()=>{
|
|
104
111
|
showSnackbar("Test event triggered.");
|
|
105
112
|
});
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
|
|
113
|
+
},
|
|
114
|
+
text: "Trigger Test"
|
|
115
|
+
}), vm.permissions.canDelete && /*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(DropdownMenu.Separator, null), /*#__PURE__*/ react.createElement(DropdownMenu.Item, {
|
|
116
|
+
onClick: ()=>{
|
|
109
117
|
showDeleteConfirmation(()=>presenter.actions.deleteWebhook(row.id));
|
|
110
|
-
}
|
|
111
|
-
|
|
118
|
+
},
|
|
119
|
+
icon: /*#__PURE__*/ react.createElement(delete_svg_ReactComponent, null),
|
|
120
|
+
text: "Delete"
|
|
121
|
+
}))),
|
|
112
122
|
size: 56,
|
|
113
123
|
enableSorting: false,
|
|
114
124
|
enableHiding: false,
|
|
@@ -121,18 +131,20 @@ const WebhookListView_WebhookListViewInner = observer(function() {
|
|
|
121
131
|
showDeleteConfirmation,
|
|
122
132
|
showSnackbar
|
|
123
133
|
]);
|
|
134
|
+
const createButton = /*#__PURE__*/ react.createElement(Button, {
|
|
135
|
+
variant: "primary",
|
|
136
|
+
onClick: ()=>goToRoute(Routes.Form, {
|
|
137
|
+
id: "new"
|
|
138
|
+
}),
|
|
139
|
+
icon: /*#__PURE__*/ react.createElement(add_svg_ReactComponent, null)
|
|
140
|
+
}, "Create Webhook");
|
|
124
141
|
return /*#__PURE__*/ react.createElement("div", {
|
|
125
142
|
className: "flex flex-col h-main-content"
|
|
126
143
|
}, /*#__PURE__*/ react.createElement("div", {
|
|
127
144
|
className: "flex items-center justify-between py-sm px-md"
|
|
128
145
|
}, /*#__PURE__*/ react.createElement(Heading, {
|
|
129
146
|
level: 5
|
|
130
|
-
}, "Webhooks"), vm.permissions.canCreate && /*#__PURE__*/ react.createElement(
|
|
131
|
-
variant: "primary",
|
|
132
|
-
onClick: ()=>goToRoute(Routes.Form, {
|
|
133
|
-
id: "new"
|
|
134
|
-
})
|
|
135
|
-
}, "Create Webhook")), /*#__PURE__*/ react.createElement(Separator, null), /*#__PURE__*/ react.createElement("div", {
|
|
147
|
+
}, "Webhooks"), vm.permissions.canCreate && createButton), /*#__PURE__*/ react.createElement(Separator, null), /*#__PURE__*/ react.createElement("div", {
|
|
136
148
|
className: "flex-1 overflow-auto"
|
|
137
149
|
}, vm.list.pagination.loading || 0 !== vm.list.rows.length ? /*#__PURE__*/ react.createElement(DataTable, {
|
|
138
150
|
columns: columns,
|
|
@@ -145,12 +157,7 @@ const WebhookListView_WebhookListViewInner = observer(function() {
|
|
|
145
157
|
className: "flex flex-col items-center justify-center h-full gap-md"
|
|
146
158
|
}, /*#__PURE__*/ react.createElement(Text, {
|
|
147
159
|
className: "text-neutral-strong"
|
|
148
|
-
}, "No webhooks found."), vm.permissions.canCreate &&
|
|
149
|
-
variant: "primary",
|
|
150
|
-
onClick: ()=>goToRoute(Routes.Form, {
|
|
151
|
-
id: "new"
|
|
152
|
-
})
|
|
153
|
-
}, "Create Webhook"))));
|
|
160
|
+
}, "No webhooks found."), vm.permissions.canCreate && createButton)));
|
|
154
161
|
});
|
|
155
162
|
const WebhookListView = ()=>{
|
|
156
163
|
const container = useContainer();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin/presentation/WebhookList/components/WebhookListView.js","sources":["../../../../../src/admin/presentation/WebhookList/components/WebhookListView.tsx"],"sourcesContent":["import React, { useMemo, useEffect, useCallback } from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { DiContainerProvider, useContainer, useFeature } from \"@webiny/app\";\nimport { useRouter } from \"@webiny/app-admin\";\nimport {\n Button,\n DataTable,\n DropdownMenu,\n Heading,\n IconButton,\n Separator,\n Tag,\n Text,\n TimeAgo\n} from \"@webiny/admin-ui\";\nimport type { DataTableSorting, OnDataTableSortingChange } from \"@webiny/admin-ui\";\nimport { useConfirmationDialog, useSnackbar } from \"@webiny/app-admin/hooks/index.js\";\nimport { ReactComponent as MoreVerticalIcon } from \"@webiny/icons/more_vert.svg\";\nimport { WebhookListPresenterFeature } from \"../feature.js\";\nimport { ListWebhooksFeature } from \"~/admin/features/ListWebhooks/feature.js\";\nimport { DeleteWebhookFeature } from \"~/admin/features/deleteWebhook/feature.js\";\nimport { TriggerWebhookFeature } from \"~/admin/features/triggerWebhook/feature.js\";\nimport { WebhookPermissionsFeature } from \"~/admin/features/permissions/feature.js\";\nimport { Routes } from \"~/admin/routes.js\";\nimport type { Webhook } from \"~/admin/shared/types.js\";\n\nconst WebhookListViewInner = observer(function WebhookListViewInner() {\n const { presenter } = useFeature(WebhookListPresenterFeature);\n const { goToRoute } = useRouter();\n\n useEffect(() => {\n presenter.init();\n }, [presenter]);\n\n const { vm } = presenter;\n\n const { showSnackbar } = useSnackbar();\n\n const { showConfirmation: showDeleteConfirmation } = useConfirmationDialog({\n title: \"Delete Webhook\",\n message: \"Are you sure you want to delete this webhook?\"\n });\n\n const sorting: DataTableSorting = useMemo(() => {\n const sort = vm.list.sort;\n if (!sort || !sort.field) {\n return [];\n }\n return [{ id: sort.field, desc: sort.direction === \"DESC\" }];\n }, [vm.list.sort]);\n\n const onSortingChange: OnDataTableSortingChange = useCallback(\n updater => {\n const next = typeof updater === \"function\" ? updater(sorting) : updater;\n if (next.length > 0) {\n const { id, desc } = next[0];\n presenter.actions.sort.set(id, desc ? \"DESC\" : \"ASC\");\n }\n },\n [sorting, presenter.actions.sort]\n );\n\n const columns = useMemo(\n () => ({\n name: {\n header: \"Name\",\n cell: (row: Webhook) => (\n <Text\n className=\"cursor-pointer text-primary hover:underline\"\n onClick={() => goToRoute(Routes.Form, { id: row.id })}\n >\n {row.name}\n </Text>\n ),\n enableSorting: true,\n size: 200\n },\n endpointUrl: {\n header: \"Endpoint\",\n cell: (row: Webhook) => (\n <Text className=\"font-mono text-sm truncate\">{row.endpointUrl}</Text>\n ),\n size: 250\n },\n enabled: {\n header: \"Status\",\n cell: (row: Webhook) => (\n <Tag\n variant={row.enabled ? \"success\" : \"neutral-muted\"}\n content={row.enabled ? \"Active\" : \"Disabled\"}\n />\n ),\n enableSorting: true,\n size: 100\n },\n createdOn: {\n header: \"Created\",\n cell: (row: Webhook) =>\n row.createdOn ? <TimeAgo datetime={row.createdOn} /> : <Text size=\"sm\">—</Text>,\n enableSorting: true,\n size: 120\n },\n actions: {\n header: \" \",\n cell: (row: Webhook) => (\n <DropdownMenu\n trigger={\n <IconButton\n icon={<MoreVerticalIcon />}\n variant=\"ghost\"\n size=\"sm\"\n aria-label=\"Actions\"\n />\n }\n >\n <DropdownMenu.Item onSelect={() => goToRoute(Routes.Form, { id: row.id })}>\n Edit\n </DropdownMenu.Item>\n {vm.permissions.canEdit && (\n <DropdownMenu.Item\n onSelect={() => {\n void presenter.actions.triggerWebhook(row.id).then(() => {\n showSnackbar(\"Test event triggered.\");\n });\n }}\n >\n Trigger Test\n </DropdownMenu.Item>\n )}\n {vm.permissions.canDelete && (\n <>\n <DropdownMenu.Separator />\n <DropdownMenu.Item\n onSelect={() => {\n showDeleteConfirmation(() =>\n presenter.actions.deleteWebhook(row.id)\n );\n }}\n >\n Delete\n </DropdownMenu.Item>\n </>\n )}\n </DropdownMenu>\n ),\n size: 56,\n enableSorting: false,\n enableHiding: false,\n enableResizing: false\n }\n }),\n [vm.permissions, presenter.actions, goToRoute, showDeleteConfirmation, showSnackbar]\n );\n\n return (\n <div className=\"flex flex-col h-main-content\">\n <div className=\"flex items-center justify-between py-sm px-md\">\n <Heading level={5}>Webhooks</Heading>\n {vm.permissions.canCreate && (\n <Button variant=\"primary\" onClick={() => goToRoute(Routes.Form, { id: \"new\" })}>\n Create Webhook\n </Button>\n )}\n </div>\n <Separator />\n <div className=\"flex-1 overflow-auto\">\n {!vm.list.pagination.loading && vm.list.rows.length === 0 ? (\n <div className=\"flex flex-col items-center justify-center h-full gap-md\">\n <Text className=\"text-neutral-strong\">No webhooks found.</Text>\n {vm.permissions.canCreate && (\n <Button\n variant=\"primary\"\n onClick={() => goToRoute(Routes.Form, { id: \"new\" })}\n >\n Create Webhook\n </Button>\n )}\n </div>\n ) : (\n <DataTable<Webhook>\n columns={columns}\n data={vm.list.rows}\n loading={vm.list.pagination.loading}\n sorting={sorting}\n onSortingChange={onSortingChange}\n stickyHeader\n />\n )}\n </div>\n </div>\n );\n});\n\nexport const WebhookListView = () => {\n const container = useContainer();\n\n const scopedContainer = useMemo(() => {\n const child = container.createChildContainer();\n ListWebhooksFeature.register(child);\n DeleteWebhookFeature.register(child);\n TriggerWebhookFeature.register(child);\n WebhookPermissionsFeature.register(child);\n WebhookListPresenterFeature.register(child);\n return child;\n }, []);\n\n return (\n <DiContainerProvider container={scopedContainer}>\n <WebhookListViewInner />\n </DiContainerProvider>\n );\n};\n"],"names":["WebhookListViewInner","observer","presenter","useFeature","WebhookListPresenterFeature","goToRoute","useRouter","useEffect","vm","showSnackbar","useSnackbar","showDeleteConfirmation","useConfirmationDialog","sorting","useMemo","sort","onSortingChange","useCallback","updater","next","id","desc","columns","row","Text","Routes","Tag","TimeAgo","DropdownMenu","IconButton","MoreVerticalIcon","Heading","Button","Separator","DataTable","WebhookListView","container","useContainer","scopedContainer","child","ListWebhooksFeature","DeleteWebhookFeature","TriggerWebhookFeature","WebhookPermissionsFeature","DiContainerProvider"],"mappings":";;;;;;;;;;;;;AA0BA,MAAMA,uCAAuBC,SAAS;IAClC,MAAM,EAAEC,SAAS,EAAE,GAAGC,WAAWC;IACjC,MAAM,EAAEC,SAAS,EAAE,GAAGC;IAEtBC,UAAU;QACNL,UAAU,IAAI;IAClB,GAAG;QAACA;KAAU;IAEd,MAAM,EAAEM,EAAE,EAAE,GAAGN;IAEf,MAAM,EAAEO,YAAY,EAAE,GAAGC;IAEzB,MAAM,EAAE,kBAAkBC,sBAAsB,EAAE,GAAGC,sBAAsB;QACvE,OAAO;QACP,SAAS;IACb;IAEA,MAAMC,UAA4BC,QAAQ;QACtC,MAAMC,OAAOP,GAAG,IAAI,CAAC,IAAI;QACzB,IAAI,CAACO,QAAQ,CAACA,KAAK,KAAK,EACpB,OAAO,EAAE;QAEb,OAAO;YAAC;gBAAE,IAAIA,KAAK,KAAK;gBAAE,MAAMA,AAAmB,WAAnBA,KAAK,SAAS;YAAY;SAAE;IAChE,GAAG;QAACP,GAAG,IAAI,CAAC,IAAI;KAAC;IAEjB,MAAMQ,kBAA4CC,YAC9CC,CAAAA;QACI,MAAMC,OAAO,AAAmB,cAAnB,OAAOD,UAAyBA,QAAQL,WAAWK;QAChE,IAAIC,KAAK,MAAM,GAAG,GAAG;YACjB,MAAM,EAAEC,EAAE,EAAEC,IAAI,EAAE,GAAGF,IAAI,CAAC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R,SAAS,IAAM3B,UAAUoB,OAAO,IAAI,EAAE;gBAAE,IAAI;YAAM;OACrD;AAkB7B;AAEO,MAAMU,kBAAkB;IAC3B,MAAMC,YAAYC;IAElB,MAAMC,kBAAkBxB,QAAQ;QAC5B,MAAMyB,QAAQH,UAAU,oBAAoB;QAC5CI,oBAAoB,QAAQ,CAACD;QAC7BE,qBAAqB,QAAQ,CAACF;QAC9BG,sBAAsB,QAAQ,CAACH;QAC/BI,0BAA0B,QAAQ,CAACJ;QACnCnC,4BAA4B,QAAQ,CAACmC;QACrC,OAAOA;IACX,GAAG,EAAE;IAEL,OAAO,WAAP,GACI,oBAACK,qBAAmBA;QAAC,WAAWN;qBAC5B,oBAACtC,sCAAoBA;AAGjC"}
|
|
1
|
+
{"version":3,"file":"admin/presentation/WebhookList/components/WebhookListView.js","sources":["../../../../../src/admin/presentation/WebhookList/components/WebhookListView.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo } from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { DiContainerProvider, useContainer, useFeature } from \"@webiny/app\";\nimport { useRouter } from \"@webiny/app-admin\";\nimport type { DataTableSorting, OnDataTableSortingChange } from \"@webiny/admin-ui\";\nimport {\n Button,\n DataTable,\n DropdownMenu,\n Heading,\n IconButton,\n Separator,\n Tag,\n Text,\n TimeAgo\n} from \"@webiny/admin-ui\";\nimport { useConfirmationDialog, useSnackbar } from \"@webiny/app-admin/hooks/index.js\";\nimport { ReactComponent as MoreVerticalIcon } from \"@webiny/icons/more_vert.svg\";\nimport { ReactComponent as AddIcon } from \"@webiny/icons/add.svg\";\nimport { WebhookListPresenterFeature } from \"../feature.js\";\nimport { ListWebhooksFeature } from \"~/admin/features/ListWebhooks/feature.js\";\nimport { DeleteWebhookFeature } from \"~/admin/features/deleteWebhook/feature.js\";\nimport { TriggerWebhookFeature } from \"~/admin/features/triggerWebhook/feature.js\";\nimport { WebhookPermissionsFeature } from \"~/admin/features/permissions/feature.js\";\nimport { Routes } from \"~/admin/routes.js\";\nimport type { Webhook } from \"~/admin/shared/types.js\";\nimport { ReactComponent as Edit } from \"@webiny/icons/edit.svg\";\nimport { ReactComponent as Delete } from \"@webiny/icons/delete.svg\";\nimport { ReactComponent as WebhookIcon } from \"@webiny/icons/webhook.svg\";\n\nconst WebhookListViewInner = observer(function WebhookListViewInner() {\n const { presenter } = useFeature(WebhookListPresenterFeature);\n const { goToRoute } = useRouter();\n\n useEffect(() => {\n presenter.init();\n }, [presenter]);\n\n const { vm } = presenter;\n\n const { showSnackbar } = useSnackbar();\n\n const { showConfirmation: showDeleteConfirmation } = useConfirmationDialog({\n title: \"Delete Webhook\",\n message: \"Are you sure you want to delete this webhook?\"\n });\n\n const sorting: DataTableSorting = useMemo(() => {\n const sort = vm.list.sort;\n if (!sort || !sort.field) {\n return [];\n }\n return [{ id: sort.field, desc: sort.direction === \"DESC\" }];\n }, [vm.list.sort]);\n\n const onSortingChange: OnDataTableSortingChange = useCallback(\n updater => {\n const next = typeof updater === \"function\" ? updater(sorting) : updater;\n if (next.length > 0) {\n const { id, desc } = next[0];\n presenter.actions.sort.set(id, desc ? \"DESC\" : \"ASC\");\n }\n },\n [sorting, presenter.actions.sort]\n );\n\n const columns = useMemo(\n () => ({\n name: {\n header: \"Name\",\n cell: (row: Webhook) => (\n <Text\n className=\"cursor-pointer text-primary hover:underline\"\n onClick={() => goToRoute(Routes.Form, { id: row.id })}\n >\n {row.name}\n </Text>\n ),\n enableSorting: true,\n size: 200\n },\n endpointUrl: {\n header: \"Endpoint\",\n cell: (row: Webhook) => (\n <Text className=\"font-mono text-sm truncate\">{row.endpointUrl}</Text>\n ),\n size: 250\n },\n enabled: {\n header: \"Status\",\n cell: (row: Webhook) => (\n <Tag\n variant={row.enabled ? \"success\" : \"neutral-muted\"}\n content={row.enabled ? \"Active\" : \"Disabled\"}\n />\n ),\n enableSorting: true,\n size: 100\n },\n createdOn: {\n header: \"Created\",\n cell: (row: Webhook) =>\n row.createdOn ? <TimeAgo datetime={row.createdOn} /> : <Text size=\"sm\">—</Text>,\n enableSorting: true,\n size: 120\n },\n actions: {\n header: \" \",\n cell: (row: Webhook) => (\n <DropdownMenu\n trigger={\n <IconButton\n icon={<MoreVerticalIcon />}\n variant=\"ghost\"\n size=\"sm\"\n aria-label=\"Actions\"\n />\n }\n >\n <DropdownMenu.Item\n icon={<Edit />}\n onClick={() => goToRoute(Routes.Form, { id: row.id })}\n text={\"Edit\"}\n />\n {vm.permissions.canEdit && (\n <DropdownMenu.Item\n icon={<WebhookIcon />}\n onClick={() => {\n void presenter.actions.triggerWebhook(row.id).then(() => {\n showSnackbar(\"Test event triggered.\");\n });\n }}\n text={\"Trigger Test\"}\n />\n )}\n {vm.permissions.canDelete && (\n <>\n <DropdownMenu.Separator />\n <DropdownMenu.Item\n onClick={() => {\n showDeleteConfirmation(() =>\n presenter.actions.deleteWebhook(row.id)\n );\n }}\n icon={<Delete />}\n text={\"Delete\"}\n />\n </>\n )}\n </DropdownMenu>\n ),\n size: 56,\n enableSorting: false,\n enableHiding: false,\n enableResizing: false\n }\n }),\n [vm.permissions, presenter.actions, goToRoute, showDeleteConfirmation, showSnackbar]\n );\n\n const createButton = (\n <Button\n variant=\"primary\"\n onClick={() => goToRoute(Routes.Form, { id: \"new\" })}\n icon={<AddIcon />}\n >\n Create Webhook\n </Button>\n );\n\n return (\n <div className=\"flex flex-col h-main-content\">\n <div className=\"flex items-center justify-between py-sm px-md\">\n <Heading level={5}>Webhooks</Heading>\n {vm.permissions.canCreate && createButton}\n </div>\n <Separator />\n <div className=\"flex-1 overflow-auto\">\n {!vm.list.pagination.loading && vm.list.rows.length === 0 ? (\n <div className=\"flex flex-col items-center justify-center h-full gap-md\">\n <Text className=\"text-neutral-strong\">No webhooks found.</Text>\n {vm.permissions.canCreate && createButton}\n </div>\n ) : (\n <DataTable<Webhook>\n columns={columns}\n data={vm.list.rows}\n loading={vm.list.pagination.loading}\n sorting={sorting}\n onSortingChange={onSortingChange}\n stickyHeader\n />\n )}\n </div>\n </div>\n );\n});\n\nexport const WebhookListView = () => {\n const container = useContainer();\n\n const scopedContainer = useMemo(() => {\n const child = container.createChildContainer();\n ListWebhooksFeature.register(child);\n DeleteWebhookFeature.register(child);\n TriggerWebhookFeature.register(child);\n WebhookPermissionsFeature.register(child);\n WebhookListPresenterFeature.register(child);\n return child;\n }, []);\n\n return (\n <DiContainerProvider container={scopedContainer}>\n <WebhookListViewInner />\n </DiContainerProvider>\n );\n};\n"],"names":["WebhookListViewInner","observer","presenter","useFeature","WebhookListPresenterFeature","goToRoute","useRouter","useEffect","vm","showSnackbar","useSnackbar","showDeleteConfirmation","useConfirmationDialog","sorting","useMemo","sort","onSortingChange","useCallback","updater","next","id","desc","columns","row","Text","Routes","Tag","TimeAgo","DropdownMenu","IconButton","MoreVerticalIcon","Edit","WebhookIcon","Delete","createButton","Button","AddIcon","Heading","Separator","DataTable","WebhookListView","container","useContainer","scopedContainer","child","ListWebhooksFeature","DeleteWebhookFeature","TriggerWebhookFeature","WebhookPermissionsFeature","DiContainerProvider"],"mappings":";;;;;;;;;;;;;;;;;AA8BA,MAAMA,uCAAuBC,SAAS;IAClC,MAAM,EAAEC,SAAS,EAAE,GAAGC,WAAWC;IACjC,MAAM,EAAEC,SAAS,EAAE,GAAGC;IAEtBC,UAAU;QACNL,UAAU,IAAI;IAClB,GAAG;QAACA;KAAU;IAEd,MAAM,EAAEM,EAAE,EAAE,GAAGN;IAEf,MAAM,EAAEO,YAAY,EAAE,GAAGC;IAEzB,MAAM,EAAE,kBAAkBC,sBAAsB,EAAE,GAAGC,sBAAsB;QACvE,OAAO;QACP,SAAS;IACb;IAEA,MAAMC,UAA4BC,QAAQ;QACtC,MAAMC,OAAOP,GAAG,IAAI,CAAC,IAAI;QACzB,IAAI,CAACO,QAAQ,CAACA,KAAK,KAAK,EACpB,OAAO,EAAE;QAEb,OAAO;YAAC;gBAAE,IAAIA,KAAK,KAAK;gBAAE,MAAMA,AAAmB,WAAnBA,KAAK,SAAS;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V,AAAC9B,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,IAAIA,AAAwB,MAAxBA,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAGd0B,WAAAA,GAGjC,oBAACK,WAASA;QACN,SAASjB;QACT,MAAMd,GAAG,IAAI,CAAC,IAAI;QAClB,SAASA,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO;QACnC,SAASK;QACT,iBAAiBG;QACjB;SAZoD,WAAJ,GACpD,oBAAC;QAAI,WAAU;qBACX,oBAACQ,MAAIA;QAAC,WAAU;OAAsB,uBACrChB,GAAG,WAAW,CAAC,SAAS,IAAI0B;AAerD;AAEO,MAAMM,kBAAkB;IAC3B,MAAMC,YAAYC;IAElB,MAAMC,kBAAkB7B,QAAQ;QAC5B,MAAM8B,QAAQH,UAAU,oBAAoB;QAC5CI,oBAAoB,QAAQ,CAACD;QAC7BE,qBAAqB,QAAQ,CAACF;QAC9BG,sBAAsB,QAAQ,CAACH;QAC/BI,0BAA0B,QAAQ,CAACJ;QACnCxC,4BAA4B,QAAQ,CAACwC;QACrC,OAAOA;IACX,GAAG,EAAE;IAEL,OAAO,WAAP,GACI,oBAACK,qBAAmBA;QAAC,WAAWN;qBAC5B,oBAAC3C,sCAAoBA;AAGjC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type IWebhookSettingsPresenter, type IWebhookSettingsViewModel } from "./abstractions.js";
|
|
2
|
+
import { GetWebhookSettingsUseCase } from "../../../admin/features/getWebhookSettings/abstractions.js";
|
|
3
|
+
import { UpdateWebhookSettingsUseCase } from "../../../admin/features/updateWebhookSettings/abstractions.js";
|
|
4
|
+
import { FormModelFactory } from "@webiny/app-admin/features/formModel/abstractions.js";
|
|
5
|
+
declare class WebhookSettingsPresenterImpl implements IWebhookSettingsPresenter {
|
|
6
|
+
private readonly formModelFactory;
|
|
7
|
+
private readonly getWebhookSettingsUseCase;
|
|
8
|
+
private readonly updateWebhookSettingsUseCase;
|
|
9
|
+
private _loading;
|
|
10
|
+
private _saving;
|
|
11
|
+
private _form;
|
|
12
|
+
get vm(): IWebhookSettingsViewModel;
|
|
13
|
+
constructor(formModelFactory: FormModelFactory.Interface, getWebhookSettingsUseCase: GetWebhookSettingsUseCase.Interface, updateWebhookSettingsUseCase: UpdateWebhookSettingsUseCase.Interface);
|
|
14
|
+
private buildForm;
|
|
15
|
+
save(): Promise<boolean>;
|
|
16
|
+
init(): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
export declare const WebhookSettingsPresenter: typeof WebhookSettingsPresenterImpl & {
|
|
19
|
+
__abstraction: import("@webiny/di").Abstraction<IWebhookSettingsPresenter>;
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { computed, makeAutoObservable, runInAction } from "mobx";
|
|
2
|
+
import { WebhookSettingsPresenter } from "./abstractions.js";
|
|
3
|
+
import { GetWebhookSettingsUseCase } from "../../features/getWebhookSettings/abstractions.js";
|
|
4
|
+
import { UpdateWebhookSettingsUseCase } from "../../features/updateWebhookSettings/abstractions.js";
|
|
5
|
+
import { FormModelFactory } from "@webiny/app-admin/features/formModel/abstractions.js";
|
|
6
|
+
class WebhookSettingsPresenterImpl {
|
|
7
|
+
get vm() {
|
|
8
|
+
return {
|
|
9
|
+
loading: this._loading,
|
|
10
|
+
saving: this._saving,
|
|
11
|
+
form: this._form.vm
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
constructor(formModelFactory, getWebhookSettingsUseCase, updateWebhookSettingsUseCase){
|
|
15
|
+
this.formModelFactory = formModelFactory;
|
|
16
|
+
this.getWebhookSettingsUseCase = getWebhookSettingsUseCase;
|
|
17
|
+
this.updateWebhookSettingsUseCase = updateWebhookSettingsUseCase;
|
|
18
|
+
this._loading = false;
|
|
19
|
+
this._saving = false;
|
|
20
|
+
this._form = this.buildForm();
|
|
21
|
+
makeAutoObservable(this, {
|
|
22
|
+
vm: computed
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
buildForm() {
|
|
26
|
+
return this.formModelFactory.create({
|
|
27
|
+
fields: (fields)=>({
|
|
28
|
+
signingSecret: fields.text().label("Signing Secret").placeholder("Enter a signing secret for webhook payloads").description("Used to sign webhook payloads so receivers can verify authenticity.")
|
|
29
|
+
}),
|
|
30
|
+
layout: (layout)=>[
|
|
31
|
+
layout.row("signingSecret")
|
|
32
|
+
]
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
async save() {
|
|
36
|
+
const data = await this._form.submit();
|
|
37
|
+
if (false === data) return false;
|
|
38
|
+
this._saving = true;
|
|
39
|
+
try {
|
|
40
|
+
const settings = await this.updateWebhookSettingsUseCase.execute({
|
|
41
|
+
signingSecret: data.signingSecret || void 0
|
|
42
|
+
});
|
|
43
|
+
runInAction(()=>{
|
|
44
|
+
this._form.setData({
|
|
45
|
+
signingSecret: settings.signingSecret ?? ""
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
} finally{
|
|
49
|
+
runInAction(()=>{
|
|
50
|
+
this._saving = false;
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
async init() {
|
|
56
|
+
this._loading = true;
|
|
57
|
+
try {
|
|
58
|
+
const settings = await this.getWebhookSettingsUseCase.execute();
|
|
59
|
+
runInAction(()=>{
|
|
60
|
+
this._form = this.buildForm();
|
|
61
|
+
this._form.setData({
|
|
62
|
+
signingSecret: settings.signingSecret ?? ""
|
|
63
|
+
});
|
|
64
|
+
this._loading = false;
|
|
65
|
+
});
|
|
66
|
+
} catch {
|
|
67
|
+
runInAction(()=>{
|
|
68
|
+
this._loading = false;
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
const WebhookSettingsPresenter_WebhookSettingsPresenter = WebhookSettingsPresenter.createImplementation({
|
|
74
|
+
implementation: WebhookSettingsPresenterImpl,
|
|
75
|
+
dependencies: [
|
|
76
|
+
FormModelFactory,
|
|
77
|
+
GetWebhookSettingsUseCase,
|
|
78
|
+
UpdateWebhookSettingsUseCase
|
|
79
|
+
]
|
|
80
|
+
});
|
|
81
|
+
export { WebhookSettingsPresenter_WebhookSettingsPresenter as WebhookSettingsPresenter };
|
|
82
|
+
|
|
83
|
+
//# sourceMappingURL=WebhookSettingsPresenter.js.map
|