Skip to content

Commit

Permalink
chore: update webhook confirmation info regarding token and secret up…
Browse files Browse the repository at this point in the history
…dates
  • Loading branch information
ryanhopperlowe committed Nov 21, 2024
1 parent da0b39c commit 86b44b4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ui/admin/app/components/webhooks/WebhookConfirmation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ export type WebhookConfirmationProps = {
token?: string;
secret: string;
type?: "github";
tokenRemoved: boolean;
secretRemoved: boolean;
};

export const WebhookConfirmation = ({
Expand All @@ -29,11 +31,14 @@ export const WebhookConfirmation = ({
token,
secret,
type: _ = "github",
tokenRemoved,
secretRemoved,
}: WebhookConfirmationProps) => {
const showUrlChange =
!original ||
original.links?.invoke !== webhook.links?.invoke ||
!!token;
!!token ||
tokenRemoved;

return (
<Dialog open>
Expand Down Expand Up @@ -83,7 +88,7 @@ export const WebhookConfirmation = ({
/>
) : (
<TypographyP className="text-muted-foreground">
(Unchanged)
({secretRemoved ? "None" : "Unchanged"})
</TypographyP>
)}
</div>
Expand Down
2 changes: 2 additions & 0 deletions ui/admin/app/components/webhooks/WebhookFormContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ export function WebhookFormContextProvider({
secret: values.secret,
token: values.token,
original: webhook,
tokenRemoved: values.removeToken,
secretRemoved: !values.secret && !values.validationHeader,
});
});

Expand Down

0 comments on commit 86b44b4

Please sign in to comment.