Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add ability to add a comment after you rate your day #2266

Merged
merged 12 commits into from
Jan 8, 2019
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ module.exports = {
}
}
],
"vue/no-v-html" : 0,
"vue/max-attributes-per-line": [
// https://vuejs.org/v2/style-guide/#Multi-attribute-elements-strongly-recommended
"error",
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ UNRELEASED CHANGES:

New features:

* Add ability to add a comment when rating your day in the journal
* Add API methods to manage genders
* Breaking change: rewrite API methods to manage contacts

Expand Down
1 change: 1 addition & 0 deletions app/Http/Controllers/JournalController.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public function storeDay(DaysRequest $request)
$day = auth()->user()->account->days()->create([
'date' => now(DateHelper::getTimezone()),
'rate' => $request->get('rate'),
'comment' => $request->get('comment'),
]);

// Log a journal entry
Expand Down
5 changes: 5 additions & 0 deletions public/changelog.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"entries": [
{
"date": "Jan 06, 2019",
"title": "Enhancement: comment when rating your day",
"description": "In the Journal, you can now add a comment after you rate your day. ![image](/img/changelogs/2019-01-06-rate-day-comment.png)"
},
{
"date": "Jan 02, 2019",
"title": "Enhancement: number of life events",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/js/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/js/langs/en.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"/js/manifest.js": "/js/manifest.js?id=01c8731923a46c30aaed",
"/js/app.js": "/js/app.js?id=f77c863e6dac8e5ae34e",
"/js/app.js": "/js/app.js?id=e1df87b13ad76b60c2bf",
"/css/app-ltr.css": "/css/app-ltr.css?id=d1a924515047b23cda18",
"/css/app-rtl.css": "/css/app-rtl.css?id=6cd44baa52797bd315d6",
"/css/stripe.css": "/css/stripe.css?id=2de4e0ce557016a0327e",
Expand Down
5 changes: 5 additions & 0 deletions resources/assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,11 @@ Vue.component(
require('./components/journal/JournalList.vue').default
);

Vue.component(
'journal-rate-day',
require('./components/journal/RateDay.vue').default
);

Vue.component(
'journal-calendar',
require('./components/journal/partials/JournalCalendar.vue').default
Expand Down
152 changes: 8 additions & 144 deletions resources/assets/js/components/journal/JournalList.vue

Large diffs are not rendered by default.

216 changes: 216 additions & 0 deletions resources/assets/js/components/journal/RateDay.vue

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@

<!-- Log content -->
<div class="flex-auto flex items-center">
<p class="mb2">
<p v-if="day.comment" class="mb2">
{{ day.comment }}
</p>
<p v-if="!day.comment" class="mb2">
{{ $t('journal.journal_entry_rate') }}
</p>
</div>
Expand Down Expand Up @@ -83,29 +86,6 @@
</g>
</svg>
</div>

<!-- Show comment -->
<div v-if="day.comment" class="flex-none w-5">
<div class="flex justify-center items-center h-100">
<svg width="16px" height="13px" viewBox="0 0 16 13" version="1.1" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" class="flex-none"
>
<defs />
<g id="App" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"
stroke-linecap="square"
>
<g id="Desktop" transform="translate(-839.000000, -279.000000)" stroke="#979797">
<g id="Group-4" transform="translate(839.000000, 278.000000)">
<path id="Line-2" d="M0.5,1.5 L15.5,1.5" />
<path id="Line-2" d="M0.5,9.5 L15.5,9.5" />
<path id="Line-2" d="M0.5,5.5 L13.5,5.5" />
<path id="Line-2" d="M0.5,13.5 L10.5,13.5" />
</g>
</g>
</g>
</svg>
</div>
</div>
</div>

<!-- Edit/Delete -->
Expand All @@ -115,6 +95,9 @@
</div>
<div class="flex-none w-90 mt2 pt0 pr3 pb2">
<ul class="f7">
<li class="di">
{{ $t('journal.journal_entry_rate') }}
</li>
<li class="di">
<a class="pointer" :cy-name="'entry-delete-button-' + journalEntry.id" @click="destroy()">
{{ $t('app.delete') }}
Expand Down
1 change: 1 addition & 0 deletions resources/lang/en/journal.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
'journal_entry_type_journal' => 'Journal entry',
'journal_entry_type_activity' => 'Activity',
'journal_entry_rate' => 'You rated your day.',
'journal_add_comment' => 'Care to add a comment (optional)?',
'entry_delete_success' => 'The journal entry has been successfully deleted.',
'journal_add_title' => 'Title (optional)',
'journal_add_date' => 'Date',
Expand Down