diff --git a/app/package-lock.json b/app/package-lock.json index 0db4b55..7913c87 100644 --- a/app/package-lock.json +++ b/app/package-lock.json @@ -18,7 +18,7 @@ "@vuelidate/core": "^2.0.0", "@vuelidate/validators": "^2.0.0", "@vuepic/vue-datepicker": "^3.6.0", - "@vueup/vue-quill": "^1.0.1", + "@vueup/vue-quill": "^1.0.0-beta.11", "axios": "^1.1.3", "axios-auth-refresh": "^3.3.4", "core-js": "^3.8.3", @@ -3481,9 +3481,9 @@ } }, "node_modules/@vueup/vue-quill": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@vueup/vue-quill/-/vue-quill-1.0.1.tgz", - "integrity": "sha512-/VJHwUxH2BAms7gwIlNhHb0KfCqn/58onOK1H0ZZX9juEha4nrb32yZbv2xLsqLxf+JKsNbJgQ8Ne6VF8ACNGw==", + "version": "1.0.0-beta.11", + "resolved": "https://registry.npmjs.org/@vueup/vue-quill/-/vue-quill-1.0.0-beta.11.tgz", + "integrity": "sha512-TeCgXPyVbN5muBPKm3EZjmIg/s8R8O0YmTp0RRG4J48skJVe035scLjeWZTDVrt/TEagmzcRUcB+9nPIyvF9fQ==", "dependencies": { "quill": "^1.3.7", "quill-delta": "^4.2.2" @@ -16417,9 +16417,9 @@ } }, "@vueup/vue-quill": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@vueup/vue-quill/-/vue-quill-1.0.1.tgz", - "integrity": "sha512-/VJHwUxH2BAms7gwIlNhHb0KfCqn/58onOK1H0ZZX9juEha4nrb32yZbv2xLsqLxf+JKsNbJgQ8Ne6VF8ACNGw==", + "version": "1.0.0-beta.11", + "resolved": "https://registry.npmjs.org/@vueup/vue-quill/-/vue-quill-1.0.0-beta.11.tgz", + "integrity": "sha512-TeCgXPyVbN5muBPKm3EZjmIg/s8R8O0YmTp0RRG4J48skJVe035scLjeWZTDVrt/TEagmzcRUcB+9nPIyvF9fQ==", "requires": { "quill": "^1.3.7", "quill-delta": "^4.2.2" diff --git a/app/package.json b/app/package.json index 33f8fb8..ccc7ce2 100644 --- a/app/package.json +++ b/app/package.json @@ -18,7 +18,7 @@ "@vuelidate/core": "^2.0.0", "@vuelidate/validators": "^2.0.0", "@vuepic/vue-datepicker": "^3.6.0", - "@vueup/vue-quill": "^1.0.1", + "@vueup/vue-quill": "^1.0.0-beta.11", "axios": "^1.1.3", "axios-auth-refresh": "^3.3.4", "core-js": "^3.8.3", diff --git a/app/src/plugins/app/_config/App.vue b/app/src/plugins/app/_config/App.vue index 6de527d..8135608 100644 --- a/app/src/plugins/app/_config/App.vue +++ b/app/src/plugins/app/_config/App.vue @@ -10,12 +10,12 @@ - + - + diff --git a/app/src/plugins/tm@_components/z-files-upload.vue b/app/src/plugins/tm@_components/z-files-upload.vue index 700472b..2156398 100644 --- a/app/src/plugins/tm@_components/z-files-upload.vue +++ b/app/src/plugins/tm@_components/z-files-upload.vue @@ -8,16 +8,16 @@ NAHRAŤ -
+
{{ file.name }} - +
@@ -28,20 +28,32 @@ export default { emit: ['files-uploaded'], - data() { - return { - files: [], - } - }, + props: { + files: { + type: Array, + default: () => [] + } + }, + + data() { + return { + uploadedFiles: [] + } + }, + + created() { + this.uploadedFiles = this.files + console.log(this.uploadedFiles) + }, methods: { onChange() { - this.files = [...this.files, ...this.$refs.fileUpload.files] - this.$emit('files-uploaded', this.files) + this.uploadedFiles = [...this.uploadedFiles, ...this.$refs.fileUpload.files] + this.$emit('files-uploaded', this.uploadedFiles) }, remove(index) { - this.files.splice(index, 1) + this.uploadedFiles.splice(index, 1) }, }, } diff --git a/app/src/plugins/tm@_utils/tm.utils.ts b/app/src/plugins/tm@_utils/tm.utils.ts index 2fad043..bdb2afe 100644 --- a/app/src/plugins/tm@_utils/tm.utils.ts +++ b/app/src/plugins/tm@_utils/tm.utils.ts @@ -13,7 +13,7 @@ export default { return moment(date).isBefore(moment(compareTo)) }, - isAfter(date, compareTo = null) { + isAfter(date, compareTo = moment()) { return moment(date).isAfter(moment(compareTo)) } } \ No newline at end of file diff --git a/app/src/plugins/tm@dashboard/_components/z-timeline.vue b/app/src/plugins/tm@dashboard/_components/z-timeline.vue index a723dab..63bc559 100644 --- a/app/src/plugins/tm@dashboard/_components/z-timeline.vue +++ b/app/src/plugins/tm@dashboard/_components/z-timeline.vue @@ -196,7 +196,7 @@ export default { } else { event.completed = !event.completed try { - await this.$axios.patch_auth(`v1/tasks/${event.id}`, event) + await this.$axios.patch_auth(`v1/subtasks/${event.id}`, event) this.$emit('reopenTask', event) } catch (error) { this.$toast.error(error) diff --git a/app/src/plugins/tm@dashboard/projects/_components/a-project-calendar.vue b/app/src/plugins/tm@dashboard/projects/_components/a-project-calendar.vue index 1708be3..004e244 100644 --- a/app/src/plugins/tm@dashboard/projects/_components/a-project-calendar.vue +++ b/app/src/plugins/tm@dashboard/projects/_components/a-project-calendar.vue @@ -86,7 +86,8 @@ export default { background: unset &:deep(.fc-day-today) background: white - a + + .fc-daygrid-day-top a background: #3700B3 width: 28px color: white diff --git a/app/src/plugins/tm@dashboard/projects/_components/a-project-filter.vue b/app/src/plugins/tm@dashboard/projects/_components/a-project-filter.vue index feceb00..f0a627f 100644 --- a/app/src/plugins/tm@dashboard/projects/_components/a-project-filter.vue +++ b/app/src/plugins/tm@dashboard/projects/_components/a-project-filter.vue @@ -1,6 +1,6 @@ diff --git a/app/src/plugins/tm@modal/team/z-team-modal.vue b/app/src/plugins/tm@modal/team/z-team-modal.vue index 8e96329..e578c78 100644 --- a/app/src/plugins/tm@modal/team/z-team-modal.vue +++ b/app/src/plugins/tm@modal/team/z-team-modal.vue @@ -48,6 +48,7 @@
response.data) .catch(error => Promise.reject(error)) }, @@ -42,14 +42,14 @@ export default { async post_auth(url: string, params = null, config?: any) { config = this._config(config) - return axios.post(url, {data: params}, config) + return axios.post(url, params, config) .then(response => response.data) .catch(error => Promise.reject(error)) }, async post_data(url: string, params = null, config?: any) { - return axios.post(url, {data: params}, config) + return axios.post(url, params, config) .then(response => response.data.data) .catch(error => Promise.reject(error.response || error)) }, @@ -57,7 +57,7 @@ export default { async post_auth_data(url: string, params = null, config?: any) { config = this._config(config) - return axios.post(url, {data: params}, config) + return axios.post(url, params, config) .then(response => response.data.data) .catch(error => Promise.reject(error.response || error)) }, @@ -91,7 +91,7 @@ export default { }, async patch(url: string, params = null, config?: any) { - return axios.patch(url, {data: params}, config) + return axios.patch(url, params, config) .then(response => response.data) .catch(error => Promise.reject(error)) }, @@ -99,13 +99,13 @@ export default { async patch_auth(url: string, params = null, config?: any) { config = this._config(config) - return axios.patch(url, {data: params}, config) + return axios.patch(url, params, config) .then(response => response.data) .catch(error => Promise.reject(error)) }, async patch_data(url: string, params = null, config?: any) { - return axios.patch(url, {data: params}, config) + return axios.patch(url, params, config) .then(response => response.data.data) .catch(error => Promise.reject(error.response || error)) }, @@ -113,13 +113,13 @@ export default { async patch_auth_data(url: string, params = null, config?: any) { config = this._config(config) - return axios.patch(url, {data: params}, config) + return axios.patch(url, params, config) .then(response => response.data.data) .catch(error => Promise.reject(error.response || error)) }, async put(url: string, params = null, config?: any) { - return axios.put(url, {data: params}, config) + return axios.put(url, params, config) .then(response => response.data) .catch(error => Promise.reject(error)) }, @@ -133,7 +133,7 @@ export default { }, async put_data(url: string, params = null, config?: any) { - return axios.put(url, {data: params}, config) + return axios.put(url, params, config) .then(response => response.data.data) .catch(error => Promise.reject(error.response || error)) }, @@ -141,7 +141,7 @@ export default { async put_auth_data(url: string, params = null, config?: any) { config = this._config(config) - return axios.put(url, {data: params}, config) + return axios.put(url, params, config) .then(response => response.data.data) .catch(error => Promise.reject(error.response || error)) }, diff --git a/app/src/plugins/w/toast/utils/toast.utils.ts b/app/src/plugins/w/toast/utils/toast.utils.ts index 1149fe5..06b6d38 100644 --- a/app/src/plugins/w/toast/utils/toast.utils.ts +++ b/app/src/plugins/w/toast/utils/toast.utils.ts @@ -1,34 +1,43 @@ +import { $t } from '@/plugins/app/_config/main' + export default { parseAndTranslate(data) { const errorsArray = this._parseToArrayOfStrings(data) - return errorsArray.map(error => this._translate(error)) + + // console.log(errorsArray.map(error => $t(error))) + return errorsArray.join(', ') + + // return errorsArray.map(error => $t(error)) }, _parseToArrayOfStrings(data) { if (typeof data == 'string') { - return [this._translate(data)] + return [$t(data)] } - + + if (data?.response?.data) + return Object.values(data?.response?.data) + if (data && data.error && typeof data.error == 'string') { - return [this._translate(data.error)] + return [$t(data.error)] } - + if (data && data.error && typeof data.error == 'object') { - return Object.values(this._translate(data.error)) + return Object.values($t(data.error)) } - + if (data.data && data.data.error && typeof data.data.error == 'string') { - return [this._translate(data.data.error)] + return [$t(data.data.error)] } - + if (data && data.data && data.data.error && typeof data.data.error == 'object') { - return Object.values(data.data.error).map(error => this._translate(error[0]) + ' ') + return Object.values(data.data.error).map(error => $t(error[0]) + ' ') } - + if (data.statusText) { - return [this._translate(data.statusText)] + return [$t(data.statusText)] } return [data] diff --git a/app/src/plugins/w@custom/axios/models/axios.ts b/app/src/plugins/w@custom/axios/models/axios.ts index affb14c..4dcf821 100644 --- a/app/src/plugins/w@custom/axios/models/axios.ts +++ b/app/src/plugins/w@custom/axios/models/axios.ts @@ -1,5 +1,6 @@ import axios from 'axios' import store from '@/store' +import toastUtils from '@/plugins/w/toast/utils/toast.utils' axios.defaults.baseURL = process.env.VUE_APP_WAXIOS_URL @@ -7,7 +8,7 @@ export default { async get(url: string, config?: any) { return axios.get(url, config) .then(response => response.data) - .catch(error => Promise.reject(error)) + .catch(error => Promise.reject(toastUtils.parseAndTranslate(error))) }, async get_auth(url: string, config?: any) { @@ -15,13 +16,13 @@ export default { return axios.get(url, config) .then(response => response.data) - .catch(error => Promise.reject(error)) + .catch(error => Promise.reject(toastUtils.parseAndTranslate(error))) }, async get_data(url: string, config?: any) { return axios.get(url, config) .then(response => response.data.data) - .catch(error => Promise.reject(error.response || error)) + .catch(error => Promise.reject(toastUtils.parseAndTranslate(error.response || error))) }, async get_auth_data(url: string, config?: any) { @@ -29,14 +30,14 @@ export default { return axios.get(url, config) .then(response => Promise.resolve(response.data.data)) - .catch(error => Promise.reject(error.response || error)) + .catch(error => Promise.reject(toastUtils.parseAndTranslate(error.response || error))) }, async post(url: string, params = null, config?: any) { return axios.post(url, this._objectToFormData(params), config) .then(response => response.data) - .catch(error => Promise.reject(error)) + .catch(error => Promise.reject(toastUtils.parseAndTranslate(error))) }, async post_auth(url: string, params = null, config?: any) { @@ -44,14 +45,14 @@ export default { return axios.post(url, this._objectToFormData(params), config) .then(response => response.data) - .catch(error => Promise.reject(error)) + .catch(error => Promise.reject(toastUtils.parseAndTranslate(error))) }, async post_data(url: string, params = null, config?: any) { return axios.post(url, this._objectToFormData(params), config) .then(response => response.data.data) - .catch(error => Promise.reject(error.response || error)) + .catch(error => Promise.reject(toastUtils.parseAndTranslate(error.response || error))) }, async post_auth_data(url: string, params = null, config?: any) { @@ -59,13 +60,13 @@ export default { return axios.post(url, this._objectToFormData(params), config) .then(response => response.data.data) - .catch(error => Promise.reject(error.response || error)) + .catch(error => Promise.reject(toastUtils.parseAndTranslate(error.response || error))) }, async delete(url: string, config?: any) { return axios.delete(url, config) .then(response => response.data) - .catch(error => Promise.reject(error)) + .catch(error => Promise.reject(toastUtils.parseAndTranslate(error))) }, async delete_auth(url: string, config?: any) { @@ -73,13 +74,13 @@ export default { return axios.delete(url, config) .then(response => response.data) - .catch(error => Promise.reject(error)) + .catch(error => Promise.reject(toastUtils.parseAndTranslate(error))) }, async delete_data(url: string, config?: any) { return axios.delete(url, config) .then(response => response.data.data) - .catch(error => Promise.reject(error.response || error)) + .catch(error => Promise.reject(toastUtils.parseAndTranslate(error.response || error))) }, async delete_auth_data(url: string, config?: any) { @@ -87,13 +88,13 @@ export default { return axios.delete(url, config) .then(response => response.data.data) - .catch(error => Promise.reject(error.response || error)) + .catch(error => Promise.reject(toastUtils.parseAndTranslate(error.response || error))) }, async patch(url: string, params = null, config?: any) { return axios.patch(url, this._objectToFormData(params), config) .then(response => response.data) - .catch(error => Promise.reject(error)) + .catch(error => Promise.reject(toastUtils.parseAndTranslate(error))) }, async patch_auth(url: string, params = null, config?: any) { @@ -101,13 +102,13 @@ export default { return axios.patch(url, this._objectToFormData(params), config) .then(response => response.data) - .catch(error => Promise.reject(error)) + .catch(error => Promise.reject(toastUtils.parseAndTranslate(error))) }, async patch_data(url: string, params = null, config?: any) { return axios.patch(url, this._objectToFormData(params), config) .then(response => response.data.data) - .catch(error => Promise.reject(error.response || error)) + .catch(error => Promise.reject(toastUtils.parseAndTranslate(error.response || error))) }, async patch_auth_data(url: string, params = null, config?: any) { @@ -115,13 +116,13 @@ export default { return axios.patch(url, this._objectToFormData(params), config) .then(response => response.data.data) - .catch(error => Promise.reject(error.response || error)) + .catch(error => Promise.reject(toastUtils.parseAndTranslate(error.response || error))) }, async put(url: string, params = null, config?: any) { return axios.put(url, this._objectToFormData(params), config) .then(response => response.data) - .catch(error => Promise.reject(error)) + .catch(error => Promise.reject(toastUtils.parseAndTranslate(error))) }, async put_auth(url: string, params = null, config?: any) { @@ -129,21 +130,21 @@ export default { return axios.put(url, this._objectToFormData(params), config) .then(response => response.data) - .catch(error => Promise.reject(error)) + .catch(error => Promise.reject(toastUtils.parseAndTranslate(error))) }, async put_data(url: string, params = null, config?: any) { return axios.put(url, this._objectToFormData(params), config) .then(response => response.data.data) - .catch(error => Promise.reject(error.response || error)) + .catch(error => Promise.reject(toastUtils.parseAndTranslate(error.response || error))) }, async put_auth_data(url: string, params = null, config?: any) { config = this._config(config) - return axios.put(url, this._objectToFormData(params), config) + return axios.put(url, {data: params}, config) .then(response => response.data.data) - .catch(error => Promise.reject(error.response || error)) + .catch(error => Promise.reject(toastUtils.parseAndTranslate(error.response || error))) }, _config(config: any) {