Skip to content

Commit

Permalink
Merge pull request #1073 from openmsupply/additional-tweaks
Browse files Browse the repository at this point in the history
Fix "disabled" message on Save button
  • Loading branch information
CarlosNZ authored Dec 8, 2021
2 parents 47242d4 + c7eb8f4 commit 6bc1464
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ const ActionConfig: React.FC<ActionConfigProps> = ({ templateAction, onClose })
<ButtonWithFallback
title={strings.TEMPLATE_BUTTON_SAVE}
disabled={!isDraft || !shouldUpdate}
disabledMessage={disabledMessage}
disabledMessage={!isDraft ? disabledMessage : strings.TEMPLATE_MESSAGE_SAVE_DISABLED}
onClick={updateAction}
/>
<ButtonWithFallback
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ const ElementConfig: React.FC<ElementConfigProps> = ({ element, onClose }) => {
<ButtonWithFallback
title={strings.TEMPLATE_BUTTON_SAVE}
disabled={!isDraft || !shouldUpdate}
disabledMessage={disabledMessage}
disabledMessage={!isDraft ? disabledMessage : strings.TEMPLATE_MESSAGE_SAVE_DISABLED}
onClick={updateElement}
/>
<ButtonWithFallback
Expand Down
8 changes: 8 additions & 0 deletions src/containers/User/UserArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,14 @@ const MainMenuBar: React.FC<MainMenuBarProps> = ({ templates, outcomes }) => {
value: '/admin/localisations',
},
]
// Only include Snapshots menu item in Dev mode
if (process.env.NODE_ENV === 'development')
adminOptions.splice(1, 0, {
key: 'snapshots',
text: 'Snapshots',
value: '/admin/snapshots',
})

// Add Admin templates to Admin menu
adminOptions.push(
...templates
Expand Down
1 change: 1 addition & 0 deletions src/utils/defaultLanguageStrings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ export default {
TEMPLATE_APPEARS_IN: 'Appears in',
TEMPLATE_MESSAGE_SAVE_AND_CLOSE: 'There are changes not saved. Would you like to save and close?',
TEMPLATE_MESSAGE_SAVE_SUCCESS: 'Changes saved',
TEMPLATE_MESSAGE_SAVE_DISABLED: 'No changes',
TEMPLATE_MESSAGE_REMOVE_ELEMENT_TITLE: 'Remove element',
TEMPLATE_MESSAGE_REMOVE_ELEMENT_CONTENT: 'Are you sure you would like to remove this element?',
UNASSIGN_TITLE: 'Unassignment of reviewer',
Expand Down

0 comments on commit 6bc1464

Please sign in to comment.