diff --git a/.changeset/easy-maps-appear.md b/.changeset/easy-maps-appear.md new file mode 100644 index 0000000000..67c97c20f6 --- /dev/null +++ b/.changeset/easy-maps-appear.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-home': minor +--- + +Widget configurations are now only saved to storage when the Save button is explicitly clicked. Added a Cancel button that allows users to discard unsaved changes and revert to the last saved state. diff --git a/plugins/home/report-alpha.api.md b/plugins/home/report-alpha.api.md index 58ceef751d..6344805372 100644 --- a/plugins/home/report-alpha.api.md +++ b/plugins/home/report-alpha.api.md @@ -107,6 +107,7 @@ export const homeTranslationRef: TranslationRef< { readonly 'starredEntities.noStarredEntitiesMessage': 'Click the star beside an entity name to add it to this list!'; readonly 'addWidgetDialog.title': 'Add new widget to dashboard'; + readonly 'customHomepageButtons.cancel': 'Cancel'; readonly 'customHomepageButtons.clearAll': 'Clear all'; readonly 'customHomepageButtons.edit': 'Edit'; readonly 'customHomepageButtons.restoreDefaults': 'Restore defaults'; diff --git a/plugins/home/src/components/CustomHomepage/CustomHomepageButtons.tsx b/plugins/home/src/components/CustomHomepage/CustomHomepageButtons.tsx index 0496e923de..b7e397c995 100644 --- a/plugins/home/src/components/CustomHomepage/CustomHomepageButtons.tsx +++ b/plugins/home/src/components/CustomHomepage/CustomHomepageButtons.tsx @@ -45,6 +45,7 @@ interface CustomHomepageButtonsProps { changeEditMode: (mode: boolean) => void; defaultConfigAvailable: boolean; restoreDefault: () => void; + cancel: () => void; } export const CustomHomepageButtons = (props: CustomHomepageButtonsProps) => { const { @@ -55,6 +56,7 @@ export const CustomHomepageButtons = (props: CustomHomepageButtonsProps) => { changeEditMode, defaultConfigAvailable, restoreDefault, + cancel, } = props; const styles = useStyles(); const { t } = useTranslationRef(homeTranslationRef); @@ -73,6 +75,9 @@ export const CustomHomepageButtons = (props: CustomHomepageButtonsProps) => { ) : ( <> + {defaultConfigAvailable && (