Merge branch 'main' of bitbucket.org:studiotem/jandl-taskmanager-app

This commit is contained in:
StudioTem committed 2023-01-18 08:44:49 +01:00
commit 5220ec9bc1
16 files changed
+99 -98

No files matched your search

File renamed without changes.
+1
View File
@@ -67,6 +67,7 @@ const options: Options = {
'POST v1/teams/(id)': true, 'POST v1/teams/(id)': true,
'DELETE v1/teams/(id)': true, 'DELETE v1/teams/(id)': true,
// 'GET v1/teams': true, // 'GET v1/teams': true,
'GET v1/teamsx': true,
'POST v1/teams': true, 'POST v1/teams': true,
'GET v1/employees': false, 'GET v1/employees': false,
@@ -29,11 +29,11 @@
<v-btn class="menu-dropdown" v-bind="props"> <v-btn class="menu-dropdown" v-bind="props">
<div class="d-flex justify-between align-center"> <div class="d-flex justify-between align-center">
<p class="employee-select-avatar d-flex justify-center align-center" @click.stop="$router.push({name: 'Dashboard - User'})"> <p class="employee-select-avatar d-flex justify-center align-center" @click.stop="$router.push({name: 'Dashboard - User'})">
{{ user.name.charAt(0) + user.surname.charAt(0) }} {{ user.name?.charAt(0) || '' + user.surname?.charAt(0) || '' }}
</p> </p>
<div> <div>
<span class="employee-name ml-4">{{ `${user.name} ${user.surname}` }}</span> <span class="employee-name ml-4">{{ `${user.name} ${user.surname || ''}` }}</span>
<v-icon class="ml-3" icon="mdi-chevron-down" size="x-small"></v-icon> <v-icon class="ml-3" icon="mdi-chevron-down" size="x-small"></v-icon>
</div> </div>
</div> </div>
@@ -72,16 +72,16 @@ export default {
ZSubTaskModal ZSubTaskModal
}, },
computed: {
...mapGetters('auth', ['user']),
},
data() { data() {
return { return {
search: '' search: ''
} }
}, },
computed: {
...mapGetters('auth', ['user']),
},
methods: { methods: {
async logOut() { async logOut() {
try { try {
@@ -3,7 +3,7 @@
<A-sidemenu ref="sidemenu" /> <A-sidemenu ref="sidemenu" />
<v-app @click="eventBus.emit('close-menu')" class="split-pane-right-side"> <v-app @click="eventBus.emit('close-menu')" class="split-pane-right-side">
<!-- <A-header /> --> <A-header />
<div class="main-content"> <div class="main-content">
<router-view id="main-content" /> <router-view id="main-content" />
@@ -19,7 +19,7 @@ import AHeader from './_components/a-header.vue'
export default { export default {
components: { components: {
ASidemenu, ASidemenu,
// AHeader AHeader
} }
} }
</script> </script>
@@ -5,8 +5,8 @@
</div> </div>
</template> </template>
<script> <script>
import VFullCalendar from '@fullcalendar/vue3' import VFullCalendar from '@fullcalendar/vue3'
import dayGridPlugin from '@fullcalendar/daygrid' import dayGridPlugin from '@fullcalendar/daygrid'
import ZMasterTaskModal from '@/plugins/tm@modal/master-task/z-master-task-modal.vue' import ZMasterTaskModal from '@/plugins/tm@modal/master-task/z-master-task-modal.vue'
export default { export default {
@@ -7,7 +7,7 @@
<script> <script>
import AProjectCalendar from './_components/a-project-calendar.vue' import AProjectCalendar from './_components/a-project-calendar.vue'
import AProjectFilter from './_components/a-project-filter.vue' import AProjectFilter from './_components/a-project-filter.vue'
export default { export default {
components: { components: {
@@ -44,7 +44,7 @@ export default {
return { return {
teams: [], teams: [],
teamsNames: [], teamsNames: [],
// Kaluza: Napojit funkcionalitu // Kaluza: Napojit funkcionalitu
selectedTeam: '', selectedTeam: '',
@@ -74,7 +74,7 @@ export default {
}, },
async _getTeams() { async _getTeams() {
this.teams = await this.$axios.get_auth_data('v1/teams') this.teams = await this.$axios.get_auth_data('v1/teamsx')
this.teams.forEach(team => { this.teams.forEach(team => {
this.teamsNames.push(team.name) this.teamsNames.push(team.name)
}) })
@@ -15,7 +15,7 @@
<v-text-field <v-text-field
@focus="onInputFocus" @focus="onInputFocus"
class="modal-input" class="modal-input"
label="Názov blocker" label="Názov blockeru"
:class="{ error: v$.blocker.name.$errors.length }" :class="{ error: v$.blocker.name.$errors.length }"
:hint=" :hint="
v$.blocker.name.$errors v$.blocker.name.$errors
@@ -100,6 +100,24 @@ export default {
} }
}, },
computed: {
employeesOptions() {
const selectedEmployeesIds = this.blocker.employees.map(
(employee) => employee.id
)
const employees = this.allEmployees.filter(
(employee) => !selectedEmployeesIds.includes(employee.id)
)
return employees.map((employee) => {
return {
key: employee.id,
value: `${employee.name} ${employee.surname}`,
}
})
}
},
validations() { validations() {
return { return {
blocker: { blocker: {
@@ -210,24 +228,6 @@ export default {
return employee return employee
}) })
} }
},
computed: {
employeesOptions() {
const selectedEmployeesIds = this.blocker.employees.map(
(employee) => employee.id
)
const employees = this.allEmployees.filter(
(employee) => !selectedEmployeesIds.includes(employee.id)
)
return employees.map((employee) => {
return {
key: employee.id,
value: `${employee.name} ${employee.surname}`,
}
})
}
} }
} }
</script> </script>
@@ -348,12 +348,12 @@ export default {
async created() { async created() {
try { try {
this.teams = await this.$axios.get_auth_data('v1/teams') this.teams = await this.$axios.get_auth_data('v1/teamsx')
this.employees = await this.$axios.get_auth_data('v1/employees') this.employees = await this.$axios.get_auth_data('v1/employees')
// this.masterTask = await this.$axios.get_auth_data(`v1/master-task/${this.masterTaksId}`) // this.masterTask = await this.$axios.get_auth_data(`v1/master-task/${this.masterTaksId}`)
// this.selectedTeam = `${this.masterTask.team.name} - ${this.masterTask.team.id}`) // this.selectedTeam = `${this.masterTask.team.name} - ${this.masterTask.team.id}`)
} catch (error) { } catch (error) {
this.$toast(error) this.$toast.error(error)
} }
}, },
@@ -35,18 +35,6 @@ export default {
} }
}, },
methods: {
showModal() {
this.visible = true
},
close() {
this.visible = false
this.$emit('close', this.blocker)
this.blocker = null
},
},
computed: { computed: {
show: { show: {
get() { get() {
@@ -57,6 +45,18 @@ export default {
if (!value) this.$emit('close') if (!value) this.$emit('close')
} }
}, },
},
methods: {
showModal() {
this.visible = true
},
close() {
this.visible = false
this.$emit('close', this.blocker)
this.blocker = null
},
} }
} }
</script> </script>
@@ -345,7 +345,7 @@ export default {
this.masterTasks = await this.$axios.get_auth_data('v1/master-tasks') this.masterTasks = await this.$axios.get_auth_data('v1/master-tasks')
this.employees = await this.$axios.get_auth_data('v1/employees') this.employees = await this.$axios.get_auth_data('v1/employees')
} catch (error) { } catch (error) {
this.$toast(error) this.$toast.error(error)
} }
}, },
@@ -382,7 +382,7 @@ export default {
this.close() this.close()
this.$router.push({ name: 'Dashboard - Tasks' }) this.$router.push({ name: 'Dashboard - Tasks' })
} catch (error) { } catch (error) {
this.$toast(error) this.$toast.error(error)
} }
}, },
@@ -34,6 +34,18 @@ export default {
} }
}, },
computed: {
show: {
get() {
return this.visible
},
set(value) {
if (!value) this.$emit('close')
}
},
},
methods: { methods: {
async complete() { async complete() {
try { try {
@@ -49,18 +61,6 @@ export default {
this.$toast.error(error) this.$toast.error(error)
} }
} }
},
computed: {
show: {
get() {
return this.visible
},
set(value) {
if (!value) this.$emit('close')
}
},
} }
} }
</script> </script>
@@ -33,17 +33,6 @@ export default {
} }
}, },
methods: {
async deleteTeam() {
try {
await this.$axios.delete(`v1/teams/${this.team.id}`)
this.show = false
} catch (error) {
this.$toast.error(error)
}
}
},
computed: { computed: {
show: { show: {
get() { get() {
@@ -54,6 +43,17 @@ export default {
if (!value) this.$emit('close') if (!value) this.$emit('close')
} }
}, },
},
methods: {
async deleteTeam() {
try {
await this.$axios.delete(`v1/teams/${this.team.id}`)
this.show = false
} catch (error) {
this.$toast.error(error)
}
}
} }
} }
</script> </script>
@@ -29,20 +29,6 @@ export default {
} }
}, },
async created() {
try {
this.employees = await this.$axios.get_auth_data('v1/employees')
} catch (error) {
this.$toast(error)
}
},
methods: {
onInput() {
this.$emit('queryChange', this.searchQuery)
}
},
computed: { computed: {
allEmployees() { allEmployees() {
const employees = this.employees.map((employee) => { const employees = this.employees.map((employee) => {
@@ -51,6 +37,20 @@ export default {
return employees return employees
} }
},
async created() {
try {
this.employees = await this.$axios.get_auth_data('v1/employees')
} catch (error) {
this.$toast.error(error)
}
},
methods: {
onInput() {
this.$emit('queryChange', this.searchQuery)
}
} }
} }
</script> </script>
+10 -10
View File
@@ -21,7 +21,7 @@ export default {
async get_data(url: string, config?: any) { async get_data(url: string, config?: any) {
return axios.get(url, config) return axios.get(url, config)
.then(response => response.data.data) .then(response => response.data.data)
.catch(error => Promise.reject(error.response)) .catch(error => Promise.reject(error.response || error))
}, },
async get_auth_data(url: string, config?: any) { async get_auth_data(url: string, config?: any) {
@@ -29,7 +29,7 @@ export default {
return axios.get(url, config) return axios.get(url, config)
.then(response => Promise.resolve(response.data.data)) .then(response => Promise.resolve(response.data.data))
.catch(error => Promise.reject(error.response)) .catch(error => Promise.reject(error.response || error))
}, },
async post(url: string, params = null, config?: any) { async post(url: string, params = null, config?: any) {
@@ -51,7 +51,7 @@ export default {
return axios.post(url, params, config) return axios.post(url, params, config)
.then(response => response.data.data) .then(response => response.data.data)
.catch(error => Promise.reject(error.response)) .catch(error => Promise.reject(error.response || error))
}, },
async post_auth_data(url: string, params = null, config?: any) { async post_auth_data(url: string, params = null, config?: any) {
@@ -59,7 +59,7 @@ export default {
return axios.post(url, params, config) return axios.post(url, params, config)
.then(response => response.data.data) .then(response => response.data.data)
.catch(error => Promise.reject(error.response)) .catch(error => Promise.reject(error.response || error))
}, },
async delete(url: string, config?: any) { async delete(url: string, config?: any) {
@@ -79,7 +79,7 @@ export default {
async delete_data(url: string, config?: any) { async delete_data(url: string, config?: any) {
return axios.delete(url, config) return axios.delete(url, config)
.then(response => response.data.data) .then(response => response.data.data)
.catch(error => Promise.reject(error.response)) .catch(error => Promise.reject(error.response || error))
}, },
async delete_auth_data(url: string, config?: any) { async delete_auth_data(url: string, config?: any) {
@@ -87,7 +87,7 @@ export default {
return axios.delete(url, config) return axios.delete(url, config)
.then(response => response.data.data) .then(response => response.data.data)
.catch(error => Promise.reject(error.response)) .catch(error => Promise.reject(error.response || error))
}, },
async patch(url: string, params = null, config?: any) { async patch(url: string, params = null, config?: any) {
@@ -107,7 +107,7 @@ export default {
async patch_data(url: string, params = null, config?: any) { async patch_data(url: string, params = null, config?: any) {
return axios.patch(url, params, config) return axios.patch(url, params, config)
.then(response => response.data.data) .then(response => response.data.data)
.catch(error => Promise.reject(error.response)) .catch(error => Promise.reject(error.response || error))
}, },
async patch_auth_data(url: string, params = null, config?: any) { async patch_auth_data(url: string, params = null, config?: any) {
@@ -115,7 +115,7 @@ export default {
return axios.patch(url, params, config) return axios.patch(url, params, config)
.then(response => response.data.data) .then(response => response.data.data)
.catch(error => Promise.reject(error.response)) .catch(error => Promise.reject(error.response || error))
}, },
async put(url: string, params = null, config?: any) { async put(url: string, params = null, config?: any) {
@@ -135,7 +135,7 @@ export default {
async put_data(url: string, params = null, config?: any) { async put_data(url: string, params = null, config?: any) {
return axios.put(url, params, config) return axios.put(url, params, config)
.then(response => response.data.data) .then(response => response.data.data)
.catch(error => Promise.reject(error.response)) .catch(error => Promise.reject(error.response || error))
}, },
async put_auth_data(url: string, params = null, config?: any) { async put_auth_data(url: string, params = null, config?: any) {
@@ -143,7 +143,7 @@ export default {
return axios.put(url, params, config) return axios.put(url, params, config)
.then(response => response.data.data) .then(response => response.data.data)
.catch(error => Promise.reject(error.response)) .catch(error => Promise.reject(error.response || error))
}, },
_config(config: any) { _config(config: any) {
@@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<div v-if="!content"></div> <div v-if="!content"></div>
<div v-else-if="content?.error">{{ content.error }}</div> <div v-else-if="content.error">{{ content.error }}</div>
<div v-else-if="(typeof content == 'array' && !array.length) || (typeof content == 'object' && !Object.values(content).length)">{{ emptyMessage }}</div> <div v-else-if="(typeof content == 'array' && !array.length) || (typeof content == 'object' && !Object.values(content).length)">{{ emptyMessage }}</div>
<slot v-else></slot> <slot v-else></slot>
</div> </div>
@@ -12,7 +12,7 @@ export default {
props: { props: {
content: { content: {
type: [Object, Array, Boolean], type: [Object, Array, Boolean],
default: null, default: () => null,
}, },
emptyMessage: { emptyMessage: {
@@ -25,7 +25,7 @@ export default {
loader: null loader: null
} }
}, },
created() { created() {
this.startLoading() this.startLoading()