From 452a2dfe7df55280e2989279f57ece630235e55a Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Fri, 10 Nov 2017 22:18:13 +0100 Subject: move unread message badge a few pixel --- src/styles/tabs.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/styles/tabs.scss b/src/styles/tabs.scss index 8347de3b4..3ffc53558 100644 --- a/src/styles/tabs.scss +++ b/src/styles/tabs.scss @@ -67,8 +67,8 @@ padding: 0px 5px; font-size: 11px; position: absolute; - right: 5px; - bottom: 5px; + right: 8px; + bottom: 8px; display: flex; justify-content: center; align-items: center; -- cgit v1.2.3-70-g09d2 From f4db3a4d513ae2240abfcd5d81499689275bded7 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Fri, 10 Nov 2017 22:58:52 +0100 Subject: fix issue with unnecessary settings request invalidation --- src/stores/SettingsStore.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/stores/SettingsStore.js b/src/stores/SettingsStore.js index 331df5c15..7cd7c9114 100644 --- a/src/stores/SettingsStore.js +++ b/src/stores/SettingsStore.js @@ -35,7 +35,10 @@ export default class SettingsStore extends Store { @action async _update({ settings }) { await this.updateSettingsRequest.execute(settings)._promise; - await this.allSettingsRequest.invalidate({ immediately: true }); + this.allSettingsRequest.patch((result) => { + if (!result) return; + Object.assign(result, settings); + }); this._shareSettingsWithMainProcess(); -- cgit v1.2.3-70-g09d2 From c3eced0aee03004af82cd840b0e9e5d65c9557af Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Fri, 10 Nov 2017 23:13:46 +0100 Subject: fix issue with share settings with main process --- src/stores/SettingsStore.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/stores/SettingsStore.js b/src/stores/SettingsStore.js index 7cd7c9114..c301eaf82 100644 --- a/src/stores/SettingsStore.js +++ b/src/stores/SettingsStore.js @@ -40,7 +40,8 @@ export default class SettingsStore extends Store { Object.assign(result, settings); }); - this._shareSettingsWithMainProcess(); + // We need a little hack to wait until everything is patched + setTimeout(() => this._shareSettingsWithMainProcess(), 0); gaEvent('Settings', 'update'); } @@ -54,6 +55,7 @@ export default class SettingsStore extends Store { // Reactions _shareSettingsWithMainProcess() { + console.log(this.all); ipcRenderer.send('settings', this.all); } } -- cgit v1.2.3-70-g09d2 From 789d9a4fb570b83e9a2ce80d832ef5ab2b79b7a8 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Fri, 10 Nov 2017 23:13:57 +0100 Subject: enable run in background by default --- src/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/config.js b/src/config.js index 1627993f5..10359f426 100644 --- a/src/config.js +++ b/src/config.js @@ -7,7 +7,7 @@ export const GA_ID = 'UA-74126766-6'; export const DEFAULT_APP_SETTINGS = { autoLaunchOnStart: true, autoLaunchInBackground: false, - runInBackground: false, + runInBackground: true, enableSystemTray: true, minimizeToSystemTray: false, showDisabledServices: true, -- cgit v1.2.3-70-g09d2 From 632756f438ef4a0411521ba49131b75b19b28ab0 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Sat, 11 Nov 2017 20:57:16 +0100 Subject: Add color as an optional property --- src/components/ui/Loader.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/components/ui/Loader.js b/src/components/ui/Loader.js index e4fbd96a2..f73296bb6 100644 --- a/src/components/ui/Loader.js +++ b/src/components/ui/Loader.js @@ -9,12 +9,14 @@ export default class LoaderComponent extends Component { children: oneOrManyChildElements, loaded: PropTypes.bool, className: PropTypes.string, + color: PropTypes.string, }; static defaultProps = { children: null, loaded: false, className: '', + color: '#373a3c', }; render() { @@ -22,6 +24,7 @@ export default class LoaderComponent extends Component { children, loaded, className, + color, } = this.props; return ( @@ -30,7 +33,7 @@ export default class LoaderComponent extends Component { // lines={10} width={4} scale={0.6} - color="#373a3c" + color={color} component="span" className={className} > -- cgit v1.2.3-70-g09d2 From cc4147f682b8dc3b7026dd97e012b8cce97a980b Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Sat, 11 Nov 2017 20:57:37 +0100 Subject: fix wrong loader color --- src/components/ui/AppLoader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/components/ui/AppLoader.js b/src/components/ui/AppLoader.js index 64a212969..ac3cdcb05 100644 --- a/src/components/ui/AppLoader.js +++ b/src/components/ui/AppLoader.js @@ -8,7 +8,7 @@ export default function () {

Franz

- +
); -- cgit v1.2.3-70-g09d2 From b54c43dd5413a7d384e977b9f2fd0ffd39a593da Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Sun, 12 Nov 2017 19:39:50 +0100 Subject: Add settings option to toggle spell checker --- src/components/settings/settings/EditSettingsForm.js | 6 ++++++ src/config.js | 1 + src/containers/settings/EditSettingsScreen.js | 10 ++++++++++ 3 files changed, 17 insertions(+) (limited to 'src') diff --git a/src/components/settings/settings/EditSettingsForm.js b/src/components/settings/settings/EditSettingsForm.js index ba07b1a5b..e711ad402 100644 --- a/src/components/settings/settings/EditSettingsForm.js +++ b/src/components/settings/settings/EditSettingsForm.js @@ -30,6 +30,10 @@ const messages = defineMessages({ id: 'settings.app.headlineAppearance', defaultMessage: '!!!Appearance', }, + headlineMessaging: { + id: 'settings.app.headlineMessaging', + defaultMessage: '!!!Messaging', + }, buttonSearchForUpdate: { id: 'settings.app.buttonSearchForUpdate', defaultMessage: '!!!Check for updates', @@ -125,6 +129,8 @@ export default class EditSettingsForm extends Component { )}

{intl.formatMessage(messages.headlineAppearance)}

+

{intl.formatMessage(messages.headlineMessaging)}

+

{intl.formatMessage(messages.headlineLanguage)}

-

{intl.formatMessage(messages.headlineUpdates)}

+ + {/* Advanced */} +

{intl.formatMessage(messages.headlineAdvanced)}

+ +

{intl.formatMessage(messages.restartRequired)}

+ {/* + + {intl.formatMessage(messages.translationHelp)} + {/* Advanced */}

{intl.formatMessage(messages.headlineAdvanced)}

-- cgit v1.2.3-70-g09d2 From 41d3fbc82f8075c032157782931c96e0550b15dd Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Tue, 21 Nov 2017 11:42:30 +0100 Subject: add external links to config --- src/config.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/config.js b/src/config.js index 5ee5ee18e..b3e00c92c 100644 --- a/src/config.js +++ b/src/config.js @@ -17,3 +17,6 @@ export const DEFAULT_APP_SETTINGS = { beta: false, isAppMuted: false, }; + +export const FRANZ_SERVICE_REQUEST = 'http://bit.ly/franz-service-request'; +export const FRANZ_TRANSLATION = 'http://bit.ly/franz-translate'; -- cgit v1.2.3-70-g09d2 From 51959acf3ed9f9963b9ecb5879b29493308e979c Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Tue, 21 Nov 2017 11:53:55 +0100 Subject: Add service request to recipe dashboard --- .../settings/recipes/RecipesDashboard.js | 57 +++++++++++++--------- .../settings/settings/EditSettingsForm.js | 4 +- src/i18n/locales/en-US.json | 1 + src/index.js | 2 +- src/styles/recipes.scss | 4 ++ 5 files changed, 43 insertions(+), 25 deletions(-) (limited to 'src') diff --git a/src/components/settings/recipes/RecipesDashboard.js b/src/components/settings/recipes/RecipesDashboard.js index 02ea04e35..b6ade5da4 100644 --- a/src/components/settings/recipes/RecipesDashboard.js +++ b/src/components/settings/recipes/RecipesDashboard.js @@ -9,6 +9,7 @@ import Infobox from '../../ui/Infobox'; import RecipeItem from './RecipeItem'; import Loader from '../../ui/Loader'; import Appear from '../../ui/effects/Appear'; +import { FRANZ_SERVICE_REQUEST } from '../../../config'; const messages = defineMessages({ headline: { @@ -35,6 +36,10 @@ const messages = defineMessages({ id: 'settings.recipes.servicesSuccessfulAddedInfo', defaultMessage: '!!!Service successfully added', }, + missingService: { + id: 'settings.recipes.missingService', + defaultMessage: '!!!Missing a service?', + }, }); @observer @@ -96,33 +101,39 @@ export default class RecipesDashboard extends Component { )} - {!searchNeedle && ( -
- - {intl.formatMessage(messages.mostPopularRecipes)} - + {/* {!searchNeedle && ( */} +
+ resetSearch()} + > + {intl.formatMessage(messages.mostPopularRecipes)} + + resetSearch()} + > + {intl.formatMessage(messages.allRecipes)} + + {devRecipesCount > 0 && ( resetSearch()} > - {intl.formatMessage(messages.allRecipes)} + {intl.formatMessage(messages.devRecipes)} ({devRecipesCount}) - {devRecipesCount > 0 && ( - - {intl.formatMessage(messages.devRecipes)} ({devRecipesCount}) - - )} -
- )} + )} + + {intl.formatMessage(messages.missingService)} + +
+ {/* )} */} {isLoading ? ( ) : ( diff --git a/src/components/settings/settings/EditSettingsForm.js b/src/components/settings/settings/EditSettingsForm.js index 941f2149e..4ce9b7ab2 100644 --- a/src/components/settings/settings/EditSettingsForm.js +++ b/src/components/settings/settings/EditSettingsForm.js @@ -9,6 +9,8 @@ import Button from '../../ui/Button'; import Toggle from '../../ui/Toggle'; import Select from '../../ui/Select'; +import { FRANZ_TRANSLATION } from '../../../config'; + const messages = defineMessages({ headline: { id: 'settings.app.headline', @@ -145,7 +147,7 @@ export default class EditSettingsForm extends Component {

{intl.formatMessage(messages.headlineLanguage)}

*/} {/* Updates */} -- cgit v1.2.3-70-g09d2 From 246132a791dae2f7235615d13937a20919c6cd49 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Thu, 14 Dec 2017 11:37:26 +0100 Subject: remove unecessary console logs --- src/index.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src') diff --git a/src/index.js b/src/index.js index 4253b681f..76b1d8352 100644 --- a/src/index.js +++ b/src/index.js @@ -37,7 +37,6 @@ const isSecondInstance = app.makeSingleInstance((argv) => { const url = argv.slice(1); if (url) { - console.log(url.toString()); handleDeepLink(mainWindow, url.toString()); } } @@ -81,8 +80,7 @@ const createWindow = () => { const trayIcon = new Tray(); // Initialize ipcApi - const franzIpcApi = ipcApi({ mainWindow, settings, trayIcon }); - console.log(franzIpcApi); + ipcApi({ mainWindow, settings, trayIcon }); // Manage Window State mainWindowState.manage(mainWindow); -- cgit v1.2.3-70-g09d2 From 413bf160f1922eb56a3ea84eb1e13b04f2628662 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Thu, 14 Dec 2017 15:58:46 +0100 Subject: Remove IME handlers --- src/helpers/webview-ime-focus-helpers.js | 38 -------------------------------- src/webview/ime.js | 10 --------- src/webview/plugin.js | 1 - 3 files changed, 49 deletions(-) delete mode 100644 src/helpers/webview-ime-focus-helpers.js delete mode 100644 src/webview/ime.js (limited to 'src') diff --git a/src/helpers/webview-ime-focus-helpers.js b/src/helpers/webview-ime-focus-helpers.js deleted file mode 100644 index 2593a5f26..000000000 --- a/src/helpers/webview-ime-focus-helpers.js +++ /dev/null @@ -1,38 +0,0 @@ -module.exports.releaseDocumentFocus = () => { - const element = document.createElement('span'); - document.body.appendChild(element); - - const range = document.createRange(); - range.setStart(element, 0); - - const selection = window.getSelection(); - selection.removeAllRanges(); - selection.addRange(range); - selection.removeAllRanges(); - - document.body.removeChild(element); -}; - -module.exports.claimDocumentFocus = () => { - const { activeElement } = document; - const selection = window.getSelection(); - - let selectionStart; - let selectionEnd; - let range; - - if (activeElement) ({ selectionStart, selectionEnd } = activeElement); - if (selection.rangeCount) range = selection.getRangeAt(0); - - const restoreOriginalSelection = () => { - if (selectionStart >= 0 && selectionEnd >= 0) { - activeElement.selectionStart = selectionStart; - activeElement.selectionEnd = selectionEnd; - } else if (range) { - selection.addRange(range); - } - }; - - exports.releaseDocumentFocus(); - window.requestAnimationFrame(restoreOriginalSelection); -}; diff --git a/src/webview/ime.js b/src/webview/ime.js deleted file mode 100644 index 43df6267c..000000000 --- a/src/webview/ime.js +++ /dev/null @@ -1,10 +0,0 @@ -const { ipcRenderer } = require('electron'); -const { claimDocumentFocus } = require('../helpers/webview-ime-focus-helpers'); - -ipcRenderer.on('claim-document-focus', claimDocumentFocus); - -window.addEventListener('DOMContentLoaded', () => { - if (document.querySelector('[autofocus]')) { - ipcRenderer.sendToHost('autofocus'); - } -}); diff --git a/src/webview/plugin.js b/src/webview/plugin.js index c877132b1..e2daf09dd 100644 --- a/src/webview/plugin.js +++ b/src/webview/plugin.js @@ -5,7 +5,6 @@ import RecipeWebview from './lib/RecipeWebview'; import Spellchecker from './spellchecker.js'; import './notifications.js'; -import './ime.js'; const spellchecker = new Spellchecker(); -- cgit v1.2.3-70-g09d2 From ca7484600c02b37262f005549d31ef52a2c6398b Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Thu, 14 Dec 2017 16:01:53 +0100 Subject: fix(Shortcuts): Fixed settings shortcut inconsistency --- src/lib/Menu.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/lib/Menu.js b/src/lib/Menu.js index d9c30466b..d01666d49 100644 --- a/src/lib/Menu.js +++ b/src/lib/Menu.js @@ -167,7 +167,7 @@ export default class FranzMenu { label: 'Settings', accelerator: 'CmdOrCtrl+,', click: () => { - this.actions.ui.openSettings({ path: '' }); + this.actions.ui.openSettings({ path: 'app' }); }, }, { -- cgit v1.2.3-70-g09d2 From cea7a5cde78189d43fdd4d43d6a5cb12cd29e1c5 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Thu, 14 Dec 2017 16:49:50 +0100 Subject: feat(Service): Add option to completely disable message badges --- .../settings/services/EditServiceForm.js | 52 ++++++++++++++++------ src/containers/settings/EditServiceScreen.js | 9 ++++ src/i18n/locales/en-US.json | 4 ++ src/models/Service.js | 1 + src/styles/settings.scss | 23 +++++++--- 5 files changed, 69 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/components/settings/services/EditServiceForm.js b/src/components/settings/services/EditServiceForm.js index 36cefe87c..32f9d72f0 100644 --- a/src/components/settings/services/EditServiceForm.js +++ b/src/components/settings/services/EditServiceForm.js @@ -67,6 +67,18 @@ const messages = defineMessages({ id: 'settings.service.form.isMutedInfo', defaultMessage: '!!!When disabled, all notification sounds and audio playback are muted', }, + headlineNotifications: { + id: 'settings.service.form.headlineNotifications', + defaultMessage: '!!!Notifications', + }, + headlineBadges: { + id: 'settings.service.form.headlineBadges', + defaultMessage: '!!!Unread message dadges', + }, + headlineGeneral: { + id: 'settings.service.form.headlineGeneral', + defaultMessage: '!!!General', + }, }); @observer @@ -231,20 +243,32 @@ export default class EditServiceForm extends Component { )}
- - {recipe.hasIndirectMessages && ( -
- -

- {intl.formatMessage(messages.indirectMessageInfo)} -

-
- )} - -

- {intl.formatMessage(messages.isMutedInfo)} -

- +
+

{intl.formatMessage(messages.headlineNotifications)}

+ + +

+ {intl.formatMessage(messages.isMutedInfo)} +

+
+ +
+

{intl.formatMessage(messages.headlineBadges)}

+ + {recipe.hasIndirectMessages && form.$('isBadgeEnabled').value && ( +
+ +

+ {intl.formatMessage(messages.indirectMessageInfo)} +

+
+ )} +
+ +
+

{intl.formatMessage(messages.headlineGeneral)}

+ +
{recipe.message && (

diff --git a/src/containers/settings/EditServiceScreen.js b/src/containers/settings/EditServiceScreen.js index 191ef447b..cdde292b0 100644 --- a/src/containers/settings/EditServiceScreen.js +++ b/src/containers/settings/EditServiceScreen.js @@ -26,6 +26,10 @@ const messages = defineMessages({ id: 'settings.service.form.enableNotification', defaultMessage: '!!!Enable Notifications', }, + enableBadge: { + id: 'settings.service.form.enableBadge', + defaultMessage: '!!!Show unread message badges', + }, enableAudio: { id: 'settings.service.form.enableAudio', defaultMessage: '!!!Enable audio', @@ -88,6 +92,11 @@ export default class EditServiceScreen extends Component { value: service.isNotificationEnabled, default: true, }, + isBadgeEnabled: { + label: intl.formatMessage(messages.enableBadge), + value: service.isBadgeEnabled, + default: true, + }, isMuted: { label: intl.formatMessage(messages.enableAudio), value: !service.isMuted, diff --git a/src/i18n/locales/en-US.json b/src/i18n/locales/en-US.json index 48b408e59..a6da0f61d 100644 --- a/src/i18n/locales/en-US.json +++ b/src/i18n/locales/en-US.json @@ -117,11 +117,15 @@ "settings.service.form.name": "Name", "settings.service.form.enableService": "Enable service", "settings.service.form.enableNotification": "Enable notifications", + "settings.service.form.enableBadge": "Show unread message badges", "settings.service.form.team": "Team", "settings.service.form.customUrl": "Custom server", "settings.service.form.indirectMessages": "Show message badge for all new messages", "settings.service.form.enableAudio": "Enable audio", "settings.service.form.isMutedInfo": "When disabled, all notification sounds and audio playback are muted", + "settings.service.form.headlineNotifications": "Notifications", + "settings.service.form.headlineBadges": "Unread message badges", + "settings.service.form.headlineGeneral": "General", "settings.service.error.headline": "Error", "settings.service.error.goBack": "Back to services", "settings.service.error.message": "Could not load service recipe.", diff --git a/src/models/Service.js b/src/models/Service.js index 958e4b11e..820cf4506 100644 --- a/src/models/Service.js +++ b/src/models/Service.js @@ -22,6 +22,7 @@ export default class Service { @observable team = ''; @observable customUrl = ''; @observable isNotificationEnabled = true; + @observable isBadgeEnabled = true; @observable isIndirectMessageBadgeEnabled = true; @observable customIconUrl = ''; @observable hasCrashed = false; diff --git a/src/styles/settings.scss b/src/styles/settings.scss index 73cef0813..b29ed5468 100644 --- a/src/styles/settings.scss +++ b/src/styles/settings.scss @@ -151,8 +151,23 @@ } } - .settings__options { - margin-top: 30px; + &__options { + margin-top: 20px; + } + + &__settings-group { + margin-top: 10px; + + h3 { + font-weight: bold; + margin: 25px 0 15px; + color: $theme-gray-light; + letter-spacing: -0.1px; + + &:first-of-type { + margin-top: 0; + } + } } .settings__message { @@ -173,10 +188,6 @@ margin: -10px 0 20px 55px;; font-size: 12px; color: $theme-gray-light; - - &:last-of-type { - margin-bottom: 30px; - } } .settings__controls { -- cgit v1.2.3-70-g09d2 From f8bb2bedba18af4085865209805a2c5373ffb027 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Thu, 14 Dec 2017 17:09:21 +0100 Subject: Add missing commit --- src/components/services/tabs/TabItem.js | 2 +- src/models/Service.js | 3 +++ src/stores/ServicesStore.js | 8 ++++---- 3 files changed, 8 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/components/services/tabs/TabItem.js b/src/components/services/tabs/TabItem.js index 8403d9462..7aed8fda7 100644 --- a/src/components/services/tabs/TabItem.js +++ b/src/components/services/tabs/TabItem.js @@ -126,7 +126,7 @@ class TabItem extends Component { const menu = Menu.buildFromTemplate(menuTemplate); let notificationBadge = null; - if ((showMessageBadgeWhenMutedSetting || service.isNotificationEnabled) && showMessageBadgesEvenWhenMuted) { + if ((showMessageBadgeWhenMutedSetting || service.isNotificationEnabled) && showMessageBadgesEvenWhenMuted && service.isBadgeEnabled) { notificationBadge = ( {service.unreadDirectMessageCount > 0 && ( diff --git a/src/models/Service.js b/src/models/Service.js index 820cf4506..0b19440e7 100644 --- a/src/models/Service.js +++ b/src/models/Service.js @@ -53,6 +53,9 @@ export default class Service { this.isNotificationEnabled = data.isNotificationEnabled !== undefined ? data.isNotificationEnabled : this.isNotificationEnabled; + this.isBadgeEnabled = data.isBadgeEnabled !== undefined + ? data.isBadgeEnabled : this.isBadgeEnabled; + this.isIndirectMessageBadgeEnabled = data.isIndirectMessageBadgeEnabled !== undefined ? data.isIndirectMessageBadgeEnabled : this.isIndirectMessageBadgeEnabled; diff --git a/src/stores/ServicesStore.js b/src/stores/ServicesStore.js index b04aafd78..1cdf06041 100644 --- a/src/stores/ServicesStore.js +++ b/src/stores/ServicesStore.js @@ -491,13 +491,13 @@ export default class ServicesStore extends Store { const showMessageBadgeWhenMuted = this.stores.settings.all.showMessageBadgeWhenMuted; const showMessageBadgesEvenWhenMuted = this.stores.ui.showMessageBadgesEvenWhenMuted; - const unreadDirectMessageCount = this.enabled - .filter(s => (showMessageBadgeWhenMuted || s.isNotificationEnabled) && showMessageBadgesEvenWhenMuted) + const unreadDirectMessageCount = this.allDisplayed + .filter(s => (showMessageBadgeWhenMuted || s.isNotificationEnabled) && showMessageBadgesEvenWhenMuted && s.isBadgeEnabled) .map(s => s.unreadDirectMessageCount) .reduce((a, b) => a + b, 0); - const unreadIndirectMessageCount = this.enabled - .filter(s => (showMessageBadgeWhenMuted || s.isIndirectMessageBadgeEnabled) && showMessageBadgesEvenWhenMuted) + const unreadIndirectMessageCount = this.allDisplayed + .filter(s => (showMessageBadgeWhenMuted || s.isIndirectMessageBadgeEnabled) && showMessageBadgesEvenWhenMuted && s.isBadgeEnabled) .map(s => s.unreadIndirectMessageCount) .reduce((a, b) => a + b, 0); -- cgit v1.2.3-70-g09d2 From 873957dbc60981c3c5b163ed09cbc0f8face2295 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Thu, 14 Dec 2017 20:48:54 +0100 Subject: fix(Recipes): Enable `urlInputPrefix` for team and customURL --- src/components/settings/services/EditServiceForm.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/components/settings/services/EditServiceForm.js b/src/components/settings/services/EditServiceForm.js index 36cefe87c..a7d296460 100644 --- a/src/components/settings/services/EditServiceForm.js +++ b/src/components/settings/services/EditServiceForm.js @@ -202,7 +202,11 @@ export default class EditServiceForm extends Component { > {recipe.hasTeamId && ( - + )} {recipe.hasCustomUrl && ( -- cgit v1.2.3-70-g09d2 From 03610f2dd6833b3b6358790d044b852c154b4bf3 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Fri, 15 Dec 2017 14:00:17 +0100 Subject: feat(Recipes): Add `hasHostedOption` to enable hosted & self hosted services --- src/components/settings/services/EditServiceForm.js | 19 +++++++++++++++++-- src/containers/settings/EditServiceScreen.js | 11 +++++++++++ src/models/Recipe.js | 2 ++ src/styles/content-tabs.scss | 12 +++++++----- src/styles/input.scss | 4 ++++ 5 files changed, 41 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/components/settings/services/EditServiceForm.js b/src/components/settings/services/EditServiceForm.js index a7d296460..f689dd5c4 100644 --- a/src/components/settings/services/EditServiceForm.js +++ b/src/components/settings/services/EditServiceForm.js @@ -47,6 +47,10 @@ const messages = defineMessages({ id: 'settings.service.form.tabOnPremise', defaultMessage: '!!!Self hosted ⭐️', }, + useHostedService: { + id: 'settings.service.form.useHostedService', + defaultMessage: '!!!Use the hosted {name} service.', + }, customUrlValidationError: { id: 'settings.service.form.customUrlValidationError', defaultMessage: '!!!Could not validate custom {name} server.', @@ -108,7 +112,6 @@ export default class EditServiceForm extends Component { this.props.form.submit({ onSuccess: async (form) => { const values = form.values(); - let isValid = true; if (recipe.validateUrl && values.customUrl) { @@ -166,6 +169,13 @@ export default class EditServiceForm extends Component { /> ); + let activeTabIndex = 0; + if (recipe.hasHostedOption && service.team) { + activeTabIndex = 1; + } else if (recipe.hasHostedOption && service.customUrl) { + activeTabIndex = 2; + } + return (

@@ -198,8 +208,13 @@ export default class EditServiceForm extends Component { {(recipe.hasTeamId || recipe.hasCustomUrl) && ( + {recipe.hasHostedOption && ( + + {intl.formatMessage(messages.useHostedService, { name: recipe.name })} + + )} {recipe.hasTeamId && ( Date: Fri, 15 Dec 2017 14:02:37 +0100 Subject: Add missing translation strings --- src/i18n/locales/en-US.json | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/i18n/locales/en-US.json b/src/i18n/locales/en-US.json index 48b408e59..9efb36450 100644 --- a/src/i18n/locales/en-US.json +++ b/src/i18n/locales/en-US.json @@ -110,6 +110,7 @@ "settings.service.form.editServiceHeadline": "Edit {name}", "settings.service.form.tabHosted": "Hosted", "settings.service.form.tabOnPremise": "Self hosted ⭐️", + "settings.service.form.useHostedService": "Use the hosted {name} service.", "settings.service.form.customUrlValidationError": "Could not validate custom {name} server.", "settings.service.form.customUrlPremiumInfo": "To add self hosted services, you need a Franz Premium Supporter Account.", "settings.service.form.customUrlUpgradeAccount": "Upgrade your account", -- cgit v1.2.3-70-g09d2 From 5826dc36797b3d1d96ec986437003e5fc2626e91 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Fri, 15 Dec 2017 14:42:45 +0100 Subject: feat(Recipe): Add semver version validation --- src/models/Recipe.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/models/Recipe.js b/src/models/Recipe.js index 036d6d216..1fc23ac89 100644 --- a/src/models/Recipe.js +++ b/src/models/Recipe.js @@ -1,10 +1,11 @@ import emailParser from 'address-rfc2822'; +import semver from 'semver'; export default class Recipe { id = ''; name = ''; description = ''; - version = '1.0'; + version = ''; path = ''; serviceURL = ''; @@ -31,6 +32,10 @@ export default class Recipe { throw Error(`Recipe '${data.name}' requires Id`); } + if (!semver.valid(data.version)) { + throw Error(`Version ${data.version} of recipe '${data.name}' is not a valid semver version`); + } + this.id = data.id || this.id; this.name = data.name || this.name; this.rawAuthor = data.author || this.author; -- cgit v1.2.3-70-g09d2 From e40dd70da782a86ca2b08de33f6a57f2be462fcf Mon Sep 17 00:00:00 2001 From: Sabree Blackmon Date: Thu, 21 Dec 2017 11:12:42 -0600 Subject: Removing explicit disabling of web security setting for the WebView controls This fixes issue #30 where certain Google Voice issues are no longer functioning. This is also required to support other Google application integrations. --- src/components/services/content/ServiceWebview.js | 1 - src/components/ui/SubscriptionPopup.js | 1 - 2 files changed, 2 deletions(-) (limited to 'src') diff --git a/src/components/services/content/ServiceWebview.js b/src/components/services/content/ServiceWebview.js index faa356d3d..11911e834 100644 --- a/src/components/services/content/ServiceWebview.js +++ b/src/components/services/content/ServiceWebview.js @@ -105,7 +105,6 @@ export default class ServiceWebview extends Component { onUpdateTargetUrl={this.updateTargetUrl} useragent={service.userAgent} muted={isAppMuted || service.isMuted} - disablewebsecurity allowpopups /> )} diff --git a/src/components/ui/SubscriptionPopup.js b/src/components/ui/SubscriptionPopup.js index 5aae2c47a..528d02907 100644 --- a/src/components/ui/SubscriptionPopup.js +++ b/src/components/ui/SubscriptionPopup.js @@ -58,7 +58,6 @@ export default class SubscriptionPopup extends Component { autosize src={encodeURI(url)} - disablewebsecurity onDidNavigate={completeCheck} // onNewWindow={(event, url, frameName, options) => // openWindow({ event, url, frameName, options })} -- cgit v1.2.3-70-g09d2 From 5881c2676dd6acd44c69083cc250b0bad241d45f Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Fri, 22 Dec 2017 10:49:35 +0100 Subject: Don't send any deep linking events when URL is empty --- src/electron/deepLinking.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/electron/deepLinking.js b/src/electron/deepLinking.js index 16e68b914..ef23fd3c5 100644 --- a/src/electron/deepLinking.js +++ b/src/electron/deepLinking.js @@ -1,5 +1,7 @@ export default function handleDeepLink(window, rawUrl) { const url = rawUrl.replace('franz://', ''); + if (!url) return; + window.webContents.send('navigateFromDeepLink', { url }); } -- cgit v1.2.3-70-g09d2 From d83eed53a0cd5a5e705dcd8b28092bf2c4509593 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Fri, 22 Dec 2017 11:50:02 +0100 Subject: add deebug output --- src/electron/deepLinking.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/electron/deepLinking.js b/src/electron/deepLinking.js index ef23fd3c5..f35cb460a 100644 --- a/src/electron/deepLinking.js +++ b/src/electron/deepLinking.js @@ -1,6 +1,8 @@ export default function handleDeepLink(window, rawUrl) { const url = rawUrl.replace('franz://', ''); + console.log('handleDeepLink', url); + if (!url) return; window.webContents.send('navigateFromDeepLink', { url }); -- cgit v1.2.3-70-g09d2 From a081fca92caee548efcf057a5f124395c55d54a9 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Fri, 22 Dec 2017 12:59:04 +0100 Subject: remove debugging tests --- src/electron/deepLinking.js | 2 -- src/index.js | 2 -- 2 files changed, 4 deletions(-) (limited to 'src') diff --git a/src/electron/deepLinking.js b/src/electron/deepLinking.js index f35cb460a..ef23fd3c5 100644 --- a/src/electron/deepLinking.js +++ b/src/electron/deepLinking.js @@ -1,8 +1,6 @@ export default function handleDeepLink(window, rawUrl) { const url = rawUrl.replace('franz://', ''); - console.log('handleDeepLink', url); - if (!url) return; window.webContents.send('navigateFromDeepLink', { url }); diff --git a/src/index.js b/src/index.js index 76b1d8352..a047e2bc1 100644 --- a/src/index.js +++ b/src/index.js @@ -147,8 +147,6 @@ const createWindow = () => { mainWindow.on('show', () => { mainWindow.setSkipTaskbar(false); - - handleDeepLink(mainWindow, 'franz://settings/services/add/msteams'); }); app.mainWindow = mainWindow; -- cgit v1.2.3-70-g09d2