From da9d338175d8ddde0c00db67235e7044ef66abf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Glasn=C3=A1k?= Date: Tue, 29 Nov 2022 20:17:51 +0100 Subject: [PATCH 1/4] [Teams] Autocomplete input component --- app/src/locales/en.json | 4 - app/src/locales/sk.json | 9 +- .../app/_components/a-delete-task-modal.vue | 54 +++++++++++ .../app/_components/a-delete-team-modal.vue | 50 ++++------ .../plugins/app/_components/a-team-modal.vue | 32 +++++-- .../app/_components/w-autocomplete.vue | 91 +++++++++++++++++++ app/src/plugins/app/_config/main.ts | 16 ++-- app/src/plugins/app/_config/router.ts | 4 +- app/src/plugins/app/_theme/global.sass | 5 +- app/src/plugins/app/_theme/index.sass | 2 + .../plugins/app/_theme/vuetify/v-dialog.sass | 4 + .../plugins/lib@auth/_utils/error.utils.ts | 3 +- .../_components/a-reset-password-form.vue | 4 +- .../_components/a-ongoing-table.vue | 27 +++++- .../_components/a-unscheduled-table.vue | 27 +++++- .../teams/_components/a-teams-table.vue | 49 +++++----- app/src/plugins/w/i18n/index.ts | 2 +- 17 files changed, 293 insertions(+), 90 deletions(-) delete mode 100644 app/src/locales/en.json create mode 100644 app/src/plugins/app/_components/a-delete-task-modal.vue create mode 100644 app/src/plugins/app/_components/w-autocomplete.vue create mode 100644 app/src/plugins/app/_theme/vuetify/v-dialog.sass diff --git a/app/src/locales/en.json b/app/src/locales/en.json deleted file mode 100644 index b7ae363..0000000 --- a/app/src/locales/en.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "Chyba": "", - "Zadali ste neplatný email.": "" -} \ No newline at end of file diff --git a/app/src/locales/sk.json b/app/src/locales/sk.json index f93594f..1a3a939 100644 --- a/app/src/locales/sk.json +++ b/app/src/locales/sk.json @@ -1,4 +1,9 @@ { - "Value is not a valid email address": "Zadali ste neplatný email.", - "error": "chyba" + "Value is not a valid email address": "Zadali ste neplatný email", + "error": "chyba", + "Value is required": "Pole je povinné", + "This field should be at least 8 characters long": "Pole musí obsahovať aspoň 8 znakov", + "This field should be at least 6 characters long": "Pole musí obsahovať aspoň 6 znakov", + "This maximum length allowed is 6": "Pole musí obsahovať 6 znakov", + "The value must be equal to the other value": "Heslá sa nezhodujú" } \ No newline at end of file diff --git a/app/src/plugins/app/_components/a-delete-task-modal.vue b/app/src/plugins/app/_components/a-delete-task-modal.vue new file mode 100644 index 0000000..c1911f5 --- /dev/null +++ b/app/src/plugins/app/_components/a-delete-task-modal.vue @@ -0,0 +1,54 @@ + + + + + \ No newline at end of file diff --git a/app/src/plugins/app/_components/a-delete-team-modal.vue b/app/src/plugins/app/_components/a-delete-team-modal.vue index 1c32920..827e5aa 100644 --- a/app/src/plugins/app/_components/a-delete-team-modal.vue +++ b/app/src/plugins/app/_components/a-delete-team-modal.vue @@ -1,17 +1,17 @@ + + \ No newline at end of file diff --git a/app/src/plugins/app/_config/main.ts b/app/src/plugins/app/_config/main.ts index dc3289d..ba0b7de 100644 --- a/app/src/plugins/app/_config/main.ts +++ b/app/src/plugins/app/_config/main.ts @@ -38,15 +38,8 @@ const options: Options = { ionic: { disabled: false }, - toast: { - disabled: true - }, i18n: { - disabled: true, languages: [ - { - title: 'English', flag: 'en', value: 'en' - }, { title: "Slovenský", flag: "sk", value: "sk" } @@ -57,6 +50,7 @@ const options: Options = { routes: { 'GET v1/auth/info': true, 'POST v1/auth/forgot': true, + 'POST v1/auth/reset': true, 'POST v1/auth/info': true, 'POST v1/auth/invalidate': true, 'POST v1/auth/login': true, @@ -89,17 +83,19 @@ const options: Options = { } } -createApp(App) +const app = createApp(App) .use(router) .use(store) .use(w, options) .use(IonicVue) .use(vuetify) - .use(wToast) - .use(i18n, options) + // .use(wToast) .use(VueCal) .use(loader, { color: '#6200EE' }) .use(vueCal) .mount('#app') + +// @ts-expect-error +export const $t = app.$i18n.t diff --git a/app/src/plugins/app/_config/router.ts b/app/src/plugins/app/_config/router.ts index fed166d..1a60f22 100644 --- a/app/src/plugins/app/_config/router.ts +++ b/app/src/plugins/app/_config/router.ts @@ -61,12 +61,12 @@ const routes: Array = [ { path: '/app/overview/unscheduled', name: 'Overview - Unscheduled tasks', - component: () => import('@/plugins/tm@overview/tasks-ongoing/tasks-ongoing.vue') + component: () => import('@/plugins/tm@overview/tasks-unscheduled/tasks-unscheduled.vue') }, { path: '/app/overview/ongoing', name: 'Overview - Ongoing tasks', - component: () => import('@/plugins/tm@overview/tasks-unscheduled/tasks-unscheduled.vue') + component: () => import('@/plugins/tm@overview/tasks-ongoing/tasks-ongoing.vue') }, { path: '/app/overview/teams', diff --git a/app/src/plugins/app/_theme/global.sass b/app/src/plugins/app/_theme/global.sass index 85c450a..4dd4d99 100644 --- a/app/src/plugins/app/_theme/global.sass +++ b/app/src/plugins/app/_theme/global.sass @@ -18,4 +18,7 @@ th width: 50% .v-card - padding: 35px !important \ No newline at end of file + padding: 35px !important + +.cursor-pointer:hover + cursor: pointer \ No newline at end of file diff --git a/app/src/plugins/app/_theme/index.sass b/app/src/plugins/app/_theme/index.sass index 5965790..32fdbc2 100644 --- a/app/src/plugins/app/_theme/index.sass +++ b/app/src/plugins/app/_theme/index.sass @@ -1,5 +1,7 @@ @import url('https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap') +@import './vuetify/v-dialog' + @import './global' @import '@/plugins/lib@auth/_theme/auth.theme' diff --git a/app/src/plugins/app/_theme/vuetify/v-dialog.sass b/app/src/plugins/app/_theme/vuetify/v-dialog.sass new file mode 100644 index 0000000..e727cf4 --- /dev/null +++ b/app/src/plugins/app/_theme/vuetify/v-dialog.sass @@ -0,0 +1,4 @@ +.v-dialog + h1 + font-size: 22px + font-weight: 300 \ No newline at end of file diff --git a/app/src/plugins/lib@auth/_utils/error.utils.ts b/app/src/plugins/lib@auth/_utils/error.utils.ts index aadad2c..e334f02 100644 --- a/app/src/plugins/lib@auth/_utils/error.utils.ts +++ b/app/src/plugins/lib@auth/_utils/error.utils.ts @@ -1,7 +1,8 @@ +import { $t } from '@/plugins/app/_config/main' export default { parseErrors(errors) { // @ts-expect-error - return Object.values(errors).map(error => error?.$message).join(', ') + return Object.values(errors).map(error => $t(error?.$message)).join('. ') } } \ No newline at end of file diff --git a/app/src/plugins/lib@auth/reset-password/_components/a-reset-password-form.vue b/app/src/plugins/lib@auth/reset-password/_components/a-reset-password-form.vue index 2ab6f3f..1b66e74 100644 --- a/app/src/plugins/lib@auth/reset-password/_components/a-reset-password-form.vue +++ b/app/src/plugins/lib@auth/reset-password/_components/a-reset-password-form.vue @@ -46,8 +46,8 @@ export default { if (!(await this.v$.$validate())) return console.log(this.v$) try { - await this.$axios.post_data('v1/auth/forgot', this.form) - this.$router.push({ name: 'Reset password' }) + await this.$axios.post_data('v1/auth/reset', this.form) + this.$router.push({ name: 'Login' }) } catch (error) { this.$toast.error(error.data.error) } diff --git a/app/src/plugins/tm@overview/tasks-ongoing/_components/a-ongoing-table.vue b/app/src/plugins/tm@overview/tasks-ongoing/_components/a-ongoing-table.vue index cef65fe..a2bff42 100644 --- a/app/src/plugins/tm@overview/tasks-ongoing/_components/a-ongoing-table.vue +++ b/app/src/plugins/tm@overview/tasks-ongoing/_components/a-ongoing-table.vue @@ -19,7 +19,9 @@
pencil-icon - trash-icon + trash-icon + +
@@ -28,12 +30,35 @@ diff --git a/app/src/plugins/tm@overview/tasks-unscheduled/_components/a-unscheduled-table.vue b/app/src/plugins/tm@overview/tasks-unscheduled/_components/a-unscheduled-table.vue index 2c6398b..a9eb9ec 100644 --- a/app/src/plugins/tm@overview/tasks-unscheduled/_components/a-unscheduled-table.vue +++ b/app/src/plugins/tm@overview/tasks-unscheduled/_components/a-unscheduled-table.vue @@ -17,7 +17,9 @@
pencil-icon - trash-icon + trash-icon + +
@@ -26,12 +28,35 @@ diff --git a/app/src/plugins/tm@overview/teams/_components/a-teams-table.vue b/app/src/plugins/tm@overview/teams/_components/a-teams-table.vue index 6babc53..c6998a2 100644 --- a/app/src/plugins/tm@overview/teams/_components/a-teams-table.vue +++ b/app/src/plugins/tm@overview/teams/_components/a-teams-table.vue @@ -12,22 +12,10 @@ {{ team.name }}
- pencil-icon - trash-icon - + pencil-icon + trash-icon + +
@@ -36,24 +24,35 @@ diff --git a/app/src/plugins/w/i18n/index.ts b/app/src/plugins/w/i18n/index.ts index 2c50ec7..a00f928 100644 --- a/app/src/plugins/w/i18n/index.ts +++ b/app/src/plugins/w/i18n/index.ts @@ -19,4 +19,4 @@ export default { app.use(i18n.vendorI18n) app.config.globalProperties.$w18n = i18n } -} +} \ No newline at end of file From e881020f86004af2926107261a8b3067c0c20cb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Glasn=C3=A1k?= Date: Tue, 29 Nov 2022 20:28:34 +0100 Subject: [PATCH 2/4] [Teams] Autocomplete input component --- app/src/plugins/app/_components/w-autocomplete.vue | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/plugins/app/_components/w-autocomplete.vue b/app/src/plugins/app/_components/w-autocomplete.vue index 608a4cb..e5f1c63 100644 --- a/app/src/plugins/app/_components/w-autocomplete.vue +++ b/app/src/plugins/app/_components/w-autocomplete.vue @@ -7,7 +7,7 @@ @keydown.enter="optionSelected()" /> -
+
{{ suggestion._suggestionHiddenPart }} {{ suggestion._suggestionShownPart }}
@@ -36,7 +36,7 @@ export default { const normalizedSearch = this._normalize(this.search) if (!normalizedSearch.length || !this.options.length) - return '' + return null const filteredOptions = this.options.filter(option => { const normalizedValue = this._normalize(option.value) @@ -45,7 +45,7 @@ export default { }) if (!filteredOptions[0]) - return '' + return null const suggestion = { ...filteredOptions[0], @@ -60,6 +60,9 @@ export default { methods: { optionSelected() { + if (!this.suggestion) + return + this.$emit('option-selected', this.suggestion) this.search = '' }, From 7a336d5d1f644ae70798e1084260cad69c75d342 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Glasn=C3=A1k?= Date: Tue, 29 Nov 2022 21:21:49 +0100 Subject: [PATCH 3/4] [Header] Refactoring --- .../app/_layout/app/_components/a-header.vue | 217 +++++++----------- app/src/plugins/app/_theme/global.sass | 5 +- 2 files changed, 82 insertions(+), 140 deletions(-) diff --git a/app/src/plugins/app/_layout/app/_components/a-header.vue b/app/src/plugins/app/_layout/app/_components/a-header.vue index e7dd618..63c6832 100644 --- a/app/src/plugins/app/_layout/app/_components/a-header.vue +++ b/app/src/plugins/app/_layout/app/_components/a-header.vue @@ -1,98 +1,59 @@ \ No newline at end of file + background-color: rgba(0, 0, 0, var(--v-hover-opacity)) + cursor: pointer + +@media (max-width: 991px) + .menu-icon + display: block !important + + h1 + display: none + + .employee-name + display: none + diff --git a/app/src/plugins/app/_theme/global.sass b/app/src/plugins/app/_theme/global.sass index 4dd4d99..b56899d 100644 --- a/app/src/plugins/app/_theme/global.sass +++ b/app/src/plugins/app/_theme/global.sass @@ -21,4 +21,7 @@ th padding: 35px !important .cursor-pointer:hover - cursor: pointer \ No newline at end of file + cursor: pointer + +.hover-background:hover + background-color: rgba(0, 0, 0, var(--v-hover-opacity)) From 7dee1c8283afe3e5d798ceb9d3eb5d45719c360e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Glasn=C3=A1k?= Date: Tue, 29 Nov 2022 21:30:29 +0100 Subject: [PATCH 4/4] . --- app/src/plugins/app/_config/router.ts | 6 ++++++ app/src/plugins/app/_layout/app/_components/a-header.vue | 2 +- app/src/plugins/app/_layout/app/_components/a-sidemenu.vue | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/plugins/app/_config/router.ts b/app/src/plugins/app/_config/router.ts index 1a60f22..5e516fa 100644 --- a/app/src/plugins/app/_config/router.ts +++ b/app/src/plugins/app/_config/router.ts @@ -45,32 +45,38 @@ const routes: Array = [ { path: '/app/dashboard/tasks', name: 'Dashboard - Tasks', + meta: { title: 'Úlohy' }, component: () => import('@/plugins/tm@dashboard/tasks/tasks.vue') }, { path: '/app/dashboard/teams', name: 'Dashboard - Teams', + meta: { title: 'Tímové zobrazenie' }, component: () => import('@/plugins/tm@dashboard/teams/teams.vue') }, { path: '/app/dashboard/projects', name: 'Dashboard - Projects', + meta: { title: 'Projektové zobrazenie' }, component: () => import('@/plugins/tm@dashboard/projects/projects.vue') }, { path: '/app/overview/unscheduled', name: 'Overview - Unscheduled tasks', + meta: { title: 'Nenaplánované úlohy' }, component: () => import('@/plugins/tm@overview/tasks-unscheduled/tasks-unscheduled.vue') }, { path: '/app/overview/ongoing', name: 'Overview - Ongoing tasks', + meta: { title: 'Prebiehajúce úlohy' }, component: () => import('@/plugins/tm@overview/tasks-ongoing/tasks-ongoing.vue') }, { path: '/app/overview/teams', name: 'Overview - Teams', + meta: { title: 'Tímy' }, component: () => import('@/plugins/tm@overview/teams/teams.vue') } ] diff --git a/app/src/plugins/app/_layout/app/_components/a-header.vue b/app/src/plugins/app/_layout/app/_components/a-header.vue index 63c6832..d3da875 100644 --- a/app/src/plugins/app/_layout/app/_components/a-header.vue +++ b/app/src/plugins/app/_layout/app/_components/a-header.vue @@ -3,7 +3,7 @@
-

{{ $route.name }}

+

{{ $route.meta.title }}

search-icon diff --git a/app/src/plugins/app/_layout/app/_components/a-sidemenu.vue b/app/src/plugins/app/_layout/app/_components/a-sidemenu.vue index b3c0884..5884e0f 100644 --- a/app/src/plugins/app/_layout/app/_components/a-sidemenu.vue +++ b/app/src/plugins/app/_layout/app/_components/a-sidemenu.vue @@ -34,7 +34,7 @@ export default { pageName: 'Overview - Unscheduled tasks' }, { - title: 'Ongoing tasky', + title: 'Prebiehajúce úlohy', pageName: 'Overview - Ongoing tasks' }, {