This commit is contained in:
romankko2 committed 2023-01-20 11:21:50 +01:00
commit 33dfb2bd6f
13 files changed
+80 -61

No files matched your search

+18 -18
View File
@@ -38,8 +38,8 @@
"tasks": [ "tasks": [
{ {
"id": 1, "id": 1,
"starts_at": "2023-01-11T08:01:00+00:00", "starts_at": "2023-01-18T08:01:00+00:00",
"ends_at": "2023-01-11T09:00:00+00:00", "ends_at": "2023-01-18T09:00:00+00:00",
"title": "Task DNES", "title": "Task DNES",
"project_code": "CO-2201", "project_code": "CO-2201",
"master_task_color": "#E9FFE6", "master_task_color": "#E9FFE6",
@@ -48,8 +48,8 @@
{ {
"id": 2, "id": 2,
"starts_at": "2023-01-12T08:30:00+00:00", "starts_at": "2023-01-19T08:30:00+00:00",
"ends_at": "2023-01-12T09:00:00+00:00", "ends_at": "2023-01-19T09:00:00+00:00",
"title": "Kratky 30min Lorem ipsum dolor sit amet, consectetur adipiscing e", "title": "Kratky 30min Lorem ipsum dolor sit amet, consectetur adipiscing e",
"project_code": "CO-2201", "project_code": "CO-2201",
"master_task_color": "#f27e57", "master_task_color": "#f27e57",
@@ -58,8 +58,8 @@
{ {
"id": 3, "id": 3,
"starts_at": "2023-01-12T10:30:00+00:00", "starts_at": "2023-01-19T10:30:00+00:00",
"ends_at": "2023-01-12T10:45:00+00:00", "ends_at": "2023-01-19T10:45:00+00:00",
"title": "Kratky 15min", "title": "Kratky 15min",
"project_code": "CO-2201", "project_code": "CO-2201",
"master_task_color": "#57e0f2", "master_task_color": "#57e0f2",
@@ -68,8 +68,8 @@
{ {
"id": 4, "id": 4,
"starts_at": "2023-01-13T08:00:00+00:00", "starts_at": "2023-01-20T08:00:00+00:00",
"ends_at": "2023-01-13T10:00:00+00:00", "ends_at": "2023-01-20T10:00:00+00:00",
"title": "Task 2", "title": "Task 2",
"project_code": "CO-2201", "project_code": "CO-2201",
"master_task_color": "#FDE1FF", "master_task_color": "#FDE1FF",
@@ -78,8 +78,8 @@
{ {
"id": 6, "id": 6,
"starts_at": "2023-01-13T09:00:00+00:00", "starts_at": "2023-01-20T09:00:00+00:00",
"ends_at": "2023-01-13T12:00:00+00:00", "ends_at": "2023-01-20T12:00:00+00:00",
"title": "Task 6", "title": "Task 6",
"project_code": "CO-2201", "project_code": "CO-2201",
"master_task_color": "#57e0f2", "master_task_color": "#57e0f2",
@@ -88,8 +88,8 @@
{ {
"id": 7, "id": 7,
"starts_at": "2023-01-13T12:00:00+00:00", "starts_at": "2023-01-20T12:00:00+00:00",
"ends_at": "2023-01-13T16:00:00+00:00", "ends_at": "2023-01-20T16:00:00+00:00",
"title": "Task 7", "title": "Task 7",
"project_code": "CO-2201", "project_code": "CO-2201",
"master_task_color": "#E7DBF8", "master_task_color": "#E7DBF8",
@@ -98,8 +98,8 @@
{ {
"id": 8, "id": 8,
"starts_at": "2023-01-14T07:00:00+00:00", "starts_at": "2023-01-21T07:00:00+00:00",
"ends_at": "2023-01-14T09:00:00+00:00", "ends_at": "2023-01-21T09:00:00+00:00",
"title": "Task 8", "title": "Task 8",
"project_code": "CO-2201", "project_code": "CO-2201",
"master_task_color": "#57e0f2", "master_task_color": "#57e0f2",
@@ -108,8 +108,8 @@
{ {
"id": 9, "id": 9,
"starts_at": "2023-01-14T09:00:00+00:00", "starts_at": "2023-01-21T09:00:00+00:00",
"ends_at": "2023-01-14T12:00:00+00:00", "ends_at": "2023-01-21T12:00:00+00:00",
"title": "Task 9", "title": "Task 9",
"project_code": "CO-2201", "project_code": "CO-2201",
"master_task_color": "#E9FFE6", "master_task_color": "#E9FFE6",
@@ -118,8 +118,8 @@
{ {
"id": 10, "id": 10,
"starts_at": "2023-01-14T12:00:00+00:00", "starts_at": "2023-01-21T12:00:00+00:00",
"ends_at": "2023-01-14T13:00:00+00:00", "ends_at": "2023-01-21T13:00:00+00:00",
"title": "Task 10", "title": "Task 10",
"project_code": "CO-2201", "project_code": "CO-2201",
"master_task_color": "#57e0f2", "master_task_color": "#57e0f2",
+18 -18
View File
@@ -10,8 +10,8 @@
"tasks": [ "tasks": [
{ {
"id": 1, "id": 1,
"starts_at": "2023-01-12T08:01:00+00:00", "starts_at": "2023-01-19T08:01:00+00:00",
"ends_at": "2023-01-12T09:00:00+00:00", "ends_at": "2023-01-19T09:00:00+00:00",
"title": "Task DNES", "title": "Task DNES",
"project_code": "CO-2201", "project_code": "CO-2201",
"master_task_color": "#E9FFE6", "master_task_color": "#E9FFE6",
@@ -20,8 +20,8 @@
{ {
"id": 2, "id": 2,
"starts_at": "2023-01-12T08:30:00+00:00", "starts_at": "2023-01-19T08:30:00+00:00",
"ends_at": "2023-01-12T09:00:00+00:00", "ends_at": "2023-01-19T09:00:00+00:00",
"title": "Kratky 30min", "title": "Kratky 30min",
"project_code": "CO-2201", "project_code": "CO-2201",
"master_task_color": "#f27e57", "master_task_color": "#f27e57",
@@ -30,8 +30,8 @@
{ {
"id": 3, "id": 3,
"starts_at": "2023-01-13T10:30:00+00:00", "starts_at": "2023-01-20T10:30:00+00:00",
"ends_at": "2023-01-13T10:45:00+00:00", "ends_at": "2023-01-20T10:45:00+00:00",
"title": "Kratky 15min", "title": "Kratky 15min",
"project_code": "CO-2201", "project_code": "CO-2201",
"master_task_color": "#57e0f2", "master_task_color": "#57e0f2",
@@ -49,8 +49,8 @@
"tasks": [ "tasks": [
{ {
"id": 4, "id": 4,
"starts_at": "2023-01-12T08:01:00+00:00", "starts_at": "2023-01-19T08:01:00+00:00",
"ends_at": "2023-01-12T09:00:00+00:00", "ends_at": "2023-01-19T09:00:00+00:00",
"title": "Task DNES", "title": "Task DNES",
"project_code": "CO-2201", "project_code": "CO-2201",
"master_task_color": "#E9FFE6", "master_task_color": "#E9FFE6",
@@ -59,8 +59,8 @@
{ {
"id": 5, "id": 5,
"starts_at": "2023-01-12T08:30:00+00:00", "starts_at": "2023-01-19T08:30:00+00:00",
"ends_at": "2023-01-12T09:00:00+00:00", "ends_at": "2023-01-19T09:00:00+00:00",
"title": "Kratky 30min", "title": "Kratky 30min",
"project_code": "CO-2201", "project_code": "CO-2201",
"master_task_color": "#f27e57", "master_task_color": "#f27e57",
@@ -69,8 +69,8 @@
{ {
"id": 6, "id": 6,
"starts_at": "2023-01-12T10:30:00+00:00", "starts_at": "2023-01-19T10:30:00+00:00",
"ends_at": "2023-01-12T10:45:00+00:00", "ends_at": "2023-01-19T10:45:00+00:00",
"title": "Kratky 15min", "title": "Kratky 15min",
"project_code": "CO-2201", "project_code": "CO-2201",
"master_task_color": "#57e0f2", "master_task_color": "#57e0f2",
@@ -88,8 +88,8 @@
"tasks": [ "tasks": [
{ {
"id": 1, "id": 1,
"starts_at": "2023-01-13T08:01:00+00:00", "starts_at": "2023-01-20T08:01:00+00:00",
"ends_at": "2023-01-13T09:00:00+00:00", "ends_at": "2023-01-20T09:00:00+00:00",
"title": "Task DNES", "title": "Task DNES",
"project_code": "CO-2201", "project_code": "CO-2201",
"master_task_color": "#E9FFE6", "master_task_color": "#E9FFE6",
@@ -98,8 +98,8 @@
{ {
"id": 2, "id": 2,
"starts_at": "2023-01-12T08:30:00+00:00", "starts_at": "2023-01-19T08:30:00+00:00",
"ends_at": "2023-01-12T09:00:00+00:00", "ends_at": "2023-01-19T09:00:00+00:00",
"title": "Kratky 30min", "title": "Kratky 30min",
"project_code": "CO-2201", "project_code": "CO-2201",
"master_task_color": "#f27e57", "master_task_color": "#f27e57",
@@ -108,8 +108,8 @@
{ {
"id": 3, "id": 3,
"starts_at": "2023-01-13T10:30:00+00:00", "starts_at": "2023-01-20T10:30:00+00:00",
"ends_at": "2023-01-13T10:45:00+00:00", "ends_at": "2023-01-20T10:45:00+00:00",
"title": "Kratky 15min", "title": "Kratky 15min",
"project_code": "CO-2201", "project_code": "CO-2201",
"master_task_color": "#57e0f2", "master_task_color": "#57e0f2",
@@ -85,7 +85,7 @@ export default {
methods: { methods: {
async logOut() { async logOut() {
try { try {
await this.$store.dispatch('wAuth/logout') await this.$store.dispatch('auth/logout')
this.$router.push('/') this.$router.push('/')
this.$toast.success('Boli ste odhlásený') this.$toast.success('Boli ste odhlásený')
} catch (error) { } catch (error) {
@@ -106,6 +106,7 @@ export default {
return { return {
'vuecal__cell-split': true, 'vuecal__cell-split': true,
'vuecal__cell-split--highlighted': this.highlightedSplit === split.id, 'vuecal__cell-split--highlighted': this.highlightedSplit === split.id,
'vuecal__cell-split--weekend': split.isWeekend,
[split.class]: !!split.class [split.class]: !!split.class
} }
}, },
@@ -2,7 +2,7 @@
<v-form> <v-form>
<v-text-field v-model="form.email" label="E-mail" variant="solo" autocomplete="email" class="mb-2" bg-color="white" :hint="v$.form.email.$errors ? errorUtils.parseErrors(v$.form.email.$errors) : null" :class="{ error: v$.form.email.$errors.length }" /> <v-text-field v-model="form.email" label="E-mail" variant="solo" autocomplete="email" class="mb-2" bg-color="white" :hint="v$.form.email.$errors ? errorUtils.parseErrors(v$.form.email.$errors) : null" :class="{ error: v$.form.email.$errors.length }" />
<v-text-field v-model="form.password" :type="showPassword ? 'text' : 'password'" variant="solo" bg-color="white" class="mb-2" :counter="8" label="Password" autocomplete="current-password" :hint="v$.form.password.$errors ? errorUtils.parseErrors(v$.form.password.$errors) : null" <v-text-field v-model="form.password" :type="showPassword ? 'text' : 'password'" variant="solo" bg-color="white" class="mb-2" :counter="12" label="Heslo" autocomplete="current-password" :hint="v$.form.password.$errors ? errorUtils.parseErrors(v$.form.password.$errors) : null"
:class="{ error: v$.form.password.$errors.length }" :append-icon="showPassword ? 'mdi-eye' : 'mdi-eye-off'" @click:append="showPassword = !showPassword" /> :class="{ error: v$.form.password.$errors.length }" :append-icon="showPassword ? 'mdi-eye' : 'mdi-eye-off'" @click:append="showPassword = !showPassword" />
<div class="d-flex flex-column"> <div class="d-flex flex-column">
@@ -31,7 +31,7 @@ export default {
return { return {
form: { form: {
email: {required, email }, email: {required, email },
password: {required, minLength: minLength(8)} password: {required, minLength: minLength(12)}
} }
} }
}, },
@@ -41,7 +41,7 @@ export default {
if (!(await this.v$.$validate())) return console.log(this.v$) if (!(await this.v$.$validate())) return console.log(this.v$)
try { try {
await this.$axios.post_data('v1/auth/login', this.form) await this.$store.dispatch('auth/login', this.form)
this.$router.push({ name: 'Overview - Ongoing tasks'}) this.$router.push({ name: 'Overview - Ongoing tasks'})
} catch (error) { } catch (error) {
this.$toast.error(error) this.$toast.error(error)
@@ -4,9 +4,9 @@
<v-text-field v-model="form.email" label="E-mail" autocomplete="email" bg-color="white" variant="solo" type="email" class="mb-2" :hint="v$.form.email.$errors ? errorUtils.parseErrors(v$.form.email.$errors) : null" :class="{ error: v$.form.email.$errors.length }" /> <v-text-field v-model="form.email" label="E-mail" autocomplete="email" bg-color="white" variant="solo" type="email" class="mb-2" :hint="v$.form.email.$errors ? errorUtils.parseErrors(v$.form.email.$errors) : null" :class="{ error: v$.form.email.$errors.length }" />
<v-text-field v-model="form.password" label="Password" autocomplete="new-password" bg-color="white" variant="solo" :type="showPassword ? 'text' : 'password'" class="mb-2" :hint="v$.form.password.$errors ? errorUtils.parseErrors(v$.form.password.$errors) : null" :class="{ error: v$.form.password.$errors.length }" :counter="8" :append-icon="showPassword ? 'mdi-eye' : 'mdi-eye-off'" @click:append="showPassword = !showPassword" /> <v-text-field v-model="form.password" label="Heslo" autocomplete="new-password" bg-color="white" variant="solo" :type="showPassword ? 'text' : 'password'" class="mb-2" :hint="v$.form.password.$errors ? errorUtils.parseErrors(v$.form.password.$errors) : null" :class="{ error: v$.form.password.$errors.length }" :counter="12" :append-icon="showPassword ? 'mdi-eye' : 'mdi-eye-off'" @click:append="showPassword = !showPassword" />
<v-text-field v-model="form.password_confirmation" autocomplete="new-password" bg-color="white" variant="solo" label="Password confirmation" :type="showConfirmationPassword ? 'text' : 'password'" :counter="8" class="mb-2" :hint="v$.form.password_confirmation.$errors ? errorUtils.parseErrors(v$.form.password_confirmation.$errors) : null" :class="{ error: v$.form.password_confirmation.$errors.length }" :append-icon="showConfirmationPassword ? 'mdi-eye' : 'mdi-eye-off'" @click:append="showConfirmationPassword = !showConfirmationPassword" /> <v-text-field v-model="form.password_confirmation" autocomplete="new-password" bg-color="white" variant="solo" label="Potvrdenie hesla" :type="showConfirmationPassword ? 'text' : 'password'" :counter="12" class="mb-2" :hint="v$.form.password_confirmation.$errors ? errorUtils.parseErrors(v$.form.password_confirmation.$errors) : null" :class="{ error: v$.form.password_confirmation.$errors.length }" :append-icon="showConfirmationPassword ? 'mdi-eye' : 'mdi-eye-off'" @click:append="showConfirmationPassword = !showConfirmationPassword" />
<div class="d-flex flex-column"> <div class="d-flex flex-column">
<v-btn class="button" color="#7F39FB" @click="submit()">Change password</v-btn> <v-btn class="button" color="#7F39FB" @click="submit()">Change password</v-btn>
@@ -35,8 +35,8 @@ export default {
form: { form: {
code: { required, integer, minLength: minLength(6), maxLength: maxLength(6) }, code: { required, integer, minLength: minLength(6), maxLength: maxLength(6) },
email: { required, email }, email: { required, email },
password: { required, minLength: minLength(8) }, password: { required, minLength: minLength(12) },
password_confirmation: { required, minLength: minLength(8), sameAs: sameAs(this.form.password)} password_confirmation: { required, minLength: minLength(12), sameAs: sameAs(this.form.password)}
} }
} }
}, },
@@ -25,7 +25,6 @@
> >
<template v-slot:split-label="{ split }"> <template v-slot:split-label="{ split }">
<div class="w-100 h-100 d-flex flex-column"> <div class="w-100 h-100 d-flex flex-column">
<h1 @click="addTimeModal()">Tu mas napojeny modal</h1>
<span v-if="split.date" class="d-flex align-center"> <span v-if="split.date" class="d-flex align-center">
<img v-if="getHeadingDate(split.date) == 'Dnes'" :src="require('./_img/home-icon.svg')" class="mr-2"> <img v-if="getHeadingDate(split.date) == 'Dnes'" :src="require('./_img/home-icon.svg')" class="mr-2">
<p class="weekday-label">{{ getHeadingDate(split.date) }}</p> <p class="weekday-label">{{ getHeadingDate(split.date) }}</p>
@@ -35,10 +34,10 @@
</span> </span>
<span v-if="split.date"> <span v-if="split.date">
<p class="day-name" >{{ split.date.toLocaleDateString('sk-SK', { weekday: 'long' }) }}</p> <p class="day-name" >{{ split.date.toLocaleDateString('en-EN', { weekday: 'long' }) }}</p>
</span> </span>
<div v-if="split.unscheduledTime && split.initials" class="unscheduled-time d-flex align-center text-left"> <div v-if="split.unscheduledTime && split.initials" class="unscheduled-time d-flex align-center text-left" :class="{'vuecal__cell-split--weekend': split.isWeekend}">
<div class="unscheduled-time-initials d-flex align-center justify-center me-4"> <div class="unscheduled-time-initials d-flex align-center justify-center me-4">
<p>{{split.initials}}</p> <p>{{split.initials}}</p>
</div> </div>
@@ -161,6 +160,7 @@ export default {
async eventMoved(e) { async eventMoved(e) {
this.focusedEventId = e.event.id this.focusedEventId = e.event.id
this.addTimeModal(e.event.id)
this.$emit('eventMoved', e) this.$emit('eventMoved', e)
}, },
@@ -356,6 +356,12 @@ export default {
.vuecal__cell--highlighted, .vuecal__cell--highlighted,
.vuecal__cell--selected .vuecal__cell--selected
background-color: white background-color: white
border-radius: 16px
.vuecal__cell-split--weekend
// background-color: #F2E7FE !important
background-color: rgba(255, 124, 124, .3) !important
border-radius: 16px
// EVENT // EVENT
@@ -3,7 +3,9 @@
<v-select <v-select
v-model="selectedEmployee" v-model="selectedEmployee"
class="subheader-input" class="subheader-input"
:items="employeesNames" :items="employees"
item-title="name"
item-value="id"
label="Zamestnanec" label="Zamestnanec"
variant="outlined" variant="outlined"
></v-select> ></v-select>
@@ -43,7 +45,6 @@ export default {
data() { data() {
return { return {
employees: [], employees: [],
employeesNames: [],
selectedDate: "", selectedDate: "",
// Kaluza: Napojit funkcnost // Kaluza: Napojit funkcnost
@@ -73,9 +74,6 @@ export default {
async _getEmployees() { async _getEmployees() {
this.employees = await this.$axios.get_auth_data('v1/employees') this.employees = await this.$axios.get_auth_data('v1/employees')
this.employees.forEach(employee => {
this.employeesNames.push(`${employee.name} ${employee.surname} `)
})
}, },
_getWeek(emitDataChanged = true) { _getWeek(emitDataChanged = true) {
+7 -1
View File
@@ -56,11 +56,17 @@ export default {
name: this.timelineData.name + " " + this.timelineData.surname, name: this.timelineData.name + " " + this.timelineData.surname,
initials: this.timelineData.name.charAt(0).toUpperCase() + this.timelineData.surname.charAt(0).toUpperCase(), initials: this.timelineData.name.charAt(0).toUpperCase() + this.timelineData.surname.charAt(0).toUpperCase(),
unscheduledTime: Math.floor(this.timelineData.unscheduled_times[i].time / 60) + "," + String(this.timelineData.unscheduled_times[i].time % 60)[0], unscheduledTime: Math.floor(this.timelineData.unscheduled_times[i].time / 60) + "," + String(this.timelineData.unscheduled_times[i].time % 60)[0],
date: addDays(date, i) date: addDays(date, i),
isWeekend: this.isWeekend(addDays(date, i))
}) })
} }
}, },
isWeekend(date) {
if (date.getDay() == 6 || date.getDay() == 0) return true
return false
},
formatTimelineDataToTimelineFormat(date) { formatTimelineDataToTimelineFormat(date) {
// format events // format events
this.timelineData.tasks.forEach(event => { this.timelineData.tasks.forEach(event => {
@@ -3,7 +3,9 @@
<v-select <v-select
v-model="selectedTeam" v-model="selectedTeam"
class="subheader-input" class="subheader-input"
:items="teamsNames" :items="teams"
item-title="name"
item-value="id"
label="Tím" label="Tím"
variant="outlined" variant="outlined"
></v-select> ></v-select>
@@ -29,6 +31,7 @@
<script> <script>
import { addDays, subDays } from 'date-fns' import { addDays, subDays } from 'date-fns'
import { mapGetters } from 'vuex'
export default { export default {
props: { props: {
@@ -43,7 +46,6 @@ export default {
data() { data() {
return { return {
teams: [], teams: [],
teamsNames: [],
// Kaluza: Napojit funkcionalitu // Kaluza: Napojit funkcionalitu
selectedTeam: '', selectedTeam: '',
@@ -55,9 +57,11 @@ export default {
}, },
computed: { computed: {
...mapGetters('auth', ['user']),
time() { time() {
return this.unscheduledTime return this.unscheduledTime
} },
}, },
created() { created() {
@@ -75,9 +79,7 @@ export default {
async _getTeams() { async _getTeams() {
this.teams = await this.$axios.get_auth_data('v1/teamsx') this.teams = await this.$axios.get_auth_data('v1/teamsx')
this.teams.forEach(team => { // this.selectedTeam()
this.teamsNames.push(team.name)
})
}, },
_getDay(emitDataChanged = true) { _getDay(emitDataChanged = true) {
@@ -95,7 +95,7 @@ export default {
async updateUserInfo() { async updateUserInfo() {
if (!(await this.v$.$validate())) return if (!(await this.v$.$validate())) return
try { try {
await this.$store.dispatch('wAuth/updateUserInfo', this.user) await this.$store.dispatch('auth/updateUserInfo', this.user)
this.$toast.success('Profil bol úspešne zmenený') this.$toast.success('Profil bol úspešne zmenený')
} catch (error) { } catch (error) {
+3 -1
View File
@@ -18,6 +18,8 @@ export default {
state.user = data.user state.user = data.user
localStorage.setItem('wzo_vue_user_user', JSON.stringify(data.user)) localStorage.setItem('wzo_vue_user_user', JSON.stringify(data.user))
} }
console.log(state)
}, },
auth_error(state: any) { auth_error(state: any) {
state.token = '' state.token = ''
@@ -158,7 +160,7 @@ export default {
return state.user return state.user
}, },
token: (state: any) => { token: (state: any) => {
return state.token return (state.token && state.token != undefined) ? state.token : null
} }
} }
} }
+4
View File
@@ -149,6 +149,10 @@ export default {
_config(config: any) { _config(config: any) {
if (config) console.error('NOT IMPLEMENTED') if (config) console.error('NOT IMPLEMENTED')
if (!store.getters['auth/token']) {
return {headers: {}}
}
return { return {
headers: { headers: {
Authorization: `Bearer ${store.getters['auth/token']}` Authorization: `Bearer ${store.getters['auth/token']}`