Files
habitica/website/client/src/components/tasks/taskModal.vue
T
SabreCat a0941ffa84 Squashed commit of the following:
commit 16d8b87e90
Merge: 07387faf48 6bea232d47
Author: negue <eugen.bolz@gmail.com>
Date:   Thu Sep 14 22:30:00 2023 +0200

    Merge remote-tracking branch 'origin/develop' into negue/ui/setting

commit 07387faf48
Author: negue <eugen.bolz@gmail.com>
Date:   Wed Sep 13 23:38:37 2023 +0200

    remove generate promoCode from ui

commit 6bea232d47
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Mon Sep 11 12:55:31 2023 -0400

    build(deps): bump core-js from 3.32.1 to 3.32.2 in /website/client (#14867)

    Bumps [core-js](https://github.com/zloirock/core-js/tree/HEAD/packages/core-js) from 3.32.1 to 3.32.2.
    - [Release notes](https://github.com/zloirock/core-js/releases)
    - [Changelog](https://github.com/zloirock/core-js/blob/master/CHANGELOG.md)
    - [Commits](https://github.com/zloirock/core-js/commits/v3.32.2/packages/core-js)

    ---
    updated-dependencies:
    - dependency-name: core-js
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit cebb3f0f25
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Mon Sep 11 12:43:49 2023 -0400

    build(deps): bump webpack from 4.46.0 to 4.47.0 in /website/client (#14868)

    Bumps [webpack](https://github.com/webpack/webpack) from 4.46.0 to 4.47.0.
    - [Release notes](https://github.com/webpack/webpack/releases)
    - [Commits](https://github.com/webpack/webpack/compare/v4.46.0...v4.47.0)

    ---
    updated-dependencies:
    - dependency-name: webpack
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit ea8563cd17
Merge: 3e16584dcf 6259955891
Author: negue <eugen.bolz@gmail.com>
Date:   Tue Aug 29 21:23:02 2023 +0200

    Merge remote-tracking branch 'origin/negue/ui/setting' into negue/ui/setting

commit 3e16584dcf
Author: negue <eugen.bolz@gmail.com>
Date:   Tue Aug 29 21:22:06 2023 +0200

    fix PR comments

commit 84ba44fb19
Author: negue <eugen.bolz@gmail.com>
Date:   Tue Aug 29 20:38:54 2023 +0200

    fix PR comments

commit 6259955891
Author: CuriousMagpie <eilatan@gmail.com>
Date:   Fri Aug 25 11:20:26 2023 -0400

    update form.scss

commit da82bd8e68
Author: negue <eugen.bolz@gmail.com>
Date:   Thu Aug 24 21:40:02 2023 +0200

    remove ending

commit 82e5fd2a83
Author: negue <eugen.bolz@gmail.com>
Date:   Mon Aug 21 22:25:41 2023 +0200

    fix spacing

commit 9ad06ea88b
Author: negue <eugen.bolz@gmail.com>
Date:   Mon Aug 21 22:09:22 2023 +0200

    clean up debug row for login methods

commit 41cde37675
Merge: 8c568060f9 82ebe71eb4
Author: negue <eugen.bolz@gmail.com>
Date:   Mon Aug 21 21:51:22 2023 +0200

    Merge remote-tracking branch 'origin/develop' into negue/ui/setting

commit 8c568060f9
Author: negue <eugen.bolz@gmail.com>
Date:   Mon Aug 21 21:49:31 2023 +0200

    fix PR comments

commit 36f7a4711d
Merge: d279af7897 647b27c55f
Author: negue <eugen.bolz@gmail.com>
Date:   Fri Aug 11 20:04:15 2023 +0200

    Merge remote-tracking branch 'origin/develop' into negue/ui/setting

commit d279af7897
Merge: ffbed3e044 b20ea44d49
Author: negue <eugen.bolz@gmail.com>
Date:   Wed Aug 9 21:13:37 2023 +0200

    Merge branch 'negue/refactor/routes' into negue/ui/setting

commit b20ea44d49
Author: negue <eugen.bolz@gmail.com>
Date:   Wed Aug 9 21:04:12 2023 +0200

    Split Vue.Router routes

commit ffbed3e044
Author: negue <eugen.bolz@gmail.com>
Date:   Sun Jul 23 00:00:24 2023 +0200

    remove console

commit 4c350b0180
Author: negue <eugen.bolz@gmail.com>
Date:   Sat Jul 22 23:34:20 2023 +0200

    update Bailey Notification Text + fix popover

commit c105b9ecf9
Author: negue <eugen.bolz@gmail.com>
Date:   Sat Jul 22 23:21:53 2023 +0200

    fix change password setting

commit 06410b4807
Author: negue <eugen.bolz@gmail.com>
Date:   Sat Jul 22 22:50:00 2023 +0200

    fix reset account texts

commit ccfdd9bb9c
Merge: 35c75304f1 8558dcc3a8
Author: negue <eugen.bolz@gmail.com>
Date:   Sat Jul 22 22:48:13 2023 +0200

    Merge remote-tracking branch 'origin/develop' into negue/ui/setting

commit 35c75304f1
Author: negue <eugen.bolz@gmail.com>
Date:   Sun Jul 2 20:16:06 2023 +0200

    more fixes

commit 203e961464
Author: negue <eugen.bolz@gmail.com>
Date:   Sun Jul 2 19:45:17 2023 +0200

    fix notification settings

commit ec94604791
Author: negue <eugen.bolz@gmail.com>
Date:   Sun Jun 25 22:00:45 2023 +0200

    applied same styling to promoCode.vue

commit 0177b3a76b
Author: negue <eugen.bolz@gmail.com>
Date:   Sun Jun 25 21:41:05 2023 +0200

    move promoCode.vue to pages/settings

commit 8fbb600273
Author: negue <eugen.bolz@gmail.com>
Date:   Sun Jun 25 21:40:35 2023 +0200

    saveCancelButtons.vue allow to hide the cancel part

commit 4915f2a3fb
Author: negue <eugen.bolz@gmail.com>
Date:   Sun Jun 25 21:09:07 2023 +0200

    Hide Transactions Page again

commit 8b5ae17f02
Author: negue <eugen.bolz@gmail.com>
Date:   Sun Jun 25 20:52:03 2023 +0200

    also check for invalid arguments in the password settings

commit aa97ed5299
Author: negue <eugen.bolz@gmail.com>
Date:   Sun Jun 25 20:25:53 2023 +0200

    fix localhost externalLinks check

commit 87a4e4931b
Author: negue <eugen.bolz@gmail.com>
Date:   Sun Jun 25 20:01:31 2023 +0200

    show notification on username change + fix userEmail checks

commit 6a6f55f6fc
Merge: f9ff5e5c55 e49d26eacd
Author: negue <eugen.bolz@gmail.com>
Date:   Sat Jun 24 22:54:00 2023 +0200

    Merge remote-tracking branch 'origin/develop' into negue/ui/setting

commit f9ff5e5c55
Author: negue <eugen.bolz@gmail.com>
Date:   Tue May 30 22:41:42 2023 +0200

    check password inputs and mark invalid for "password change" setting

commit 4497514eeb
Author: negue <eugen.bolz@gmail.com>
Date:   Tue May 30 21:59:21 2023 +0200

    show notification when chaning display name

commit 3232f12f0d
Author: negue <eugen.bolz@gmail.com>
Date:   Tue May 30 21:55:25 2023 +0200

    check current password valid style in "delete account" and "reset account"

commit 582a2f1304
Author: negue <eugen.bolz@gmail.com>
Date:   Tue May 30 21:27:20 2023 +0200

    mark password field of email setting as invalid on wrong password

commit 8e3b8a962a
Author: negue <eugen.bolz@gmail.com>
Date:   Tue May 30 21:24:46 2023 +0200

    refactor currentPasswordInput.vue to use validatedTextInput.vue

commit 61521507a4
Author: negue <eugen.bolz@gmail.com>
Date:   Tue May 30 20:20:56 2023 +0200

    fix username setting:
    - unsaved values check
    - @ char must be first in input, otherwise not remove it for checks

commit f74c29a065
Merge: c4b6f0c39c d4a5823916
Author: negue <eugen.bolz@gmail.com>
Date:   Tue May 30 19:54:06 2023 +0200

    Merge remote-tracking branch 'origin/develop' into negue/ui/setting

commit c4b6f0c39c
Merge: 37eee140ad 6e3a367832
Author: negue <eugen.bolz@gmail.com>
Date:   Fri May 12 22:08:08 2023 +0200

    Merge remote-tracking branch 'origin/develop' into negue/ui/setting

commit 37eee140ad
Author: negue <eugen.bolz@gmail.com>
Date:   Fri May 12 21:57:27 2023 +0200

    delete account without password

commit 48a6801f4e
Author: negue <eugen.bolz@gmail.com>
Date:   Mon May 8 22:06:29 2023 +0200

    fix duplicate json entry

commit 47a2189f49
Merge: a56b4a4457 49f45d27e3
Author: negue <eugen.bolz@gmail.com>
Date:   Mon May 8 21:48:21 2023 +0200

    Merge remote-tracking branch 'origin/release' into negue/ui/setting

commit a56b4a4457
Author: negue <eugen.bolz@gmail.com>
Date:   Mon May 8 21:37:31 2023 +0200

    show current class on setting panel

commit 9c973cca2a
Author: negue <eugen.bolz@gmail.com>
Date:   Mon May 8 21:15:46 2023 +0200

    fix selectDifficulty.vue - refactor selectList.vue

commit 95b37b3ba3
Author: negue <eugen.bolz@gmail.com>
Date:   Mon May 8 20:45:09 2023 +0200

    migrate restoreValues fix to new setting component

commit 7947b1c67d
Merge: ad3e4d604a 71e165433a
Author: negue <eugen.bolz@gmail.com>
Date:   Mon May 8 20:41:31 2023 +0200

    Merge remote-tracking branch 'origin/develop' into negue/ui/setting

commit ad3e4d604a
Author: negue <eugen.bolz@gmail.com>
Date:   Sat Apr 29 01:18:25 2023 +0200

    style fixes

commit cea13d5bc3
Merge: 73a5e5fcab b159182188
Author: negue <eugen.bolz@gmail.com>
Date:   Fri Apr 28 23:58:09 2023 +0200

    Merge remote-tracking branch 'origin/develop' into negue/ui/setting

commit 73a5e5fcab
Author: negue <eugen.bolz@gmail.com>
Date:   Tue Apr 25 20:51:14 2023 +0200

    style / padding issues

commit 0a10eb32cc
Author: negue <eugen.bolz@gmail.com>
Date:   Sat Apr 15 20:54:08 2023 +0200

    fix "setting new password" invalid check

commit a79bec3fa5
Author: negue <eugen.bolz@gmail.com>
Date:   Tue Apr 11 23:15:15 2023 +0200

    add password for other logins

commit 9ff17fd6dd
Author: negue <eugen.bolz@gmail.com>
Date:   Tue Apr 11 23:05:19 2023 +0200

    "fix values" use keydown event to mark as change

commit 1f470942a9
Author: negue <eugen.bolz@gmail.com>
Date:   Thu Apr 6 00:19:18 2023 +0200

    delete old api.vue

commit b4904a8b84
Merge: b5da7ccc70 c8b98678d0
Author: negue <eugen.bolz@gmail.com>
Date:   Thu Apr 6 00:18:07 2023 +0200

    Merge remote-tracking branch 'origin/develop' into negue/ui/setting

commit b5da7ccc70
Author: negue <eugen.bolz@gmail.com>
Date:   Thu Apr 6 00:11:36 2023 +0200

    refactor webhook ui to use save/cancel buttons

commit f49f67ff5c
Author: negue <eugen.bolz@gmail.com>
Date:   Wed Apr 5 22:56:37 2023 +0200

    remove unused settings

commit cc73b44b25
Author: negue <eugen.bolz@gmail.com>
Date:   Wed Mar 29 23:40:30 2023 +0200

    remove advancedCollapsed settings to start it opened

commit e0300e8710
Author: negue <eugen.bolz@gmail.com>
Date:   Wed Mar 29 22:58:09 2023 +0200

    remove displayInviteToPartyWhenPartyIs1 setting

commit 1741ddfc64
Author: negue <eugen.bolz@gmail.com>
Date:   Mon Mar 20 23:00:17 2023 +0100

    webhook margins

commit 24a43d027c
Author: negue <eugen.bolz@gmail.com>
Date:   Mon Mar 20 22:40:19 2023 +0100

    userid tooltip

commit 42fcb20bc4
Author: negue <eugen.bolz@gmail.com>
Date:   Thu Mar 16 00:51:10 2023 +0100

    remove balance for choosing class

commit 160848473d
Author: negue <eugen.bolz@gmail.com>
Date:   Thu Mar 16 00:20:56 2023 +0100

    show real class setting modal if enough gems available

commit f74ba9738d
Author: negue <eugen.bolz@gmail.com>
Date:   Thu Mar 16 00:10:53 2023 +0100

    update apple icon and size

commit bf961bc728
Author: negue <eugen.bolz@gmail.com>
Date:   Wed Mar 15 23:59:42 2023 +0100

    Copied API Token Notification

commit 28f0220b4e
Author: negue <eugen.bolz@gmail.com>
Date:   Wed Mar 15 23:53:33 2023 +0100

    remove blue color of setting links

commit b53ccace95
Author: negue <eugen.bolz@gmail.com>
Date:   Wed Mar 15 23:43:06 2023 +0100

    fix username/email setting input width

commit 1dfa5b275d
Author: negue <eugen.bolz@gmail.com>
Date:   Wed Mar 15 23:11:32 2023 +0100

    developer mode

commit 776618d2db
Author: negue <eugen.bolz@gmail.com>
Date:   Tue Mar 14 21:11:52 2023 +0100

    Add new Pause Dailies Setting

commit 576c80af7e
Merge: dec1a1159d 377b152ffd
Author: negue <eugen.bolz@gmail.com>
Date:   Tue Mar 14 21:04:05 2023 +0100

    Merge remote-tracking branch 'origin/develop' into negue/ui/setting

commit dec1a1159d
Author: negue <eugen.bolz@gmail.com>
Date:   Tue Mar 14 21:00:52 2023 +0100

    developer mode dummy row

commit 1e80a7d145
Author: negue <eugen.bolz@gmail.com>
Date:   Sat Mar 11 00:03:33 2023 +0100

    WIP webhook row

commit cc4bedbe2d
Author: negue <eugen.bolz@gmail.com>
Date:   Fri Mar 10 20:28:57 2023 +0100

    add spritely login creds message to the new api-row / redirect old url to the new one

commit f9833aa78a
Author: negue <eugen.bolz@gmail.com>
Date:   Thu Mar 9 02:23:39 2023 +0100

    API Token Row

commit 123c9b9bb1
Author: negue <eugen.bolz@gmail.com>
Date:   Mon Mar 6 22:46:50 2023 +0100

    "Your User Data" Row instead of Page

commit 0ade5663ae
Author: negue <eugen.bolz@gmail.com>
Date:   Fri Mar 3 22:43:03 2023 +0100

    userid row

commit b4f2236ab8
Author: negue <eugen.bolz@gmail.com>
Date:   Fri Mar 3 22:22:32 2023 +0100

    rename folder of setting rows

commit 3b050861c4
Author: negue <eugen.bolz@gmail.com>
Date:   Tue Feb 21 21:11:48 2023 +0100

    move remaining setting to generalSettings.vue - delete site.vue - start with siteData.vue

commit b09298fb01
Author: negue <eugen.bolz@gmail.com>
Date:   Tue Feb 21 20:56:03 2023 +0100

    move taskSettings.vue and add it to the settings list

commit 5ed25066ec
Author: negue <eugen.bolz@gmail.com>
Date:   Tue Feb 21 20:06:13 2023 +0100

    size/margin for transactions

commit 25e77cbd95
Author: negue <eugen.bolz@gmail.com>
Date:   Tue Feb 21 19:52:12 2023 +0100

    move purchaseHistory.vue

commit 8e4e1bcb0f
Merge: bb14d09aa4 85c50d50e9
Author: negue <eugen.bolz@gmail.com>
Date:   Tue Feb 21 19:04:31 2023 +0100

    Merge remote-tracking branch 'origin/negue/ui/setting' into negue/ui/setting

commit 85c50d50e9
Author: SabreCat <sabe@habitica.com>
Date:   Thu Feb 16 14:23:27 2023 -0600

    fix(css): remove redundant formatting for a elements

commit bb14d09aa4
Author: negue <eugen.bolz@gmail.com>
Date:   Thu Feb 16 01:34:09 2023 +0100

    remove console

commit 8c5e722c72
Author: negue <eugen.bolz@gmail.com>
Date:   Thu Feb 16 01:26:43 2023 +0100

    first try with the refactored UI of Login Methods

commit 9c8770051d
Author: negue <eugen.bolz@gmail.com>
Date:   Sat Feb 11 19:13:16 2023 +0100

    fix dayStartAdjustmentSetting.vue for 0 value

commit ee2ff3881b
Author: negue <eugen.bolz@gmail.com>
Date:   Sat Feb 11 18:37:46 2023 +0100

    fix color after refactor

commit 121e7485ca
Author: negue <eugen.bolz@gmail.com>
Date:   Sat Feb 11 18:29:00 2023 +0100

    mark audioThemeSetting as changed

commit 98c6570003
Author: negue <eugen.bolz@gmail.com>
Date:   Sat Feb 11 18:05:55 2023 +0100

    fix ul/li style in resetAccount.vue

commit fed824f705
Author: negue <eugen.bolz@gmail.com>
Date:   Sat Feb 11 17:49:36 2023 +0100

    fix color of gem price

commit 80365e537d
Author: negue <eugen.bolz@gmail.com>
Date:   Sat Feb 11 17:44:55 2023 +0100

    fix "fixValuesSetting.vue"

commit d3e15c5413
Author: negue <eugen.bolz@gmail.com>
Date:   Wed Feb 8 01:06:27 2023 +0100

    open forgot password in new tab

commit 31edec9ec5
Author: negue <eugen.bolz@gmail.com>
Date:   Wed Feb 8 01:03:19 2023 +0100

    move validatedTextInput.vue to shared components + fix check pos/size + input-error cleanup

commit 2adfd8c259
Author: negue <eugen.bolz@gmail.com>
Date:   Sun Feb 5 20:19:30 2023 +0100

    hide class setting until level 10

commit 64fb4c0cf9
Author: negue <eugen.bolz@gmail.com>
Date:   Sun Feb 5 19:32:40 2023 +0100

    delete old modals (refactored into new settings ui)

commit b5be137a8d
Author: negue <eugen.bolz@gmail.com>
Date:   Sun Feb 5 19:27:26 2023 +0100

    enable forgot password link in settings

commit bec75c6e12
Author: negue <eugen.bolz@gmail.com>
Date:   Sun Feb 5 18:52:54 2023 +0100

    reset account + password required in api

commit 64f7e7a1d9
Author: negue <eugen.bolz@gmail.com>
Date:   Mon Jan 30 23:22:55 2023 +0100

    fix compile

commit 7ffb5101be
Merge: 2bfb130b92 9f64633a57
Author: negue <eugen.bolz@gmail.com>
Date:   Mon Jan 30 22:47:05 2023 +0100

    Merge remote-tracking branch 'origin/develop' into negue/ui/setting

commit 2bfb130b92
Author: negue <eugen.bolz@gmail.com>
Date:   Mon Jan 30 22:44:23 2023 +0100

    remove restore-modal and replace it with the finished fix values setting

commit 89530a133c
Author: negue <eugen.bolz@gmail.com>
Date:   Wed Jan 18 19:22:36 2023 +0100

    wip fix values

commit 428647fc71
Author: negue <eugen.bolz@gmail.com>
Date:   Sat Jan 14 21:50:22 2023 +0100

    refactor change class to design update + clean up old site.vue settings

commit 1f16819bc1
Author: negue <eugen.bolz@gmail.com>
Date:   Wed Jan 11 22:41:05 2023 +0100

    WIP fix values

commit 6fef3d0579
Author: negue <eugen.bolz@gmail.com>
Date:   Sat Jan 7 22:51:30 2023 +0100

    check for unsaved changes when pressing cancel

commit bef8a4cdfc
Merge: 494f32c3e3 c7aadede4d
Author: negue <eugen.bolz@gmail.com>
Date:   Sat Jan 7 22:10:53 2023 +0100

    Merge remote-tracking branch 'origin/develop' into negue/ui/setting

commit 494f32c3e3
Author: negue <eugen.bolz@gmail.com>
Date:   Wed Dec 21 00:55:31 2022 +0100

    Class Setting

commit bda210cfbb
Author: negue <eugen.bolz@gmail.com>
Date:   Tue Dec 20 23:01:41 2022 +0100

    removes username, email and display name from site.vue

commit 38198d7df6
Author: negue <eugen.bolz@gmail.com>
Date:   Tue Dec 20 22:36:27 2022 +0100

    WIP class setting

commit dddcfa637f
Author: negue <eugen.bolz@gmail.com>
Date:   Tue Dec 20 22:31:36 2022 +0100

    fix styles

commit ce0a5cf974
Author: negue <eugen.bolz@gmail.com>
Date:   Sun Dec 11 23:57:07 2022 +0100

    Scroll into opened Setting

commit 7e0a95ddff
Author: negue <eugen.bolz@gmail.com>
Date:   Sun Dec 11 23:43:44 2022 +0100

    Audio Theme Setting

commit 9c556662fe
Author: negue <eugen.bolz@gmail.com>
Date:   Sun Dec 11 00:25:30 2022 +0100

    prepare header settings but still hidden

commit 30d8b27534
Merge: a1d1a788b2 580139ff69
Author: negue <eugen.bolz@gmail.com>
Date:   Sat Dec 10 23:36:36 2022 +0100

    Merge remote-tracking branch 'origin/develop' into negue/ui/setting

commit a1d1a788b2
Author: negue <eugen.bolz@gmail.com>
Date:   Sat Dec 10 23:34:33 2022 +0100

    DayStartAdjustmentSetting

commit ddee94a393
Author: negue <eugen.bolz@gmail.com>
Date:   Sat Dec 10 20:00:12 2022 +0100

    disable reset account button when password empty

commit 30a6db4c2d
Author: negue <eugen.bolz@gmail.com>
Date:   Sat Dec 10 19:54:21 2022 +0100

    hide & reset previous setting when switching to a different one

commit 78093848d7
Author: negue <eugen.bolz@gmail.com>
Date:   Wed Dec 7 22:19:15 2022 +0100

    validated text input (in/valid border color + icon)

commit e1b444ea63
Author: negue <eugen.bolz@gmail.com>
Date:   Tue Dec 6 22:09:54 2022 +0100

    re-enable box-shadow on hover

commit 96dc4e47ae
Author: negue <negue@users.noreply.github.com>
Date:   Mon Nov 28 01:13:47 2022 +0100

    remove console log

commit 69ad07daad
Author: negue <negue@users.noreply.github.com>
Date:   Mon Nov 28 01:01:17 2022 +0100

    dateFormatSetting

commit bc11c0cf75
Author: negue <negue@users.noreply.github.com>
Date:   Mon Nov 28 00:49:24 2022 +0100

    move shared components / mixins

commit 0d1a189c64
Author: negue <negue@users.noreply.github.com>
Date:   Mon Nov 28 00:44:21 2022 +0100

    language Setting + imports cleanup

commit 29ebd89030
Author: negue <negue@users.noreply.github.com>
Date:   Sun Nov 27 23:23:02 2022 +0100

    fix icon size + fix display name valid checks

commit 5c7747517b
Merge: fd5cbc3026 90b34c4dac
Author: negue <negue@users.noreply.github.com>
Date:   Sun Nov 27 23:08:35 2022 +0100

    Merge remote-tracking branch 'origin/release' into negue/ui/setting

commit fd5cbc3026
Author: negue <negue@users.noreply.github.com>
Date:   Wed Nov 23 00:14:21 2022 +0100

    fix conflicts

commit 49361217b0
Merge: edb427158f 04e2a39a9f
Author: negue <negue@users.noreply.github.com>
Date:   Wed Nov 23 00:12:38 2022 +0100

    Merge remote-tracking branch 'origin/develop' into negue/ui/setting

commit edb427158f
Author: negue <negue@users.noreply.github.com>
Date:   Wed Nov 23 00:03:19 2022 +0100

    disable save button if nothing was changed

commit c7e40e9446
Author: negue <negue@users.noreply.github.com>
Date:   Tue Nov 22 23:36:37 2022 +0100

    delete account row

commit 4bf740c531
Author: negue <negue@users.noreply.github.com>
Date:   Tue Nov 22 23:14:24 2022 +0100

    Shared Modal Visible State

commit d718153717
Author: negue <negue@users.noreply.github.com>
Date:   Sun Nov 20 18:06:20 2022 +0100

    resetAccount

commit e25922f8b3
Author: negue <negue@users.noreply.github.com>
Date:   Wed Nov 16 23:39:26 2022 +0100

    rename functional components for compiler

commit fdbc2c0eee
Author: negue <negue@users.noreply.github.com>
Date:   Wed Nov 16 01:44:50 2022 +0100

    password setting row

commit 5fd5e6275a
Author: negue <negue@users.noreply.github.com>
Date:   Tue Nov 15 17:35:44 2022 +0100

    update package-lock.json again

commit 9d742fd9a1
Author: negue <negue@users.noreply.github.com>
Date:   Tue Nov 15 17:24:15 2022 +0100

    update package-lock.json

commit cd588e74d5
Author: negue <negue@users.noreply.github.com>
Date:   Mon Nov 14 02:12:39 2022 +0100

    displayNameSetting.vue

commit 265970c5ef
Author: negue <negue@users.noreply.github.com>
Date:   Mon Nov 14 02:09:47 2022 +0100

    fix lint

commit a2b510caca
Merge: 0bae5fbe02 4dca69f14b
Author: negue <negue@users.noreply.github.com>
Date:   Mon Nov 14 01:15:02 2022 +0100

    Merge remote-tracking branch 'origin/develop' into negue/ui/setting

commit 0bae5fbe02
Author: negue <negue@users.noreply.github.com>
Date:   Sun Nov 13 22:00:34 2022 +0100

    userEmailSetting

commit 23da70fa2e
Author: negue <negue@users.noreply.github.com>
Date:   Sun Nov 13 20:38:14 2022 +0100

    extract save / cancel buttons and the shared inlineSetting "logic"

commit 82047380f3
Author: negue <negue@users.noreply.github.com>
Date:   Sun Nov 13 20:18:21 2022 +0100

    first setting (username) in the new layout

commit 39150349c7
Author: negue <negue@users.noreply.github.com>
Date:   Wed Nov 2 21:42:12 2022 +0100

    Working on M1 - will be reverted on full merge

commit f7787b318c
Merge: 4c0ecc9938 53fb28cc48
Author: negue <negue@users.noreply.github.com>
Date:   Tue Nov 1 14:20:24 2022 +0100

    Merge remote-tracking branch 'origin/develop' into negue/ui/setting

commit 4c0ecc9938
Merge: 2f53613a45 62b4315b3d
Author: negue <negue@users.noreply.github.com>
Date:   Sun Oct 30 12:49:34 2022 +0100

    Merge remote-tracking branch 'origin/develop' into negue/ui/setting

commit 2f53613a45
Author: negue <eugen.bolz@gmail.com>
Date:   Mon Oct 10 22:54:41 2022 +0200

    split routes for ease of dev

commit 390f0fc69d
Merge: cf222ee63a 137f7d53dc
Author: negue <eugen.bolz@gmail.com>
Date:   Mon Oct 10 22:50:43 2022 +0200

    Merge remote-tracking branch 'origin/develop' into negue/ui/setting

commit cf222ee63a
Author: negue <eugen.bolz@gmail.com>
Date:   Sun Oct 2 23:15:35 2022 +0200

    Update remaining Notification labels

commit f837cce125
Author: negue <eugen.bolz@gmail.com>
Date:   Sun Oct 2 22:45:12 2022 +0200

    move site popup settings to notifications

commit fc5181c3a7
Author: negue <eugen.bolz@gmail.com>
Date:   Sun Oct 2 21:12:24 2022 +0200

    fix styling in notification settings

commit 7b5568ed23
Author: negue <eugen.bolz@gmail.com>
Date:   Sat Sep 10 16:00:56 2022 +0200

    wip notification settings
2023-10-03 13:30:44 -05:00

1346 lines
36 KiB
Vue

<template>
<b-modal
id="task-modal"
:no-close-on-esc="true"
:no-close-on-backdrop="true"
size="sm"
:hide-footer="true"
@hidden="onClose()"
@show="syncTask()"
@shown="focusInput()"
>
<div
v-if="task"
slot="modal-header"
class="task-modal-header p-4"
:class="cssClass('bg')"
>
<div class="d-flex align-items-center mb-3">
<h2
class="my-auto"
:class="cssClass('headings')"
>
{{ title }}
</h2>
<div
class="ml-auto d-flex align-items-center"
>
<button
class="cancel-task-btn mr-3"
:class="cssClass('headings')"
type="button"
@click="cancel()"
>
{{ $t('cancel') }}
</button>
<button
class="btn btn-secondary d-flex align-items-center justify-content-center"
:class="{disabled: !canSave}"
type="button"
@click="submit()"
>
<div
v-if="purpose === 'edit'"
class="m-auto"
>
{{ $t('save') }}
</div>
<div
v-if="purpose === 'create'"
class="m-auto"
>
{{ $t('create') }}
</div>
</button>
</div>
</div>
<div class="form-group">
<lockable-label
:class-override="cssClass('headings')"
:locked="challengeAccessRequired"
:text="`${$t('text')}*`"
/>
<input
ref="inputToFocus"
v-model="task.text"
class="form-control input-title"
:class="cssClass('input')"
type="text"
required="required"
spellcheck="true"
:disabled="challengeAccessRequired"
:placeholder="$t('addATitle')"
>
</div>
<div
class="form-group mb-0"
>
<div class="d-flex">
<lockable-label
class="mr-auto"
:class-override="cssClass('headings')"
:text="`${$t('notes')}`"
/>
<small
class="my-1"
>
<a
target="_blank"
href="https://habitica.fandom.com/wiki/Markdown_Cheat_Sheet"
:class="cssClass('headings')"
>{{ $t('markdownHelpLink') }}</a>
</small>
</div>
<textarea
v-model="task.notes"
class="form-control input-notes"
:class="cssClass('input')"
:placeholder="$t('addNotes')"
></textarea>
</div>
</div>
<div
v-if="task"
class="task-modal-content px-4"
:class="cssClass('content')"
>
<form
@submit.stop.prevent="submit()"
>
<div
v-if="task.type === 'reward'"
class="option mt-3"
>
<div class="form-group">
<label
v-once
class="mb-1"
>{{ $t('cost') }}</label>
<div class="input-group">
<div class="input-group-prepend input-group-icon align-items-center">
<div
class="svg-icon gold"
v-html="icons.gold"
></div>
</div>
<input
v-model="task.value"
class="form-control"
type="number"
required="required"
placeholder="Enter a Value"
step="0.01"
min="0"
>
</div>
</div>
</div>
<div
v-if="checklistEnabled"
class="option mt-3"
>
<checklist
:items.sync="task.checklist"
/>
</div>
<div
v-if="task.type === 'habit'"
class="d-flex justify-content-center mt-3"
>
<button
type="button"
class="habit-option-container no-transition
d-flex flex-column justify-content-center align-items-center"
:class="!task.up ? cssClass('habit-control-disabled') : ''"
:disabled="challengeAccessRequired"
@click="toggleUpDirection()"
>
<div
class="habit-option-button no-transition
d-flex justify-content-center align-items-center mb-2"
:class="task.up ? cssClass('bg') : ''"
>
<div
class="habit-option-icon svg-icon no-transition"
:class="task.up ? '' : 'disabled'"
v-html="icons.positive"
></div>
</div>
<div
class="habit-option-label no-transition"
:class="task.up ? cssClass('icon') : 'disabled'"
>
{{ $t('positive') }}
</div>
</button>
<button
type="button"
class="habit-option-container no-transition
d-flex flex-column justify-content-center align-items-center"
:class="!task.down ? cssClass('habit-control-disabled') : ''"
:disabled="challengeAccessRequired"
@click="toggleDownDirection()"
>
<div
class="habit-option-button no-transition
d-flex justify-content-center align-items-center mb-2"
:class="task.down ? cssClass('bg') : ''"
>
<div
class="habit-option-icon no-transition svg-icon negative mx-auto"
:class="task.down ? '' : 'disabled'"
v-html="icons.negative"
></div>
</div>
<div
class="habit-option-label no-transition"
:class="task.down ? cssClass('icon') : 'disabled'"
>
{{ $t('negative') }}
</div>
</button>
</div>
<template
v-if="task.type !== 'reward'"
>
<div class="d-flex mt-3 align-items-center">
<lockable-label
:locked="challengeAccessRequired"
:text="$t('difficulty')"
/>
<information-icon
tooltip-id="difficultyHelp"
:tooltip="$t('difficultyHelp')"
/>
</div>
<select-difficulty
:value="task.priority"
:disabled="challengeAccessRequired"
@select="setDifficulty($event)"
/>
</template>
<div
v-if="task.type === 'todo' && (!challengeAccessRequired || task.date)"
class="option mt-3"
>
<div class="form-group">
<lockable-label
:locked="challengeAccessRequired"
:text="$t('dueDate')"
/>
<datepicker
:date.sync="task.date"
:disabled="challengeAccessRequired"
:highlighted="calendarHighlights"
:clear-button="true"
/>
</div>
</div>
<div
v-if="task.type === 'daily'"
class="option mt-3"
>
<div class="form-group">
<lockable-label
:locked="challengeAccessRequired"
:text="$t('startDate')"
/>
<datepicker
:date.sync="task.startDate"
:disabled="challengeAccessRequired"
:highlighted="calendarHighlights"
/>
</div>
</div>
<div
v-if="task.type === 'daily'"
class="option mt-3"
>
<div class="form-group">
<lockable-label
:locked="challengeAccessRequired"
:text="$t('repeats')"
/>
<select-translated-array
:disabled="challengeAccessRequired"
:items="['daily', 'weekly', 'monthly', 'yearly']"
:value="task.frequency"
@select="task.frequency = $event"
/>
</div>
</div>
<div
v-if="task.type === 'daily'"
class="option mt-3"
>
<div class="form-group">
<lockable-label
:locked="challengeAccessRequired"
:text="$t('repeatEvery')"
/>
<div
class="input-group-outer"
:class="{disabled: challengeAccessRequired}"
>
<div class="input-group">
<input
v-model="task.everyX"
class="form-control"
type="number"
min="0"
max="9999"
required="required"
:disabled="challengeAccessRequired"
>
</div>
<div class="input-group-spaced input-group-text">
{{ repeatSuffix }}
</div>
</div>
</div>
</div>
<div
v-if="task.type === 'daily' && task.frequency === 'weekly'"
class="option mt-3"
>
<div class="form-group">
<lockable-label
:locked="challengeAccessRequired"
:text="$t('repeatOn')"
/>
<div class="toggle-group">
<toggle-checkbox
v-for="(day, dayNumber) in ['su','m','t','w','th','f','s']"
:key="dayNumber"
:tab-index="dayNumber"
:checked.sync="task.repeat[day]"
:disabled="challengeAccessRequired"
:text="weekdaysMin(dayNumber)"
/>
</div>
</div>
</div>
<div
v-if="task.type === 'daily' && task.frequency === 'monthly'"
class="option mt-3"
>
<label
v-once
class="d-block mb-1"
>{{ $t('repeatOn') }}</label>
<div class="form-radio">
<div class="custom-control custom-radio custom-control-inline">
<input
id="repeat-dayOfMonth"
v-model="repeatsOn"
class="custom-control-input"
type="radio"
value="dayOfMonth"
name="repeatsOn"
>
<label
class="custom-control-label"
for="repeat-dayOfMonth"
>{{ $t('dayOfMonth') }}</label>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input
id="repeat-dayOfWeek"
v-model="repeatsOn"
class="custom-control-input"
type="radio"
value="dayOfWeek"
name="repeatsOn"
>
<label
class="custom-control-label"
for="repeat-dayOfWeek"
>{{ $t('dayOfWeek') }}</label>
</div>
</div>
</div>
<div
v-if="!groupId"
class="tags-select option mt-3"
>
<div class="tags-inline form-group row">
<label
v-once
class="col-12 mb-1"
>{{ $t('tags') }}</label>
<div class="col-12">
<select-multi
ref="selectTag"
:selected-items="task.tags"
:all-items="user.tags"
:add-new="true"
:empty-message="$t('addTags')"
:search-placeholder="$t('enterTag')"
@changed="task.tags = $event"
@addNew="addTag"
/>
</div>
</div>
</div>
<div
v-if="task.type === 'habit' && !groupId"
class="option mt-3"
>
<div class="form-group">
<lockable-label
:locked="challengeAccessRequired"
:text="$t('resetCounter')"
/>
<select-translated-array
:disabled="challengeAccessRequired"
:items="['daily', 'weekly', 'monthly']"
:value="task.frequency"
@select="task.frequency = $event"
/>
</div>
</div>
<div
v-if="groupId"
class="option group-options mt-3"
>
<div class="form-group row mt-3 mb-3">
<label
v-once
class="col-10 mb-1"
>{{ $t('assignTo') }}</label>
<a
v-if="assignedMembers.length > 0"
class="col-2 text-right mt-1"
@click="clearAssignments"
>
{{ $t('clear') }}
</a>
<div class="col-12">
<select-multi
ref="assignMembers"
:all-items="membersNameAndId"
:empty-message="$t('unassigned')"
:pill-invert="true"
:search-placeholder="$t('chooseTeamMember')"
:selected-items="assignedMembers"
@toggle="toggleAssignment($event)"
/>
</div>
</div>
</div>
<div
v-if="advancedSettingsAvailable"
class="advanced-settings mt-3"
>
<div
class="advanced-settings-toggle d-flex justify-content-between align-items-center"
@click="showAdvancedOptions = !showAdvancedOptions"
>
<h3>{{ $t('advancedSettings') }}</h3>
<div class="toggle-up">
<div
class="svg-icon"
:class="{'toggle-open': showAdvancedOptions}"
v-html="icons.chevron"
></div>
</div>
</div>
<b-collapse
id="advancedOptionsCollapse"
v-model="showAdvancedOptions"
>
<div>
<div
v-if="advancedSettingsShowRestoreStreak"
class="option mt-3"
>
<div class="form-group">
<label
v-once
class="mb-1"
>{{ $t('restoreStreak') }}</label>
<div class="input-group">
<div class="input-group-prepend streak-addon input-group-icon">
<div
v-once
class="svg-icon"
v-html="icons.streak"
></div>
</div>
<input
v-model="task.streak"
class="form-control"
type="number"
min="0"
required="required"
>
</div>
</div>
</div>
<div
v-if="advancedSettingsShowAdjustCounter"
class="option mt-3"
>
<div class="form-group">
<label
v-once
class="mb-1"
>{{ $t('adjustCounter') }}</label>
<div
class="row streak-inputs"
:class="{'both': task.up && task.down}"
>
<div
v-if="task.up"
class="positive"
:class="{'col-6': task.down, 'col-12': !task.down}"
>
<div class="input-group">
<div class="input-group-prepend positive-addon input-group-icon">
<div
v-once
class="svg-icon"
v-html="icons.positive"
></div>
</div>
<input
v-model="task.counterUp"
class="form-control"
type="number"
min="0"
required="required"
>
</div>
</div>
<div
v-if="task.down"
class="negative"
:class="{'col-6': task.up, 'col-12': !task.up}"
>
<div class="input-group">
<div class="input-group-prepend negative-addon input-group-icon">
<div
v-once
class="svg-icon"
v-html="icons.negative"
></div>
</div>
<input
v-model="task.counterDown"
class="form-control"
type="number"
min="0"
required="required"
>
</div>
</div>
</div>
</div>
</div>
<div
v-if="advancedSettingsShowTaskAlias"
class="option mt-3"
>
<div class="form-group">
<label
v-once
class="mb-1"
>{{ $t('taskAlias') }}
<information-icon
tooltip-id="taskAlias"
:tooltip="$t('taskAliasPopover')"
/>
</label>
<div class="input-group">
<input
v-model="task.alias"
class="form-control"
:placeholder="$t('taskAliasPlaceholder')"
type="text"
>
</div>
</div>
</div>
</div>
</b-collapse>
</div>
<div
v-if="purpose !== 'create' && !challengeAccessRequired"
class="d-flex justify-content-center mt-4 mb-4"
>
<button
class="delete-task-btn d-flex"
type="button"
@click="destroy()"
>
<div
v-once
class="svg-icon"
v-html="icons.destroy"
></div>
<span class="delete-text mt-1">
{{ $t('deleteTaskType', { type: $t(task.type) }) }}
</span>
</button>
</div>
<div
v-if="purpose === 'create'"
slot="modal-footer"
class="task-modal-footer d-flex justify-content-center align-items-center mt-4 mb-4"
>
<button
class="btn btn-primary btn-footer
d-flex align-items-center justify-content-center"
:class="{disabled: !canSave}"
type="button"
@click="submit()"
>
{{ $t('create') }}
</button>
</div>
<div
v-else
class="task-modal-footer mt-4"
>
</div>
</form>
</div>
</b-modal>
</template>
<style lang="scss">
@import '~@/assets/scss/colors.scss';
#task-modal {
a:not(.dropdown-item) {
font-size: 12px;
line-height: 1.33;
}
.modal-dialog.modal-sm {
max-width: 448px;
}
.form-group {
margin-bottom: 0;
}
.custom-control-input {
z-index: -1;
opacity: 0;
}
.modal-header {
.form-group {
margin-bottom: 1rem;
}
}
.habit-option-container {
&, &:focus, &:active, &:hover {
outline: 0;
border: 0;
background: none;
}
}
.no-transition {
transition: none;
}
input, textarea {
transition-property: border-color, box-shadow, color, background;
background-color: rgba(255, 255, 255, 0.5);
&:focus:not(:disabled), &:active:not(:disabled), &:hover:not(:disabled) {
background-color: rgba(255, 255, 255, 0.75);
}
}
.modal-content {
border-radius: 8px;
border: none;
box-shadow: 0 14px 28px 0 rgba($black, 0.24), 0 10px 10px 0 rgba($black, 0.28);
}
.modal-header, .modal-body, .modal-footer {
padding: 0px;
border: none;
}
.cursor-auto {
cursor: auto;
}
.task-modal-header {
color: $white;
width: 100%;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
h2 {
color: $white;
}
}
.info-icon {
float: left;
height: 16px;
width: 16px;
margin-top: 2px;
color: $gray-200;
}
.option {
position: relative;
.custom-control-label p {
word-break: break-word;
}
}
.option-item {
margin-right: 48px;
cursor: pointer;
&:last-child {
margin-right: 0px;
}
&-box {
width: 64px;
height: 64px;
border-radius: 2px;
background: $gray-600;
margin-bottom: 8px;
display: flex;
align-items: center;
justify-content: center;
}
&-label {
color: $gray-50;
text-align: center;
transition-property: none;
}
}
.category-wrap {
cursor: pointer;
margin-top: 0px;
width: 100%;
}
.category-box {
bottom: 0px;
left: 40px;
top: auto;
z-index: 11;
.container {
max-height: 90vh;
overflow: auto;
}
}
.datetime-buttons {
display: flex;
flex-direction: row;
.btn {
flex: 1;
}
}
.delete-task-btn, .cancel-task-btn {
border: 0;
background: none;
padding-right: 0;
color: inherit;
cursor: pointer;
&:hover, &:active, &:focus {
border: none !important;
background: none !important;
outline: none !important;
text-decoration: underline;
}
}
.delete-task-btn {
height: 1.5rem;
align-items: center;
&:hover, &:focus, &:active {
text-decoration: underline;
text-decoration-color: $maroon-50;
}
.delete-text {
font-size: 14px;
font-weight: normal;
font-stretch: normal;
font-style: normal;
line-height: 1.71;
letter-spacing: normal;
color: $maroon-50;
height: 1.5rem;
}
.svg-icon {
svg {
height: 1rem;
width: 1rem;
object-fit: contain;
display: inline;
}
margin-right: 0.5rem;
color: $maroon-50;
display: inline;
}
}
.task-modal-footer {
margin: 0;
width: 100%;
.cancel-task-btn {
margin-right: 16px;
color: $blue-10;
}
.btn-footer {
height: 2rem;
}
}
.weekday-check {
margin-left: 0px;
width: 57px;
}
.advanced-settings {
min-height: 3rem;
background-color: $gray-700;
margin-left: -1.5rem;
margin-right: -1.5rem;
padding: 0.75rem 1.5rem;
.form-group:last-of-type {
margin-bottom: 0.75rem;
}
&-toggle {
cursor: pointer;
}
h3 {
height: 1.5rem;
// Condensed is the default for h3
font-family: Roboto;
font-size: 14px;
font-weight: bold;
font-stretch: normal;
font-style: normal;
line-height: 1.71;
letter-spacing: normal;
color: $gray-10;
margin: 0;
}
.attributes .custom-control {
margin-right: 40px;
}
.toggle-up .svg-icon {
width: 1rem;
}
.toggle-up svg {
width: 1rem;
height: 1rem;
}
.toggle-open {
transform: rotate(180deg);
}
.attr-description {
border-bottom: 1px dashed;
}
label {
height: 1.5rem;
letter-spacing: normal;
color: $gray-50;
}
}
.form-radio {
.custom-control {
margin-bottom: 0;
}
}
}
@media only screen and (max-width: 768px) {
.option-item {
margin-right: 12px !important;
}
}
.streak-addon path {
fill: $gray-200;
}
</style>
<style lang="scss" scoped>
@import '~@/assets/scss/colors.scss';
.gold {
width: 1rem;
height: 1rem;
}
label {
display: inline-flex;
align-items: center;
}
.habit-option {
&-container {
min-width: 3rem;
&:not(:disabled) {
cursor: pointer;
}
&:first-of-type {
margin-right: 2rem;
}
}
&-button {
width: 2.5rem;
height: 2.5rem;
border-radius: 50%;
}
&-icon {
width: 10px;
height: 10px;
color: $white;
&.disabled {
color: $gray-200;
}
&.negative {
margin-top: 0.5rem;
}
}
&-label {
font-size: 12px;
font-weight: bold;
text-align: center;
&.disabled {
color: $gray-100;
font-weight: normal;
}
}
}
input, textarea, input.form-control, textarea.form-control {
padding: 0.25rem 0.75rem;
line-height: 1.71;
}
.input-title {
height: 2rem;
}
.input-notes {
height: 3.5rem;
}
label {
font-size: 14px;
font-weight: bold;
line-height: 1.71;
}
.flex-group {
display: flex;
.flex {
flex: 1;
}
}
.streak-inputs.both {
.positive {
padding-right: 6px;
}
.negative {
padding-left: 6px;
}
}
.input-group-text {
font-size: 14px;
font-weight: bold;
font-stretch: normal;
font-style: normal;
line-height: 1.71;
letter-spacing: normal;
text-align: center;
color: $gray-50;
border: 0;
}
.disabled .input-group-text {
color: $gray-200;
}
</style>
<script>
import axios from 'axios';
import moment from 'moment';
import Datepicker from '@/components/ui/datepicker';
import toggleCheckbox from '@/components/ui/toggleCheckbox';
import markdownDirective from '@/directives/markdown';
import { mapGetters, mapActions, mapState } from '@/libs/store';
import checklist from './modal-controls/checklist';
import SelectMulti from './modal-controls/selectMulti';
import selectDifficulty from '@/components/tasks/modal-controls/selectDifficulty';
import selectTranslatedArray from '@/components/tasks/modal-controls/selectTranslatedArray';
import lockableLabel from '@/components/tasks/modal-controls/lockableLabel';
import syncTask from '../../mixins/syncTask';
import positiveIcon from '@/assets/svg/positive.svg';
import negativeIcon from '@/assets/svg/negative.svg';
import streakIcon from '@/assets/svg/streak.svg';
import deleteIcon from '@/assets/svg/delete.svg';
import goldIcon from '@/assets/svg/gold.svg';
import chevronIcon from '@/assets/svg/chevron.svg';
import calendarIcon from '@/assets/svg/calendar.svg';
import gripIcon from '@/assets/svg/grip.svg';
import InformationIcon from '@/components/ui/informationIcon.vue';
export default {
components: {
InformationIcon,
SelectMulti,
Datepicker,
checklist,
selectDifficulty,
selectTranslatedArray,
toggleCheckbox,
lockableLabel,
},
directives: {
markdown: markdownDirective,
},
mixins: [syncTask],
// purpose is either create or edit, task is the task created or edited
props: ['task', 'purpose', 'challengeId', 'groupId'],
data () {
return {
showAssignedSelect: false,
newChecklistItem: null,
icons: Object.freeze({
negative: negativeIcon,
positive: positiveIcon,
destroy: deleteIcon,
gold: goldIcon,
chevron: chevronIcon,
streak: streakIcon,
calendar: calendarIcon,
grip: gripIcon,
}),
members: [],
membersNameAndId: [],
memberNamesById: {},
assignedMembers: [],
managers: [],
showAdvancedOptions: false,
attributesStrings: {
str: 'strength',
int: 'intelligence',
con: 'constitution',
per: 'perception',
},
calendarHighlights: { dates: [new Date()] },
};
},
computed: {
...mapGetters({
getTaskClasses: 'tasks:getTaskClasses',
canDeleteTask: 'tasks:canDelete',
}),
...mapState({
user: 'user.data',
dayMapping: 'constants.DAY_MAPPING',
ATTRIBUTES: 'constants.ATTRIBUTES',
}),
// region advanced settings
advancedSettingsShowAdjustCounter () {
return this.task.type === 'habit'
&& this.isUserTask && this.purpose === 'edit'
&& (this.task.up || this.task.down);
},
advancedSettingsShowRestoreStreak () {
return this.task.type === 'daily' && this.isUserTask
&& this.purpose === 'edit';
},
advancedSettingsShowTaskAlias () {
return this.isUserTask && this.user.preferences.developerMode;
},
advancedSettingsAvailable () {
return this.advancedSettingsShowRestoreStreak
|| this.advancedSettingsShowAdjustCounter
|| this.advancedSettingsShowTaskAlias;
},
// endregion advanced settings
checklistEnabled () {
return ['daily', 'todo'].indexOf(this.task.type) > -1 && !this.isOriginalChallengeTask;
},
isChallengeTask () {
return Boolean(this.task.challenge && this.task.challenge.id);
},
isUserTask () {
return !this.challengeId && !this.groupId;
},
challengeAccessRequired () {
return this.isUserTask && this.isChallengeTask;
},
isOriginalChallengeTask () {
const isUserChallenge = Boolean(this.task.userId);
return !isUserChallenge
&& (this.challengeId || (this.task.challenge && this.task.challenge.id));
},
canDelete () {
return this.purpose !== 'create' && this.canDeleteTask(this.task);
},
canSave () {
return this.task && this.task.text && this.task.text.length > 0;
},
title () {
const type = this.$t(this.task.type);
return this.$t(this.purpose === 'edit' ? 'editATask' : 'createTask', { type });
},
repeatSuffix () {
const { task } = this;
// once changed it is a string
const everyXValue = +task.everyX;
if (task.frequency === 'daily') {
return everyXValue === 1 ? this.$t('day') : this.$t('days');
} if (task.frequency === 'weekly') {
return everyXValue === 1 ? this.$t('week') : this.$t('weeks');
} if (task.frequency === 'monthly') {
return everyXValue === 1 ? this.$t('month') : this.$t('months');
} if (task.frequency === 'yearly') {
return everyXValue === 1 ? this.$t('year') : this.$t('years');
}
return null;
},
repeatsOn: {
get () {
let repeatsOn = 'dayOfMonth';
if (this.task.type === 'daily' && this.task.weeksOfMonth && this.task.weeksOfMonth.length > 0) {
repeatsOn = 'dayOfWeek';
}
return repeatsOn;
},
set (newRepeatsOn) {
this.calculateMonthlyRepeatDays(newRepeatsOn);
},
},
selectedTags () {
return this.getTagsFor(this.task);
},
},
watch: {
task () {
this.syncTask();
},
'task.startDate': function taskStartDate () {
this.calculateMonthlyRepeatDays();
},
'task.frequency': function taskFrequency () {
this.calculateMonthlyRepeatDays();
},
},
async mounted () {
if (this.groupId) {
const groupResponse = await axios.get(`/api/v4/groups/${this.groupId}`);
this.managers = Object.keys(groupResponse.data.data.managers);
this.managers.push(groupResponse.data.data.leader._id);
}
},
methods: {
...mapActions({
saveTask: 'tasks:save',
destroyTask: 'tasks:destroy',
createTask: 'tasks:create',
createTag: 'tags:createTag',
}),
cssClass (suffix) {
if (!this.task) {
return '';
}
return this.getTaskClasses(this.task, `${this.purpose === 'edit' ? 'edit' : 'create'}-modal-${suffix}`);
},
setDifficulty (level) {
if (this.challengeAccessRequired) return;
this.task.priority = level;
},
toggleUpDirection () {
if (this.challengeAccessRequired) return;
this.task.up = !this.task.up;
},
toggleDownDirection () {
if (this.challengeAccessRequired) return;
this.task.down = !this.task.down;
},
weekdaysMin (dayNumber) {
return moment.weekdaysMin(dayNumber);
},
formattedDate (date) {
return moment(date).format('MM/DD/YYYY');
},
calculateMonthlyRepeatDays (newRepeatsOn) {
if (!this.task) return;
const { task } = this;
const repeatsOn = newRepeatsOn || this.repeatsOn;
if (task.frequency === 'monthly') {
if (repeatsOn === 'dayOfMonth') {
const date = moment(task.startDate).date();
task.weeksOfMonth = [];
task.daysOfMonth = [date];
} else if (repeatsOn === 'dayOfWeek') {
const week = Math.ceil(moment(task.startDate).date() / 7) - 1;
const dayOfWeek = moment(task.startDate).day();
const shortDay = this.dayMapping[dayOfWeek];
task.daysOfMonth = [];
task.weeksOfMonth = [week];
for (const key of Object.keys(task.repeat)) {
task.repeat[key] = false;
}
task.repeat[shortDay] = true;
}
}
},
async submit () {
if (!this.canSave) return;
if (this.newChecklistItem) this.addChecklistItem();
if (this.task.type === 'reward' && this.task.value === '') {
this.task.value = 0;
}
if (this.purpose === 'create') {
if (this.challengeId) {
const response = await this.$store.dispatch('tasks:createChallengeTasks', {
challengeId: this.challengeId,
tasks: [this.task],
});
Object.assign(this.task, response);
this.$emit('taskCreated', this.task);
} else if (this.groupId) {
const response = await this.$store.dispatch('tasks:createGroupTasks', {
groupId: this.groupId,
tasks: [this.task],
});
Object.assign(this.task, response);
await this.$store.dispatch('tasks:assignTask', {
taskId: this.task._id,
assignedUserIds: this.assignedMembers,
});
this.assignedMembers.forEach(memberId => {
if (!this.task.assignedUsersDetail) this.task.assignedUsersDetail = {};
this.task.assignedUsersDetail[memberId] = {
assignedDate: new Date(),
assigningUsername: this.user.auth.local.username,
completed: false,
};
});
this.$emit('taskCreated', this.task);
} else {
this.createTask(this.task);
}
} else {
await this.saveTask(this.task);
this.$emit('taskEdited', this.task);
}
this.$root.$emit('bv::hide::modal', 'task-modal');
},
destroy () {
const type = this.$t(this.task.type);
if (!window.confirm(this.$t('sureDeleteType', { type }))) return; // eslint-disable-line no-alert
this.destroyTask(this.task);
this.$emit('taskDestroyed', this.task);
this.$root.$emit('bv::hide::modal', 'task-modal');
},
cancel () {
this.$root.$emit('bv::hide::modal', 'task-modal');
},
onClose () {
this.newChecklistItem = '';
this.$emit('cancel');
},
async toggleAssignment (memberId) {
if (this.purpose === 'create') {
return;
}
const assignedIndex = this.assignedMembers.indexOf(memberId);
if (assignedIndex === -1) {
await this.$store.dispatch('tasks:unassignTask', {
taskId: this.task._id,
userId: memberId,
});
} else {
await this.$store.dispatch('tasks:assignTask', {
taskId: this.task._id,
assignedUserIds: [memberId],
});
}
},
async clearAssignments () {
if (this.purpose === 'edit') {
for (const assignedMember of this.assignedMembers) {
await this.$store.dispatch('tasks:unassignTask', { // eslint-disable-line no-await-in-loop
taskId: this.task._id,
userId: assignedMember,
});
}
}
this.assignedMembers = [];
},
focusInput () {
this.$refs.inputToFocus.focus();
},
async addTag (name) {
const tagResult = await this.createTag({ name });
this.task.tags.push(tagResult.id);
},
},
};
</script>