fix: Webhook category subscriptions do not work correctly, closes #5257

This commit is contained in:
Tom Moor
2023-04-26 08:59:24 -04:00
parent 01707d733a
commit f1ce23dce9

View File

@@ -14,7 +14,7 @@ import useCurrentTeam from "~/hooks/useCurrentTeam";
import useMobile from "~/hooks/useMobile";
const WEBHOOK_EVENTS = {
user: [
users: [
"users.create",
"users.signin",
"users.update",
@@ -25,7 +25,7 @@ const WEBHOOK_EVENTS = {
"users.promote",
"users.demote",
],
document: [
documents: [
"documents.create",
"documents.publish",
"documents.unpublish",
@@ -38,7 +38,7 @@ const WEBHOOK_EVENTS = {
"documents.update",
"documents.title_change",
],
collection: [
collections: [
"collections.create",
"collections.update",
"collections.delete",
@@ -49,30 +49,30 @@ const WEBHOOK_EVENTS = {
"collections.move",
"collections.permission_changed",
],
comment: ["comments.create", "comments.update", "comments.delete"],
revision: ["revisions.create"],
fileOperation: [
comments: ["comments.create", "comments.update", "comments.delete"],
revisions: ["revisions.create"],
fileOperations: [
"fileOperations.create",
"fileOperations.update",
"fileOperations.delete",
],
group: [
groups: [
"groups.create",
"groups.update",
"groups.delete",
"groups.add_user",
"groups.remove_user",
],
integration: ["integrations.create", "integrations.update"],
share: ["shares.create", "shares.update", "shares.revoke"],
team: ["teams.update"],
pin: ["pins.create", "pins.update", "pins.delete"],
webhookSubscription: [
integrations: ["integrations.create", "integrations.update"],
shares: ["shares.create", "shares.update", "shares.revoke"],
teams: ["teams.update"],
pins: ["pins.create", "pins.update", "pins.delete"],
webhookSubscriptions: [
"webhookSubscriptions.create",
"webhookSubscriptions.delete",
"webhookSubscriptions.update",
],
view: ["views.create"],
views: ["views.create"],
};
const EventCheckboxLabel = styled.label`
@@ -283,7 +283,9 @@ function WebhookSubscriptionForm({ handleSubmit, webhookSubscription }: Props) {
.map(([group, events], i) => (
<GroupWrapper key={i} isMobile={isMobile}>
<EventCheckbox
label={t(`All {{ groupName }} events`, { groupName: group })}
label={t(`All {{ groupName }} events`, {
groupName: group.replace(/s$/, ""),
})}
value={group}
/>
<FieldSet disabled={selectedGroups.includes(group)}>