diff --git a/app/src/plugins/app/_img/icons/checkmark-double.svg b/app/src/plugins/app/_img/icons/checkmark-double.svg new file mode 100644 index 0000000..cc0fd44 --- /dev/null +++ b/app/src/plugins/app/_img/icons/checkmark-double.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/app/src/plugins/app/_theme/global.sass b/app/src/plugins/app/_theme/global.sass index 88e8ac0..f49f852 100644 --- a/app/src/plugins/app/_theme/global.sass +++ b/app/src/plugins/app/_theme/global.sass @@ -43,7 +43,7 @@ height: 24px width: 24px -.remove-date +.circle-border border: 1px solid rgba(0, 0, 0, 0.2) border-radius: 50% padding: 13px @@ -53,6 +53,9 @@ .is-finished background: #06dece !important +.strike-through + text-decoration: line-through + .add-date color: white border-radius: 50% diff --git a/app/src/plugins/tm@dashboard/_components/z-timeline.vue b/app/src/plugins/tm@dashboard/_components/z-timeline.vue index a1c2bb0..0d2646b 100644 --- a/app/src/plugins/tm@dashboard/_components/z-timeline.vue +++ b/app/src/plugins/tm@dashboard/_components/z-timeline.vue @@ -65,7 +65,7 @@ -
+
@@ -222,6 +223,18 @@ export default { this.$events.emit('show-complete-task-modal', { subtask }) }, + async toggleTimeblockIsFinished(event) { + if (!event.timeblock.is_finished) + this.$events.emit('show-task-add-time-modal', { subtask: event.subtask }) + + try { + await this.$axios.put_auth(`v1/timeblocks/${event._timeblock_id}`, {is_finished: !event.timeblock.is_finished}) + // TODO: Co mi to vrati? A updatenut + } catch (error) { + this.$toast.error(error.message || error) + } + }, + editTask({subtask}) { this.$events.emit('show-subtask-modal', {subtask}) }, diff --git a/app/src/plugins/tm@dashboard/_mixins/Filter.mixin.ts b/app/src/plugins/tm@dashboard/_mixins/Filter.mixin.ts new file mode 100644 index 0000000..77468e3 --- /dev/null +++ b/app/src/plugins/tm@dashboard/_mixins/Filter.mixin.ts @@ -0,0 +1,89 @@ +export default { + data() { + return { + header: { + initialized: false, + marginTop: 0, + calendar_previousScrollPosition: 0, + isVisible: true + } + } + }, + + unmounted() { + this.$refs.page?.querySelector('.vuecal__bg')?.removeEventListener('scroll', this.handleScroll) + }, + + methods: { + _initScrollListener(repeat = 0) { + if (this.initialized) return + + const calendar = this.$refs.page?.querySelector('.vuecal__bg') + + if (!calendar) + return setTimeout(() => { + if (repeat < 20) this._initScrollListener(repeat + 1) + }, 200) + + calendar.addEventListener('scroll', this._handleScroll) + this.initialized = true + this.header.calendar_previousScrollPosition = calendar.scrollTop + // if (calendar.scrollTop > 0 && this.header.isVisible) { + // this.hideHeader() + // } + }, + + _handleScroll(e) { + const header = document.querySelector('div.subheader') as HTMLElement + + // Check if the header is initialized + if (!this.initialized) { + this.header.calendar_previousScrollPosition = e.target.scrollTop + return + } + + if (this.header.calendar_previousScrollPosition > e.target.scrollTop) { + // On the way up + if (!this.header.isVisible) { + this.showHeader() + } + } else if (header.offsetHeight > Math.abs(e.target.scrollTop)) { + // On the way down + if (this.header.isVisible) { + this.hideHeader() + } + } else { + // On the way down below filter height + if (this.header.isVisible) { + this.hideHeader() + } + } + + this.header.calendar_previousScrollPosition = e.target.scrollTop + }, + + hideHeader() { + const header = document.querySelector('div.subheader') as HTMLElement + + header.style.transition = 'margin-top 0.5s' + header.style.marginTop = `-${header.offsetHeight}px` + this.header.isVisible = false + + setTimeout(() => { + header.style.transition = '' + }, 500) + }, + + showHeader() { + const header = document.querySelector('div.subheader') as HTMLElement + + header.style.transition = 'margin-top 0.5s' + header.style.marginTop = '0' + this.header.isVisible = true + + setTimeout(() => { + header.style.transition = '' + }, 500) + }, + } +} diff --git a/app/src/plugins/tm@dashboard/projects/projects.vue b/app/src/plugins/tm@dashboard/projects/projects.vue index 400d5af..8ad9add 100644 --- a/app/src/plugins/tm@dashboard/projects/projects.vue +++ b/app/src/plugins/tm@dashboard/projects/projects.vue @@ -1,5 +1,5 @@