From ff89e2849673a03aa7add44cf44ee83f9a5aacc1 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 2 Sep 2017 13:38:52 -0700 Subject: [PATCH 1/5] Fixes: Hitting 'e' shortcut should not add an e to the document --- frontend/components/Layout/Layout.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/frontend/components/Layout/Layout.js b/frontend/components/Layout/Layout.js index b22c3eaeb..9679eb833 100644 --- a/frontend/components/Layout/Layout.js +++ b/frontend/components/Layout/Layout.js @@ -69,9 +69,13 @@ type Props = { } @keydown('e') - goToEdit() { - if (!this.props.documents.active) return; - this.props.history.push(documentEditUrl(this.props.documents.active)); + goToEdit(ev) { + const activeDocument = this.props.documents.active; + if (!activeDocument) return; + + ev.preventDefault(); + ev.stopPropagation(); + this.props.history.push(documentEditUrl(activeDocument)); } handleLogout = () => { From 9d133cce9810ab3b2e50377a3dbc73714b815af9 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 2 Sep 2017 13:59:11 -0700 Subject: [PATCH 2/5] Disabled publish action should not be clickable --- .../Layout/components/HeaderAction/HeaderAction.scss | 1 - .../components/Layout/components/SaveAction/SaveAction.js | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/components/Layout/components/HeaderAction/HeaderAction.scss b/frontend/components/Layout/components/HeaderAction/HeaderAction.scss index 5e7bbec4c..cc5013907 100644 --- a/frontend/components/Layout/components/HeaderAction/HeaderAction.scss +++ b/frontend/components/Layout/components/HeaderAction/HeaderAction.scss @@ -2,7 +2,6 @@ display: flex; justify-content: center; align-items: center; - cursor: pointer; min-height: 43px; padding: 0 0.5rem; diff --git a/frontend/components/Layout/components/SaveAction/SaveAction.js b/frontend/components/Layout/components/SaveAction/SaveAction.js index ff307acb9..f33cfec42 100644 --- a/frontend/components/Layout/components/SaveAction/SaveAction.js +++ b/frontend/components/Layout/components/SaveAction/SaveAction.js @@ -26,10 +26,9 @@ class SaveAction extends React.Component { return ( {showCheckmark && } {isNew ? 'Publish' : 'Save'} @@ -41,6 +40,9 @@ class SaveAction extends React.Component { const Link = styled.a` display: flex; align-items: center; + opacity: ${props => (props.disabled ? 0.5 : 1)}; + pointer-events: ${props => (props.disabled ? 'none' : 'auto')}; + cursor: ${props => (props.disabled ? 'default' : 'pointer')}; `; const SavedIcon = styled(CheckIcon)` From b9b2769563aa5e9ddda464f93af88824f8143246 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 2 Sep 2017 16:58:24 -0700 Subject: [PATCH 3/5] Fixes: Documents marked as starred incorrectly --- server/presenters/document.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/presenters/document.js b/server/presenters/document.js index 4dce75bb3..7d06c3210 100644 --- a/server/presenters/document.js +++ b/server/presenters/document.js @@ -31,7 +31,7 @@ async function present(ctx: Object, document: Document, options: ?Options) { lastViewedAt: undefined, team: document.teamId, collaborators: [], - starred: !!document.starred, + starred: !!document.starred.length, collaboratorCount: undefined, collection: undefined, views: undefined, From 44e635cbc7105a03eb6450fa38bed392c08e8833 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 2 Sep 2017 18:43:12 -0700 Subject: [PATCH 4/5] Closes #189 --- .../components/DocumentPreview/DocumentPreview.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/frontend/components/DocumentPreview/DocumentPreview.js b/frontend/components/DocumentPreview/DocumentPreview.js index 30cc0f845..6703e896f 100644 --- a/frontend/components/DocumentPreview/DocumentPreview.js +++ b/frontend/components/DocumentPreview/DocumentPreview.js @@ -19,13 +19,9 @@ const StyledStar = styled(StarIcon)` top: 2px; position: relative; margin-left: 4px; - opacity: ${props => (props.solid ? 1 : 0.25)}; + opacity: ${props => (props.solid ? '1 !important' : 0)}; transition: opacity 100ms ease-in-out; - &:hover { - opacity: 1; - } - svg { width: 1em; height: 1em; @@ -48,6 +44,14 @@ const DocumentLink = styled(Link)` background: ${color.smokeLight}; border: 2px solid ${color.smoke}; outline: none; + + ${StyledStar} { + opacity: .25; + + &:hover { + opacity: 1; + } + } } &:focus { From 95182057a62cbaefe4620ad7c22606b5f987f4cd Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 2 Sep 2017 18:44:41 -0700 Subject: [PATCH 5/5] :green_heart: --- server/presenters/document.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/presenters/document.js b/server/presenters/document.js index 7d06c3210..0ca0ea186 100644 --- a/server/presenters/document.js +++ b/server/presenters/document.js @@ -31,7 +31,7 @@ async function present(ctx: Object, document: Document, options: ?Options) { lastViewedAt: undefined, team: document.teamId, collaborators: [], - starred: !!document.starred.length, + starred: !!(document.starred && document.starred.length), collaboratorCount: undefined, collection: undefined, views: undefined,