Skip to content

Commit

Permalink
Merge release/1.12 into master
Browse files Browse the repository at this point in the history
Release: 1.12.0
  • Loading branch information
dmsnell authored Dec 4, 2019
2 parents a6fc432 + d26df01 commit 2236889
Show file tree
Hide file tree
Showing 21 changed files with 374 additions and 163 deletions.
10 changes: 0 additions & 10 deletions .github/actions/deploy/Dockerfile

This file was deleted.

23 changes: 0 additions & 23 deletions .github/actions/deploy/deploy.yml

This file was deleted.

66 changes: 0 additions & 66 deletions .github/actions/deploy/entrypoint.sh

This file was deleted.

16 changes: 0 additions & 16 deletions .github/workflows/deploy.yml

This file was deleted.

20 changes: 20 additions & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Changelog

## [v1.12.0]

### Enhancements

- Updated menu icon to use the new icon set [#1694](https://github.com/Automattic/simplenote-electron/pull/1694)
- Added script to deploy web app [#1723](https://github.com/Automattic/simplenote-electron/pull/1723)
- Prioritize search results where title matches query [#1705](https://github.com/Automattic/simplenote-electron/pull/1705)

### Fixes

- Fixed markdown code styles [#1702](https://github.com/Automattic/simplenote-electron/pull/1702)
- Stop crashing app in a few cases where it shouldn't [#1721](https://github.com/Automattic/simplenote-electron/pull/1721)
- Prevent infinite duplication of changes caused by relying on shared note bucket [#1724](https://github.com/Automattic/simplenote-electron/pull/1724)
- Prevent note corruption in certain cases involving Asian characters, Emoji, and "surrogate pairs" [#1714](https://github.com/Automattic/simplenote-electron/pull/1714)

### Other Changes

- Updated dependencies [#1693](https://github.com/Automattic/simplenote-electron/pull/1693)
- Stop app boot when missing platform support and indicate what is missing [#1713](https://github.com/Automattic/simplenote-electron/pull/1713)

## [v1.11.0]

### Enhancements
Expand Down
84 changes: 84 additions & 0 deletions bin/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
#!/bin/sh -l

COMMIT_BRANCH=''
WEB_APP_URL=''
APP_ENGINE_URL=''

if [ -z "$1" ]
then
echo "You did not specify a deploy environment, your choices are: production, develop, staging"
exit 1
fi

case $1 in

"staging")
COMMIT_BRANCH='webapp-staging'
WEB_APP_URL='https://simplenote-staging.go-vip.net'
APP_ENGINE_URL='https://staging.simplenote.com'
;;

"develop")
COMMIT_BRANCH='webapp-develop'
WEB_APP_URL='https://simplenote-develop.go-vip.net'
APP_ENGINE_URL='https://develop.simplenote.com'
;;

"production")
COMMIT_BRANCH='webapp'
WEB_APP_URL='https://simplenote.go-vip.co'
APP_ENGINE_URL='https://app.simplenote.com'
;;

*)
exit 0
;;
esac

# Install Node Modules
npm install

# Temporarily move config-local so it doesn't get overwritten
mv config-local.json config-local.original.json

# Setup config
json_string=$(printf '{"app_id": "chalk-bump-f49", "app_key": "12345", "development": false, "wpcc_client_id": "0", "wpcc_redirect_url": "https://simplenote.com", "is_app_engine": true, "web_app_url": "%s", "app_engine_url": "%s"}' "$WEB_APP_URL" "$APP_ENGINE_URL")
echo "$json_string" > config-local.json

# Clean up old builds
rm -rf dist

# Build site
NODE_ENV=production make build

# Restore config-local
rm config-local.json
mv config-local.original.json config-local.json

# Checkout deploy branch
if [ "$(git branch | grep $COMMIT_BRANCH)" ]
then
git branch -D $COMMIT_BRANCH
fi
git checkout -b $COMMIT_BRANCH

# Delete files not needed in production
find . -maxdepth 1 ! -name '.git' ! -name 'dist' ! -name 'vip' ! -name 'config-local.json' -exec rm -rf {} ';'

# Copy vip files to base path
cp -r vip/* ./
rm -rf vip

# Add, commit, push
touch .gitignore
echo config-local.json >> .gitignore
git add --all
git commit -m "Build: $COMMIT_BRANCH [ci skip]"
git push -f origin $COMMIT_BRANCH
git reset .

echo "Deployed Successfully!"

git checkout develop

exit 0
2 changes: 2 additions & 0 deletions lib/boot.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import './utils/ensure-platform-support';
// import './utils/ensure-single-browser-tab-only';
import 'core-js/stable';
import 'regenerator-runtime/runtime';
import 'unorm';
Expand Down
9 changes: 9 additions & 0 deletions lib/components/boot-warning/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';

import './style';

const BootWarning = ({ children }) => (
<h3 className="boot-warning__message">{children}</h3>
);

export default BootWarning;
4 changes: 4 additions & 0 deletions lib/components/boot-warning/style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
h3.boot-warning__message {
margin: 50px auto;
width: 50%;
}
14 changes: 9 additions & 5 deletions lib/components/sync-status/popover.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ class SyncStatusPopover extends React.Component {
: [];
const overflowCount = unsyncedNoteIds.length - noteTitles.length;
const unit = overflowCount === 1 ? 'note' : 'notes';

const lastSyncedTime = formatDistanceToNow(getLastSyncedTime(), {
addSuffix: true,
});
const lastSyncedTime = getLastSyncedTime();

return (
<Popover
Expand Down Expand Up @@ -88,7 +85,14 @@ class SyncStatusPopover extends React.Component {
</div>
</div>
)}
<span>Last synced: {lastSyncedTime}</span>
{lastSyncedTime > -Infinity ? (
<span>
Last synced:{' '}
{formatDistanceToNow(lastSyncedTime, { addSuffix: true })}
</span>
) : (
<span>Unknown sync status</span>
)}
</Popover>
);
}
Expand Down
18 changes: 14 additions & 4 deletions lib/flux/app-state.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,11 +430,21 @@ export const actionMap = new ActionMap({
onNoteBeforeRemoteUpdate: {
creator({ noteId }) {
return (dispatch, getState) => {
const state = getState();
if (state.selectedNoteId !== noteId) {
return null;
const {
appState: { selectedNoteId, note, notes },
} = getState();

if ( selectedNoteId === noteId ) {
return note.data;
}
return getState().note.data;

const match = (notes || []).find(({ id }) => noteId === id);

if (match) {
return match.data;
}

return null;
};
},
},
Expand Down
7 changes: 4 additions & 3 deletions lib/icons/menu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ export default function MenuIcon() {
<svg
className="icon-menu"
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
>
<path d="M21 6v2H3V6h18zM3 18h18v-2H3v2zm0-5h18v-2H3v2z" />
<rect x="0" fill="none" width="24" height="24" />
<g>
<path d="M21,11H3v2H21Zm0-5H3V8H21Zm0,10H3v2H21Z" />
</g>
</svg>
);
}
11 changes: 1 addition & 10 deletions lib/note-detail/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
}

.note-detail-markdown {
@import '../node_modules/highlight.js/styles/solarized-light.css';
@import '../node_modules/highlight.js/scss/solarized-light.scss';

h1,
h2,
Expand Down Expand Up @@ -179,22 +179,13 @@
}
}

code {
background: $studio-gray-5;
}

pre {
border: 1px solid $studio-gray-20;
padding: 1em;
border-radius: $border-radius;
font-size: 85%;
}

pre code {
color: $studio-gray-90;
background: transparent;
}

table {
border-collapse: collapse;
border-spacing: 0;
Expand Down
Loading

0 comments on commit 2236889

Please sign in to comment.