From 617bcea04ed14c446d2832a6179bdca31256f24a Mon Sep 17 00:00:00 2001 From: konrad Date: Sat, 1 Aug 2020 13:17:10 +0000 Subject: [PATCH] Add deferring task's due dates directly from the overview (#199) Make the defer popup responsible Add buttons to defer by 1/3/7 days Add updating due date Add update method Add component to defer the due date from the task overview Co-authored-by: kolaente Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/199 --- src/components/tasks/partials/defer-task.vue | 112 ++++++++++++++++++ .../tasks/partials/singleTaskInList.vue | 51 +++++--- src/styles/components/tasks.scss | 52 +++++++- src/styles/theme/form.scss | 4 + 4 files changed, 199 insertions(+), 20 deletions(-) create mode 100644 src/components/tasks/partials/defer-task.vue diff --git a/src/components/tasks/partials/defer-task.vue b/src/components/tasks/partials/defer-task.vue new file mode 100644 index 0000000000..cfb299be81 --- /dev/null +++ b/src/components/tasks/partials/defer-task.vue @@ -0,0 +1,112 @@ + + + diff --git a/src/components/tasks/partials/singleTaskInList.vue b/src/components/tasks/partials/singleTaskInList.vue index 3ce9a6618c..e5ec94d883 100644 --- a/src/components/tasks/partials/singleTaskInList.vue +++ b/src/components/tasks/partials/singleTaskInList.vue @@ -1,24 +1,26 @@ @@ -43,6 +53,7 @@ import Labels from './labels' import User from '../../misc/user' import Fancycheckbox from '../../input/fancycheckbox' + import DeferTask from './defer-task' export default { name: 'singleTaskInList', @@ -50,9 +61,11 @@ return { taskService: TaskService, task: TaskModel, + showDefer: false, } }, components: { + DeferTask, Fancycheckbox, User, Labels, diff --git a/src/styles/components/tasks.scss b/src/styles/components/tasks.scss index 8ed79b61ea..dd1a1f3b10 100644 --- a/src/styles/components/tasks.scss +++ b/src/styles/components/tasks.scss @@ -191,4 +191,54 @@ .spinner.is-loading:after { margin-left: calc(40% - 1em); } -} \ No newline at end of file +} + +.defer-task { + $defer-task-max-width: 350px; + + position: absolute; + width: 100%; + max-width: $defer-task-max-width; + border-radius: $radius; + border: 1px solid $grey-lighter; + padding: 1rem; + margin: 1rem; + background: $white; + color: $text; + cursor: default; + z-index: 10; + + input.input { + display: none; + } + + .flatpickr-calendar { + margin: 0 auto; + box-shadow: none; + + span { + width: auto !important; + } + } + + .defer-days { + justify-content: space-between; + display: flex; + margin: .5rem 0; + } + + @media screen and (max-width: ($defer-task-max-width + 100px)) { // 100px is roughly the size the pane is pulled to the right + left: .5rem; + right: .5rem; + max-width: 100%; + width: calc(100vw - 1rem - 2rem); + + .flatpickr-calendar { + max-width: 100%; + + .flatpickr-innerContainer { + overflow: scroll; + } + } + } +} diff --git a/src/styles/theme/form.scss b/src/styles/theme/form.scss index d3b5f772f1..bba5af9117 100644 --- a/src/styles/theme/form.scss +++ b/src/styles/theme/form.scss @@ -54,6 +54,10 @@ } } + &.is-primary.is-outlined:hover { + color: $white; + } + &.noshadow{ &, &.is-hovered,