diff --git a/packages/netlify-cms-core/src/components/Editor/EditorToolbar.js b/packages/netlify-cms-core/src/components/Editor/EditorToolbar.js index 82eacedf..8609af58 100644 --- a/packages/netlify-cms-core/src/components/Editor/EditorToolbar.js +++ b/packages/netlify-cms-core/src/components/Editor/EditorToolbar.js @@ -41,6 +41,40 @@ const styles = { `, }; +const TooltipText = styled.div` + visibility: hidden; + width: 321px; + background-color: #555; + color: #fff; + text-align: unset; + border-radius: 6px; + padding: 5px; + + /* Position the tooltip text */ + position: absolute; + z-index: 1; + top: 145%; + left: 50%; + margin-left: -320px; + + /* Fade in tooltip */ + opacity: 0; + transition: opacity 0.3s; +`; + +const Tooltip = styled.div` + position: relative; + display: inline-block; + &:hover + ${TooltipText} { + visibility: visible; + opacity: 0.9; + } +`; + +const TooltipContainer = styled.div` + position: relative; +`; + const DropdownButton = styled(StyledDropdownButton)` ${styles.noOverflow} @media (max-width: 1200px) { @@ -301,40 +335,64 @@ export class EditorToolbar extends React.Component { ); }; + renderStatusInfoTooltip = () => { + const { t, currentStatus } = this.props; + + const statusToLocaleKey = { + [status.get('DRAFT')]: 'statusInfoTooltipDraft', + [status.get('PENDING_REVIEW')]: 'statusInfoTooltipInReview', + }; + + const statusKey = Object.keys(statusToLocaleKey).find(key => key === currentStatus); + return ( + + + + + {statusKey && ( + {t(`editor.editorToolbar.${statusToLocaleKey[statusKey]}`)} + )} + + ); + }; + renderWorkflowStatusControls = () => { const { isUpdatingStatus, onChangeStatus, currentStatus, t, useOpenAuthoring } = this.props; return ( - ( - - {isUpdatingStatus - ? t('editor.editorToolbar.updating') - : t('editor.editorToolbar.setStatus')} - - )} - > - onChangeStatus('DRAFT')} - icon={currentStatus === status.get('DRAFT') ? 'check' : null} - /> - onChangeStatus('PENDING_REVIEW')} - icon={currentStatus === status.get('PENDING_REVIEW') ? 'check' : null} - /> - {useOpenAuthoring ? ( - '' - ) : ( + <> + ( + + {isUpdatingStatus + ? t('editor.editorToolbar.updating') + : t('editor.editorToolbar.setStatus')} + + )} + > onChangeStatus('PENDING_PUBLISH')} - icon={currentStatus === status.get('PENDING_PUBLISH') ? 'check' : null} + label={t('editor.editorToolbar.draft')} + onClick={() => onChangeStatus('DRAFT')} + icon={currentStatus === status.get('DRAFT') ? 'check' : null} /> - )} - + onChangeStatus('PENDING_REVIEW')} + icon={currentStatus === status.get('PENDING_REVIEW') ? 'check' : null} + /> + {useOpenAuthoring ? ( + '' + ) : ( + onChangeStatus('PENDING_PUBLISH')} + icon={currentStatus === status.get('PENDING_PUBLISH') ? 'check' : null} + /> + )} + + {useOpenAuthoring && this.renderStatusInfoTooltip()} + ); }; 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 1225d423..9891c045 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 @@ -4,21 +4,6 @@ import { fromJS } from 'immutable'; import { EditorToolbar } from '../EditorToolbar'; -jest.mock('netlify-cms-ui-default', () => ({ - // eslint-disable-next-line react/display-name - Icon: props => , - // eslint-disable-next-line react/display-name - Dropdown: props => , - // eslint-disable-next-line react/display-name - DropdownItem: props => , - // eslint-disable-next-line react/display-name - StyledDropdownButton: props => , - colorsRaw: {}, - colors: {}, - components: {}, - buttons: {}, - zIndex: {}, -})); jest.mock('../../UI', () => ({ // eslint-disable-next-line react/display-name SettingsDropdown: props => , @@ -112,5 +97,19 @@ describe('EditorToolbar', () => { ); expect(asFragment()).toMatchSnapshot(); }); + + ['draft', 'pending_review', 'pending_publish'].forEach(status => { + it(`should render with status=${status},useOpenAuthoring=${useOpenAuthoring}`, () => { + 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 486f765f..480ff697 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 @@ -9,6 +9,7 @@ exports[`EditorToolbar should render with default props 1`] = ` left: 0; width: 100%; min-width: 800px; + z-index: 300; background-color: #fff; height: 66px; display: -webkit-box; @@ -22,26 +23,36 @@ exports[`EditorToolbar should render with default props 1`] = ` } .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-4 { margin-top: 6px; + font-size: 13px; + line-height: 1; + display: inline-block; + font-weight: 700; + text-transform: uppercase; + color: #005614; } .emotion-4::after { height: 12px; width: 15.5px; + color: #005614; margin-left: 5px; position: relative; top: 1px; @@ -58,7 +69,7 @@ exports[`EditorToolbar should render with default props 1`] = ` -webkit-box-align: center; -ms-flex-align: center; align-items: center; - border: 0 solid; + border: 0 solid #dfdfe3; -webkit-flex: 10; -ms-flex: 10; flex: 10; @@ -85,11 +96,22 @@ exports[`EditorToolbar should render with default props 1`] = ` } .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) { @@ -114,11 +136,22 @@ exports[`EditorToolbar should render with default props 1`] = ` } .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; margin: 0 10px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: block; + background-color: #ddf5f9; + color: #17a2b8; } @media (max-width:1200px) { @@ -137,7 +170,7 @@ exports[`EditorToolbar should render with default props 1`] = ` -webkit-box-align: center; -ms-flex-align: center; align-items: center; - border: 0 solid; + border: 0 solid #dfdfe3; border-left-width: 1px; padding: 0 7px; } @@ -146,7 +179,7 @@ exports[`EditorToolbar should render with default props 1`] = ` class="emotion-18 emotion-19" >
`; -exports[`EditorToolbar should render with workflow controls hasUnpublishedChanges=false,isNewEntry=false,isModification=false,useOpenAuthoring=false 1`] = ` +exports[`EditorToolbar should render with status=draft,useOpenAuthoring=false 1`] = ` - .emotion-18 { + .emotion-23 { 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; @@ -222,33 +256,43 @@ exports[`EditorToolbar should render with workflow controls hasUnpublishedChange } .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-4 { margin-top: 6px; + font-size: 13px; + line-height: 1; + display: inline-block; + font-weight: 700; + text-transform: uppercase; + color: #005614; } .emotion-4::after { height: 12px; width: 15.5px; + color: #005614; margin-left: 5px; position: relative; top: 1px; content: url("data:image/svg+xml; utf8, "); } -.emotion-14 { +.emotion-19 { height: 100%; display: -webkit-box; display: -webkit-flex; @@ -258,7 +302,7 @@ exports[`EditorToolbar should render with workflow controls hasUnpublishedChange -webkit-box-align: center; -ms-flex-align: center; align-items: center; - border: 0 solid; + border: 0 solid #dfdfe3; -webkit-flex: 10; -ms-flex: 10; flex: 10; @@ -285,11 +329,1985 @@ exports[`EditorToolbar should render with workflow controls hasUnpublishedChange } .emotion-8 { + 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-8 { + padding: 0 10px; + } +} + +.emotion-17 { + 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-21 { + 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-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: #e8f5fe; + color: #3a69c7; +} + +@media (max-width:1200px) { + .emotion-6 { + padding: 0 10px; + } +} + +.emotion-15 { + position: relative; + font-size: 14px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + margin: 0 10px; +} + +.emotion-15 .ei6fm2r1 { + color: #17a2b8; +} + +.emotion-12 { + 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: #ddf5f9; + color: #17a2b8; +} + +.emotion-12: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-12 { + padding-left: 10px; + } +} + +
+ +
+ ← +
+
+
+ editor.editorToolbar.backCollection +
+
+ editor.editorToolbar.changesSaved +
+
+
+
+
+ + +
+
+
+ +
+
+
+
+ +
+
+
+`; + +exports[`EditorToolbar should render with status=draft,useOpenAuthoring=true 1`] = ` + + .emotion-30 { + 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-4 { + margin-top: 6px; + font-size: 13px; + line-height: 1; + display: inline-block; + font-weight: 700; + text-transform: uppercase; + color: #005614; +} + +.emotion-4::after { + height: 12px; + width: 15.5px; + color: #005614; + margin-left: 5px; + position: relative; + top: 1px; + content: url("data:image/svg+xml; utf8, "); +} + +.emotion-26 { + 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-24 { + 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-28 { + 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-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: #e8f5fe; + color: #3a69c7; +} + +@media (max-width:1200px) { + .emotion-6 { + padding: 0 10px; + } +} + +.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 .emotion-15 { + color: #17a2b8; +} + +.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: #ddf5f9; + 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; + } +} + +.emotion-22 { + position: relative; +} + +.emotion-18 { + position: relative; + display: inline-block; +} + +.emotion-18:hover + .emotion-21 { + visibility: visible; + opacity: 0.9; +} + +.emotion-16 { + display: inline-block; + line-height: 0; + width: 18px; + height: 18px; + -webkit-transform: rotate(0deg); + -ms-transform: rotate(0deg); + transform: rotate(0deg); +} + +.emotion-16 path:not(.no-fill), +.emotion-16 circle:not(.no-fill), +.emotion-16 polygon:not(.no-fill), +.emotion-16 rect:not(.no-fill) { + fill: currentColor; +} + +.emotion-16 path.clipped { + fill: transparent; +} + +.emotion-16 svg { + width: 100%; + height: 100%; +} + +.emotion-20 { + visibility: hidden; + width: 321px; + background-color: #555; + color: #fff; + text-align: unset; + border-radius: 6px; + padding: 5px; + position: absolute; + z-index: 1; + top: 145%; + left: 50%; + margin-left: -320px; + opacity: 0; + -webkit-transition: opacity 0.3s; + transition: opacity 0.3s; +} + +
+ +
+ ← +
+
+
+ editor.editorToolbar.backCollection +
+
+ editor.editorToolbar.changesSaved +
+
+
+
+
+ +
+
+
+ +
+
+
+ + + + + + +
+
+ editor.editorToolbar.statusInfoTooltipDraft +
+
+
+
+
+ +
+
+
+`; + +exports[`EditorToolbar should render with status=pending_publish,useOpenAuthoring=false 1`] = ` + + .emotion-23 { + 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-4 { + margin-top: 6px; + font-size: 13px; + line-height: 1; + display: inline-block; + font-weight: 700; + text-transform: uppercase; + color: #005614; +} + +.emotion-4::after { + height: 12px; + width: 15.5px; + color: #005614; + margin-left: 5px; + position: relative; + top: 1px; + content: url("data:image/svg+xml; utf8, "); +} + +.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; + -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-10 { + 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-8 { + 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-8 { + padding: 0 10px; + } +} + +.emotion-17 { + 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-21 { + 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-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: #e8f5fe; + color: #3a69c7; +} + +@media (max-width:1200px) { + .emotion-6 { + padding: 0 10px; + } +} + +.emotion-15 { + position: relative; + font-size: 14px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + margin: 0 10px; +} + +.emotion-15 .ei6fm2r1 { + color: #17a2b8; +} + +.emotion-12 { + 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: #ddf5f9; + color: #17a2b8; +} + +.emotion-12: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-12 { + padding-left: 10px; + } +} + +
+ +
+ ← +
+
+
+ editor.editorToolbar.backCollection +
+
+ editor.editorToolbar.changesSaved +
+
+
+
+
+ + +
+
+
+ +
+
+
+
+ +
+
+
+`; + +exports[`EditorToolbar should render with status=pending_publish,useOpenAuthoring=true 1`] = ` + + .emotion-28 { + 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-4 { + margin-top: 6px; + font-size: 13px; + line-height: 1; + display: inline-block; + font-weight: 700; + text-transform: uppercase; + color: #005614; +} + +.emotion-4::after { + height: 12px; + width: 15.5px; + color: #005614; + margin-left: 5px; + position: relative; + top: 1px; + content: url("data:image/svg+xml; utf8, "); +} + +.emotion-24 { + 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-22 { + 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-26 { + 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-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: #e8f5fe; + color: #3a69c7; +} + +@media (max-width:1200px) { + .emotion-6 { + padding: 0 10px; + } +} + +.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 .emotion-15 { + color: #17a2b8; +} + +.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: #ddf5f9; + 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; + } +} + +.emotion-20 { + position: relative; +} + +.emotion-18 { + position: relative; + display: inline-block; +} + +.emotion-18:hover + .evqrzhe0 { + visibility: visible; + opacity: 0.9; +} + +.emotion-16 { + display: inline-block; + line-height: 0; + width: 18px; + height: 18px; + -webkit-transform: rotate(0deg); + -ms-transform: rotate(0deg); + transform: rotate(0deg); +} + +.emotion-16 path:not(.no-fill), +.emotion-16 circle:not(.no-fill), +.emotion-16 polygon:not(.no-fill), +.emotion-16 rect:not(.no-fill) { + fill: currentColor; +} + +.emotion-16 path.clipped { + fill: transparent; +} + +.emotion-16 svg { + width: 100%; + height: 100%; +} + +
+ +
+ ← +
+
+
+ editor.editorToolbar.backCollection +
+
+ editor.editorToolbar.changesSaved +
+
+
+
+
+ +
+
+
+ +
+
+
+ + + + + + +
+
+
+
+
+ +
+
+
+`; + +exports[`EditorToolbar should render with status=pending_review,useOpenAuthoring=false 1`] = ` + + .emotion-23 { + 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-4 { + margin-top: 6px; + font-size: 13px; + line-height: 1; + display: inline-block; + font-weight: 700; + text-transform: uppercase; + color: #005614; +} + +.emotion-4::after { + height: 12px; + width: 15.5px; + color: #005614; + margin-left: 5px; + position: relative; + top: 1px; + content: url("data:image/svg+xml; utf8, "); +} + +.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; + -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-10 { + 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-8 { + 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-8 { + padding: 0 10px; + } +} + +.emotion-17 { + 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-21 { + 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-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: #e8f5fe; + color: #3a69c7; +} + +@media (max-width:1200px) { + .emotion-6 { + padding: 0 10px; + } +} + +.emotion-15 { + position: relative; + font-size: 14px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + margin: 0 10px; +} + +.emotion-15 .ei6fm2r1 { + color: #17a2b8; +} + +.emotion-12 { + 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: #ddf5f9; + color: #17a2b8; +} + +.emotion-12: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-12 { + padding-left: 10px; + } +} + +
+ +
+ ← +
+
+
+ editor.editorToolbar.backCollection +
+
+ editor.editorToolbar.changesSaved +
+
+
+
+
+ + +
+
+
+ +
+
+
+
+ +
+
+
+`; + +exports[`EditorToolbar should render with status=pending_review,useOpenAuthoring=true 1`] = ` + + .emotion-30 { + 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-4 { + margin-top: 6px; + font-size: 13px; + line-height: 1; + display: inline-block; + font-weight: 700; + text-transform: uppercase; + color: #005614; +} + +.emotion-4::after { + height: 12px; + width: 15.5px; + color: #005614; + margin-left: 5px; + position: relative; + top: 1px; + content: url("data:image/svg+xml; utf8, "); +} + +.emotion-26 { + 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-24 { + 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-28 { + 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-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: #e8f5fe; + color: #3a69c7; +} + +@media (max-width:1200px) { + .emotion-6 { + padding: 0 10px; + } +} + +.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 .emotion-15 { + color: #17a2b8; +} + +.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: #ddf5f9; + 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; + } +} + +.emotion-22 { + position: relative; +} + +.emotion-18 { + position: relative; + display: inline-block; +} + +.emotion-18:hover + .emotion-21 { + visibility: visible; + opacity: 0.9; +} + +.emotion-16 { + display: inline-block; + line-height: 0; + width: 18px; + height: 18px; + -webkit-transform: rotate(0deg); + -ms-transform: rotate(0deg); + transform: rotate(0deg); +} + +.emotion-16 path:not(.no-fill), +.emotion-16 circle:not(.no-fill), +.emotion-16 polygon:not(.no-fill), +.emotion-16 rect:not(.no-fill) { + fill: currentColor; +} + +.emotion-16 path.clipped { + fill: transparent; +} + +.emotion-16 svg { + width: 100%; + height: 100%; +} + +.emotion-20 { + visibility: hidden; + width: 321px; + background-color: #555; + color: #fff; + text-align: unset; + border-radius: 6px; + padding: 5px; + position: absolute; + z-index: 1; + top: 145%; + left: 50%; + margin-left: -320px; + opacity: 0; + -webkit-transition: opacity 0.3s; + transition: opacity 0.3s; +} + +
+ +
+ ← +
+
+
+ editor.editorToolbar.backCollection +
+
+ editor.editorToolbar.changesSaved +
+
+
+
+
+ +
+
+
+ +
+
+
+ + + + + + +
+
+ editor.editorToolbar.statusInfoTooltipInReview +
+
+
+
+
+ +
+
+
+`; + +exports[`EditorToolbar should render with workflow controls hasUnpublishedChanges=false,isNewEntry=false,isModification=false,useOpenAuthoring=false 1`] = ` + + .emotion-18 { + 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-4 { + margin-top: 6px; + font-size: 13px; + line-height: 1; + display: inline-block; + font-weight: 700; + text-transform: uppercase; + color: #005614; +} + +.emotion-4::after { + height: 12px; + width: 15.5px; + color: #005614; + margin-left: 5px; + position: relative; + top: 1px; + content: url("data:image/svg+xml; utf8, "); +} + +.emotion-14 { + 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-10 { + 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-8 { + 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) { @@ -323,17 +2341,28 @@ exports[`EditorToolbar should render with workflow controls hasUnpublishedChange -webkit-box-align: center; -ms-flex-align: center; align-items: center; - border: 0 solid; + border: 0 solid #dfdfe3; border-left-width: 1px; padding: 0 7px; } .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: #e8f5fe; + color: #3a69c7; } @media (max-width:1200px) { @@ -346,7 +2375,7 @@ exports[`EditorToolbar should render with workflow controls hasUnpublishedChange class="emotion-18 emotion-19" >
+ + + \ No newline at end of file