From f2aa71db4d08537d5a147642c4660bcd7e683e1e Mon Sep 17 00:00:00 2001 From: "Kristine.K" Date: Thu, 16 Nov 2017 11:37:05 +0200 Subject: [PATCH 1/5] [#345] - Change default history page --- frontend/app/components/health-dashboard.js | 4 ++-- frontend/app/templates/components/health-dashboard.hbs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/app/components/health-dashboard.js b/frontend/app/components/health-dashboard.js index 0f636ed4b..39308760c 100644 --- a/frontend/app/components/health-dashboard.js +++ b/frontend/app/components/health-dashboard.js @@ -10,8 +10,8 @@ const { } = Ember; export default Component.extend(CheckinByDate, { - patternsVisible: true, - chartVisible: false, + patternsVisible: false, + chartVisible: true, journalIsVisible: alias('chartJournalSwitcher.journalIsVisible'), chartJournalSwitcher: service(), i18n: service(), diff --git a/frontend/app/templates/components/health-dashboard.hbs b/frontend/app/templates/components/health-dashboard.hbs index 7bc3cc494..9167c86f4 100644 --- a/frontend/app/templates/components/health-dashboard.hbs +++ b/frontend/app/templates/components/health-dashboard.hbs @@ -1,6 +1,6 @@
- +
From 1b2dbb0b588dfc7bef0beb7d1ca5f08534d72847 Mon Sep 17 00:00:00 2001 From: "Kristine.K" Date: Thu, 16 Nov 2017 12:59:59 +0200 Subject: [PATCH 2/5] [#345] - Add sharing button to the history chart page --- frontend/app/components/pattern/index-step.js | 4 ---- frontend/app/locales/en/translations.js | 6 +++++- frontend/app/router.js | 4 ++++ frontend/app/styles/global.scss | 2 +- frontend/app/templates/components/health-chart.hbs | 10 ++++++++++ frontend/app/templates/components/health-dashboard.hbs | 4 ++-- .../app/templates/components/pattern/index-step.hbs | 4 ++-- 7 files changed, 24 insertions(+), 10 deletions(-) diff --git a/frontend/app/components/pattern/index-step.js b/frontend/app/components/pattern/index-step.js index 1756bbfca..2d273566e 100644 --- a/frontend/app/components/pattern/index-step.js +++ b/frontend/app/components/pattern/index-step.js @@ -142,9 +142,5 @@ export default Component.extend({ setProperties(this, { startAt: startAt, endAt: endAt }); }, - - sharePattern() { - this.transitionTo('patterns'); - }, } }); diff --git a/frontend/app/locales/en/translations.js b/frontend/app/locales/en/translations.js index 40e6ceea8..9c2c4ed6a 100644 --- a/frontend/app/locales/en/translations.js +++ b/frontend/app/locales/en/translations.js @@ -81,6 +81,10 @@ export default { }, history: { + charts: { + shareButtonText: 'Share Charts', + }, + step: { initial: { title: 'History', @@ -100,7 +104,7 @@ export default { }, index: { newPatternText: '+ Create new pattern', - sharePatternText: 'Share Patterns', + shareButtonText: 'Share Patterns', } } }, diff --git a/frontend/app/router.js b/frontend/app/router.js index 5b50c12f7..7bcc2511d 100644 --- a/frontend/app/router.js +++ b/frontend/app/router.js @@ -12,6 +12,10 @@ Router.map(function() { this.route('signup'); this.route('chart'); + this.route('charts', function() { + this.route('shared', { path: '/:friendly_id' }); + }); + this.route('patterns', function() { this.route('shared', { path: '/:friendly_id' }); }); diff --git a/frontend/app/styles/global.scss b/frontend/app/styles/global.scss index 4a9c8fc48..96f507fca 100644 --- a/frontend/app/styles/global.scss +++ b/frontend/app/styles/global.scss @@ -512,7 +512,7 @@ input[type="submit"] { } } -.sharePatternLink { +.shareHistoryBtn { display: flex; justify-content: center; margin-bottom: 10px; diff --git a/frontend/app/templates/components/health-chart.hbs b/frontend/app/templates/components/health-chart.hbs index 7b391d478..7c1f062b3 100644 --- a/frontend/app/templates/components/health-chart.hbs +++ b/frontend/app/templates/components/health-chart.hbs @@ -1,3 +1,13 @@ +{{#if authorPage}} +
+ {{#link-to 'charts' class="history-index-btn btn"}} + {{t "history.step.index.shareButtonText"}} + {{/link-to}} +
+{{else}} +

{{authorName}}'s Health History

+{{/if}} + {{#if chartLoaded }} diff --git a/frontend/app/templates/components/health-dashboard.hbs b/frontend/app/templates/components/health-dashboard.hbs index 9167c86f4..789df46e4 100644 --- a/frontend/app/templates/components/health-dashboard.hbs +++ b/frontend/app/templates/components/health-dashboard.hbs @@ -1,13 +1,13 @@
- +
{{#if journalIsVisible}} {{journal-list}} {{else if chartVisible}} - {{health-chart onDateClicked=(action "routeToCheckin")}} + {{health-chart onDateClicked=(action "routeToCheckin") authorPage=true}} {{else}} {{chart-patterns}} {{/if}} diff --git a/frontend/app/templates/components/pattern/index-step.hbs b/frontend/app/templates/components/pattern/index-step.hbs index 007d2d514..6e13a99bb 100644 --- a/frontend/app/templates/components/pattern/index-step.hbs +++ b/frontend/app/templates/components/pattern/index-step.hbs @@ -1,7 +1,7 @@ {{#if authorPage}} -