Skip to content

Commit

Permalink
Merge pull request #330 from meetfranz/develop
Browse files Browse the repository at this point in the history
Beta 14
  • Loading branch information
adlk committed Nov 23, 2017
2 parents e871a00 + 7caca91 commit abca425
Show file tree
Hide file tree
Showing 85 changed files with 4,964 additions and 2,211 deletions.
38 changes: 38 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Franz - Test API",
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron",
"program": "${workspaceFolder}/build/index.js",
"protocol": "inspector",
"env": {
"NODE_ENV": "development"
}
},
{
"type": "node",
"request": "launch",
"name": "Franz – Live API",
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron",
"program": "${workspaceFolder}/build/index.js",
"protocol": "inspector",
"env": {
"LIVE_API": "1"
}
},
{
"type": "node",
"request": "launch",
"name": "Franz – Local API",
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron",
"program": "${workspaceFolder}/build/index.js",
"protocol": "inspector",
"env": {
"LOCAL_API": "1"
}
}
]
}
18 changes: 18 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "dev",
"group": {
"kind": "build",
"isDefault": true
}
},
{
"type": "npm",
"script": "lint",
"group": "test"
}
]
}
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
<a name="5.0.0-beta.14"></a>
# [5.0.0-beta.14](https://github.com/meetfranz/franz/compare/v5.0.0-beta.13...v5.0.0-beta.14) (2017-11-23)


### Features

