Skip to content

Commit

Permalink
Add support for the BrokerProperties header (#4831)
Browse files Browse the repository at this point in the history
  • Loading branch information
patrys authored Apr 26, 2024
1 parent cb5988f commit e7e639b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/purple-beans-deliver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": patch
---

Addedd support for the BrokerProperties webhook header
8 changes: 4 additions & 4 deletions locale/defaultMessages.json
Original file line number Diff line number Diff line change
Expand Up @@ -6927,10 +6927,6 @@
"context": "button",
"string": "Apply"
},
"iERn5G": {
"context": "header name input",
"string": "Should start with `x-` or `authorization`"
},
"iEeIhY": {
"context": "draft order",
"string": "Customer"
Expand Down Expand Up @@ -8362,6 +8358,10 @@
"context": "dialog title",
"string": "Delete categories"
},
"sGDsFP": {
"context": "header name input",
"string": "Should match `x-*`, `authorization*`, or `brokerproperties`."
},
"sHON47": {
"context": "refunded products list title",
"string": "Products refunded"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ const WebhookHeaders: React.FC<WebhookHeadersProps> = ({ data: { customHeaders }
<FormattedMessage
{...messages.acceptedFormat}
values={{
code: (...chunks) => <code>${chunks}</code>,
code: (...chunks) => <code>{chunks}</code>,
}}
/>
</Typography>
Expand Down
4 changes: 2 additions & 2 deletions src/custom-apps/components/WebhookHeaders/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export const messages = defineMessages({
description: "header field name, header",
},
headerNameError: {
id: "iERn5G",
defaultMessage: "Should start with `x-` or `authorization`",
id: "sGDsFP",
defaultMessage: "Should match `x-*`, `authorization*`, or `brokerproperties`.",
description: "header name input",
},
headerValue: {
Expand Down
4 changes: 3 additions & 1 deletion src/custom-apps/components/WebhookHeaders/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ const validateName = (name: string) => {
if (
name
.toLowerCase()
.match("(^x$)|(^x-)|^(a|$)(u|$)(t|$)(h|$)(o|$)(r|$)(i|$)(z|$)(a|$)(t|$)(i|$)(o|$)(n|$)(-|$)")
.match(
"(^x$)|(^x-)|^(a|$)(u|$)(t|$)(h|$)(o|$)(r|$)(i|$)(z|$)(a|$)(t|$)(i|$)(o|$)(n|$)(-|$)|^brokerproperties$",
)
) {
return false;
}
Expand Down

0 comments on commit e7e639b

Please sign in to comment.