@bigbinary/neeto-webhooks-frontend 2.2.14 → 2.2.16
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/README.md +1 -0
- package/app/javascript/src/translations/de.json +93 -0
- package/app/javascript/src/translations/en.json +20 -1
- package/app/javascript/src/translations/es.json +93 -0
- package/app/javascript/src/translations/fr.json +93 -0
- package/dist/NeetoWebhooks.js +88 -2
- package/dist/NeetoWebhooks.js.map +1 -1
- package/dist/cjs/NeetoWebhooks.js +88 -2
- package/dist/cjs/NeetoWebhooks.js.map +1 -1
- package/package.json +11 -11
package/README.md
CHANGED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
{
|
|
2
|
+
"neetoWebhooks": {
|
|
3
|
+
"common": {
|
|
4
|
+
"event_one": "Ereignis",
|
|
5
|
+
"event_other": "Ereignisse",
|
|
6
|
+
"endpoint": "Endpunkt",
|
|
7
|
+
"responseStatus": "Antwortstatus",
|
|
8
|
+
"webhookWithCount": "{{count}} Webhook",
|
|
9
|
+
"webhookWithCount_other": "{{count}} Webhooks"
|
|
10
|
+
},
|
|
11
|
+
"entity": {
|
|
12
|
+
"webhook": "Webhook",
|
|
13
|
+
"configure": "Konfigurieren"
|
|
14
|
+
},
|
|
15
|
+
"buttons": {
|
|
16
|
+
"saveChanges": "Änderungen speichern",
|
|
17
|
+
"cancel": "Abbrechen",
|
|
18
|
+
"delete": "Löschen",
|
|
19
|
+
"edit": "Bearbeiten",
|
|
20
|
+
"viewDetails": "Details anzeigen",
|
|
21
|
+
"regenerate": "Neu generieren",
|
|
22
|
+
"generateSecretKey": "Geheimen Schlüssel generieren"
|
|
23
|
+
},
|
|
24
|
+
"errors": {
|
|
25
|
+
"webhook": {
|
|
26
|
+
"required": "Bitte geben Sie Ihre Endpunkt-URL ein",
|
|
27
|
+
"invalidUrl": "Bitte geben Sie eine gültige URL ein",
|
|
28
|
+
"invalidUrlProtocol": "Bitte geben Sie eine gültige URL ein. Die URL muss mit http oder https beginnen",
|
|
29
|
+
"urlNotUnique": "Die Endpunkt-URL muss eindeutig sein",
|
|
30
|
+
"events": {
|
|
31
|
+
"required": "Bitte wählen Sie mindestens ein Webhook-Ereignis aus"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"delivery": {
|
|
36
|
+
"title": "Lieferungen",
|
|
37
|
+
"redeliver": "Erneut liefern",
|
|
38
|
+
"redelivery": "Erneut zustellen",
|
|
39
|
+
"request": "Anfrage",
|
|
40
|
+
"response": "Antwort",
|
|
41
|
+
"header": "Header",
|
|
42
|
+
"body": "Inhalt",
|
|
43
|
+
"payload": "Payload",
|
|
44
|
+
"deliveryId": "Liefer-ID",
|
|
45
|
+
"sid": "ID",
|
|
46
|
+
"helpDescription": "Details zu der Antwort, die erhalten wurde, wenn das Produkt mit dem im Webhook angegebenen Endpunkt interagiert.",
|
|
47
|
+
"empty": {
|
|
48
|
+
"title": "Es gibt keine Lieferungen anzuzeigen.",
|
|
49
|
+
"description": "Es wurden keine Ereignisse an dieses Webhook gesendet."
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"webhook": {
|
|
53
|
+
"title": "Webhooks",
|
|
54
|
+
"description": "Alle neuen Aktionsereignisdaten werden an die konfigurierten Webhook-URLs gesendet.",
|
|
55
|
+
"helpDescription": "Erhalten Sie einen Webhook, wenn die angegebenen Ereignisse stattfinden.",
|
|
56
|
+
"empty": "Es gibt keine Webhooks anzuzeigen.",
|
|
57
|
+
"emptyHelpText": "Was sind Webhooks?",
|
|
58
|
+
"add": "Neues Webhook hinzufügen",
|
|
59
|
+
"endpoint": "Endpunkt",
|
|
60
|
+
"event_one": "Ereignis",
|
|
61
|
+
"event_other": "Ereignisse",
|
|
62
|
+
"endpointPlaceholder": "Endpunkt-URL eingeben",
|
|
63
|
+
"eventPlaceholder": "Webhook-Ereignisse auswählen",
|
|
64
|
+
"secret": "Geheimer Schlüssel (optional)",
|
|
65
|
+
"secretkeyHelpTitle": "Webhook-Anfragen sichern",
|
|
66
|
+
"secretkeyHelpDescription": "Durch Hinzufügen eines geheimen Schlüssels können Sie überprüfen, ob die Webhook-Anfrage tatsächlich von Neeto gesendet wurde.",
|
|
67
|
+
"secretPlaceholder": "Einen geheimen Schlüssel eingeben",
|
|
68
|
+
"edit": "Webhook bearbeiten",
|
|
69
|
+
"active": "Aktiv",
|
|
70
|
+
"activeStatuses": {
|
|
71
|
+
"active": "Aktiv",
|
|
72
|
+
"inactive": "Inaktiv"
|
|
73
|
+
},
|
|
74
|
+
"statusActiveHelpDescription": "Das Webhook ist derzeit aktiv. Umschalten, um es inaktiv zu machen.",
|
|
75
|
+
"statusInactiveHelpDescription": "Das Webhook ist derzeit inaktiv. Umschalten, um es aktiv zu machen."
|
|
76
|
+
},
|
|
77
|
+
"operation": {
|
|
78
|
+
"edit": "Bearbeiten",
|
|
79
|
+
"delete": "Löschen"
|
|
80
|
+
},
|
|
81
|
+
"alert": {
|
|
82
|
+
"delete": {
|
|
83
|
+
"title": "Löschen {{entity}}?",
|
|
84
|
+
"message": "Sie löschen {{entity}} dauerhaft. Dies kann nicht rückgängig gemacht werden."
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"tableHeaders": {
|
|
88
|
+
"active": "Aktiv",
|
|
89
|
+
"details": "Details",
|
|
90
|
+
"createdAt": "Erstellt am"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"configure": "Configure"
|
|
14
14
|
},
|
|
15
15
|
"buttons": {
|
|
16
|
+
"save": "Save",
|
|
16
17
|
"saveChanges": "Save changes",
|
|
17
18
|
"cancel": "Cancel",
|
|
18
19
|
"delete": "Delete",
|
|
@@ -72,7 +73,25 @@
|
|
|
72
73
|
"inactive": "Inactive"
|
|
73
74
|
},
|
|
74
75
|
"statusActiveHelpDescription": "The webhook is currently active. Toggle to make it inactive.",
|
|
75
|
-
"statusInactiveHelpDescription": "The webhook is currently inactive. Toggle to make it active."
|
|
76
|
+
"statusInactiveHelpDescription": "The webhook is currently inactive. Toggle to make it active.",
|
|
77
|
+
"version": "Version",
|
|
78
|
+
"versionStatus": {
|
|
79
|
+
"expired": {
|
|
80
|
+
"title": "Webhook Expired",
|
|
81
|
+
"message": "This webhook version has expired and cannot be edited. Only deletion is allowed."
|
|
82
|
+
},
|
|
83
|
+
"deprecated": {
|
|
84
|
+
"title": "Webhook Deprecated",
|
|
85
|
+
"message": "This webhook version is deprecated and cannot be edited. Only deletion is allowed."
|
|
86
|
+
},
|
|
87
|
+
"expiresIn": {
|
|
88
|
+
"days": "Expires in {{count}} day",
|
|
89
|
+
"days_other": "Expires in {{count}} days",
|
|
90
|
+
"hoursAndMinutes": "Expires in {{hours}} hour{{hoursPlural}} and {{minutes}} minute{{minutesPlural}}"
|
|
91
|
+
},
|
|
92
|
+
"expiredOn": "Expired on {{date}}",
|
|
93
|
+
"moreDetails": "More details."
|
|
94
|
+
}
|
|
76
95
|
},
|
|
77
96
|
"operation": {
|
|
78
97
|
"edit": "Edit",
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
{
|
|
2
|
+
"neetoWebhooks": {
|
|
3
|
+
"common": {
|
|
4
|
+
"event_one": "Evento",
|
|
5
|
+
"event_other": "Eventos",
|
|
6
|
+
"endpoint": "Endpoint",
|
|
7
|
+
"responseStatus": "Estado de respuesta",
|
|
8
|
+
"webhookWithCount": "{{count}} Webhook",
|
|
9
|
+
"webhookWithCount_other": "{{count}} Webhooks"
|
|
10
|
+
},
|
|
11
|
+
"entity": {
|
|
12
|
+
"webhook": "webhook",
|
|
13
|
+
"configure": "Configurar"
|
|
14
|
+
},
|
|
15
|
+
"buttons": {
|
|
16
|
+
"saveChanges": "Guardar cambios",
|
|
17
|
+
"cancel": "Cancelar",
|
|
18
|
+
"delete": "Eliminar",
|
|
19
|
+
"edit": "Editar",
|
|
20
|
+
"viewDetails": "Ver detalles",
|
|
21
|
+
"regenerate": "Regenerar",
|
|
22
|
+
"generateSecretKey": "Generar clave secreta"
|
|
23
|
+
},
|
|
24
|
+
"errors": {
|
|
25
|
+
"webhook": {
|
|
26
|
+
"required": "Por favor, ingrese la URL de su endpoint",
|
|
27
|
+
"invalidUrl": "Por favor, ingrese una URL válida",
|
|
28
|
+
"invalidUrlProtocol": "Por favor, ingrese una URL válida. La URL debe comenzar con http o https",
|
|
29
|
+
"urlNotUnique": "La URL del endpoint debe ser única",
|
|
30
|
+
"events": {
|
|
31
|
+
"required": "Por favor, seleccione al menos un evento de webhook"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"delivery": {
|
|
36
|
+
"title": "Entregas",
|
|
37
|
+
"redeliver": "Reenviar",
|
|
38
|
+
"redelivery": "reenvío",
|
|
39
|
+
"request": "Solicitud",
|
|
40
|
+
"response": "Respuesta",
|
|
41
|
+
"header": "Cabecera",
|
|
42
|
+
"body": "Cuerpo",
|
|
43
|
+
"payload": "Carga útil",
|
|
44
|
+
"deliveryId": "ID de entrega",
|
|
45
|
+
"sid": "ID",
|
|
46
|
+
"helpDescription": "Detalles relacionados con la respuesta recibida cuando el producto interactúa con el endpoint especificado en el webhook.",
|
|
47
|
+
"empty": {
|
|
48
|
+
"title": "No hay entregas para mostrar.",
|
|
49
|
+
"description": "No se han enviado eventos a este webhook"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"webhook": {
|
|
53
|
+
"title": "Webhooks",
|
|
54
|
+
"description": "Todos los detalles de eventos de acción nuevos se publicarán en las URL de webhook configuradas",
|
|
55
|
+
"helpDescription": "Reciba un webhook cuando ocurran los eventos especificados.",
|
|
56
|
+
"empty": "No hay webhooks para mostrar.",
|
|
57
|
+
"emptyHelpText": "¿Qué son los webhooks?",
|
|
58
|
+
"add": "Agregar nuevo webhook",
|
|
59
|
+
"endpoint": "Endpoint",
|
|
60
|
+
"event_one": "Evento",
|
|
61
|
+
"event_other": "Eventos",
|
|
62
|
+
"endpointPlaceholder": "Ingrese la URL del endpoint",
|
|
63
|
+
"eventPlaceholder": "Seleccione eventos de webhook",
|
|
64
|
+
"secret": "Clave secreta (opcional)",
|
|
65
|
+
"secretkeyHelpTitle": "Asegurando solicitudes de webhook",
|
|
66
|
+
"secretkeyHelpDescription": "Agregar una clave secreta le ayudará a verificar que la solicitud de webhook fue enviada realmente por neeto.",
|
|
67
|
+
"secretPlaceholder": "Ingrese la clave secreta",
|
|
68
|
+
"edit": "Editar Webhook",
|
|
69
|
+
"active": "Activo",
|
|
70
|
+
"activeStatuses": {
|
|
71
|
+
"active": "Activo",
|
|
72
|
+
"inactive": "Inactivo"
|
|
73
|
+
},
|
|
74
|
+
"statusActiveHelpDescription": "El webhook está actualmente activo. Cambie para hacerlo inactivo.",
|
|
75
|
+
"statusInactiveHelpDescription": "El webhook está actualmente inactivo. Cambie para hacerlo activo."
|
|
76
|
+
},
|
|
77
|
+
"operation": {
|
|
78
|
+
"edit": "Editar",
|
|
79
|
+
"delete": "Eliminar"
|
|
80
|
+
},
|
|
81
|
+
"alert": {
|
|
82
|
+
"delete": {
|
|
83
|
+
"title": "Eliminar {{entity}}?",
|
|
84
|
+
"message": "Está eliminando permanentemente el {{entity}}. Esto no se puede deshacer."
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"tableHeaders": {
|
|
88
|
+
"active": "Activo",
|
|
89
|
+
"details": "Detalles",
|
|
90
|
+
"createdAt": "Creado en"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
{
|
|
2
|
+
"neetoWebhooks": {
|
|
3
|
+
"common": {
|
|
4
|
+
"event_one": "Événement",
|
|
5
|
+
"event_other": "Événements",
|
|
6
|
+
"endpoint": "Point de terminaison",
|
|
7
|
+
"responseStatus": "Statut de la réponse",
|
|
8
|
+
"webhookWithCount": "{{count}} Webhook",
|
|
9
|
+
"webhookWithCount_other": "{{count}} Webhooks"
|
|
10
|
+
},
|
|
11
|
+
"entity": {
|
|
12
|
+
"webhook": "webhook",
|
|
13
|
+
"configure": "Configurer"
|
|
14
|
+
},
|
|
15
|
+
"buttons": {
|
|
16
|
+
"saveChanges": "Enregistrer les modifications",
|
|
17
|
+
"cancel": "Annuler",
|
|
18
|
+
"delete": "Supprimer",
|
|
19
|
+
"edit": "Modifier",
|
|
20
|
+
"viewDetails": "Voir les détails",
|
|
21
|
+
"regenerate": "Régénérer",
|
|
22
|
+
"generateSecretKey": "Générer une clé secrète"
|
|
23
|
+
},
|
|
24
|
+
"errors": {
|
|
25
|
+
"webhook": {
|
|
26
|
+
"required": "Veuillez entrer votre URL de point de terminaison",
|
|
27
|
+
"invalidUrl": "Veuillez entrer une URL valide",
|
|
28
|
+
"invalidUrlProtocol": "Veuillez entrer une URL valide. L'URL doit commencer par http ou https",
|
|
29
|
+
"urlNotUnique": "L'URL de point de terminaison doit être unique",
|
|
30
|
+
"events": {
|
|
31
|
+
"required": "Veuillez sélectionner au moins un événement webhook"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"delivery": {
|
|
36
|
+
"title": "Livraisons",
|
|
37
|
+
"redeliver": "Renvoyer",
|
|
38
|
+
"redelivery": "renvoi",
|
|
39
|
+
"request": "Demande",
|
|
40
|
+
"response": "Réponse",
|
|
41
|
+
"header": "En-tête",
|
|
42
|
+
"body": "Corps",
|
|
43
|
+
"payload": "Charge utile",
|
|
44
|
+
"deliveryId": "ID de livraison",
|
|
45
|
+
"sid": "ID",
|
|
46
|
+
"helpDescription": "Détails relatifs à la réponse reçue lorsque le produit interagit avec le point de terminaison spécifié dans le webhook.",
|
|
47
|
+
"empty": {
|
|
48
|
+
"title": "Il n'y a pas de livraisons à afficher.",
|
|
49
|
+
"description": "Aucun événement n'a été envoyé à ce webhook"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"webhook": {
|
|
53
|
+
"title": "Webhooks",
|
|
54
|
+
"description": "Tous les détails des nouveaux événements d'action seront envoyés aux URL de webhook configurées",
|
|
55
|
+
"helpDescription": "Recevez un webhook lorsque les événements spécifiés se produisent.",
|
|
56
|
+
"empty": "Il n'y a pas de webhooks à afficher.",
|
|
57
|
+
"emptyHelpText": "Qu'est-ce que les webhooks ?",
|
|
58
|
+
"add": "Ajouter un nouveau webhook",
|
|
59
|
+
"endpoint": "Point de terminaison",
|
|
60
|
+
"event_one": "Événement",
|
|
61
|
+
"event_other": "Événements",
|
|
62
|
+
"endpointPlaceholder": "Entrez l'URL du point de terminaison",
|
|
63
|
+
"eventPlaceholder": "Sélectionnez les événements webhook",
|
|
64
|
+
"secret": "Clé secrète (facultatif)",
|
|
65
|
+
"secretkeyHelpTitle": "Sécurisation des demandes de webhook",
|
|
66
|
+
"secretkeyHelpDescription": "Ajouter une clé secrète vous aidera à vérifier que la demande de webhook a bien été envoyée par neeto.",
|
|
67
|
+
"secretPlaceholder": "Entrez la clé secrète",
|
|
68
|
+
"edit": "Modifier le webhook",
|
|
69
|
+
"active": "Actif",
|
|
70
|
+
"activeStatuses": {
|
|
71
|
+
"active": "Actif",
|
|
72
|
+
"inactive": "Inactif"
|
|
73
|
+
},
|
|
74
|
+
"statusActiveHelpDescription": "Le webhook est actuellement actif. Basculez pour le rendre inactif.",
|
|
75
|
+
"statusInactiveHelpDescription": "Le webhook est actuellement inactif. Basculez pour le rendre actif."
|
|
76
|
+
},
|
|
77
|
+
"operation": {
|
|
78
|
+
"edit": "Modifier",
|
|
79
|
+
"delete": "Supprimer"
|
|
80
|
+
},
|
|
81
|
+
"alert": {
|
|
82
|
+
"delete": {
|
|
83
|
+
"title": "Supprimer {{entity}} ?",
|
|
84
|
+
"message": "Vous supprimez définitivement le {{entity}}. Cela ne peut pas être annulé."
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"tableHeaders": {
|
|
88
|
+
"active": "Actif",
|
|
89
|
+
"details": "Détails",
|
|
90
|
+
"createdAt": "Créé à"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
package/dist/NeetoWebhooks.js
CHANGED
|
@@ -275,6 +275,7 @@ var TransactionDetails = function TransactionDetails(_ref) {
|
|
|
275
275
|
};
|
|
276
276
|
|
|
277
277
|
var Details = function Details(_ref) {
|
|
278
|
+
var _delivery$webhook;
|
|
278
279
|
var onClose = _ref.onClose,
|
|
279
280
|
deliveryId = _ref.deliveryId,
|
|
280
281
|
webhookSid = _ref.webhookSid;
|
|
@@ -345,7 +346,7 @@ var Details = function Details(_ref) {
|
|
|
345
346
|
}), /*#__PURE__*/jsxs(Pane.Footer, {
|
|
346
347
|
className: "gap-x-2",
|
|
347
348
|
children: [(delivery === null || delivery === void 0 ? void 0 : delivery.eventId) && /*#__PURE__*/jsx(Button, {
|
|
348
|
-
disabled: isRedelivering,
|
|
349
|
+
disabled: isRedelivering || ((_delivery$webhook = delivery.webhook) === null || _delivery$webhook === void 0 ? void 0 : _delivery$webhook.versionExpired),
|
|
349
350
|
label: t("neetoWebhooks.delivery.redeliver"),
|
|
350
351
|
loading: isRedelivering,
|
|
351
352
|
style: "primary",
|
|
@@ -584,6 +585,10 @@ var useUpdateWebhook = function useUpdateWebhook(id, options) {
|
|
|
584
585
|
onSuccess: function onSuccess() {
|
|
585
586
|
var _options$onSuccess2;
|
|
586
587
|
options === null || options === void 0 || (_options$onSuccess2 = options.onSuccess) === null || _options$onSuccess2 === void 0 || _options$onSuccess2.call(options);
|
|
588
|
+
},
|
|
589
|
+
onError: function onError(error) {
|
|
590
|
+
var _options$onError;
|
|
591
|
+
options === null || options === void 0 || (_options$onError = options.onError) === null || _options$onError === void 0 || _options$onError.call(options, error);
|
|
587
592
|
}
|
|
588
593
|
});
|
|
589
594
|
};
|
|
@@ -722,10 +727,22 @@ var ToggleActiveSwitch = function ToggleActiveSwitch(_ref) {
|
|
|
722
727
|
_useState2 = _slicedToArray(_useState, 2),
|
|
723
728
|
status = _useState2[0],
|
|
724
729
|
setStatus = _useState2[1];
|
|
725
|
-
var
|
|
730
|
+
var previousStatusRef = useRef(isActive);
|
|
731
|
+
var _useUpdateWebhook = useUpdateWebhook(webhookId, {
|
|
732
|
+
onError: function onError() {
|
|
733
|
+
// Revert to the previous state
|
|
734
|
+
setStatus(previousStatusRef.current);
|
|
735
|
+
},
|
|
736
|
+
onSuccess: function onSuccess() {
|
|
737
|
+
// Update the previous status ref on successful update
|
|
738
|
+
previousStatusRef.current = status;
|
|
739
|
+
}
|
|
740
|
+
}),
|
|
726
741
|
updateWebhook = _useUpdateWebhook.mutate;
|
|
727
742
|
var handleToggle = function handleToggle(event) {
|
|
728
743
|
var updatedStatus = event.target.checked;
|
|
744
|
+
// Store the current status as previous before changing
|
|
745
|
+
previousStatusRef.current = status;
|
|
729
746
|
setStatus(updatedStatus);
|
|
730
747
|
updateWebhook({
|
|
731
748
|
id: webhookId,
|
|
@@ -796,6 +813,35 @@ var buildPayload = function buildPayload(_ref2) {
|
|
|
796
813
|
eventsAttributes: [].concat(_toConsumableArray(creatable), _toConsumableArray(deletable))
|
|
797
814
|
});
|
|
798
815
|
};
|
|
816
|
+
var formatTimeUntilExpiration = function formatTimeUntilExpiration(expiresAt) {
|
|
817
|
+
if (!expiresAt) return null;
|
|
818
|
+
var now = new Date();
|
|
819
|
+
var expiry = new Date(expiresAt);
|
|
820
|
+
var diffMs = expiry - now;
|
|
821
|
+
if (diffMs <= 0) return null;
|
|
822
|
+
var diffHours = Math.floor(diffMs / (1000 * 60 * 60));
|
|
823
|
+
var diffDays = Math.floor(diffHours / 24);
|
|
824
|
+
if (diffDays > 0) {
|
|
825
|
+
return t$1("neetoWebhooks.webhook.versionStatus.expiresIn.days", {
|
|
826
|
+
count: diffDays
|
|
827
|
+
});
|
|
828
|
+
}
|
|
829
|
+
var remainingHours = diffHours;
|
|
830
|
+
var remainingMinutes = Math.floor(diffMs % (1000 * 60 * 60) / (1000 * 60));
|
|
831
|
+
return t$1("neetoWebhooks.webhook.versionStatus.expiresIn.hoursAndMinutes", {
|
|
832
|
+
hours: remainingHours,
|
|
833
|
+
hoursPlural: remainingHours !== 1 ? "s" : "",
|
|
834
|
+
minutes: remainingMinutes,
|
|
835
|
+
minutesPlural: remainingMinutes !== 1 ? "s" : ""
|
|
836
|
+
});
|
|
837
|
+
};
|
|
838
|
+
var formatExpiredDate = function formatExpiredDate(expiresAt) {
|
|
839
|
+
if (!expiresAt) return null;
|
|
840
|
+
var expiry = new Date(expiresAt);
|
|
841
|
+
return t$1("neetoWebhooks.webhook.versionStatus.expiredOn", {
|
|
842
|
+
date: expiry.toLocaleDateString()
|
|
843
|
+
});
|
|
844
|
+
};
|
|
799
845
|
var buildColumns = function buildColumns(_ref6) {
|
|
800
846
|
var handleDelete = _ref6.handleDelete,
|
|
801
847
|
handleEdit = _ref6.handleEdit,
|
|
@@ -840,6 +886,38 @@ var buildColumns = function buildColumns(_ref6) {
|
|
|
840
886
|
});
|
|
841
887
|
},
|
|
842
888
|
width: 150
|
|
889
|
+
}, {
|
|
890
|
+
title: t$1("neetoWebhooks.webhook.version"),
|
|
891
|
+
dataIndex: "version",
|
|
892
|
+
key: "version",
|
|
893
|
+
render: function render(version, webhook) {
|
|
894
|
+
var timeMessage = webhook.versionExpired ? formatExpiredDate(webhook.versionExpiresAt) : formatTimeUntilExpiration(webhook.versionExpiresAt);
|
|
895
|
+
return /*#__PURE__*/jsxs("div", {
|
|
896
|
+
className: "flex flex-col space-y-1",
|
|
897
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
898
|
+
className: "flex items-center space-x-2",
|
|
899
|
+
children: [/*#__PURE__*/jsx("span", {
|
|
900
|
+
children: version
|
|
901
|
+
}), webhook.versionExpired && /*#__PURE__*/jsx(Tag, {
|
|
902
|
+
label: "expired",
|
|
903
|
+
style: "danger"
|
|
904
|
+
}), webhook.versionDeprecated && !webhook.versionExpired && /*#__PURE__*/jsx(Tag, {
|
|
905
|
+
label: "deprecated",
|
|
906
|
+
style: "warning"
|
|
907
|
+
})]
|
|
908
|
+
}), timeMessage && /*#__PURE__*/jsxs("div", {
|
|
909
|
+
className: "text-xs neeto-ui-text-gray-600",
|
|
910
|
+
children: [timeMessage, ".", " ", /*#__PURE__*/jsx("a", {
|
|
911
|
+
className: "text-blue-600 hover:text-blue-800 underline",
|
|
912
|
+
href: webhook.defaultVersionPayloadDocUrl,
|
|
913
|
+
rel: "noopener noreferrer",
|
|
914
|
+
target: "_blank",
|
|
915
|
+
children: t$1("neetoWebhooks.webhook.versionStatus.moreDetails")
|
|
916
|
+
}), "."]
|
|
917
|
+
})]
|
|
918
|
+
});
|
|
919
|
+
},
|
|
920
|
+
width: 200
|
|
843
921
|
}, {
|
|
844
922
|
title: t$1("neetoWebhooks.common.event", PLURAL),
|
|
845
923
|
dataIndex: "events",
|
|
@@ -898,7 +976,12 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
|
|
|
898
976
|
var initialValues = editingWebhookId ? _objectSpread$1(_objectSpread$1({}, WEBHOOK_INITIAL_VALUES), webhook) : _objectSpread$1(_objectSpread$1({}, WEBHOOK_INITIAL_VALUES), {}, {
|
|
899
977
|
events: events
|
|
900
978
|
});
|
|
979
|
+
var isWebhookExpiredOrDeprecated = editingWebhookId && (webhook.versionExpired || webhook.versionDeprecated);
|
|
901
980
|
var handleSubmit = function handleSubmit(values) {
|
|
981
|
+
// Check if webhook is expired or deprecated before allowing edit
|
|
982
|
+
if (editingWebhookId && (webhook.versionExpired || webhook.versionDeprecated)) {
|
|
983
|
+
return;
|
|
984
|
+
}
|
|
902
985
|
var payload = buildPayload({
|
|
903
986
|
isEditing: editingWebhookId,
|
|
904
987
|
values: values,
|
|
@@ -1052,6 +1135,9 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
|
|
|
1052
1135
|
children: /*#__PURE__*/jsx(ActionBlock, {
|
|
1053
1136
|
cancelButtonProps: {
|
|
1054
1137
|
onClick: onClose
|
|
1138
|
+
},
|
|
1139
|
+
submitButtonProps: {
|
|
1140
|
+
disabled: isWebhookExpiredOrDeprecated
|
|
1055
1141
|
}
|
|
1056
1142
|
})
|
|
1057
1143
|
})]
|