Enabled header

This commit is contained in:
Matej Glasnák committed 2023-01-17 16:16:40 +01:00
1 parent 032f045854
commit f04a2b7c55
10 files changed
+23 -22

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': true, 'GET v1/employees': true,
@@ -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>
@@ -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>
@@ -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)
}) })
@@ -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)
} }
}, },
@@ -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)
} }
}, },
@@ -33,7 +33,7 @@ export default {
try { try {
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)
} }
}, },
+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: {