Skip to content

Commit

Permalink
feat: clarify disabled export button when editor is dirty (#434)
Browse files Browse the repository at this point in the history
  • Loading branch information
dm-p committed May 13, 2024
1 parent 8d5cc5f commit 24e0a6d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/features/toolbar/components/toolbar-button-standard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ const resolveClick = (command: Command) => {
const resolveI18nKey = (command: Command) => {
const {
editorPreviewDebugIsExpanded,
editor: { applyMode },
editor: { applyMode, isDirty },
visualSettings: {
editor: {
interface: {
Expand All @@ -164,7 +164,7 @@ const resolveI18nKey = (command: Command) => {
case 'editorPaneToggle':
return 'Tooltip_Collapse_Editor_Pane';
case 'exportSpecification':
return 'Button_Export';
return isDirty ? 'Button_Export_Dirty' : 'Button_Export';
case 'fieldMappings':
return 'Button_Map_Fields';
case 'formatJson':
Expand Down
1 change: 1 addition & 0 deletions stringResources/en-US/resources.resjson
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@
"Font_Family": "Font Family",
"Button_Help": "Open help site in a new tab [Ctrl+Alt+H]",
"Button_Export": "Generate JSON template [Ctrl+Alt+T]",
"Button_Export_Dirty": "Save your changes first to ensure that your specification is eligible for export.",
"Button_Map_Fields": "Edit specification field mapping [Ctrl+Alt+F]",
"Button_New": "New specification [Ctrl+Alt+N]",
"Button_Apply": "Apply changes [Ctrl+Enter]",
Expand Down

0 comments on commit 24e0a6d

Please sign in to comment.