Monica: Manual journal entries are missing an edit option.

Created on 15 Jan 2018  路  4Comments  路  Source: monicahq/monica

Currently (v1.6.1) there is no option to edit a journal entry, for e.g. appending more content after submitting the first draft.

Only workaround currently:

  • Copy journal entry content to clipboard
  • Delete entry
  • Submit edited content from clipboard as new entry
feature request good first issue

Most helpful comment

@erdmenchen @aiveras it's done 馃憤 Not yet tested by myself but this feature is available in the latest Monica version thanks to @asbiin help 鈽猴笍

This ticket can be closed 馃帀

All 4 comments

@djaiss Hi there,

I would like to be part of this one. Here are my first thoughts:

Two brand new routes :

Route::get('/journal/entries/{journalEntry}/edit', 'JournalController@edit');
Route::put('/journal/entries/{journalEntry}', 'JournalController@update');

Two approaches for the view:

  1. We can use the same view for both adding and editing, using an empty Entry object injected into the add.blade.php view and an existing Entry for editing.
  2. We can create a new view file edit.blade.php.

Into the edit view, we need to modify:

  1. The breadcrumbs from "Add a journal entry" to "Edit a journal entry"
  2. The action button label from "Save" to "Modify"
  3. The page title "Add a journal entry" to something like "Edit a journal entry"

The Entry post field can contain HTML/Markdown and it has to be correctly rendered during the edition process. I don't really know how to handle that since textarea tag cannot render HTML. Do you have any suggestion/idea?

Create two methods, edit() and update() in the JournalController.php file (checking for both that the user is allowed to modify the Entry using account_id field).

Add a new "Modify" link just before the "Delete" link in the JournalContentEntry.vue component. Something like:

<li class="di">
    <a class="pointer" :cy-name="'entry-modify-button-' + entry.id" :href="'/journal/entries/' + entry.id + '/edit'">
        {{ $t('app.modify') }}
    </a>
</li>
<li class="di">
    <a class="pointer" :cy-name="'entry-delete-button-' + entry.id" @click="trash()">
        {{ $t('app.delete') }}
    </a>
</li>

Plus tests, of course :-)

Is that this approach satisfying your expectations ? Is it simple enough to implement and maintain ?

Best regards,

We also expect this feature. What is the status?

@aiveras Thanks for your interest in this issue.

Well, actually it looks like this => https://imgur.com/a/rHAt7r3

It's fully working (but not yet programmatically tested), the code is available here => https://github.com/TeddyBear06/monica/tree/818-add-journal-entry-edit-option.

I'm gonna write tests and create a pull request.

@erdmenchen @aiveras it's done 馃憤 Not yet tested by myself but this feature is available in the latest Monica version thanks to @asbiin help 鈽猴笍

This ticket can be closed 馃帀

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dnykanen picture dnykanen  路  3Comments

jkbecker picture jkbecker  路  3Comments

mattdavenport picture mattdavenport  路  3Comments

cynddl picture cynddl  路  3Comments

djaiss picture djaiss  路  3Comments