From 48a0a1e963c27d633f6b0dd736e27ac2215586c5 Mon Sep 17 00:00:00 2001 From: Dominik Guzei Date: Fri, 12 Apr 2019 16:15:11 +0200 Subject: fixes last issues with announcement logic --- src/actions/lib/actions.js | 2 +- .../announcements/components/AnnouncementScreen.js | 100 ++++++++++----------- src/features/announcements/store.js | 5 -- src/features/utils/FeatureStore.js | 1 - src/i18n/locales/en-US.json | 2 +- 5 files changed, 52 insertions(+), 58 deletions(-) (limited to 'src') diff --git a/src/actions/lib/actions.js b/src/actions/lib/actions.js index 2bc7d2711..b38db9946 100644 --- a/src/actions/lib/actions.js +++ b/src/actions/lib/actions.js @@ -1,7 +1,7 @@ export const createActionsFromDefinitions = (actionDefinitions, validate) => { const actions = {}; Object.keys(actionDefinitions).forEach((actionName) => { - const action = (params) => { + const action = (params = {}) => { const schema = actionDefinitions[actionName]; validate(schema, params, actionName); action.notify(params); diff --git a/src/features/announcements/components/AnnouncementScreen.js b/src/features/announcements/components/AnnouncementScreen.js index 13cb6aab0..dfce6cdd5 100644 --- a/src/features/announcements/components/AnnouncementScreen.js +++ b/src/features/announcements/components/AnnouncementScreen.js @@ -205,65 +205,65 @@ class AnnouncementScreen extends Component { const { changelog, announcement } = announcementsStore; const themeImage = stores.ui.isDarkThemeActive ? 'dark' : 'light'; return ( -
-
-
-

{announcement.main.headline}

-

{announcement.main.subHeadline}

-
-
- -
-
-
-
-
-
- {announcement.spotlight && ( -
-
-

{announcement.spotlight.title}

-

{announcement.spotlight.subject}

-
-
-
-
-
-
- )} -
+ )} +
+ )} {changelog && (

diff --git a/src/features/announcements/store.js b/src/features/announcements/store.js index b99309ca7..0bebf29fd 100644 --- a/src/features/announcements/store.js +++ b/src/features/announcements/store.js @@ -111,16 +111,11 @@ export class AnnouncementsStore extends FeatureStore { // Check if there is an announcement and on't show announcements to new users if (!announcement || isNewUser) return; - this._showAnnouncement(); - // Check if the user has already used current version (= has seen the announcement) const { currentVersion, lastSeenAnnouncementVersion } = this; if (semver.gt(currentVersion, lastSeenAnnouncementVersion)) { debug(`${currentVersion} < ${lastSeenAnnouncementVersion}: announcement is shown`); this._showAnnouncement(); - } else { - debug(`${currentVersion} >= ${lastSeenAnnouncementVersion}: announcement is hidden`); - this._hideAnnouncement(); } }; diff --git a/src/features/utils/FeatureStore.js b/src/features/utils/FeatureStore.js index 967e745b2..b6e0fbce3 100644 --- a/src/features/utils/FeatureStore.js +++ b/src/features/utils/FeatureStore.js @@ -18,7 +18,6 @@ export class FeatureStore { } _startActions(actions = this._actions) { - console.log(actions); actions.forEach(a => a.start()); } diff --git a/src/i18n/locales/en-US.json b/src/i18n/locales/en-US.json index 70b869557..5bb10438a 100644 --- a/src/i18n/locales/en-US.json +++ b/src/i18n/locales/en-US.json @@ -320,4 +320,4 @@ "workspaceDrawer.workspaceFeatureInfo": "

Franz Workspaces let you focus on what’s important right now. Set up different sets of services and easily switch between them at any time.

You decide which services you need when and where, so we can help you stay on top of your game - or easily switch off from work whenever you want.

", "workspaceDrawer.workspacesSettingsTooltip": "Edit workspaces settings", "workspaces.switchingIndicator.switchingTo": "Switching to" -} +} \ No newline at end of file -- cgit v1.2.3-54-g00ecf