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,
'DELETE v1/teams/(id)': true,
// 'GET v1/teams': true,
'GET v1/teamsx': true,
'POST v1/teams': true,
'GET v1/employees': false,
@@ -29,11 +29,11 @@
<v-btn class="menu-dropdown" v-bind="props">
<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'})">
{{ user.name.charAt(0) + user.surname.charAt(0) }}
{{ user.name?.charAt(0) || '' + user.surname?.charAt(0) || '' }}
</p>
<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>
</div>
</div>
@@ -72,16 +72,16 @@ export default {
ZSubTaskModal
},
computed: {
...mapGetters('auth', ['user']),
},
data() {
return {
search: ''
}
},
computed: {
...mapGetters('auth', ['user']),
},
methods: {
async logOut() {
try {
@@ -3,7 +3,7 @@
<A-sidemenu ref="sidemenu" />
<v-app @click="eventBus.emit('close-menu')" class="split-pane-right-side">
<!-- <A-header /> -->
<A-header />
<div class="main-content">
<router-view id="main-content" />
@@ -19,7 +19,7 @@ import AHeader from './_components/a-header.vue'
export default {
components: {
ASidemenu,
// AHeader
AHeader
}
}
</script>
@@ -5,8 +5,8 @@
</div>
</template>
<script>
import VFullCalendar from '@fullcalendar/vue3'
import dayGridPlugin from '@fullcalendar/daygrid'
import VFullCalendar from '@fullcalendar/vue3'
import dayGridPlugin from '@fullcalendar/daygrid'
import ZMasterTaskModal from '@/plugins/tm@modal/master-task/z-master-task-modal.vue'
export default {
@@ -7,7 +7,7 @@
<script>
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 {
components: {
@@ -44,7 +44,7 @@ export default {
return {
teams: [],
teamsNames: [],
// Kaluza: Napojit funkcionalitu
selectedTeam: '',
@@ -74,7 +74,7 @@ export default {
},
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.teamsNames.push(team.name)
})
@@ -15,7 +15,7 @@
<v-text-field
@focus="onInputFocus"
class="modal-input"
label="Názov blocker"
label="Názov blockeru"
:class="{ error: v$.blocker.name.$errors.length }"
:hint="
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() {
return {
blocker: {
@@ -210,24 +228,6 @@ export default {
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>
@@ -348,12 +348,12 @@ export default {
async created() {
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.masterTask = await this.$axios.get_auth_data(`v1/master-task/${this.masterTaksId}`)
// this.selectedTeam = `${this.masterTask.team.name} - ${this.masterTask.team.id}`)
} 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: {
show: {
get() {
@@ -57,6 +45,18 @@ export default {
if (!value) this.$emit('close')
}
},
},
methods: {
showModal() {
this.visible = true
},
close() {
this.visible = false
this.$emit('close', this.blocker)
this.blocker = null
},
}
}
</script>
@@ -345,7 +345,7 @@ export default {
this.masterTasks = await this.$axios.get_auth_data('v1/master-tasks')
this.employees = await this.$axios.get_auth_data('v1/employees')
} catch (error) {
this.$toast(error)
this.$toast.error(error)
}
},
@@ -382,7 +382,7 @@ export default {
this.close()
this.$router.push({ name: 'Dashboard - Tasks' })
} 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: {
async complete() {
try {
@@ -49,18 +61,6 @@ export default {
this.$toast.error(error)
}
}
},
computed: {
show: {
get() {
return this.visible
},
set(value) {
if (!value) this.$emit('close')
}
},
}
}
</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: {
show: {
get() {
@@ -54,6 +43,17 @@ export default {
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>
@@ -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: {
allEmployees() {
const employees = this.employees.map((employee) => {
@@ -51,6 +37,20 @@ export default {
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>
+10 -10
View File
@@ -21,7 +21,7 @@ export default {
async get_data(url: string, config?: any) {
return axios.get(url, config)
.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) {
@@ -29,7 +29,7 @@ export default {
return axios.get(url, config)
.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) {
@@ -51,7 +51,7 @@ export default {
return axios.post(url, params, config)
.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) {
@@ -59,7 +59,7 @@ export default {
return axios.post(url, params, config)
.then(response => response.data.data)
.catch(error => Promise.reject(error.response))
.catch(error => Promise.reject(error.response || error))
},
async delete(url: string, config?: any) {
@@ -79,7 +79,7 @@ export default {
async delete_data(url: string, config?: any) {
return axios.delete(url, config)
.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) {
@@ -87,7 +87,7 @@ export default {
return axios.delete(url, config)
.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) {
@@ -107,7 +107,7 @@ export default {
async patch_data(url: string, params = null, config?: any) {
return axios.patch(url, params, config)
.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) {
@@ -115,7 +115,7 @@ export default {
return axios.patch(url, params, config)
.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) {
@@ -135,7 +135,7 @@ export default {
async put_data(url: string, params = null, config?: any) {
return axios.put(url, params, config)
.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) {
@@ -143,7 +143,7 @@ export default {
return axios.put(url, params, config)
.then(response => response.data.data)
.catch(error => Promise.reject(error.response))
.catch(error => Promise.reject(error.response || error))
},
_config(config: any) {
@@ -1,7 +1,7 @@
<template>
<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>
<slot v-else></slot>
</div>
@@ -12,7 +12,7 @@ export default {
props: {
content: {
type: [Object, Array, Boolean],
default: null,
default: () => null,
},
emptyMessage: {
@@ -25,7 +25,7 @@ export default {
loader: null
}
},
created() {
this.startLoading()