Compare commits

..

1 Commits

Author SHA1 Message Date
renovate d7e1cdafd3 fix(deps): update dependency vue to v3.4.14
continuous-integration/drone/pr Build is failing Details
2024-01-15 18:29:28 +00:00
12 changed files with 435 additions and 529 deletions

View File

@ -541,86 +541,6 @@ describe('Task', () => {
.should('contain', 'Success')
})
it('Can set a due date to a specific date for a task', () => {
const tasks = TaskFactory.create(1, {
id: 1,
done: false,
})
cy.visit(`/tasks/${tasks[0].id}`)
cy.get('.task-view .action-buttons .button')
.contains('Set Due Date')
.click()
cy.get('.task-view .columns.details .column')
.contains('Due Date')
.get('.date-input .datepicker .show')
.click()
cy.get('.datepicker-popup .flatpickr-innerContainer .flatpickr-days .flatpickr-day.today')
.click()
cy.get('[data-cy="closeDatepicker"]')
.contains('Confirm')
.click()
const today = new Date()
const day = today.toLocaleString('default', {day: '2-digit'})
const month = today.toLocaleString('default', {month: 'short'})
const year = today.toLocaleString('default', {year: 'numeric'})
const date = `${day} ${month} ${year}, 12:00:00`
cy.get('.task-view .columns.details .column')
.contains('Due Date')
.get('.date-input .datepicker-popup')
.should('not.exist')
cy.get('.task-view .columns.details .column')
.contains('Due Date')
.get('.date-input')
.should('contain.text', date)
cy.get('.global-notification')
.should('contain', 'Success')
})
it('Can change a due date to a specific date for a task', () => {
const dueDate = new Date()
dueDate.setHours(12)
dueDate.setMinutes(0)
dueDate.setSeconds(0)
dueDate.setDate(1)
const tasks = TaskFactory.create(1, {
id: 1,
done: false,
due_date: dueDate.toISOString(),
})
cy.visit(`/tasks/${tasks[0].id}`)
cy.get('.task-view .action-buttons .button')
.contains('Set Due Date')
.click()
cy.get('.task-view .columns.details .column')
.contains('Due Date')
.get('.date-input .datepicker .show')
.click()
cy.get('.datepicker-popup .flatpickr-innerContainer .flatpickr-days .flatpickr-day.today')
.click()
cy.get('[data-cy="closeDatepicker"]')
.contains('Confirm')
.click()
const today = new Date()
const day = today.toLocaleString('default', {day: '2-digit'})
const month = today.toLocaleString('default', {month: 'short'})
const year = today.toLocaleString('default', {year: 'numeric'})
const date = `${day} ${month} ${year}, 12:00:00`
cy.get('.task-view .columns.details .column')
.contains('Due Date')
.get('.date-input .datepicker-popup')
.should('not.exist')
cy.get('.task-view .columns.details .column')
.contains('Due Date')
.get('.date-input')
.should('contain.text', date)
cy.get('.global-notification')
.should('contain', 'Success')
})
it('Can set a reminder', () => {
TaskReminderFactory.truncate()
const tasks = TaskFactory.create(1, {
@ -725,7 +645,7 @@ describe('Task', () => {
.click()
cy.get('.reminder-options-popup .card-content .reminder-period input')
.first()
.type('{selectall}10')
.type('10')
cy.get('.reminder-options-popup .card-content .reminder-period select')
.first()
.select('days')
@ -851,7 +771,7 @@ describe('Task', () => {
.should('exist')
})
it('Can check items off a checklist', () => {
it.only('Can check items off a checklist', () => {
const tasks = TaskFactory.create(1, {
id: 1,
description: `
@ -938,7 +858,7 @@ describe('Task', () => {
method: 'PUT',
url: `${Cypress.env('API_URL')}/tasks/${tasks[0].id}/attachments`,
headers: {
'Authorization': `Bearer ${window.localStorage.getItem('token')}`,
'Authorization': `Bearer ${window.localStorage.getItem('token')}`,
'Content-Type': 'multipart/form-data',
},
body: formData,

View File

@ -55,39 +55,39 @@
"@kyvg/vue3-notification": "3.1.3",
"@sentry/tracing": "7.93.0",
"@sentry/vue": "7.93.0",
"@tiptap/core": "2.1.16",
"@tiptap/extension-blockquote": "2.1.16",
"@tiptap/extension-bold": "2.1.16",
"@tiptap/extension-bullet-list": "2.1.16",
"@tiptap/extension-code": "2.1.16",
"@tiptap/extension-code-block-lowlight": "2.1.16",
"@tiptap/extension-document": "2.1.16",
"@tiptap/extension-dropcursor": "2.1.16",
"@tiptap/extension-gapcursor": "2.1.16",
"@tiptap/extension-hard-break": "2.1.16",
"@tiptap/extension-heading": "2.1.16",
"@tiptap/extension-history": "2.1.16",
"@tiptap/extension-horizontal-rule": "2.1.16",
"@tiptap/extension-image": "2.1.16",
"@tiptap/extension-italic": "2.1.16",
"@tiptap/extension-link": "2.1.16",
"@tiptap/extension-list-item": "2.1.16",
"@tiptap/extension-ordered-list": "2.1.16",
"@tiptap/extension-paragraph": "2.1.16",
"@tiptap/extension-placeholder": "2.1.16",
"@tiptap/extension-strike": "2.1.16",
"@tiptap/extension-table": "2.1.16",
"@tiptap/extension-table-cell": "2.1.16",
"@tiptap/extension-table-header": "2.1.16",
"@tiptap/extension-table-row": "2.1.16",
"@tiptap/extension-task-item": "2.1.16",
"@tiptap/extension-task-list": "2.1.16",
"@tiptap/extension-text": "2.1.16",
"@tiptap/extension-typography": "2.1.16",
"@tiptap/extension-underline": "2.1.16",
"@tiptap/pm": "2.1.16",
"@tiptap/suggestion": "2.1.16",
"@tiptap/vue-3": "2.1.16",
"@tiptap/core": "2.1.15",
"@tiptap/extension-blockquote": "2.1.15",
"@tiptap/extension-bold": "2.1.15",
"@tiptap/extension-bullet-list": "2.1.15",
"@tiptap/extension-code": "2.1.15",
"@tiptap/extension-code-block-lowlight": "2.1.15",
"@tiptap/extension-document": "2.1.15",
"@tiptap/extension-dropcursor": "2.1.15",
"@tiptap/extension-gapcursor": "2.1.15",
"@tiptap/extension-hard-break": "2.1.15",
"@tiptap/extension-heading": "2.1.15",
"@tiptap/extension-history": "2.1.15",
"@tiptap/extension-horizontal-rule": "2.1.15",
"@tiptap/extension-image": "2.1.15",
"@tiptap/extension-italic": "2.1.15",
"@tiptap/extension-link": "2.1.15",
"@tiptap/extension-list-item": "2.1.15",
"@tiptap/extension-ordered-list": "2.1.15",
"@tiptap/extension-paragraph": "2.1.15",
"@tiptap/extension-placeholder": "2.1.15",
"@tiptap/extension-strike": "2.1.15",
"@tiptap/extension-table": "2.1.15",
"@tiptap/extension-table-cell": "2.1.15",
"@tiptap/extension-table-header": "2.1.15",
"@tiptap/extension-table-row": "2.1.15",
"@tiptap/extension-task-item": "2.1.15",
"@tiptap/extension-task-list": "2.1.15",
"@tiptap/extension-text": "2.1.15",
"@tiptap/extension-typography": "2.1.15",
"@tiptap/extension-underline": "2.1.15",
"@tiptap/pm": "2.1.15",
"@tiptap/suggestion": "2.1.15",
"@tiptap/vue-3": "2.1.15",
"@types/is-touch-device": "1.0.2",
"@types/lodash.clonedeep": "4.5.9",
"@vueuse/core": "10.7.1",

File diff suppressed because it is too large Load Diff

View File

@ -4,11 +4,6 @@
"extends": [
"config:js-app"
],
"hostRules": [
{
"timeout": 600000
}
],
"packageRules": [
{
"matchPackageNames": ["happy-dom"],

View File

@ -128,11 +128,9 @@ const flatPickrDate = computed({
return
}
if (date.value !== null) {
const oldDate = formatDate(date.value, 'yyy-LL-dd H:mm')
if (oldDate === newValue) {
return
}
const oldDate = formatDate(date.value, 'yyy-LL-dd H:mm')
if (oldDate !== newValue) {
return
}
date.value = createDateFromString(newValue)
updateData()

View File

@ -671,17 +671,36 @@ watch(
line-height: 1.1;
}
a {
color: #68cef8;
}
code {
background-color: var(--grey-200);
color: var(--grey-700);
background-color: rgba(#616161, 0.1);
color: #616161;
}
pre {
background: var(--grey-200);
color: var(--grey-700);
background: #0d0d0d;
color: #fff;
font-family: 'JetBrainsMono', monospace;
padding: 0.75rem 1rem;
border-radius: $radius;
border-radius: 0.5rem;
code {
color: inherit;
padding: 0;
background: none;
font-size: 0.8rem;
}
}
pre {
background: #0d0d0d;
color: #fff;
font-family: 'JetBrainsMono', monospace;
padding: 0.75rem 1rem;
border-radius: 0.5rem;
code {
color: inherit;
@ -692,7 +711,7 @@ watch(
.hljs-comment,
.hljs-quote {
color: var(--grey-500);
color: #616161;
}
.hljs-variable,
@ -705,7 +724,7 @@ watch(
.hljs-name,
.hljs-selector-id,
.hljs-selector-class {
color: var(--code-variable);
color: #f98181;
}
.hljs-number,
@ -715,23 +734,23 @@ watch(
.hljs-literal,
.hljs-type,
.hljs-params {
color: var(--code-literal);
color: #fbbc88;
}
.hljs-string,
.hljs-symbol,
.hljs-bullet {
color: var(--code-symbol);
color: #b9f18d;
}
.hljs-title,
.hljs-section {
color: var(--code-section);
color: #faf594;
}
.hljs-keyword,
.hljs-selector-tag {
color: var(--code-keyword);
color: #70cff8;
}
.hljs-emphasis {

View File

@ -1,5 +1,5 @@
<template>
<slot name="trigger" :isOpen="open" :toggle="toggle" :close="close"></slot>
<slot name="trigger" :isOpen="open" :toggle="toggle"></slot>
<div
class="popup"
:class="{
@ -8,7 +8,7 @@
}"
ref="popup"
>
<slot name="content" :isOpen="open" :toggle="toggle" :close="close"/>
<slot name="content" :isOpen="open" :toggle="toggle"/>
</div>
</template>

View File

@ -9,7 +9,7 @@
{{ reminderText }}
</SimpleButton>
</template>
<template #content="{isOpen, close}">
<template #content="{isOpen, toggle}">
<Card class="reminder-options-popup" :class="{'is-open': isOpen}" :padding="false">
<div class="options" v-if="activeForm === null">
<SimpleButton
@ -17,7 +17,7 @@
:key="k"
class="option-button"
:class="{'currently-active': p.relativePeriod === modelValue?.relativePeriod && modelValue?.relativeTo === p.relativeTo}"
@click="setReminderFromPreset(p, close)"
@click="setReminderFromPreset(p, toggle)"
>
{{ formatReminder(p) }}
</SimpleButton>
@ -40,20 +40,20 @@
<ReminderPeriod
v-if="activeForm === 'relative'"
v-model="reminder"
@update:modelValue="updateDataAndMaybeClose(close)"
@update:modelValue="updateDataAndMaybeClose(toggle)"
/>
<DatepickerInline
v-if="activeForm === 'absolute'"
v-model="reminderDate"
@update:modelValue="setReminderDate(close)"
@update:modelValue="setReminderDate(toggle)"
/>
<x-button
v-if="showFormSwitch !== null"
class="reminder__close-button"
:shadow="false"
@click="updateDataAndMaybeClose(close)"
@click="toggle"
>
{{ $t('misc.confirm') }}
</x-button>
@ -148,26 +148,25 @@ function updateData() {
}
}
function setReminderDate(close) {
function setReminderDate(toggle) {
reminder.value.reminder = reminderDate.value === null
? null
: new Date(reminderDate.value)
reminder.value.relativeTo = null
reminder.value.relativePeriod = 0
updateDataAndMaybeClose(close)
updateDataAndMaybeClose(toggle)
}
function setReminderFromPreset(preset, close) {
function setReminderFromPreset(preset, toggle) {
reminder.value = preset
updateData()
close()
toggle()
}
function updateDataAndMaybeClose(close) {
function updateDataAndMaybeClose(toggle) {
updateData()
if (clearAfterUpdate) {
close()
toggle()
}
}

View File

@ -55,7 +55,6 @@ import TaskReminderModel from '@/models/taskReminder'
import type {ITaskReminder} from '@/modelTypes/ITaskReminder'
import {REMINDER_PERIOD_RELATIVE_TO_TYPES, type IReminderPeriodRelativeTo} from '@/types/IReminderPeriodRelativeTo'
import {useDebounceFn} from '@vueuse/core'
const {
modelValue,
@ -106,7 +105,7 @@ function updateData() {
reminder.value.relativeTo = period.value.relativeTo
reminder.value.reminder = null
useDebounceFn(() => emit('update:modelValue', reminder.value), 1000)
emit('update:modelValue', reminder.value)
}
</script>

View File

@ -288,7 +288,6 @@ async function markAsDone(checked: boolean) {
title: t('task.undo'),
callback: () => undoDone(checked),
}])
updateDueDate()
}
if (checked) {

View File

@ -256,13 +256,6 @@
--card-border-color: var(--grey-200);
--logo-text-color: hsl(180, 1%, 15%);
// Code colors
--code-variable: #da2222;
--code-literal: #fd8a09;
--code-symbol: #0ead69;
--code-section: #3a86ff;
--code-keyword: #8338ec;
&.dark {
@media screen {
// Light mode colours reversed for dark mode
@ -318,13 +311,6 @@
--scheme-invert: var(--grey-900);
--scheme-invert-bis: var(--grey-900);
--scheme-invert-ter: var(--grey-800);
// Code colors
--code-variable: #f98181;
--code-literal: #fbbc88;
--code-symbol: #b9f18d;
--code-section: #faf594;
--code-keyword: #70cff8;
}
}
}

View File

@ -179,23 +179,7 @@ watch(
if (projectId < 0) {
return
}
const tasksById = {}
tasks.value.forEach(t => tasksById[t.id] = true)
tasks.value = tasks.value.filter(t => {
if (typeof t.relatedTasks?.parenttask === 'undefined') {
return true
}
// If the task is a subtask, make sure the parent task is available in the current view as well
for (const pt of t.relatedTasks.parenttask) {
if(typeof tasksById[pt.id] === 'undefined') {
return true
}
}
return false
})
tasks.value = tasks.value.filter(t => typeof t.relatedTasks?.parenttask === 'undefined')
},
)