mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
Merge branch 'main' of bitbucket.org:studiotem/jandl-taskmanager-app
This commit is contained in:
commit
4ec7bca609
15 files changed
+208
-33
No files matched your search
@@ -3,16 +3,17 @@ import { Quill } from '@vueup/vue-quill'
|
|||||||
export function registerQuillUrlSanitizer() {
|
export function registerQuillUrlSanitizer() {
|
||||||
const Link = Quill.import('formats/link')
|
const Link = Quill.import('formats/link')
|
||||||
|
|
||||||
|
// Extend the protocol whitelist
|
||||||
|
Link.PROTOCOL_WHITELIST.push('smb', 'fmp', 'radar', 'rdar', 'sms', '\\')
|
||||||
|
|
||||||
class CustomLinkSanitizer extends Link {
|
class CustomLinkSanitizer extends Link {
|
||||||
static sanitize(url) {
|
static sanitize(url) {
|
||||||
const sanitizedUrl = super.sanitize(url)
|
const sanitizedUrl = super.sanitize(url)
|
||||||
|
|
||||||
if (!sanitizedUrl || sanitizedUrl === 'about:blank') return sanitizedUrl
|
if (!sanitizedUrl || sanitizedUrl === 'about:blank') return sanitizedUrl
|
||||||
|
|
||||||
const protocolWhhitelist = ['http', 'https', 'mailto', 'tel', 'radar', 'rdar', 'smb', 'sms']
|
const protocolWhitelist = Link.PROTOCOL_WHITELIST
|
||||||
const hasWhitelistedProtocol = protocolWhhitelist.some(function(protocol) {
|
const hasWhitelistedProtocol = protocolWhitelist.some(protocol => sanitizedUrl.startsWith(protocol))
|
||||||
return sanitizedUrl.startsWith(protocol)
|
|
||||||
})
|
|
||||||
|
|
||||||
if (hasWhitelistedProtocol) return sanitizedUrl
|
if (hasWhitelistedProtocol) return sanitizedUrl
|
||||||
|
|
||||||
@@ -20,5 +21,5 @@ export function registerQuillUrlSanitizer() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Quill.register(CustomLinkSanitizer, true)
|
Quill.register('formats/link', CustomLinkSanitizer, true)
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<header class="login-header-border hover">
|
<header class="login-header-border">
|
||||||
<v-container>
|
<v-container>
|
||||||
<img :src="require('@/plugins/app/_img/jandl-logo.svg')" alt="jandl-logo" @click="$router.push({name: 'Login'})">
|
<img :src="require('@/plugins/app/_img/jandl-logo.svg')" alt="jandl-logo" @click="$router.push({name: 'Login'})">
|
||||||
</v-container>
|
</v-container>
|
||||||
|
|||||||
@@ -29,11 +29,6 @@
|
|||||||
padding: 5px 20px
|
padding: 5px 20px
|
||||||
min-width: 50px
|
min-width: 50px
|
||||||
|
|
||||||
.description-detail
|
|
||||||
background: rgba(0, 0, 0, 0.04)
|
|
||||||
color: rgba(0, 0, 0, 0.6)
|
|
||||||
height: fit-content
|
|
||||||
|
|
||||||
.employee-selected-avatar
|
.employee-selected-avatar
|
||||||
background: #6200EE
|
background: #6200EE
|
||||||
color: #fff
|
color: #fff
|
||||||
@@ -105,7 +100,51 @@ input[type="time"]::-webkit-calendar-picker-indicator
|
|||||||
.v-input
|
.v-input
|
||||||
height: 40px !important
|
height: 40px !important
|
||||||
|
|
||||||
|
.server-links
|
||||||
|
background: rgba(127, 57, 251, 1)
|
||||||
|
padding: 4px 5px
|
||||||
|
|
||||||
|
a
|
||||||
|
color: #fff
|
||||||
|
|
||||||
@media (max-width: 534px)
|
@media (max-width: 534px)
|
||||||
.mobile-view
|
.mobile-view
|
||||||
flex-direction: column
|
flex-direction: column
|
||||||
gap: 20px
|
gap: 20px
|
||||||
|
|
||||||
|
.description-detail
|
||||||
|
background: rgba(0, 0, 0, 0.04)
|
||||||
|
color: rgba(0, 0, 0, 0.6)
|
||||||
|
height: fit-content
|
||||||
|
|
||||||
|
$indentSize: 15px
|
||||||
|
|
||||||
|
li
|
||||||
|
margin-left: $indentSize
|
||||||
|
|
||||||
|
&.ql-indent-1
|
||||||
|
margin-left: 2 * $indentSize
|
||||||
|
|
||||||
|
&.ql-indent-2
|
||||||
|
margin-left: 3 * $indentSize
|
||||||
|
|
||||||
|
&.ql-indent-3
|
||||||
|
margin-left: 4 * $indentSize
|
||||||
|
|
||||||
|
&.ql-indent-4
|
||||||
|
margin-left: 5 * $indentSize
|
||||||
|
|
||||||
|
&.ql-indent-5
|
||||||
|
margin-left: 6 * $indentSize
|
||||||
|
|
||||||
|
&.ql-indent-6
|
||||||
|
margin-left: 7 * $indentSize
|
||||||
|
|
||||||
|
&.ql-indent-7
|
||||||
|
margin-left: 8 * $indentSize
|
||||||
|
|
||||||
|
&.ql-indent-8
|
||||||
|
margin-left: 9 * $indentSize
|
||||||
|
|
||||||
|
&.ql-indent-9
|
||||||
|
margin-left: 10 * $indentSize
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
import { useToast } from 'vue-toast-notification';
|
||||||
|
const toast = useToast();
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface Window {
|
||||||
|
toast: typeof toast;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
window.toast = toast;
|
||||||
|
|
||||||
|
export function detectOS() {
|
||||||
|
const platform = window.navigator.platform
|
||||||
|
const macosPlatforms = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K']
|
||||||
|
const windowsPlatforms = ['Win32', 'Win64', 'Windows', 'WinCE']
|
||||||
|
|
||||||
|
if (macosPlatforms.indexOf(platform) !== -1) {
|
||||||
|
return 'mac'
|
||||||
|
} else if (windowsPlatforms.indexOf(platform) !== -1) {
|
||||||
|
return 'win'
|
||||||
|
}
|
||||||
|
return 'win'
|
||||||
|
}
|
||||||
|
|
||||||
|
export function prepareHTMLDescription(description) {
|
||||||
|
if (!description) return description
|
||||||
|
|
||||||
|
const os = detectOS()
|
||||||
|
|
||||||
|
if (os === 'mac') {
|
||||||
|
description = description.replace(/\\\\/g, 'smb://')
|
||||||
|
|
||||||
|
// find all smb links and replace them with clickable links, separated by ' ', '<', '>', '"', and '(', ')' characters
|
||||||
|
description = description = description.replace(/(smb:\/\/[^\s<>"()]+)/g, function(match) {
|
||||||
|
return '<a href="' + match.replace(/\\/g, '/') + '">' + match.replace(/\\/g, '/') + '</a>'
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
description = description.replace(/smb:\/\//g, '\\\\')
|
||||||
|
|
||||||
|
|
||||||
|
// find all windows links and replace them with clickable links, separated by ' ', '<', '>', '"', and '(', ')' characters
|
||||||
|
description = description.replace(/(\\\\[^\s<>"()]+)/g, function(match) {
|
||||||
|
match = match.replaceAll('/', '\\')
|
||||||
|
return '<span style="cursor: pointer; text-decoration: underline" onclick="' + getCopyFunction(match) + '">' + match + '</span>';
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getCopyFunction(text) {
|
||||||
|
return `
|
||||||
|
if (navigator.clipboard && navigator.clipboard.writeText) {
|
||||||
|
navigator.clipboard.writeText('${text.replace(/\\/g, '\\\\')}').then(() => {
|
||||||
|
window.toast.success('Link copied to clipboard!')
|
||||||
|
}).catch(err => {
|
||||||
|
window.toast.error('Failed to copy link to clipboard!')
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
const input = document.createElement('input');
|
||||||
|
input.style.position = 'fixed';
|
||||||
|
input.style.opacity = 0;
|
||||||
|
input.style.pointerEvents = 'none';
|
||||||
|
input.value = '${text.replace(/\\/g, '\\\\')}';
|
||||||
|
document.body.appendChild(input);
|
||||||
|
input.select();
|
||||||
|
input.focus();
|
||||||
|
document.execCommand('copy');
|
||||||
|
document.body.removeChild(input);
|
||||||
|
window.toast.success('Link copied to clipboard!')
|
||||||
|
}
|
||||||
|
`
|
||||||
|
}
|
||||||
@@ -16,7 +16,7 @@ export default {
|
|||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
_initScrollListener(repeat = 0) {
|
_initScrollListener(repeat = 0) {
|
||||||
if (this.initialized) return
|
if (this.initialized && repeat > 0) return
|
||||||
|
|
||||||
const calendar = this.$refs.page?.querySelector('.vuecal__bg')
|
const calendar = this.$refs.page?.querySelector('.vuecal__bg')
|
||||||
|
|
||||||
|
|||||||
@@ -120,7 +120,9 @@ export default {
|
|||||||
this.$toast.error('Nepodarilo sa nacitat data!')
|
this.$toast.error('Nepodarilo sa nacitat data!')
|
||||||
}
|
}
|
||||||
|
|
||||||
this._initScrollListener()
|
setTimeout(() => {
|
||||||
|
this._initScrollListener()
|
||||||
|
}, 100)
|
||||||
},
|
},
|
||||||
|
|
||||||
openMasterTaskModal(mastertaskId) {
|
openMasterTaskModal(mastertaskId) {
|
||||||
|
|||||||
@@ -181,7 +181,9 @@ export default {
|
|||||||
this.$toast.error('Nepodarilo sa nacitat data!')
|
this.$toast.error('Nepodarilo sa nacitat data!')
|
||||||
}
|
}
|
||||||
|
|
||||||
this._initScrollListener()
|
setTimeout(() => {
|
||||||
|
this._initScrollListener()
|
||||||
|
}, 100)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,7 +86,9 @@ export default {
|
|||||||
this.$toast.error('Nepodarilo sa nacitat data!')
|
this.$toast.error('Nepodarilo sa nacitat data!')
|
||||||
}
|
}
|
||||||
|
|
||||||
this._initScrollListener()
|
setTimeout(() => {
|
||||||
|
this._initScrollListener()
|
||||||
|
}, 100)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,18 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="px-5 py-5 border-bottom" v-if="description" >
|
<div class="px-5 py-5 border-bottom" v-if="description" >
|
||||||
<p>Popis zadania</p>
|
<p>Popis zadania</p>
|
||||||
<section v-html="description" class="description-detail px-2 py-2 w-100 rounded mt-2" />
|
<section v-html="preparedDescription" class="description-detail px-2 py-2 w-100 rounded mt-2" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="px-5 py-5 border-bottom" v-if="inheritedDescription">
|
<div class="px-5 py-5 border-bottom" v-if="inheritedDescription">
|
||||||
<p>Popis mastertasku</p>
|
<p>Popis mastertasku</p>
|
||||||
<section v-html="inheritedDescription" class="description-detail px-2 py-2 w-100 rounded mt-2" />
|
<section v-html="preparedInheritedDescription" class="description-detail px-2 py-2 w-100 rounded mt-2" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { prepareHTMLDescription } from '@/plugins/tm@_utils/server-links.utils'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
description: {
|
description: {
|
||||||
@@ -22,6 +24,19 @@ export default {
|
|||||||
type: String || null,
|
type: String || null,
|
||||||
default: () => null
|
default: () => null
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
copiedIndices: [],
|
||||||
|
preparedDescription: '',
|
||||||
|
preparedInheritedDescription: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
mounted() {
|
||||||
|
this.preparedDescription = prepareHTMLDescription(this.description)
|
||||||
|
this.preparedInheritedDescription = prepareHTMLDescription(this.inheritedDescription)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -43,7 +43,6 @@ export default {
|
|||||||
|
|
||||||
onEmployeeSelected(id) {
|
onEmployeeSelected(id) {
|
||||||
const employee = this.enrichedEmployees.find(employee => employee.id == id)
|
const employee = this.enrichedEmployees.find(employee => employee.id == id)
|
||||||
console.log('add employee', employee)
|
|
||||||
this.mastertask.employees.push(employee)
|
this.mastertask.employees.push(employee)
|
||||||
this.showAddEmployeeInput = false
|
this.showAddEmployeeInput = false
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -280,8 +280,6 @@ export default {
|
|||||||
return employee
|
return employee
|
||||||
})
|
})
|
||||||
|
|
||||||
console.log('NEW', this.mastertask)
|
|
||||||
|
|
||||||
// this.mastertask.project_code = project.code
|
// this.mastertask.project_code = project.code
|
||||||
} else {
|
} else {
|
||||||
this.mastertask = { employees: [], duration: 0, _deadline_time: '17:00' }
|
this.mastertask = { employees: [], duration: 0, _deadline_time: '17:00' }
|
||||||
@@ -300,7 +298,7 @@ export default {
|
|||||||
async save() {
|
async save() {
|
||||||
if (this.mastertask.id) {
|
if (this.mastertask.id) {
|
||||||
this.mastertask.employees = this.mastertask.employees.map(employee => {
|
this.mastertask.employees = this.mastertask.employees.map(employee => {
|
||||||
const { duration } = this.mastertask.subtasks.find(({ employee_id }) => employee_id == employee.id)
|
const { duration } = this.mastertask.subtasks.find(({ employee_id }) => employee_id == employee.id) || {}
|
||||||
employee.duration = duration
|
employee.duration = duration
|
||||||
return employee
|
return employee
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -54,7 +54,6 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
createTask() {
|
createTask() {
|
||||||
console.log(this.localData.date, this.localData.time, this.localData.employees)
|
|
||||||
this.$events.emit('show-subtask-modal', {
|
this.$events.emit('show-subtask-modal', {
|
||||||
subtask: {
|
subtask: {
|
||||||
deadline: this.localData.date,
|
deadline: this.localData.date,
|
||||||
|
|||||||
@@ -1,16 +1,18 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="px-5 py-5 border-bottom" v-if="description" >
|
<div class="px-5 py-5 border-bottom" v-if="description" >
|
||||||
<p>Popis zadania</p>
|
<p>Popis zadania</p>
|
||||||
<section v-html="description" class="description-detail px-2 py-2 w-100 rounded mt-2" />
|
<section v-html="preparedDescription" class="description-detail px-2 py-2 w-100 rounded mt-2" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="px-5 py-5 border-bottom" v-if="mastertaskDescription">
|
<div class="px-5 py-5 border-bottom" v-if="mastertaskDescription">
|
||||||
<p>Popis mastertasku</p>
|
<p>Popis mastertasku</p>
|
||||||
<section v-html="mastertaskDescription" class="description-detail px-2 py-2 w-100 rounded mt-2" />
|
<section v-html="preparedMastertaskDescription" class="description-detail px-2 py-2 w-100 rounded mt-2" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { prepareHTMLDescription } from '@/plugins/tm@_utils/server-links.utils'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
description: {
|
description: {
|
||||||
@@ -22,6 +24,19 @@ export default {
|
|||||||
type: String || null,
|
type: String || null,
|
||||||
default: () => null
|
default: () => null
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
copiedIndices: [],
|
||||||
|
preparedDescription: '',
|
||||||
|
preparedMastertaskDescription: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
mounted() {
|
||||||
|
this.preparedDescription = prepareHTMLDescription(this.description)
|
||||||
|
this.preparedMastertaskDescription = prepareHTMLDescription(this.mastertaskDescription)
|
||||||
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -3,7 +3,9 @@
|
|||||||
<div v-if="deletable && editable" class="x-button">
|
<div v-if="deletable && editable" class="x-button">
|
||||||
<button @click="$emit('removeTimeblock')" class="x-button">x</button>
|
<button @click="$emit('removeTimeblock')" class="x-button">x</button>
|
||||||
</div>
|
</div>
|
||||||
<Datepicker :model-value="timeblock.date" @focus="$emit('onDateFocus')" @update:model-value="updateDate" format="dd.MM.yyyy" locale="sk" select-text="Vybrať" cancel-text="Zrušiť" placeholder="Dátum" :auto-apply="true" :enable-time-picker="false" class="mb-5 modal-input" />
|
<div @click="openDatepicker('datepicker')" class="datepicker-wrapper" ref="datepicker-wrapper">
|
||||||
|
<Datepicker :model-value="timeblock.date" ref="datepicker" @focus="onDateFocus" @update:model-value="updateDate" format="dd.MM.yyyy" locale="sk" select-text="Vybrať" cancel-text="Zrušiť" placeholder="Dátum" :auto-apply="true" :enable-time-picker="false" class="mb-5 modal-input datepicker-input" />
|
||||||
|
</div>
|
||||||
<div class="splitted-time-inputs">
|
<div class="splitted-time-inputs">
|
||||||
<v-text-field :value="timeblock.starts_at_time" @input="updateStartTime" @focus="onInputFocus" :class="{ error: v$?.timeblock.starts_at_time.$errors.length }" type="time" variant="solo" bg-color="white" label="Začiatok" />
|
<v-text-field :value="timeblock.starts_at_time" @input="updateStartTime" @focus="onInputFocus" :class="{ error: v$?.timeblock.starts_at_time.$errors.length }" type="time" variant="solo" bg-color="white" label="Začiatok" />
|
||||||
<v-text-field :value="timeblock.ends_at_time" @input="updateEndTime" @focus="onInputFocus" :class="{ error: v$?.timeblock.ends_at_time.$errors.length }" type="time" variant="solo" bg-color="white" label="Koniec" />
|
<v-text-field :value="timeblock.ends_at_time" @input="updateEndTime" @focus="onInputFocus" :class="{ error: v$?.timeblock.ends_at_time.$errors.length }" type="time" variant="solo" bg-color="white" label="Koniec" />
|
||||||
@@ -15,13 +17,15 @@
|
|||||||
import useVuelidate from '@vuelidate/core'
|
import useVuelidate from '@vuelidate/core'
|
||||||
import { requiredIf } from '@vuelidate/validators'
|
import { requiredIf } from '@vuelidate/validators'
|
||||||
import Datepicker from '@vuepic/vue-datepicker'
|
import Datepicker from '@vuepic/vue-datepicker'
|
||||||
|
import VuetifyFixFocusMixin from '@/plugins/tm@modal/_mixins/vuetify-fix-focus'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [VuetifyFixFocusMixin],
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
Datepicker
|
Datepicker
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
timeblock: {
|
timeblock: {
|
||||||
type: Object,
|
type: Object,
|
||||||
@@ -55,9 +59,18 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
onFocus() {
|
async openDatepicker(ref) {
|
||||||
console.log('focus')
|
this.$refs[ref].openMenu()
|
||||||
},
|
this.$nextTick(() => {
|
||||||
|
this.$refs['datepicker-wrapper'].scrollIntoView({ behavior: 'instant', block: 'center', inline: 'center' })
|
||||||
|
this.$nextTick(() => {
|
||||||
|
const popup = document.querySelector('.dp__menu.dp__menu_index')
|
||||||
|
const isBottom = popup.querySelector('.dp__arrow_bottom')
|
||||||
|
const yDifference = isBottom ? 0 - popup.clientHeight - 42 : 35
|
||||||
|
popup.style.top = window.innerHeight / 2 + yDifference + 'px'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
updateDate(date) {
|
updateDate(date) {
|
||||||
const timeblock = { ...this.timeblock }
|
const timeblock = { ...this.timeblock }
|
||||||
if (date) timeblock.date = date
|
if (date) timeblock.date = date
|
||||||
@@ -100,4 +113,10 @@ export default {
|
|||||||
|
|
||||||
.error input
|
.error input
|
||||||
border: 1px solid red !important
|
border: 1px solid red !important
|
||||||
|
|
||||||
|
.datepicker-wrapper
|
||||||
|
width: 100%
|
||||||
|
.datepicker-input
|
||||||
|
width: 100% !important
|
||||||
|
pointer-events: none
|
||||||
</style>e
|
</style>e
|
||||||
@@ -16,7 +16,9 @@
|
|||||||
|
|
||||||
<div class="splitted-inputs">
|
<div class="splitted-inputs">
|
||||||
<!-- TODO: Bialko validacie -->
|
<!-- TODO: Bialko validacie -->
|
||||||
<Datepicker v-model="subtask.deadline" @focus="onDateFocus" :auto-apply="true" :min-date="new Date()" class="modal-input left" format="dd.MM.yyyy" locale="sk" select-text="Vybrať" cancel-text="Zrušiť" placeholder="Deadline" :class="{ error: v$.subtask.deadline.$errors?.length }" :validations="v$.subtask.deadline" />
|
<div @click="openDatepicker('datepicker-01')" class="datepicker-wrapper">
|
||||||
|
<Datepicker v-model="subtask.deadline" @focus="onDateFocus" ref="datepicker-01" :auto-apply="true" :min-date="new Date()" class="modal-input left datepicker-input" format="dd.MM.yyyy" locale="sk" select-text="Vybrať" cancel-text="Zrušiť" placeholder="Deadline" :class="{ error: v$.subtask.deadline.$errors?.length }" :validations="v$.subtask.deadline" />
|
||||||
|
</div>
|
||||||
|
|
||||||
<v-text-field class="modal-input right" variant="solo" v-model="subtask._deadline_time" label="Čas" append-inner-icon="mdi-clock-outline" type="time" @focus="onInputFocus" :class="{ error: v$.subtask._deadline_time.$errors.length }" :hint="v$.subtask._deadline_time.$errors ? errorUtils.parseErrors(v$.subtask._deadline_time.$errors) : null" />
|
<v-text-field class="modal-input right" variant="solo" v-model="subtask._deadline_time" label="Čas" append-inner-icon="mdi-clock-outline" type="time" @focus="onInputFocus" :class="{ error: v$.subtask._deadline_time.$errors.length }" :hint="v$.subtask._deadline_time.$errors ? errorUtils.parseErrors(v$.subtask._deadline_time.$errors) : null" />
|
||||||
</div>
|
</div>
|
||||||
@@ -69,7 +71,7 @@
|
|||||||
|
|
||||||
<template v-if="!subtask.id">
|
<template v-if="!subtask.id">
|
||||||
<div class="timeblocks w-100">
|
<div class="timeblocks w-100">
|
||||||
<A-timeblock v-for="(timeblock, index) in timeblocks" :key="index" @updateTimeblock="val => updateTimeblock(val, index)" @removeTimeblock="removeTimeblock(index)" @onDateFocus="onDateFocus" :timeblock="timeblock" :deletable="index > 0" editable :ref="`timetable-${index}`" />
|
<A-timeblock v-for="(timeblock, index) in timeblocks" :key="index" @updateTimeblock="val => updateTimeblock(val, index)" @removeTimeblock="removeTimeblock(index)" :timeblock="timeblock" :deletable="index > 0" editable :ref="`timetable-${index}`" />
|
||||||
<div class="end-button w-100">
|
<div class="end-button w-100">
|
||||||
<button @click="timeblocks.push({date: null, starts_at_time: null, ends_at_time: null})">Pridať časový blok</button>
|
<button @click="timeblocks.push({date: null, starts_at_time: null, ends_at_time: null})">Pridať časový blok</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -232,6 +234,10 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
openDatepicker(ref) {
|
||||||
|
this.$refs[ref].openMenu()
|
||||||
|
},
|
||||||
|
|
||||||
updateTimeblock(val, index) {
|
updateTimeblock(val, index) {
|
||||||
this.timeblocks[index] = val
|
this.timeblocks[index] = val
|
||||||
},
|
},
|
||||||
@@ -362,7 +368,6 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
updateSubtask(subtask) {
|
updateSubtask(subtask) {
|
||||||
console.log('UPDATE SUBTASK: ', subtask.timeblocks[0])
|
|
||||||
this.subtask = subtask
|
this.subtask = subtask
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -559,4 +564,10 @@ export default {
|
|||||||
flex-direction: row !important
|
flex-direction: row !important
|
||||||
gap: 15px
|
gap: 15px
|
||||||
margin-bottom: -11px
|
margin-bottom: -11px
|
||||||
|
|
||||||
|
.datepicker-wrapper
|
||||||
|
width: 70%
|
||||||
|
.datepicker-input
|
||||||
|
width: 100% !important
|
||||||
|
pointer-events: none
|
||||||
</style>
|
</style>
|
||||||
Reference in new issue
Block a user