* **App:** Add link to changelog in app update notification ([2cbd938](https://github.com/meetfranz/franz/commit/2cbd938))
* **App:** Add option to enable/disable spell checker ([dcab45a](https://github.com/meetfranz/franz/commit/dcab45a))
* **App:** Add option to mute all services in sidebar ([f5a9aa2](https://github.com/meetfranz/franz/commit/f5a9aa2)), closes [#8](https://github.com/meetfranz/franz/issues/8) [#162](https://github.com/meetfranz/franz/issues/162)
* **App:** Decrease minimum window size to 600px width ([2521621](https://github.com/meetfranz/franz/commit/2521621)), closes [#239](https://github.com/meetfranz/franz/issues/239)
* **App:** Respect System DoNotDisturb mode for service audio ([7d41227](https://github.com/meetfranz/franz/commit/7d41227)), closes [#162](https://github.com/meetfranz/franz/issues/162)
* **Service:** Add option to display disabled services in tabs ([1839eff](https://github.com/meetfranz/franz/commit/1839eff))
* **Service:** Add option to mute service ([b405ba1](https://github.com/meetfranz/franz/commit/b405ba1))
* **Service:** Add dialog to reload crashed services ([259d40c](https://github.com/meetfranz/franz/commit/259d40c)) ([dannyqiu](https://github.com/dannyqiu))
* **Translations:** Added new translations and improved existing ones. **[A million thanks to the amazing community.](http://i18n.meetfranz.com/)**


### Bug Fixes

* **Windows:** Fix notifications on Windows 10 (Fall Creators Update) ([eea4801](https://github.com/meetfranz/franz/commit/eea4801)), closes [#173](https://github.com/meetfranz/franz/issues/173)
* **macOS:** Fix TouchBar related crash on macOS 10.12.1 and lower ([9e9a2ed](https://github.com/meetfranz/franz/commit/9e9a2ed)), closes [#70](https://github.com/meetfranz/franz/issues/70)
* **App:** Add fallback to service menu when service name is empty ([42ed24d](https://github.com/meetfranz/franz/commit/42ed24d)), closes [#250](https://github.com/meetfranz/franz/issues/250)
* **App:** Prevent app from redirecting when dropping link ([811a527](https://github.com/meetfranz/franz/commit/811a527)) ([dannyqiu](https://github.com/dannyqiu))
* **Support with CPU:** Reduce maximum CPU usage ([64ad918](https://github.com/meetfranz/franz/commit/64ad918)), closes [#314](https://github.com/meetfranz/franz/issues/314)
* **Hosted Services:** Do not strip www from custom service Url ([a764321](https://github.com/meetfranz/franz/commit/a764321)) ([BeneStem](https://github.com/BeneStem))
* **Services:** Fix onNotify in service API ([b15421b](https://github.com/meetfranz/franz/commit/b15421b)) ([dannyqiu](https://github.com/dannyqiu))
* **Sidebar:** Fix tabs reordering ([86413ba](https://github.com/meetfranz/franz/commit/86413ba)) ([josescgar](https://github.com/josescgar))



<a name="5.0.0-beta.13"></a>
# [5.0.0-beta.13](https://github.com/meetfranz/franz/compare/v5.0.0-beta.12...v5.0.0-beta.13) (2017-11-06)

Expand Down
10 changes: 6 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,20 @@ environment:
version: 5.0.0.{build}

install:
- ps: Install-Product node 7
- ps: Install-Product node 8
- yarn cache clean
- yarn add global gulp-cli@1.2.2
- yarn add global gulpjs/gulp#4.0
- yarn install

cache:
- "%LOCALAPPDATA%\\Yarn"
# cache:
# - "%LOCALAPPDATA%\\Yarn"

before_build:
- yarn lint

build_script:
- yarn build
- yarn build --x64 --ia32

notifications:
- provider: Slack
Expand All @@ -30,3 +31,4 @@ notifications:

artifacts:
- path: out\*.exe
- path: out\*.yml
2 changes: 1 addition & 1 deletion electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ directories:
app: ./build
output: ./out

# forceCodeSigning: true
appId: "com.meetfranz.franz"

compression: maximum

Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "franz",
"productName": "Franz",
"appId": "com.meetfranz.franz",
"version": "5.0.0-beta.13",
"version": "5.0.0-beta.14",
"description": "Messaging app for WhatsApp, Slack, Telegram, HipChat, Hangouts and many many more.",
"copyright": "adlk x franz - Stefan Malzner",
"main": "index.js",
Expand All @@ -26,6 +26,7 @@
"author": "Stefan Malzner <stefan@adlk.io>",
"license": "Apache-2.0",
"dependencies": {
"@meetfranz/electron-notification-state": "^1.0.0",
"@paulcbetts/system-idle-time": "^1.0.4",
"address-rfc2822": "^2.0.1",
"auto-launch": "https://github.com/meetfranz/node-auto-launch.git",
Expand Down Expand Up @@ -64,6 +65,7 @@
"react-sortable-hoc": "^0.6.7",
"react-tooltip": "^3.2.7",
"route-parser": "^0.0.5",
"semver": "^5.4.1",
"smoothscroll-polyfill": "^0.3.4",
"tar": "^4.0.2",
"uuid": "^3.0.1"
Expand Down
4 changes: 4 additions & 0 deletions src/actions/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ export default {
resetUpdateStatus: {},
installUpdate: {},
healthCheck: {},
muteApp: {
isMuted: PropTypes.bool.isRequired,
},
toggleMuteApp: {},
};
7 changes: 7 additions & 0 deletions src/actions/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ export default {
channel: PropTypes.string.isRequired,
args: PropTypes.object.isRequired,
},
sendIPCMessageToAllServices: {
channel: PropTypes.string.isRequired,
args: PropTypes.object.isRequired,
},
openWindow: {
event: PropTypes.object.isRequired,
},
Expand All @@ -71,6 +75,9 @@ export default {
toggleNotifications: {
serviceId: PropTypes.string.isRequired,
},
toggleAudio: {
serviceId: PropTypes.string.isRequired,
},
openDevTools: {
serviceId: PropTypes.string.isRequired,
},
Expand Down
4 changes: 3 additions & 1 deletion src/api/server/LocalApi.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import SettingsModel from '../../models/Settings';

export default class LocalApi {
// App
async updateAppSettings(data) {
Expand All @@ -13,7 +15,7 @@ export default class LocalApi {
async getAppSettings() {
const settingsString = localStorage.getItem('app');
try {
const settings = JSON.parse(settingsString) || {};
const settings = new SettingsModel(JSON.parse(settingsString) || {});
console.debug('LocalApi::getAppSettings resolves', settings);

return settings;
Expand Down
2 changes: 1 addition & 1 deletion src/api/server/ServerApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ export default class ServerApi {
// News
async getLatestNews() {
// eslint-disable-next-line
const request = await window.fetch(`${SERVER_URL}/${API_VERSION}/news?platform=${os.platform()}&arch=${os.arch()}version=${app.getVersion()}`,
const request = await window.fetch(`${SERVER_URL}/${API_VERSION}/news?platform=${os.platform()}&arch=${os.arch()}&version=${app.getVersion()}`,
this._prepareAuthRequest({
method: 'GET',
}));
Expand Down
4 changes: 4 additions & 0 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,7 @@ window.addEventListener('load', () => {
};
window.franz.render();
});

// Prevent drag and drop into window from redirecting
window.addEventListener('dragover', event => event.preventDefault());
window.addEventListener('drop', event => event.preventDefault());
8 changes: 7 additions & 1 deletion src/components/layout/AppLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ const messages = defineMessages({
id: 'infobar.buttonReloadServices',
defaultMessage: '!!!Reload services',
},
changelog: {
id: 'infobar.buttonChangelog',
defaultMessage: '!!!Changelog',
},
buttonInstallUpdate: {
id: 'infobar.buttonInstallUpdate',
defaultMessage: '!!!Restart & install update',
Expand Down Expand Up @@ -135,7 +139,9 @@ export default class AppLayout extends Component {
sticky
>
<span className="mdi mdi-information" />
{intl.formatMessage(messages.updateAvailable)}
{intl.formatMessage(messages.updateAvailable)} <a href="https://meetfranz.com/changelog" target="_blank">
<u>{intl.formatMessage(messages.changelog)}</u>
</a>
</InfoBar>
)}
{services}
Expand Down
54 changes: 35 additions & 19 deletions src/components/layout/Sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { Component } from 'react';
import PropTypes from 'prop-types';
import ReactTooltip from 'react-tooltip';
import { defineMessages, intlShape } from 'react-intl';
import { observer } from 'mobx-react';

import Tabbar from '../services/tabs/Tabbar';
import { ctrlKey } from '../../environment';
Expand All @@ -11,16 +12,26 @@ const messages = defineMessages({
id: 'sidebar.settings',
defaultMessage: '!!!Settings',
},
addNewService: {
id: 'sidebar.addNewService',
defaultMessage: '!!!Add new service',
},
mute: {
id: 'sidebar.mute',
defaultMessage: '!!!Disable audio',
},
unmute: {
id: 'sidebar.unmute',
defaultMessage: '!!!Enable audio',
},
});

@observer
export default class Sidebar extends Component {
static propTypes = {
openSettings: PropTypes.func.isRequired,
isPremiumUser: PropTypes.bool,
}

static defaultProps = {
isPremiumUser: false,
toggleMuteApp: PropTypes.func.isRequired,
isAppMuted: PropTypes.bool.isRequired,
}

static contextTypes = {
Expand All @@ -40,8 +51,9 @@ export default class Sidebar extends Component {
}

render() {
const { openSettings, isPremiumUser } = this.props;
const { openSettings, toggleMuteApp, isAppMuted } = this.props;
const { intl } = this.context;

return (
<div className="sidebar">
<Tabbar
Expand All @@ -50,21 +62,25 @@ export default class Sidebar extends Component {
disableToolTip={() => this.disableToolTip()}
/>
<button
onClick={openSettings}
className="sidebar__settings-button"
onClick={toggleMuteApp}
className={`sidebar__button sidebar__button--audio ${isAppMuted ? 'is-muted' : ''}`}
data-tip={`${intl.formatMessage(isAppMuted ? messages.unmute : messages.mute)} (${ctrlKey}+Shift+M)`}
>
<i className={`mdi mdi-bell${isAppMuted ? '-off' : ''}`} />
</button>
<button
onClick={() => openSettings({ path: 'recipes' })}
className="sidebar__button sidebar__button--new-service"
data-tip={`${intl.formatMessage(messages.addNewService)} (${ctrlKey}+N)`}
>
<i className="mdi mdi-plus-box" />
</button>
<button
onClick={() => openSettings({ path: 'app' })}
className="sidebar__button sidebar__button--settings"
data-tip={`${intl.formatMessage(messages.settings)} (${ctrlKey}+,)`}
>
{isPremiumUser && (
<span className="emoji">
<img src="./assets/images/emoji/star.png" alt="" />
</span>
)}
<img
src="./assets/images/logo.svg"
className="sidebar__logo"
alt=""
/>
{intl.formatMessage(messages.settings)}
<i className="mdi mdi-settings" />
</button>
{this.state.tooltipEnabled && (
<ReactTooltip place="right" type="dark" effect="solid" />
Expand Down
48 changes: 48 additions & 0 deletions src/components/services/content/ServiceDisabled.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { observer } from 'mobx-react';
import { defineMessages, intlShape } from 'react-intl';

import Button from '../../ui/Button';

const messages = defineMessages({
headline: {
id: 'service.disabledHandler.headline',
defaultMessage: '!!!{name} is disabled',
},
action: {
id: 'service.disabledHandler.action',
defaultMessage: '!!!Enable {name}',
},
});

@observer
export default class ServiceDisabled extends Component {
static propTypes = {
name: PropTypes.string.isRequired,
enable: PropTypes.func.isRequired,
};

static contextTypes = {
intl: intlShape,
};

countdownInterval = null;
countdownIntervalTimeout = 1000;

render() {
const { name, enable } = this.props;
const { intl } = this.context;

return (
<div className="services__info-layer">
<h1>{intl.formatMessage(messages.headline, { name })}</h1>
<Button
label={intl.formatMessage(messages.action, { name })}
buttonType="inverted"
onClick={() => enable()}
/>
</div>
);
}
}
Loading

0 comments on commit abca425

Please sign in to comment.