aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar Dominik Guzei <dominik.guzei@gmail.com>2019-04-12 16:15:11 +0200
committerLibravatar Dominik Guzei <dominik.guzei@gmail.com>2019-04-12 16:15:11 +0200
commit48a0a1e963c27d633f6b0dd736e27ac2215586c5 (patch)
treef12d78e95efb610ab06d65325e06ebf52577e3fa /src
parentadd i18n files (diff)
downloadferdium-app-48a0a1e963c27d633f6b0dd736e27ac2215586c5.tar.gz
ferdium-app-48a0a1e963c27d633f6b0dd736e27ac2215586c5.tar.zst
ferdium-app-48a0a1e963c27d633f6b0dd736e27ac2215586c5.zip
fixes last issues with announcement logic
Diffstat (limited to 'src')
-rw-r--r--src/actions/lib/actions.js2
-rw-r--r--src/features/announcements/components/AnnouncementScreen.js100
-rw-r--r--src/features/announcements/store.js5
-rw-r--r--src/features/utils/FeatureStore.js1
-rw-r--r--src/i18n/locales/en-US.json2
5 files changed, 52 insertions, 58 deletions
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 @@
1export const createActionsFromDefinitions = (actionDefinitions, validate) => { 1export const createActionsFromDefinitions = (actionDefinitions, validate) => {
2 const actions = {}; 2 const actions = {};
3 Object.keys(actionDefinitions).forEach((actionName) => { 3 Object.keys(actionDefinitions).forEach((actionName) => {
4 const action = (params) => { 4 const action = (params = {}) => {
5 const schema = actionDefinitions[actionName]; 5 const schema = actionDefinitions[actionName];
6 validate(schema, params, actionName); 6 validate(schema, params, actionName);
7 action.notify(params); 7 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 {
205 const { changelog, announcement } = announcementsStore; 205 const { changelog, announcement } = announcementsStore;
206 const themeImage = stores.ui.isDarkThemeActive ? 'dark' : 'light'; 206 const themeImage = stores.ui.isDarkThemeActive ? 'dark' : 'light';
207 return ( 207 return (
208 <div className={`${classes.container}`}> 208 <div className={classes.container}>
209 <div className={classes.announcement}> 209 {announcement && (
210 <div className={classes.main}> 210 <div className={classes.announcement}>
211 <h1>{announcement.main.headline}</h1> 211 <div className={classes.main}>
212 <h2>{announcement.main.subHeadline}</h2> 212 <h1>{announcement.main.headline}</h1>
213 <div className={classes.mainBody}> 213 <h2>{announcement.main.subHeadline}</h2>
214 <div className={classes.mainImage}> 214 <div className={classes.mainBody}>
215 <img 215 <div className={classes.mainImage}>
216 src={announcement.main.image[themeImage]} 216 <img
217 alt="" 217 src={announcement.main.image[themeImage]}
218 /> 218 alt=""
219 </div> 219 />
220 <div className={classes.mainText}> 220 </div>
221 <div 221 <div className={classes.mainText}>
222 dangerouslySetInnerHTML={{ 222 <div
223 __html: marked(announcement.main.text, markedOptions), 223 dangerouslySetInnerHTML={{
224 }} 224 __html: marked(announcement.main.text, markedOptions),
225 />
226 <div className={classes.mainCtaButton}>
227 <Button
228 label={announcement.main.cta.label}
229 onClick={() => {
230 const { analytics } = announcement.main.cta;
231 window.location.href = `#${announcement.main.cta.href}`;
232
233 gaEvent(analytics.category, analytics.action, announcement.main.cta.label);
234 }} 225 }}
235 /> 226 />
227 <div className={classes.mainCtaButton}>
228 <Button
229 label={announcement.main.cta.label}
230 onClick={() => {
231 const { analytics } = announcement.main.cta;
232 window.location.href = `#${announcement.main.cta.href}`;
233 gaEvent(analytics.category, analytics.action, announcement.main.cta.label);
234 }}
235 />
236 </div>
236 </div> 237 </div>
237 </div> 238 </div>
238 </div> 239 </div>
239 </div> 240 {announcement.spotlight && (
240 {announcement.spotlight && ( 241 <div className={classes.spotlight}>
241 <div className={classes.spotlight}> 242 <div className={classes.spotlightTopicContainer}>
242 <div className={classes.spotlightTopicContainer}> 243 <h2 className={classes.spotlightTopic}>{announcement.spotlight.title}</h2>
243 <h2 className={classes.spotlightTopic}>{announcement.spotlight.title}</h2> 244 <h3 className={classes.spotlightSubject}>{announcement.spotlight.subject}</h3>
244 <h3 className={classes.spotlightSubject}>{announcement.spotlight.subject}</h3> 245 </div>
245 </div> 246 <div className={classes.spotlightContentContainer}>
246 <div className={classes.spotlightContentContainer}> 247 <div
247 <div 248 dangerouslySetInnerHTML={{
248 dangerouslySetInnerHTML={{ 249 __html: marked(announcement.spotlight.text, markedOptions),
249 __html: marked(announcement.spotlight.text, markedOptions),
250 }}
251 />
252 <div className={classes.mainCtaButton}>
253 <Button
254 label={announcement.spotlight.cta.label}
255 onClick={() => {
256 const { analytics } = announcement.spotlight.cta;
257 window.location.href = `#${announcement.spotlight.cta.href}`;
258
259 gaEvent(analytics.category, analytics.action, announcement.spotlight.cta.label);
260 }} 250 }}
261 /> 251 />
252 <div className={classes.mainCtaButton}>
253 <Button
254 label={announcement.spotlight.cta.label}
255 onClick={() => {
256 const { analytics } = announcement.spotlight.cta;
257 window.location.href = `#${announcement.spotlight.cta.href}`;
258 gaEvent(analytics.category, analytics.action, announcement.spotlight.cta.label);
259 }}
260 />
261 </div>
262 </div> 262 </div>
263 </div> 263 </div>
264 </div> 264 )}
265 )} 265 </div>
266 </div> 266 )}
267 {changelog && ( 267 {changelog && (
268 <div className={classes.changelog}> 268 <div className={classes.changelog}>
269 <h1 className={classes.headline}> 269 <h1 className={classes.headline}>
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 {
111 // Check if there is an announcement and on't show announcements to new users 111 // Check if there is an announcement and on't show announcements to new users
112 if (!announcement || isNewUser) return; 112 if (!announcement || isNewUser) return;
113 113
114 this._showAnnouncement();
115
116 // Check if the user has already used current version (= has seen the announcement) 114 // Check if the user has already used current version (= has seen the announcement)
117 const { currentVersion, lastSeenAnnouncementVersion } = this; 115 const { currentVersion, lastSeenAnnouncementVersion } = this;
118 if (semver.gt(currentVersion, lastSeenAnnouncementVersion)) { 116 if (semver.gt(currentVersion, lastSeenAnnouncementVersion)) {
119 debug(`${currentVersion} < ${lastSeenAnnouncementVersion}: announcement is shown`); 117 debug(`${currentVersion} < ${lastSeenAnnouncementVersion}: announcement is shown`);
120 this._showAnnouncement(); 118 this._showAnnouncement();
121 } else {
122 debug(`${currentVersion} >= ${lastSeenAnnouncementVersion}: announcement is hidden`);
123 this._hideAnnouncement();
124 } 119 }
125 }; 120 };
126 121
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 {
18 } 18 }
19 19
20 _startActions(actions = this._actions) { 20 _startActions(actions = this._actions) {
21 console.log(actions);
22 actions.forEach(a => a.start()); 21 actions.forEach(a => a.start());
23 } 22 }
24 23
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 @@
320 "workspaceDrawer.workspaceFeatureInfo": "<p>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.</p><p>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.</p>", 320 "workspaceDrawer.workspaceFeatureInfo": "<p>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.</p><p>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.</p>",
321 "workspaceDrawer.workspacesSettingsTooltip": "Edit workspaces settings", 321 "workspaceDrawer.workspacesSettingsTooltip": "Edit workspaces settings",
322 "workspaces.switchingIndicator.switchingTo": "Switching to" 322 "workspaces.switchingIndicator.switchingTo": "Switching to"
323} 323} \ No newline at end of file