diff --git a/packages/netlify-cms-backend-git-gateway/src/__tests__/__snapshots__/AuthenticationPage.spec.js.snap b/packages/netlify-cms-backend-git-gateway/src/__tests__/__snapshots__/AuthenticationPage.spec.js.snap index 4cdacb49..056dc645 100644 --- a/packages/netlify-cms-backend-git-gateway/src/__tests__/__snapshots__/AuthenticationPage.spec.js.snap +++ b/packages/netlify-cms-backend-git-gateway/src/__tests__/__snapshots__/AuthenticationPage.spec.js.snap @@ -164,6 +164,7 @@ exports[`GitGatewayAuthenticationPage should render with no identity error 1`] = .emotion-2[disabled] { background-color: #eff0f4; color: #798291; + cursor: default; } .emotion-5 { @@ -255,6 +256,7 @@ exports[`GitGatewayAuthenticationPage should render with no identity error 1`] = .emotion-2[disabled] { background-color: #eff0f4; color: #798291; + cursor: default; } .emotion-5 { diff --git a/packages/netlify-cms-core/src/components/Editor/EditorToolbar.js b/packages/netlify-cms-core/src/components/Editor/EditorToolbar.js index 581ab5b4..3e04ce52 100644 --- a/packages/netlify-cms-core/src/components/Editor/EditorToolbar.js +++ b/packages/netlify-cms-core/src/components/Editor/EditorToolbar.js @@ -194,6 +194,9 @@ const DeleteButton = styled(ToolbarButton)` const SaveButton = styled(ToolbarButton)` ${buttons.lightBlue}; + &[disabled] { + ${buttons.disabled}; + } `; const PublishedToolbarButton = styled(DropdownButton)` @@ -583,7 +586,11 @@ export class EditorToolbar extends React.Component { (!hasUnpublishedChanges && !isModification && t('editor.editorToolbar.deletePublishedEntry')); return [ - hasChanged && onPersist()}> + hasChanged && onPersist()} + > {isPersisting ? t('editor.editorToolbar.saving') : t('editor.editorToolbar.save')} , (!showDelete || useOpenAuthoring) && !hasUnpublishedChanges && !isModification ? null : ( diff --git a/packages/netlify-cms-core/src/components/Editor/__tests__/EditorToolbar.spec.js b/packages/netlify-cms-core/src/components/Editor/__tests__/EditorToolbar.spec.js index 9891c045..5f1917ab 100644 --- a/packages/netlify-cms-core/src/components/Editor/__tests__/EditorToolbar.spec.js +++ b/packages/netlify-cms-core/src/components/Editor/__tests__/EditorToolbar.spec.js @@ -111,5 +111,10 @@ describe('EditorToolbar', () => { expect(asFragment()).toMatchSnapshot(); }); }); + + it(`should render normal save button`, () => { + const { asFragment } = render(); + expect(asFragment()).toMatchSnapshot(); + }); }); }); diff --git a/packages/netlify-cms-core/src/components/Editor/__tests__/__snapshots__/EditorToolbar.spec.js.snap b/packages/netlify-cms-core/src/components/Editor/__tests__/__snapshots__/EditorToolbar.spec.js.snap index 4dda046a..9e073670 100644 --- a/packages/netlify-cms-core/src/components/Editor/__tests__/__snapshots__/EditorToolbar.spec.js.snap +++ b/packages/netlify-cms-core/src/components/Editor/__tests__/__snapshots__/EditorToolbar.spec.js.snap @@ -1,5 +1,533 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`EditorToolbar should render normal save button 1`] = ` + + .emotion-21 { + box-shadow: 0 2px 6px 0 rgba(68,74,87,0.05),0 1px 3px 0 rgba(68,74,87,0.1),0 2px 54px rgba(0,0,0,0.1); + position: fixed; + top: 0; + left: 0; + width: 100%; + min-width: 800px; + z-index: 300; + background-color: #fff; + height: 66px; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-pack: justify; + -webkit-justify-content: space-between; + -ms-flex-pack: justify; + justify-content: space-between; +} + +.emotion-0 { + color: #313d3e; + font-size: 21px; + font-weight: 600; + margin-right: 16px; +} + +.emotion-2 { + color: #313d3e; + font-size: 14px; +} + +.emotion-2 { + color: #313d3e; + font-size: 14px; +} + +.emotion-17 { + height: 100%; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + border: 0 solid #dfdfe3; + -webkit-flex: 10; + -ms-flex: 10; + flex: 10; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-pack: justify; + -webkit-justify-content: space-between; + -ms-flex-pack: justify; + justify-content: space-between; + padding: 0 10px; +} + +.emotion-8 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; +} + +.emotion-6 { + border: 0; + border-radius: 5px; + cursor: pointer; + height: 36px; + line-height: 36px; + font-weight: 500; + padding: 0 15px; + background-color: #798291; + color: #fff; + margin: 0 10px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + display: block; + background-color: #fcefea; + color: #ff003b; +} + +@media (max-width:1200px) { + .emotion-6 { + padding: 0 10px; + } +} + +.emotion-15 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: end; + -webkit-justify-content: flex-end; + -ms-flex-pack: end; + justify-content: flex-end; +} + +.emotion-19 { + height: 100%; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + border: 0 solid #dfdfe3; + border-left-width: 1px; + padding: 0 7px; +} + +.emotion-13 { + position: relative; + font-size: 14px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + margin: 0 10px; +} + +.emotion-13 .ei6fm2r1 { + color: #17a2b8; +} + +.emotion-4 { + margin-top: 6px; + font-size: 13px; + line-height: 1; + display: inline-block; + font-weight: 700; + text-transform: uppercase; + color: #ff003b; +} + +.emotion-10 { + border: 0; + border-radius: 5px; + cursor: pointer; + height: 36px; + line-height: 36px; + font-weight: 500; + padding: 0 15px; + background-color: #798291; + color: #fff; + display: block; + padding-left: 20px; + padding-right: 40px; + position: relative; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + background-color: #17a2b8; +} + +.emotion-10:after { + color: #fff; + width: 0; + height: 0; + border: 5px solid transparent; + border-radius: 2px; + border-top: 6px solid currentColor; + border-bottom: 0; + content: ''; + display: block; + position: absolute; + top: 16px; + right: 10px; + color: currentColor; +} + +@media (max-width:1200px) { + .emotion-10 { + padding-left: 10px; + } +} + +
+ +
+ ← +
+
+
+ editor.editorToolbar.backCollection +
+
+ editor.editorToolbar.unsavedChanges +
+
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+`; + +exports[`EditorToolbar should render normal save button 2`] = ` + + .emotion-21 { + box-shadow: 0 2px 6px 0 rgba(68,74,87,0.05),0 1px 3px 0 rgba(68,74,87,0.1),0 2px 54px rgba(0,0,0,0.1); + position: fixed; + top: 0; + left: 0; + width: 100%; + min-width: 800px; + z-index: 300; + background-color: #fff; + height: 66px; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-pack: justify; + -webkit-justify-content: space-between; + -ms-flex-pack: justify; + justify-content: space-between; +} + +.emotion-0 { + color: #313d3e; + font-size: 21px; + font-weight: 600; + margin-right: 16px; +} + +.emotion-2 { + color: #313d3e; + font-size: 14px; +} + +.emotion-2 { + color: #313d3e; + font-size: 14px; +} + +.emotion-17 { + height: 100%; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + border: 0 solid #dfdfe3; + -webkit-flex: 10; + -ms-flex: 10; + flex: 10; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-pack: justify; + -webkit-justify-content: space-between; + -ms-flex-pack: justify; + justify-content: space-between; + padding: 0 10px; +} + +.emotion-8 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; +} + +.emotion-6 { + border: 0; + border-radius: 5px; + cursor: pointer; + height: 36px; + line-height: 36px; + font-weight: 500; + padding: 0 15px; + background-color: #798291; + color: #fff; + margin: 0 10px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + display: block; + background-color: #fcefea; + color: #ff003b; +} + +@media (max-width:1200px) { + .emotion-6 { + padding: 0 10px; + } +} + +.emotion-15 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: end; + -webkit-justify-content: flex-end; + -ms-flex-pack: end; + justify-content: flex-end; +} + +.emotion-19 { + height: 100%; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + border: 0 solid #dfdfe3; + border-left-width: 1px; + padding: 0 7px; +} + +.emotion-13 { + position: relative; + font-size: 14px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + margin: 0 10px; +} + +.emotion-13 .ei6fm2r1 { + color: #17a2b8; +} + +.emotion-4 { + margin-top: 6px; + font-size: 13px; + line-height: 1; + display: inline-block; + font-weight: 700; + text-transform: uppercase; + color: #ff003b; +} + +.emotion-10 { + border: 0; + border-radius: 5px; + cursor: pointer; + height: 36px; + line-height: 36px; + font-weight: 500; + padding: 0 15px; + background-color: #798291; + color: #fff; + display: block; + padding-left: 20px; + padding-right: 40px; + position: relative; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + background-color: #17a2b8; +} + +.emotion-10:after { + color: #fff; + width: 0; + height: 0; + border: 5px solid transparent; + border-radius: 2px; + border-top: 6px solid currentColor; + border-bottom: 0; + content: ''; + display: block; + position: absolute; + top: 16px; + right: 10px; + color: currentColor; +} + +@media (max-width:1200px) { + .emotion-10 { + padding-left: 10px; + } +} + +
+ +
+ ← +
+
+
+ editor.editorToolbar.backCollection +
+
+ editor.editorToolbar.unsavedChanges +
+
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+`; + exports[`EditorToolbar should render with default props 1`] = ` .emotion-18 { @@ -179,7 +707,7 @@ exports[`EditorToolbar should render with default props 1`] = ` class="emotion-18 emotion-19" >
@@ -684,6 +1219,12 @@ exports[`EditorToolbar should render with status=draft,useOpenAuthoring=true 1`] } } +.emotion-6[disabled] { + background-color: #eff0f4; + color: #798291; + cursor: default; +} + .emotion-13 { position: relative; font-size: 14px; @@ -803,7 +1344,7 @@ exports[`EditorToolbar should render with status=draft,useOpenAuthoring=true 1`] class="emotion-30 emotion-31" >
@@ -1070,6 +1612,12 @@ exports[`EditorToolbar should render with status=pending_publish,useOpenAuthorin } } +.emotion-6[disabled] { + background-color: #eff0f4; + color: #798291; + cursor: default; +} + .emotion-15 { position: relative; font-size: 14px; @@ -1131,7 +1679,7 @@ exports[`EditorToolbar should render with status=pending_publish,useOpenAuthorin class="emotion-23 emotion-24" >
@@ -1346,6 +1895,12 @@ exports[`EditorToolbar should render with status=pending_publish,useOpenAuthorin } } +.emotion-6[disabled] { + background-color: #eff0f4; + color: #798291; + cursor: default; +} + .emotion-13 { position: relative; font-size: 14px; @@ -1447,7 +2002,7 @@ exports[`EditorToolbar should render with status=pending_publish,useOpenAuthorin class="emotion-28 emotion-29" >
@@ -1709,6 +2265,12 @@ exports[`EditorToolbar should render with status=pending_review,useOpenAuthoring } } +.emotion-6[disabled] { + background-color: #eff0f4; + color: #798291; + cursor: default; +} + .emotion-15 { position: relative; font-size: 14px; @@ -1770,7 +2332,7 @@ exports[`EditorToolbar should render with status=pending_review,useOpenAuthoring class="emotion-23 emotion-24" >
@@ -1985,6 +2548,12 @@ exports[`EditorToolbar should render with status=pending_review,useOpenAuthoring } } +.emotion-6[disabled] { + background-color: #eff0f4; + color: #798291; + cursor: default; +} + .emotion-13 { position: relative; font-size: 14px; @@ -2104,7 +2673,7 @@ exports[`EditorToolbar should render with status=pending_review,useOpenAuthoring class="emotion-30 emotion-31" >
@@ -2371,11 +2941,17 @@ exports[`EditorToolbar should render with workflow controls hasUnpublishedChange } } +.emotion-6[disabled] { + background-color: #eff0f4; + color: #798291; + cursor: default; +} +
@@ -2576,11 +3153,17 @@ exports[`EditorToolbar should render with workflow controls hasUnpublishedChange } } +.emotion-6[disabled] { + background-color: #eff0f4; + color: #798291; + cursor: default; +} +
@@ -2801,11 +3385,17 @@ exports[`EditorToolbar should render with workflow controls hasUnpublishedChange } } +.emotion-6[disabled] { + background-color: #eff0f4; + color: #798291; + cursor: default; +} +
@@ -3031,11 +3622,17 @@ exports[`EditorToolbar should render with workflow controls hasUnpublishedChange } } +.emotion-6[disabled] { + background-color: #eff0f4; + color: #798291; + cursor: default; +} +
@@ -3261,11 +3859,17 @@ exports[`EditorToolbar should render with workflow controls hasUnpublishedChange } } +.emotion-6[disabled] { + background-color: #eff0f4; + color: #798291; + cursor: default; +} +
@@ -3491,11 +4096,17 @@ exports[`EditorToolbar should render with workflow controls hasUnpublishedChange } } +.emotion-6[disabled] { + background-color: #eff0f4; + color: #798291; + cursor: default; +} +
diff --git a/packages/netlify-cms-ui-default/src/styles.js b/packages/netlify-cms-ui-default/src/styles.js index a75466ec..13ce842f 100644 --- a/packages/netlify-cms-ui-default/src/styles.js +++ b/packages/netlify-cms-ui-default/src/styles.js @@ -241,6 +241,7 @@ const buttons = { disabled: css` background-color: ${colorsRaw.grayLight}; color: ${colorsRaw.gray}; + cursor: default; `, };