feat(admin-shared,dashboard,js-sdk,types): refund reasons in dashboard (#13575)

CLOSES CORE-1209

This PR just adds the stuff necessary to support refund reasons in the dashboard. It adds the option in the settings tab and allows viewing, creating, editing and deleting refund reasons. I hate to open such a big PR but most of it is copy pasted from the return reasons. Major difference is only the fact that refund reasons don't have a `value` field
This commit is contained in:
William Bouchard
2025-09-23 15:51:40 +00:00
committed by GitHub
parent 543c9f7d0f
commit 5e827ec95d
39 changed files with 1190 additions and 131 deletions
@@ -161,6 +161,9 @@
"noRecordsMessage": {
"type": "string"
},
"noRecordsMessageFiltered": {
"type": "string"
},
"unsavedChangesTitle": {
"type": "string"
},
@@ -229,6 +232,7 @@
"noSearchResultsFor",
"noRecordsTitle",
"noRecordsMessage",
"noRecordsMessageFiltered",
"unsavedChangesTitle",
"unsavedChangesDescription",
"includesTaxTooltip",
@@ -10202,6 +10206,115 @@
],
"additionalProperties": false
},
"refundReasons": {
"type": "object",
"properties": {
"domain": {
"type": "string"
},
"subtitle": {
"type": "string"
},
"calloutHint": {
"type": "string"
},
"editReason": {
"type": "string"
},
"create": {
"type": "object",
"properties": {
"header": {
"type": "string"
},
"subtitle": {
"type": "string"
},
"hint": {
"type": "string"
},
"successToast": {
"type": "string"
}
},
"required": ["header", "subtitle", "hint", "successToast"],
"additionalProperties": false
},
"edit": {
"type": "object",
"properties": {
"header": {
"type": "string"
},
"subtitle": {
"type": "string"
},
"successToast": {
"type": "string"
}
},
"required": ["header", "subtitle", "successToast"],
"additionalProperties": false
},
"delete": {
"type": "object",
"properties": {
"confirmation": {
"type": "string"
},
"successToast": {
"type": "string"
}
},
"required": ["confirmation", "successToast"],
"additionalProperties": false
},
"fields": {
"type": "object",
"properties": {
"label": {
"type": "object",
"properties": {
"label": {
"type": "string"
},
"placeholder": {
"type": "string"
}
},
"required": ["label", "placeholder"],
"additionalProperties": false
},
"description": {
"type": "object",
"properties": {
"label": {
"type": "string"
},
"placeholder": {
"type": "string"
}
},
"required": ["label", "placeholder"],
"additionalProperties": false
}
},
"required": ["label", "description"],
"additionalProperties": false
}
},
"required": [
"domain",
"subtitle",
"calloutHint",
"editReason",
"create",
"edit",
"delete",
"fields"
],
"additionalProperties": false
},
"login": {
"type": "object",
"properties": {
@@ -11554,70 +11667,6 @@
],
"additionalProperties": false
},
"views": {
"type": "object",
"properties": {
"save": {
"type": "string"
},
"saveAsNew": {
"type": "string"
},
"updateDefaultForEveryone": {
"type": "string"
},
"updateViewName": {
"type": "string"
},
"prompts": {
"type": "object",
"properties": {
"updateDefault": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"confirmText": {
"type": "string"
},
"cancelText": {
"type": "string"
}
},
"required": ["title", "description", "confirmText", "cancelText"],
"additionalProperties": false
},
"updateView": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"confirmText": {
"type": "string"
},
"cancelText": {
"type": "string"
}
},
"required": ["title", "description", "confirmText", "cancelText"],
"additionalProperties": false
}
},
"required": ["updateDefault", "updateView"],
"additionalProperties": false
}
},
"required": ["save", "saveAsNew", "updateDefaultForEveryone", "updateViewName", "prompts"],
"additionalProperties": false
},
"dateTime": {
"type": "object",
"properties": {
@@ -11681,6 +11730,76 @@
"seconds_other"
],
"additionalProperties": false
},
"views": {
"type": "object",
"properties": {
"save": {
"type": "string"
},
"saveAsNew": {
"type": "string"
},
"updateDefaultForEveryone": {
"type": "string"
},
"updateViewName": {
"type": "string"
},
"prompts": {
"type": "object",
"properties": {
"updateDefault": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"confirmText": {
"type": "string"
},
"cancelText": {
"type": "string"
}
},
"required": ["title", "description", "confirmText", "cancelText"],
"additionalProperties": false
},
"updateView": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"confirmText": {
"type": "string"
},
"cancelText": {
"type": "string"
}
},
"required": ["title", "description", "confirmText", "cancelText"],
"additionalProperties": false
}
},
"required": ["updateDefault", "updateView"],
"additionalProperties": false
}
},
"required": [
"save",
"saveAsNew",
"updateDefaultForEveryone",
"updateViewName",
"prompts"
],
"additionalProperties": false
}
},
"required": [
@@ -11724,6 +11843,7 @@
"salesChannels",
"apiKeyManagement",
"returnReasons",
"refundReasons",
"login",
"invite",
"resetPassword",
@@ -11736,8 +11856,8 @@
"statuses",
"labels",
"fields",
"views",
"dateTime"
"dateTime",
"views"
],
"additionalProperties": false
}
@@ -52,6 +52,7 @@
"noSearchResultsFor": "No search results for <0>'{{query}}'</0>",
"noRecordsTitle": "No records",
"noRecordsMessage": "There are no records to show",
"noRecordsMessageFiltered": "There are no records to show matching the filters",
"unsavedChangesTitle": "Are you sure you want to leave this form?",
"unsavedChangesDescription": "You have unsaved changes that will be lost if you exit this form.",
"includesTaxTooltip": "Prices in this column are tax inclusive.",
@@ -2740,6 +2741,37 @@
}
}
},
"refundReasons": {
"domain": "Refund Reasons",
"subtitle": "Manage reasons for issuing refunds.",
"calloutHint": "Manage the reasons to categorize refunds.",
"editReason": "Edit Refund Reason",
"create": {
"header": "Add Refund Reason",
"subtitle": "Specify the most common reasons for refunds.",
"hint": "Create a new refund reason to categorize refunds.",
"successToast": "Refund reason {{label}} was successfully created."
},
"edit": {
"header": "Edit Refund Reason",
"subtitle": "Edit the value of the refund reason.",
"successToast": "Refund reason {{label}} was successfully updated."
},
"delete": {
"confirmation": "You are about to delete the refund reason \"{{label}}\". This action cannot be undone.",
"successToast": "Refund reason was successfully deleted."
},
"fields": {
"label": {
"label": "Label",
"placeholder": "Gesture of goodwill"
},
"description": {
"label": "Description",
"placeholder": "Customer had a bad shopping experience"
}
}
},
"login": {
"forgotPassword": "Forgot password? - <0>Reset</0>",
"title": "Welcome to Medusa",