-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Failed event deliveries list (#5163)
* improve app install loading state * tiny ui fix * failed event delivery list in app details * changeset * fix types * add tests * fix type * cr fixes * ui fixes * remove unused import
- Loading branch information
Showing
12 changed files
with
467 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"saleor-dashboard": patch | ||
--- | ||
|
||
You can now see app's webhooks' event delivery attempts in app settings. These include last 6 failed or pending deliveries with their details: payload, status and date. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
src/apps/components/AppWebhooksDisplay/AppWebhooksAttemptDetails.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import { DateTime } from "@dashboard/components/Date"; | ||
import { EventDeliveryAttemptFragment } from "@dashboard/graphql"; | ||
import { Box, Text } from "@saleor/macaw-ui-next"; | ||
import React from "react"; | ||
|
||
interface AppWebhooksAttemptDetailsProps { | ||
attempt: EventDeliveryAttemptFragment; | ||
} | ||
|
||
export const AppWebhooksAttemptDetails: React.FC<AppWebhooksAttemptDetailsProps> = ({ | ||
attempt, | ||
}) => { | ||
const { createdAt, status, responseStatusCode, response, id } = attempt; | ||
|
||
return ( | ||
<Box | ||
display="flex" | ||
flexDirection="column" | ||
paddingX={2} | ||
borderRadius={4} | ||
backgroundColor={{ | ||
hover: "default1Hovered", | ||
}} | ||
paddingTop={1} | ||
borderWidth={1} | ||
> | ||
<Box display="flex" gap={4} key={id}> | ||
<Text display="block" size={3} fontWeight="bold"> | ||
<DateTime plain date={createdAt} /> | ||
</Text> | ||
|
||
<Box display="block" marginLeft="auto"> | ||
<Text color="default2">HTTP</Text>{" "} | ||
<Text color="critical1" fontWeight="bold" marginRight={4}> | ||
{responseStatusCode} | ||
</Text> | ||
<Text color="default2">Status</Text>:{" "} | ||
<Text color={status === "FAILED" ? "critical1" : "default1"} fontWeight="bold"> | ||
{status} | ||
</Text> | ||
</Box> | ||
</Box> | ||
|
||
<Box paddingTop={4} paddingBottom={2}> | ||
<Text | ||
// @ts-expect-error - "pre" is missing in Text props | ||
as="pre" | ||
wordBreak="break-all" | ||
maxWidth="100%" | ||
size={3} | ||
style={{ whiteSpace: "pre-wrap" }} | ||
> | ||
{response} | ||
</Text> | ||
</Box> | ||
</Box> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.