feat: replace our home-grown gantt implementation with ganttastic #2180
|
@ -53,7 +53,7 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {computed, nextTick, ref} from 'vue'
|
||||
import {computed, nextTick, ref, watch} from 'vue'
|
||||
import TaskCollectionService from '@/services/taskCollection'
|
||||
import {format, parse} from 'date-fns'
|
||||
import {colorIsDark} from '@/helpers/color/colorIsDark'
|
||||
|
@ -85,6 +85,11 @@ const props = defineProps({
|
|||
type: String,
|
||||
required: true,
|
||||
},
|
||||
showTasksWithoutDates: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
konrad marked this conversation as resolved
Outdated
|
||||
default: false,
|
||||
},
|
||||
})
|
||||
|
||||
const dateFromDate = computed(() => parse(props.dateFrom, 'yyyy-LL-dd', new Date()))
|
||||
|
@ -142,7 +147,7 @@ async function loadTasks() {
|
|||
filter_comparator: ['greater_equals', 'less_equals'],
|
||||
filter_value: [props.dateFrom, props.dateTo],
|
||||
filter_concat: 'and',
|
||||
filter_include_nulls: true,
|
||||
filter_include_nulls: props.showTasksWithoutDates,
|
||||
}
|
||||
|
||||
const taskCollectionService = new TaskCollectionService()
|
||||
|
@ -168,6 +173,10 @@ async function loadTasks() {
|
|||
|
||||
loadTasks()
|
||||
|
||||
watch(() => props.dateTo, loadTasks)
|
||||
konrad marked this conversation as resolved
Outdated
dpschen
commented
This and the three lines below should be combined to one watcher that trigger immediately.
Something like:
This and the three lines below should be combined to one watcher that trigger immediately.
`loadTasks` should accept these three as params, so that it's clear that these are needed to reload.
Something like:
```
watchEffect(() => loadTasks({
dateTo: props.dateTo,
dateFrom: props.dateFrom,
showTasksWithoutDates: props.showTasksWithoutDates,
})
```
|
||||
watch(() => props.dateFrom, loadTasks)
|
||||
watch(() => props.showTasksWithoutDates, loadTasks)
|
||||
|
||||
async function updateTask(e) {
|
||||
const task = tasks.value.get(e.bar.ganttBarConfig.id)
|
||||
task.startDate = e.bar.startDate
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<fancycheckbox class="is-block" v-model="showTaskswithoutDates">
|
||||
<fancycheckbox class="is-block" v-model="showTasksWithoutDates">
|
||||
{{ $t('list.gantt.showTasksWithoutDates') }}
|
||||
</fancycheckbox>
|
||||
</div>
|
||||
|
@ -44,6 +44,7 @@
|
|||
:date-to="dateTo"
|
||||
:precision="precision"
|
||||
:list-id="props.listId"
|
||||
:show-tasks-without-dates="showTasksWithoutDates"
|
||||
/>
|
||||
|
||||
</card>
|
||||
|
@ -71,7 +72,7 @@ const props = defineProps({
|
|||
},
|
||||
})
|
||||
|
||||
const showTaskswithoutDates = ref(false)
|
||||
const showTasksWithoutDates = ref(false)
|
||||
const precision = ref('day')
|
||||
|
||||
const now = ref(new Date())
|
||||
konrad marked this conversation as resolved
Outdated
dpschen
commented
Should this update? Should this update?
konrad
commented
No, doesn't even need to be ref. No, doesn't even need to be ref.
|
||||
|
|
Reference in New Issue
picky: If you use a default value there is no need to define
required
Done.