The Cognitive Distortion Journal (CDJ) is a smart journaling tool that helps remedy distorted thinking. It can feel impossible to follow the CBT technique of labeling and reframing distorted thinking when you've been thinking this way your whole life. The CDJ can help with that 🧠✨ -- v2 is in development!
This PR provides the opportunity to allow the user to update smaller areas of their journal.
The first commit allows the user to update their journal title. It does this by creating a new access endpoint to a specific journal and updates it by accepted request body fields. Currently the only accepted field is the journal title but this is where top level journal settings may be updated conveniently if any more are added.
The journal title may be updated by clicking on journal title in the Entries view page to reveal a TextField used to update the journal title. To update it, the user simply clicks outside of the TextField or may press enter. The Escape button escapes the updating and returns the title to the previous title.
A successful update returns a flash message from the server saying the Title has been updated.
Cleans up the frontend replacing all divs with the custom Item component or react fragment.
Updates the default journal title to The Cognitive Distortion Journal as opposed to Untitled.
Allows the user to regenerate an analysis for any entry using a refresh button icon at the bottom right of the analysis component.
Allows the user to edit their thought in the focused entry component by clicking on it. Pressing enter submits the edited entry, clicking away or pressing escape closes the TextField. Note that clicking away does not reset the editing field in case the user accidentally clicks out of the textfield and closes it. Pressing escape will reset the TextField though (design decision).
Provides a bit of a work around where the user is flashed that they must be logged in again after changing their email or password by navigating them back to the login page and sending a flash message to please re-authenticate using the new credentials. Previously they were stuck on the Account page and had to refresh to login again. If the user is logged in using a token however, they do not have to manually enter their new credentials. This work around is being used because it has proven difficult to re-authenticate the user after they change their credentials on the server. req.LogIn should work, however, it doesn't, at least in any obvious way.
This PR provides the opportunity to allow the user to update smaller areas of their journal.
The first commit allows the user to update their journal title. It does this by creating a new access endpoint to a specific journal and updates it by accepted request body fields. Currently the only accepted field is the journal title but this is where top level journal settings may be updated conveniently if any more are added.
The journal title may be updated by clicking on journal title in the Entries view page to reveal a TextField used to update the journal title. To update it, the user simply clicks outside of the TextField or may press enter. The Escape button escapes the updating and returns the title to the previous title.
A successful update returns a flash message from the server saying the Title has been updated.