From 36322f75988ed85f61055f713e9e8492e1abb283 Mon Sep 17 00:00:00 2001 From: Mariana Date: Thu, 14 Mar 2024 16:23:07 -0300 Subject: [PATCH 1/8] feat: Add pinia and adjust some lint errors --- package.json | 4 +- src/main.js | 196 +++++++++---------- src/router/index.js | 110 +++++------ src/store/modules/actions.js | 10 +- src/store/modules/getters.js | 8 +- src/store/modules/mutations.js | 14 +- vite.config.js | 10 +- yarn.lock | 339 ++++++++++++++++++--------------- 8 files changed, 359 insertions(+), 332 deletions(-) diff --git a/package.json b/package.json index a97f2b4..39b5425 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "vue": "^3.3.11", "vue-awesome-swiper": "^5.0.1", "vue-router": "^4.2.5", - "vuex": "^4.1.0" + "pinia": "^2.1.7" }, "devDependencies": { "@rushstack/eslint-patch": "^1.3.3", @@ -39,4 +39,4 @@ "vite": "^5.0.10", "vue-eslint-parser": "^9.4.2" } -} \ No newline at end of file +} diff --git a/src/main.js b/src/main.js index 8b260a9..f0c35c3 100644 --- a/src/main.js +++ b/src/main.js @@ -1,96 +1,100 @@ -import { createApp } from "vue"; -import App from './App.vue' -import router from './router' -import store from './store' -import VueAwesomeSwiper from 'vue-awesome-swiper' -import LogRocket from 'logrocket'; - -import Unnnic from './utils/plugins/UnnnicSystem'; - -// import style (>= Swiper 6.x) -import 'swiper/swiper-bundle.css' - -import getEnv from './utils/env' - -LogRocket.init(getEnv('VUE_APP_LOGROCKET_ID'), { - mergeIframes: true, - parentDomain: getEnv('VUE_APP_PARENT_DOMAIN'), -}); - -const app = createApp(App); - -app.use(router); -app.use(store); -app.use(VueAwesomeSwiper); -app.use(Unnnic); - -app.mount("#app"); -function enableLinkTranslations() { - let connectBaseURL = ''; - - function translateAllLinks() { - if (!connectBaseURL) { - return; - } - document.querySelectorAll('a[href]').forEach((link) => { - const internalHref = - link.getAttribute('internal-href') || link.getAttribute('href'); - if ( - ['http://', 'https://'].some((initial) => - internalHref.startsWith(initial) - ) - ) { - return; - } - const dashHref = connectBaseURL + internalHref; - if (link.translateLinkConnect) { - if (link.getAttribute('href') === dashHref) { - return; - } - link.removeEventListener('click', link.translateLinkConnect); - } - link.setAttribute('internal-href', internalHref); - link.setAttribute('href', dashHref); - link.addEventListener( - 'click', - (link.translateLinkConnect = () => { - if (link.getAttribute('target') !== '_blank') { - link.setAttribute('href', internalHref); - setTimeout(() => { - link.setAttribute('href', dashHref); - }, 0); - } - }) - ); - }); - } - function initializeObserver() { - const targetNode = document.getElementById('pageBody'); - const config = { attributes: true, childList: true, subtree: true }; - const callback = function (mutationList) { - mutationList.forEach((mutation) => { - if (mutation.type === 'childList') { - translateAllLinks(); - } - }); - }; - const observer = new MutationObserver(callback); - observer.observe(targetNode, config); - } - window.addEventListener('message', (event) => { - const eventName = event.data && event.data.event; - if (eventName === 'setConnectBaseURL') { - connectBaseURL = event.data.connectBaseURL; - translateAllLinks(); - initializeObserver(); - } - }); - window.parent.postMessage( - { - event: 'getConnectBaseURL', - }, - '*' - ); -} - -enableLinkTranslations(); +import { createApp } from 'vue'; +import { createPinia } from 'pinia'; +import App from './App.vue'; +import router from './router'; +import store from './store'; +import VueAwesomeSwiper from 'vue-awesome-swiper'; +import LogRocket from 'logrocket'; + +import Unnnic from './utils/plugins/UnnnicSystem'; + +// import style (>= Swiper 6.x) +import 'swiper/swiper-bundle.css'; + +import getEnv from './utils/env'; + +LogRocket.init(getEnv('VUE_APP_LOGROCKET_ID'), { + mergeIframes: true, + parentDomain: getEnv('VUE_APP_PARENT_DOMAIN'), +}); + +const app = createApp(App); + +const pinia = createPinia(); + +app.use(router); +app.use(store); +app.use(pinia); +app.use(VueAwesomeSwiper); +app.use(Unnnic); + +app.mount('#app'); +function enableLinkTranslations() { + let connectBaseURL = ''; + + function translateAllLinks() { + if (!connectBaseURL) { + return; + } + document.querySelectorAll('a[href]').forEach((link) => { + const internalHref = + link.getAttribute('internal-href') || link.getAttribute('href'); + if ( + ['http://', 'https://'].some((initial) => + internalHref.startsWith(initial), + ) + ) { + return; + } + const dashHref = connectBaseURL + internalHref; + if (link.translateLinkConnect) { + if (link.getAttribute('href') === dashHref) { + return; + } + link.removeEventListener('click', link.translateLinkConnect); + } + link.setAttribute('internal-href', internalHref); + link.setAttribute('href', dashHref); + link.addEventListener( + 'click', + (link.translateLinkConnect = () => { + if (link.getAttribute('target') !== '_blank') { + link.setAttribute('href', internalHref); + setTimeout(() => { + link.setAttribute('href', dashHref); + }, 0); + } + }), + ); + }); + } + function initializeObserver() { + const targetNode = document.getElementById('pageBody'); + const config = { attributes: true, childList: true, subtree: true }; + const callback = function (mutationList) { + mutationList.forEach((mutation) => { + if (mutation.type === 'childList') { + translateAllLinks(); + } + }); + }; + const observer = new MutationObserver(callback); + observer.observe(targetNode, config); + } + window.addEventListener('message', (event) => { + const eventName = event.data && event.data.event; + if (eventName === 'setConnectBaseURL') { + connectBaseURL = event.data.connectBaseURL; + translateAllLinks(); + initializeObserver(); + } + }); + window.parent.postMessage( + { + event: 'getConnectBaseURL', + }, + '*', + ); +} + +enableLinkTranslations(); diff --git a/src/router/index.js b/src/router/index.js index 4fc9d6f..c2b67f1 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,5 +1,4 @@ -import Vue from 'vue' -import VueRouter from 'vue-router' +import { createRouter, createWebHistory } from 'vue-router'; import ClassPage from '@/views/ClassPage.vue'; import ClassesListAll from '@/views/ClassesListAll.vue'; import Home from '@/views/Home.vue'; @@ -7,64 +6,56 @@ import Onboarding from '@/views/Onboarding.vue'; import store from '@/store'; -Vue.use(VueRouter) - -const routes = [ - { - path: '/', - redirect: { - name: 'Home', - params: { - module_id: 1, +const router = createRouter({ + history: createWebHistory(), + routes: [ + { + path: '/', + redirect: { + name: 'Home', + params: { + module_id: 1, + }, }, }, - }, - { - path: '/module/:module_id', - name: 'Home', - component: Home - }, - { - path: '/onboarding', - name: 'Onboarding', - component: Onboarding - }, - { - path: '/module/:module_id/category/:id_category/class/:id_class', - name: 'ClassPage', - component: ClassPage - }, - { - path: '/module/:module_id/category/:id_category', - name: 'ClassesListAll', - component: ClassesListAll, - }, - { - path: '/loginexternal/:token/', - name: 'externalLogin', - component: null, - beforeEnter: async (to, from, next) => { - const { token } = to.params; - store.dispatch('externalLogin', token.replace('+', ' ')); - - await store.dispatch('fetchModules'); - - if (to.query.next) { - next(to.query.next); - } else { - next('/onboarding'); - - //TO-DO HANDLE ERROR - } + { + path: '/module/:module_id', + name: 'Home', + component: Home, }, - } -] - -const router = new VueRouter({ - mode: 'history', - routes -}) - + { + path: '/onboarding', + name: 'Onboarding', + component: Onboarding, + }, + { + path: '/module/:module_id/category/:id_category/class/:id_class', + name: 'ClassPage', + component: ClassPage, + }, + { + path: '/module/:module_id/category/:id_category', + name: 'ClassesListAll', + component: ClassesListAll, + }, + { + path: '/loginexternal/:token/', + name: 'externalLogin', + component: null, + beforeEnter: async (to, from, next) => { + const { token } = to.params; + store.dispatch('externalLogin', token.replace('+', ' ')); + await store.dispatch('fetchModules'); + if (to.query.next) { + next(to.query.next); + } else { + next('/onboarding'); + //TO-DO HANDLE ERROR + } + }, + }, + ], +}); router.afterEach(async () => { window.parent.postMessage( { @@ -73,6 +64,5 @@ router.afterEach(async () => { }, '*', ); -}) - -export default router +}); +export default router; diff --git a/src/store/modules/actions.js b/src/store/modules/actions.js index 06fbb39..d53c3be 100644 --- a/src/store/modules/actions.js +++ b/src/store/modules/actions.js @@ -1,4 +1,4 @@ -import { api } from "@/services/api"; +import { api } from '@/services/api'; export default { async fetchModules({ commit }) { @@ -53,20 +53,20 @@ export default { } }, - async toggleCheckClass({ commit, getters }, {classID, value}) { + async toggleCheckClass({ commit, getters }, { classID, value }) { commit('TOGGLE_CHECK_CLASS_REQUEST', { value, getters }); try { const { data } = await api.patch(`classes/${classID}/update_watched/`, { - watched: value + watched: value, }); commit('TOGGLE_CHECK_CLASS__SUCCESS', data.watched_percentage); } catch (error) { commit('TOGGLE_CHECK_CLASS_ERROR', { error, getters, value }); } - } + }, // setCurrentModule({ commit }, moduleID){ // commit('SET_CURRENT_MODULE', module) // } -} \ No newline at end of file +}; diff --git a/src/store/modules/getters.js b/src/store/modules/getters.js index 70abad6..07e9cc6 100644 --- a/src/store/modules/getters.js +++ b/src/store/modules/getters.js @@ -1,10 +1,10 @@ import router from '@/router'; export default { - currentModule(state){ + currentModule(state) { const id = router.app.$route.params.module_id; - return state.modules.find((item)=> { + return state.modules.find((item) => { return item.id == id; }); }, @@ -30,12 +30,12 @@ export default { }, getTotalCompletedClasses(state, getters) { const category = getters.currentCategory; - + const number = category?.class_set.reduce((acumulator, lesson) => { if (lesson.lesson_monitoring.watched) acumulator++; return acumulator; }, 0); return number; - } + }, }; diff --git a/src/store/modules/mutations.js b/src/store/modules/mutations.js index c146673..1b15d2c 100644 --- a/src/store/modules/mutations.js +++ b/src/store/modules/mutations.js @@ -2,7 +2,7 @@ export default { MODULES_REQUEST: (state) => (state.loadingModules = true), MODULES__SUCCESS: (state, modules) => { state.loadingModules = false; - state.modules = modules + state.modules = modules; }, MODULES_ERROR: (state, profileError) => { state.error = profileError; @@ -11,7 +11,7 @@ export default { SINGLE_MODULE_REQUEST: (state) => (state.loadingSingleModule = true), SINGLE_MODULE__SUCCESS: (state, module) => { state.loadingSingleModule = false; - state.currentModule = module + state.currentModule = module; }, SINGLE_MODULE_ERROR: (state, profileError) => { state.error = profileError; @@ -28,14 +28,14 @@ export default { }, TOGGLE_CHECK_CLASS__SUCCESS: (state, watched_percentage) => { state.loadingToggleCurrentClass = false; - state.modules - .find( mod => mod.id === state.currentModule.id ) - .watched_percentage = watched_percentage; - state.currentModule.watched_percentage = watched_percentage + state.modules.find( + (mod) => mod.id === state.currentModule.id, + ).watched_percentage = watched_percentage; + state.currentModule.watched_percentage = watched_percentage; }, TOGGLE_CHECK_CLASS_ERROR: (state, { error, getters, value }) => { state.error = error; state.loadingSingleModule = false; getters.currentClass.lesson_monitoring.watched = !value; }, -} \ No newline at end of file +}; diff --git a/vite.config.js b/vite.config.js index c3ba988..7af8629 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,6 +1,6 @@ -import { fileURLToPath, URL } from "node:url"; -import { defineConfig } from "vite"; -import vue from "@vitejs/plugin-vue"; +import { fileURLToPath, URL } from 'node:url'; +import { defineConfig } from 'vite'; +import vue from '@vitejs/plugin-vue'; // https://vitejs.dev/config/ export default defineConfig({ plugins: [vue()], @@ -15,7 +15,7 @@ export default defineConfig({ }, resolve: { alias: { - "@": fileURLToPath(new URL("./src", import.meta.url)), + '@': fileURLToPath(new URL('./src', import.meta.url)), }, }, -}); \ No newline at end of file +}); diff --git a/yarn.lock b/yarn.lock index 8dac17d..1b9c579 100644 --- a/yarn.lock +++ b/yarn.lock @@ -36,7 +36,7 @@ chalk "^2.4.2" js-tokens "^4.0.0" -"@babel/parser@^7.23.5", "@babel/parser@^7.23.9": +"@babel/parser@^7.23.9": version "7.24.0" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.24.0.tgz#26a3d1ff49031c53a97d03b604375f028746a9ac" integrity sha512-QuP/FxEAzMSjXygs8v4N9dvdXzEHN4W1oF3PxuWAtPo08UdM17u89RDMgjLn/mlc56iM0HlLmVkO/wgR+rDgHg== @@ -197,6 +197,27 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== +"@intlify/core-base@9.10.1": + version "9.10.1" + resolved "https://registry.yarnpkg.com/@intlify/core-base/-/core-base-9.10.1.tgz#e61d507d35beb0c69f9c94566313f9520c25a84a" + integrity sha512-0+Wtjj04GIyglh5KKiNjRwgjpHrhqqGZhaKY/QVjjogWKZq5WHROrTi84pNVsRN18QynyPmjtsVUWqFKPQ45xQ== + dependencies: + "@intlify/message-compiler" "9.10.1" + "@intlify/shared" "9.10.1" + +"@intlify/message-compiler@9.10.1": + version "9.10.1" + resolved "https://registry.yarnpkg.com/@intlify/message-compiler/-/message-compiler-9.10.1.tgz#d70c9ec211dab67d50a42ad1fb782c0e02f89c42" + integrity sha512-b68UTmRhgZfswJZI7VAgW6BXZK5JOpoi5swMLGr4j6ss2XbFY13kiw+Hu+xYAfulMPSapcHzdWHnq21VGnMCnA== + dependencies: + "@intlify/shared" "9.10.1" + source-map-js "^1.0.2" + +"@intlify/shared@9.10.1": + version "9.10.1" + resolved "https://registry.yarnpkg.com/@intlify/shared/-/shared-9.10.1.tgz#024ad6dd4ee9581962437570b3dc25516c82f4e9" + integrity sha512-liyH3UMoglHBUn70iCYcy9CQlInx/lp50W2aeSxqqrvmG+LDj/Jj7tBJhBoQL4fECkldGhbmW0g2ommHfL6Wmw== + "@isaacs/cliui@^8.0.2": version "8.0.2" resolved "https://registry.yarnpkg.com/@isaacs/cliui/-/cliui-8.0.2.tgz#b37667b7bc181c168782259bab42474fbf52b550" @@ -261,70 +282,70 @@ resolved "https://registry.yarnpkg.com/@pkgr/core/-/core-0.1.1.tgz#1ec17e2edbec25c8306d424ecfbf13c7de1aaa31" integrity sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA== -"@rollup/rollup-android-arm-eabi@4.12.1": - version "4.12.1" - resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.12.1.tgz#11aaa02a933864b87f0b31cf2b755734e1f22787" - integrity sha512-iU2Sya8hNn1LhsYyf0N+L4Gf9Qc+9eBTJJJsaOGUp+7x4n2M9dxTt8UvhJl3oeftSjblSlpCfvjA/IfP3g5VjQ== - -"@rollup/rollup-android-arm64@4.12.1": - version "4.12.1" - resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.12.1.tgz#b1e606fb4b46b38dc32bf010d513449462d669e9" - integrity sha512-wlzcWiH2Ir7rdMELxFE5vuM7D6TsOcJ2Yw0c3vaBR3VOsJFVTx9xvwnAvhgU5Ii8Gd6+I11qNHwndDscIm0HXg== - -"@rollup/rollup-darwin-arm64@4.12.1": - version "4.12.1" - resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.12.1.tgz#dc21df1be9402671a8b6b15a93dd5953c68ec114" - integrity sha512-YRXa1+aZIFN5BaImK+84B3uNK8C6+ynKLPgvn29X9s0LTVCByp54TB7tdSMHDR7GTV39bz1lOmlLDuedgTwwHg== - -"@rollup/rollup-darwin-x64@4.12.1": - version "4.12.1" - resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.12.1.tgz#397dcc4427d774f29b9954676893574ac563bf0b" - integrity sha512-opjWJ4MevxeA8FhlngQWPBOvVWYNPFkq6/25rGgG+KOy0r8clYwL1CFd+PGwRqqMFVQ4/Qd3sQu5t7ucP7C/Uw== - -"@rollup/rollup-linux-arm-gnueabihf@4.12.1": - version "4.12.1" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.12.1.tgz#d851fd49d617e7792e7cde8e5a95ca51ea520fe5" - integrity sha512-uBkwaI+gBUlIe+EfbNnY5xNyXuhZbDSx2nzzW8tRMjUmpScd6lCQYKY2V9BATHtv5Ef2OBq6SChEP8h+/cxifQ== - -"@rollup/rollup-linux-arm64-gnu@4.12.1": - version "4.12.1" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.12.1.tgz#e41a271ae51f79ffee6fb2b5597cc81b4ef66ad9" - integrity sha512-0bK9aG1kIg0Su7OcFTlexkVeNZ5IzEsnz1ept87a0TUgZ6HplSgkJAnFpEVRW7GRcikT4GlPV0pbtVedOaXHQQ== - -"@rollup/rollup-linux-arm64-musl@4.12.1": - version "4.12.1" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.12.1.tgz#d3b4cd6ef18d0aa7103129755e0c535701624fac" - integrity sha512-qB6AFRXuP8bdkBI4D7UPUbE7OQf7u5OL+R94JE42Z2Qjmyj74FtDdLGeriRyBDhm4rQSvqAGCGC01b8Fu2LthQ== - -"@rollup/rollup-linux-riscv64-gnu@4.12.1": - version "4.12.1" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.12.1.tgz#215101b2bb768cce2f2227145b8dd5c3c716c259" - integrity sha512-sHig3LaGlpNgDj5o8uPEoGs98RII8HpNIqFtAI8/pYABO8i0nb1QzT0JDoXF/pxzqO+FkxvwkHZo9k0NJYDedg== - -"@rollup/rollup-linux-x64-gnu@4.12.1": - version "4.12.1" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.12.1.tgz#34a12fa305e167105eab70dbf577cd41e5199709" - integrity sha512-nD3YcUv6jBJbBNFvSbp0IV66+ba/1teuBcu+fBBPZ33sidxitc6ErhON3JNavaH8HlswhWMC3s5rgZpM4MtPqQ== - -"@rollup/rollup-linux-x64-musl@4.12.1": - version "4.12.1" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.12.1.tgz#3f000b5a92a32b844e385e1166979c87882930a3" - integrity sha512-7/XVZqgBby2qp/cO0TQ8uJK+9xnSdJ9ct6gSDdEr4MfABrjTyrW6Bau7HQ73a2a5tPB7hno49A0y1jhWGDN9OQ== - -"@rollup/rollup-win32-arm64-msvc@4.12.1": - version "4.12.1" - resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.12.1.tgz#27977d91f5059645ebb3b7fbf4429982de2278d3" - integrity sha512-CYc64bnICG42UPL7TrhIwsJW4QcKkIt9gGlj21gq3VV0LL6XNb1yAdHVp1pIi9gkts9gGcT3OfUYHjGP7ETAiw== - -"@rollup/rollup-win32-ia32-msvc@4.12.1": - version "4.12.1" - resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.12.1.tgz#0d252acd5af0274209c74374867ee8b949843d75" - integrity sha512-LN+vnlZ9g0qlHGlS920GR4zFCqAwbv2lULrR29yGaWP9u7wF5L7GqWu9Ah6/kFZPXPUkpdZwd//TNR+9XC9hvA== - -"@rollup/rollup-win32-x64-msvc@4.12.1": - version "4.12.1" - resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.12.1.tgz#cd8d175e001c212d5ac71c7827ef1d5c5e14494c" - integrity sha512-n+vkrSyphvmU0qkQ6QBNXCGr2mKjhP08mPRM/Xp5Ck2FV4NrHU+y6axzDeixUrCBHVUS51TZhjqrKBBsHLKb2Q== +"@rollup/rollup-android-arm-eabi@4.12.0": + version "4.12.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.12.0.tgz#38c3abd1955a3c21d492af6b1a1dca4bb1d894d6" + integrity sha512-+ac02NL/2TCKRrJu2wffk1kZ+RyqxVUlbjSagNgPm94frxtr+XDL12E5Ll1enWskLrtrZ2r8L3wED1orIibV/w== + +"@rollup/rollup-android-arm64@4.12.0": + version "4.12.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.12.0.tgz#3822e929f415627609e53b11cec9a4be806de0e2" + integrity sha512-OBqcX2BMe6nvjQ0Nyp7cC90cnumt8PXmO7Dp3gfAju/6YwG0Tj74z1vKrfRz7qAv23nBcYM8BCbhrsWqO7PzQQ== + +"@rollup/rollup-darwin-arm64@4.12.0": + version "4.12.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.12.0.tgz#6c082de71f481f57df6cfa3701ab2a7afde96f69" + integrity sha512-X64tZd8dRE/QTrBIEs63kaOBG0b5GVEd3ccoLtyf6IdXtHdh8h+I56C2yC3PtC9Ucnv0CpNFJLqKFVgCYe0lOQ== + +"@rollup/rollup-darwin-x64@4.12.0": + version "4.12.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.12.0.tgz#c34ca0d31f3c46a22c9afa0e944403eea0edcfd8" + integrity sha512-cc71KUZoVbUJmGP2cOuiZ9HSOP14AzBAThn3OU+9LcA1+IUqswJyR1cAJj3Mg55HbjZP6OLAIscbQsQLrpgTOg== + +"@rollup/rollup-linux-arm-gnueabihf@4.12.0": + version "4.12.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.12.0.tgz#48e899c1e438629c072889b824a98787a7c2362d" + integrity sha512-a6w/Y3hyyO6GlpKL2xJ4IOh/7d+APaqLYdMf86xnczU3nurFTaVN9s9jOXQg97BE4nYm/7Ga51rjec5nfRdrvA== + +"@rollup/rollup-linux-arm64-gnu@4.12.0": + version "4.12.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.12.0.tgz#788c2698a119dc229062d40da6ada8a090a73a68" + integrity sha512-0fZBq27b+D7Ar5CQMofVN8sggOVhEtzFUwOwPppQt0k+VR+7UHMZZY4y+64WJ06XOhBTKXtQB/Sv0NwQMXyNAA== + +"@rollup/rollup-linux-arm64-musl@4.12.0": + version "4.12.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.12.0.tgz#3882a4e3a564af9e55804beeb67076857b035ab7" + integrity sha512-eTvzUS3hhhlgeAv6bfigekzWZjaEX9xP9HhxB0Dvrdbkk5w/b+1Sxct2ZuDxNJKzsRStSq1EaEkVSEe7A7ipgQ== + +"@rollup/rollup-linux-riscv64-gnu@4.12.0": + version "4.12.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.12.0.tgz#0c6ad792e1195c12bfae634425a3d2aa0fe93ab7" + integrity sha512-ix+qAB9qmrCRiaO71VFfY8rkiAZJL8zQRXveS27HS+pKdjwUfEhqo2+YF2oI+H/22Xsiski+qqwIBxVewLK7sw== + +"@rollup/rollup-linux-x64-gnu@4.12.0": + version "4.12.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.12.0.tgz#9d62485ea0f18d8674033b57aa14fb758f6ec6e3" + integrity sha512-TenQhZVOtw/3qKOPa7d+QgkeM6xY0LtwzR8OplmyL5LrgTWIXpTQg2Q2ycBf8jm+SFW2Wt/DTn1gf7nFp3ssVA== + +"@rollup/rollup-linux-x64-musl@4.12.0": + version "4.12.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.12.0.tgz#50e8167e28b33c977c1f813def2b2074d1435e05" + integrity sha512-LfFdRhNnW0zdMvdCb5FNuWlls2WbbSridJvxOvYWgSBOYZtgBfW9UGNJG//rwMqTX1xQE9BAodvMH9tAusKDUw== + +"@rollup/rollup-win32-arm64-msvc@4.12.0": + version "4.12.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.12.0.tgz#68d233272a2004429124494121a42c4aebdc5b8e" + integrity sha512-JPDxovheWNp6d7AHCgsUlkuCKvtu3RB55iNEkaQcf0ttsDU/JZF+iQnYcQJSk/7PtT4mjjVG8N1kpwnI9SLYaw== + +"@rollup/rollup-win32-ia32-msvc@4.12.0": + version "4.12.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.12.0.tgz#366ca62221d1689e3b55a03f4ae12ae9ba595d40" + integrity sha512-fjtuvMWRGJn1oZacG8IPnzIV6GF2/XG+h71FKn76OYFqySXInJtseAqdprVTDTyqPxQOG9Exak5/E9Z3+EJ8ZA== + +"@rollup/rollup-win32-x64-msvc@4.12.0": + version "4.12.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.12.0.tgz#9ffdf9ed133a7464f4ae187eb9e1294413fab235" + integrity sha512-ZYmr5mS2wd4Dew/JjT0Fqi2NPB/ZhZ2VvPp7SmvPZb4Y1CG/LRcS6tcRo2cYU7zLK5A7cdbhWnnWmUjoI4qapg== "@rushstack/eslint-patch@^1.3.3": version "1.7.2" @@ -356,6 +377,11 @@ resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz#56e2cc26c397c038fab0e3a917a12d5c5909e901" integrity sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA== +"@types/web-bluetooth@^0.0.20": + version "0.0.20" + resolved "https://registry.yarnpkg.com/@types/web-bluetooth/-/web-bluetooth-0.0.20.tgz#f066abfcd1cbe66267cdbbf0de010d8a41b41597" + integrity sha512-g9gZnnXVq7gM7v3tJCWV/qw7w+KeOlSHAhgF9RytFyifW6AF61hdT2ucrYhPq9hLs5JIryeupHV3qGk95dH9ow== + "@vitejs/plugin-vue@^4.5.2": version "4.6.2" resolved "https://registry.yarnpkg.com/@vitejs/plugin-vue/-/plugin-vue-4.6.2.tgz#057d2ded94c4e71b94e9814f92dcd9306317aa46" @@ -389,17 +415,6 @@ "@vue/compiler-core" "3.4.21" "@vue/shared" "3.4.21" -"@vue/compiler-sfc@2.7.16": - version "2.7.16" - resolved "https://registry.yarnpkg.com/@vue/compiler-sfc/-/compiler-sfc-2.7.16.tgz#ff81711a0fac9c68683d8bb00b63f857de77dc83" - integrity sha512-KWhJ9k5nXuNtygPU7+t1rX6baZeqOYLEforUPjgNDBnLicfHCoi48H87Q8XyLZOrNNsmhuwKqtpDQWjEFe6Ekg== - dependencies: - "@babel/parser" "^7.23.5" - postcss "^8.4.14" - source-map "^0.6.1" - optionalDependencies: - prettier "^1.18.2 || ^2.0.0" - "@vue/compiler-sfc@3.4.21": version "3.4.21" resolved "https://registry.yarnpkg.com/@vue/compiler-sfc/-/compiler-sfc-3.4.21.tgz#4af920dc31ab99e1ff5d152b5fe0ad12181145b2" @@ -423,7 +438,7 @@ "@vue/compiler-dom" "3.4.21" "@vue/shared" "3.4.21" -"@vue/devtools-api@^6.0.0-beta.11", "@vue/devtools-api@^6.5.1": +"@vue/devtools-api@^6.5.0", "@vue/devtools-api@^6.5.1": version "6.6.1" resolved "https://registry.yarnpkg.com/@vue/devtools-api/-/devtools-api-6.6.1.tgz#7c14346383751d9f6ad4bea0963245b30220ef83" integrity sha512-LgPscpE3Vs0x96PzSSB4IGVSZXZBZHpfxs+ZA1d+VEPwHdOXowy/Y2CsvCAIFrf+ssVU1pD1jidj505EpUnfbA== @@ -481,22 +496,53 @@ js-beautify "^1.14.9" vue-component-type-helpers "^1.8.21" +"@vueuse/components@^10.4.1": + version "10.9.0" + resolved "https://registry.yarnpkg.com/@vueuse/components/-/components-10.9.0.tgz#5c1011e0511b68e4d94f5d545343f86d2a7e3044" + integrity sha512-BHQpA0yIi3y7zKa1gYD0FUzLLkcRTqVhP8smnvsCK6GFpd94Nziq1XVPD7YpFeho0k5BzbBiNZF7V/DpkJ967A== + dependencies: + "@vueuse/core" "10.9.0" + "@vueuse/shared" "10.9.0" + vue-demi ">=0.14.7" + +"@vueuse/core@10.9.0": + version "10.9.0" + resolved "https://registry.yarnpkg.com/@vueuse/core/-/core-10.9.0.tgz#7d779a95cf0189de176fee63cee4ba44b3c85d64" + integrity sha512-/1vjTol8SXnx6xewDEKfS0Ra//ncg4Hb0DaZiwKf7drgfMsKFExQ+FnnENcN6efPen+1kIzhLQoGSy0eDUVOMg== + dependencies: + "@types/web-bluetooth" "^0.0.20" + "@vueuse/metadata" "10.9.0" + "@vueuse/shared" "10.9.0" + vue-demi ">=0.14.7" + +"@vueuse/metadata@10.9.0": + version "10.9.0" + resolved "https://registry.yarnpkg.com/@vueuse/metadata/-/metadata-10.9.0.tgz#769a1a9db65daac15cf98084cbf7819ed3758620" + integrity sha512-iddNbg3yZM0X7qFY2sAotomgdHK7YJ6sKUvQqbvwnf7TmaVPxS4EJydcNsVejNdS8iWCtDk+fYXr7E32nyTnGA== + +"@vueuse/shared@10.9.0": + version "10.9.0" + resolved "https://registry.yarnpkg.com/@vueuse/shared/-/shared-10.9.0.tgz#13af2a348de15d07b7be2fd0c7fc9853a69d8fe0" + integrity sha512-Uud2IWncmAfJvRaFYzv5OHDli+FbOzxiVEQdLCKQKLyhz94PIyFC3CHcH7EDMwIn8NPtD06+PNbC/PiO0LGLtw== + dependencies: + vue-demi ">=0.14.7" + "@weni/eslint-config@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@weni/eslint-config/-/eslint-config-1.0.1.tgz#944b6f9f4cb7f2c2d998d3d7981a66983a32c9b9" integrity sha512-XRH2EFyg6ar8R37bNTtIBc/XYSdxWsqgmaLlZV4MAUR3lENRNhRdlqo89WwNVIx1SYDyU6aT6waVUP5dc7VDcg== "@weni/unnnic-system@^2.0.0-beta.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@weni/unnnic-system/-/unnnic-system-2.0.0.tgz#3ae21bede798e4ac02eb445b0fab4ac4cbe48728" - integrity sha512-3fZVgilW9sdyXiTJoOyOF2zKtP1nsHB559CQEE87tS7t1foL5QG5ROiRAq0HvH4vGUqzQEaUokxdLp/EhrL4Hw== - dependencies: - core-js "^3.6.5" - mime-types "^2.1.35" - moment "^2.29.1" - v-click-outside "^3.1.2" - vue "^2.6.11" - vue-i18n "8" + version "2.0.0-beta.2" + resolved "https://registry.yarnpkg.com/@weni/unnnic-system/-/unnnic-system-2.0.0-beta.2.tgz#8b5f828739ae358a1c69ff22259e59b2410be318" + integrity sha512-vN+5Jro25hMTAaanufYMi3MzbQBXyDLFEa7uBCBojIcUK7daZDfVWkkKmYwzODn2mST4/G0OnXNSA0IvB57nOg== + dependencies: + "@vueuse/components" "^10.4.1" + lodash "^4.17.21" + mime "^4.0.1" + moment "^2.30.1" + vue "^3.4.8" + vue-i18n "9" vue-the-mask "^0.11.1" abbrev@1: @@ -871,11 +917,6 @@ console-control-strings@^1.1.0: resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" integrity sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ== -core-js@^3.6.5: - version "3.36.0" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.36.0.tgz#e752fa0b0b462a0787d56e9d73f80b0f7c0dde68" - integrity sha512-mt7+TUBbTFg5+GngsAxeKBTl5/VS0guFeJacYge9OmHb+m058UwwIm41SE9T4Den7ClatV57B6TYTuJ0CX1MAw== - core-util-is@~1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" @@ -895,7 +936,7 @@ cssesc@^3.0.0: resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee" integrity sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg== -csstype@^3.1.0, csstype@^3.1.3: +csstype@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.3.tgz#d80ff294d114fb0e6ac500fbf85b60137d7eff81" integrity sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw== @@ -1860,13 +1901,18 @@ mime-db@1.52.0: resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== -mime-types@^2.1.12, mime-types@^2.1.35: +mime-types@^2.1.12: version "2.1.35" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== dependencies: mime-db "1.52.0" +mime@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/mime/-/mime-4.0.1.tgz#ad7563d1bfe30253ad97dedfae2b1009d01b9470" + integrity sha512-5lZ5tyrIfliMXzFtkYyekWbtRXObT9OWa8IwQ5uxTBDHucNNwniRqo0yInflj+iYi5CBa6qxadGzGarDfuEOxA== + min-indent@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869" @@ -1996,7 +2042,7 @@ mkdirp@^1.0.3, mkdirp@^1.0.4: resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== -moment@^2.29.1, moment@^2.30.1: +moment@^2.30.1: version "2.30.1" resolved "https://registry.yarnpkg.com/moment/-/moment-2.30.1.tgz#f8c91c07b7a786e30c59926df530b4eac96974ae" integrity sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how== @@ -2012,9 +2058,9 @@ ms@^2.0.0: integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== nan@^2.17.0: - version "2.19.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.19.0.tgz#bb58122ad55a6c5bc973303908d5b16cfdd5a8c0" - integrity sha512-nO1xXxfh/RWNxfd/XPfbIfFk5vgLsAxUR9y5O0cHMJu/AW9U95JLXqthYHjEp+8gQ5p96K9jUp8nbVOxCdRbtw== + version "2.18.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.18.0.tgz#26a6faae7ffbeb293a39660e88a76b82e30b7554" + integrity sha512-W7tfG7vMOGtD30sHoZSSc/JVYiyDPEyQVso/Zz+/uQd0B0L46gtC+pHha5FFMRpil6fm/AoEcRWyOVi4+E/f8w== nanoid@^3.3.7: version "3.3.7" @@ -2228,6 +2274,14 @@ picomatch@^2.0.4, picomatch@^2.2.1: resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== +pinia@^2.1.7: + version "2.1.7" + resolved "https://registry.yarnpkg.com/pinia/-/pinia-2.1.7.tgz#4cf5420d9324ca00b7b4984d3fbf693222115bbc" + integrity sha512-+C2AHFtcFqjPih0zpYuvof37SFxMQ7OEG2zV9jRI12i9BOy3YQVAHwdKtyyc8pDcDyIc33WCIsZaCFWU7WWxGQ== + dependencies: + "@vue/devtools-api" "^6.5.0" + vue-demi ">=0.14.5" + postcss-selector-parser@^6.0.15: version "6.0.15" resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.15.tgz#11cc2b21eebc0b99ea374ffb9887174855a01535" @@ -2236,7 +2290,7 @@ postcss-selector-parser@^6.0.15: cssesc "^3.0.0" util-deprecate "^1.0.2" -postcss@^8.4.14, postcss@^8.4.35: +postcss@^8.4.35: version "8.4.35" resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.35.tgz#60997775689ce09011edf083a549cea44aabe2f7" integrity sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA== @@ -2257,11 +2311,6 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -"prettier@^1.18.2 || ^2.0.0": - version "2.8.8" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da" - integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== - prettier@^3.2.5: version "3.2.5" resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.2.5.tgz#e52bc3090586e824964a8813b09aba6233b28368" @@ -2408,25 +2457,25 @@ rimraf@^3.0.2: glob "^7.1.3" rollup@^4.2.0: - version "4.12.1" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-4.12.1.tgz#0659cb02551cde4c5b210e9bd3af050b5b5b415d" - integrity sha512-ggqQKvx/PsB0FaWXhIvVkSWh7a/PCLQAsMjBc+nA2M8Rv2/HG0X6zvixAB7KyZBRtifBUhy5k8voQX/mRnABPg== + version "4.12.0" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-4.12.0.tgz#0b6d1e5f3d46bbcf244deec41a7421dc54cc45b5" + integrity sha512-wz66wn4t1OHIJw3+XU7mJJQV/2NAfw5OAk6G6Hoo3zcvz/XOfQ52Vgi+AN4Uxoxi0KBBwk2g8zPrTDA4btSB/Q== dependencies: "@types/estree" "1.0.5" optionalDependencies: - "@rollup/rollup-android-arm-eabi" "4.12.1" - "@rollup/rollup-android-arm64" "4.12.1" - "@rollup/rollup-darwin-arm64" "4.12.1" - "@rollup/rollup-darwin-x64" "4.12.1" - "@rollup/rollup-linux-arm-gnueabihf" "4.12.1" - "@rollup/rollup-linux-arm64-gnu" "4.12.1" - "@rollup/rollup-linux-arm64-musl" "4.12.1" - "@rollup/rollup-linux-riscv64-gnu" "4.12.1" - "@rollup/rollup-linux-x64-gnu" "4.12.1" - "@rollup/rollup-linux-x64-musl" "4.12.1" - "@rollup/rollup-win32-arm64-msvc" "4.12.1" - "@rollup/rollup-win32-ia32-msvc" "4.12.1" - "@rollup/rollup-win32-x64-msvc" "4.12.1" + "@rollup/rollup-android-arm-eabi" "4.12.0" + "@rollup/rollup-android-arm64" "4.12.0" + "@rollup/rollup-darwin-arm64" "4.12.0" + "@rollup/rollup-darwin-x64" "4.12.0" + "@rollup/rollup-linux-arm-gnueabihf" "4.12.0" + "@rollup/rollup-linux-arm64-gnu" "4.12.0" + "@rollup/rollup-linux-arm64-musl" "4.12.0" + "@rollup/rollup-linux-riscv64-gnu" "4.12.0" + "@rollup/rollup-linux-x64-gnu" "4.12.0" + "@rollup/rollup-linux-x64-musl" "4.12.0" + "@rollup/rollup-win32-arm64-msvc" "4.12.0" + "@rollup/rollup-win32-ia32-msvc" "4.12.0" + "@rollup/rollup-win32-x64-msvc" "4.12.0" fsevents "~2.3.2" safe-buffer@~5.1.0, safe-buffer@~5.1.1: @@ -2562,11 +2611,6 @@ socks@^2.6.2: resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== -source-map@^0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - source-map@^0.7.3: version "0.7.4" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.4.tgz#a9bbe705c9d8846f4e08ff6765acf0f1b0898656" @@ -2838,11 +2882,6 @@ util-deprecate@^1.0.1, util-deprecate@^1.0.2, util-deprecate@~1.0.1: resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== -v-click-outside@^3.1.2: - version "3.2.0" - resolved "https://registry.yarnpkg.com/v-click-outside/-/v-click-outside-3.2.0.tgz#850ac3f52d66d84b9f7e8002a1bcadcafec5534e" - integrity sha512-QD0bDy38SHJXQBjgnllmkI/rbdiwmq9RC+/+pvrFjYJKTn8dtp7Penf9q1lLBta280fYG2q53mgLhQ+3l3z74w== - v8-compile-cache@^2.0.3: version "2.4.0" resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.4.0.tgz#cdada8bec61e15865f05d097c5f4fd30e94dc128" @@ -2857,9 +2896,9 @@ validate-npm-package-license@^3.0.1: spdx-expression-parse "^3.0.0" vite@^5.0.10: - version "5.1.5" - resolved "https://registry.yarnpkg.com/vite/-/vite-5.1.5.tgz#bdbc2b15e8000d9cc5172f059201178f9c9de5fb" - integrity sha512-BdN1xh0Of/oQafhU+FvopafUp6WaYenLU/NFoL5WyJL++GxkNfieKzBhM24H3HVsPQrlAqB7iJYTHabzaRed5Q== + version "5.1.4" + resolved "https://registry.yarnpkg.com/vite/-/vite-5.1.4.tgz#14e9d3e7a6e488f36284ef13cebe149f060bcfb6" + integrity sha512-n+MPqzq+d9nMVTKyewqw6kSt+R3CkvF9QAKY8obiQn8g1fwTscKxyfaYnC632HtBXAQGc1Yjomphwn1dtwGAHg== dependencies: esbuild "^0.19.3" postcss "^8.4.35" @@ -2877,6 +2916,11 @@ vue-component-type-helpers@^1.8.21: resolved "https://registry.yarnpkg.com/vue-component-type-helpers/-/vue-component-type-helpers-1.8.27.tgz#e816c82dcffac8bca58833c120ba395c325dfa68" integrity sha512-0vOfAtI67UjeO1G6UiX5Kd76CqaQ67wrRZiOe7UAb9Jm6GzlUr/fC7CV90XfwapJRjpCMaZFhv1V0ajWRmE9Dg== +vue-demi@>=0.14.5, vue-demi@>=0.14.7: + version "0.14.7" + resolved "https://registry.yarnpkg.com/vue-demi/-/vue-demi-0.14.7.tgz#8317536b3ef74c5b09f268f7782e70194567d8f2" + integrity sha512-EOG8KXDQNwkJILkx/gPcoL/7vH+hORoBaKgGe+6W7VFMvCYJfmF2dGbvgDroVnI8LU7/kTu8mbjRZGBU1z9NTA== + vue-eslint-parser@^9.4.2: version "9.4.2" resolved "https://registry.yarnpkg.com/vue-eslint-parser/-/vue-eslint-parser-9.4.2.tgz#02ffcce82042b082292f2d1672514615f0d95b6d" @@ -2890,10 +2934,14 @@ vue-eslint-parser@^9.4.2: lodash "^4.17.21" semver "^7.3.6" -vue-i18n@8: - version "8.28.2" - resolved "https://registry.yarnpkg.com/vue-i18n/-/vue-i18n-8.28.2.tgz#913558066e274395c0a9f40b2f3393d5c2636840" - integrity sha512-C5GZjs1tYlAqjwymaaCPDjCyGo10ajUphiwA922jKt9n7KPpqR7oM1PCwYzhB/E7+nT3wfdG3oRre5raIT1rKA== +vue-i18n@9: + version "9.10.1" + resolved "https://registry.yarnpkg.com/vue-i18n/-/vue-i18n-9.10.1.tgz#b3244233da31a55a07a2ae72cdddab7296bca814" + integrity sha512-37HVJQZ/pZaRXGzFmmMomM1u1k7kndv3xCBPYHKEVfv5W3UVK67U/TpBug71ILYLNmjHLHdvTUPRF81pFT5fFg== + dependencies: + "@intlify/core-base" "9.10.1" + "@intlify/shared" "9.10.1" + "@vue/devtools-api" "^6.5.0" vue-router@^4.2.5: version "4.3.0" @@ -2907,15 +2955,7 @@ vue-the-mask@^0.11.1: resolved "https://registry.yarnpkg.com/vue-the-mask/-/vue-the-mask-0.11.1.tgz#91ee01008354ae57bccc79bb61b65f32d971d9d5" integrity sha512-UquSfnSWejD0zAfcD+3jJ1chUAkOAyoxya9Lxh9acCRtrlmGcAIvd0cQYraWqKenbuZJUdum+S174atv2AuEHQ== -vue@^2.6.11: - version "2.7.16" - resolved "https://registry.yarnpkg.com/vue/-/vue-2.7.16.tgz#98c60de9def99c0e3da8dae59b304ead43b967c9" - integrity sha512-4gCtFXaAA3zYZdTp5s4Hl2sozuySsgz4jy1EnpBHNfpMa9dK1ZCG7viqBPCwXtmgc8nHqUsAu3G4gtmXkkY3Sw== - dependencies: - "@vue/compiler-sfc" "2.7.16" - csstype "^3.1.0" - -vue@^3.3.11: +vue@^3.3.11, vue@^3.4.8: version "3.4.21" resolved "https://registry.yarnpkg.com/vue/-/vue-3.4.21.tgz#69ec30e267d358ee3a0ce16612ba89e00aaeb731" integrity sha512-5hjyV/jLEIKD/jYl4cavMcnzKwjMKohureP8ejn3hhEjwhWIhWeuzL2kJAjzl/WyVsgPY56Sy4Z40C3lVshxXA== @@ -2926,13 +2966,6 @@ vue@^3.3.11: "@vue/server-renderer" "3.4.21" "@vue/shared" "3.4.21" -vuex@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/vuex/-/vuex-4.1.0.tgz#aa1b3ea5c7385812b074c86faeeec2217872e36c" - integrity sha512-hmV6UerDrPcgbSy9ORAtNXDr9M4wlNP4pEFKye4ujJF8oqgFFuxDCdOLS3eNoRTtq5O3hoBDh9Doj1bQMYHRbQ== - dependencies: - "@vue/devtools-api" "^6.0.0-beta.11" - which@^2.0.1, which@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" From d54c1bbc00d8a104deed97662cdddecfba5aa3c7 Mon Sep 17 00:00:00 2001 From: Mariana Date: Fri, 22 Mar 2024 08:31:28 -0300 Subject: [PATCH 2/8] feat: Adjusting some files so that pinia can be used --- src/App.vue | 45 +++-- src/components/Banner.vue | 57 +++++-- src/components/Header.vue | 23 ++- src/main.js | 6 +- src/router/index.js | 7 +- src/store/header/index.js | 97 +++++------ src/store/index.js | 37 ++-- src/store/modules/actions.js | 72 -------- src/store/modules/getters.js | 41 ----- src/store/modules/index.js | 174 +++++++++++++++++-- src/store/modules/mutations.js | 41 ----- src/views/ClassPage.vue | 300 ++++++++++++++++++++++----------- src/views/ClassesListAll.vue | 42 +++-- src/views/Home.vue | 95 +++++++---- src/views/Onboarding.vue | 46 ++--- 15 files changed, 618 insertions(+), 465 deletions(-) delete mode 100644 src/store/modules/actions.js delete mode 100644 src/store/modules/getters.js delete mode 100644 src/store/modules/mutations.js diff --git a/src/App.vue b/src/App.vue index 0145378..f87f785 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,20 +1,20 @@ - \ No newline at end of file + diff --git a/src/components/Header.vue b/src/components/Header.vue index 2dc5e22..9b205d0 100644 --- a/src/components/Header.vue +++ b/src/components/Header.vue @@ -1,6 +1,6 @@ \ No newline at end of file +header { + padding: 0 $unnnic-spacing-stack-md; +} + diff --git a/src/main.js b/src/main.js index f0c35c3..dc5ff27 100644 --- a/src/main.js +++ b/src/main.js @@ -1,12 +1,13 @@ import { createApp } from 'vue'; import { createPinia } from 'pinia'; + import App from './App.vue'; import router from './router'; -import store from './store'; import VueAwesomeSwiper from 'vue-awesome-swiper'; import LogRocket from 'logrocket'; import Unnnic from './utils/plugins/UnnnicSystem'; +import '@weni/unnnic-system/dist/style.css'; // import style (>= Swiper 6.x) import 'swiper/swiper-bundle.css'; @@ -19,16 +20,15 @@ LogRocket.init(getEnv('VUE_APP_LOGROCKET_ID'), { }); const app = createApp(App); - const pinia = createPinia(); app.use(router); -app.use(store); app.use(pinia); app.use(VueAwesomeSwiper); app.use(Unnnic); app.mount('#app'); + function enableLinkTranslations() { let connectBaseURL = ''; diff --git a/src/router/index.js b/src/router/index.js index c2b67f1..3d13cd8 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -4,7 +4,7 @@ import ClassesListAll from '@/views/ClassesListAll.vue'; import Home from '@/views/Home.vue'; import Onboarding from '@/views/Onboarding.vue'; -import store from '@/store'; +import { useLoginStore } from '@/store'; const router = createRouter({ history: createWebHistory(), @@ -43,9 +43,10 @@ const router = createRouter({ name: 'externalLogin', component: null, beforeEnter: async (to, from, next) => { + const store = useLoginStore(); const { token } = to.params; - store.dispatch('externalLogin', token.replace('+', ' ')); - await store.dispatch('fetchModules'); + store.externalLogin(token.replace('+', ' ')); + await store.fetchModules(); if (to.query.next) { next(to.query.next); } else { diff --git a/src/store/header/index.js b/src/store/header/index.js index 34cd9d5..e9a767d 100644 --- a/src/store/header/index.js +++ b/src/store/header/index.js @@ -1,57 +1,58 @@ -import router from '@/router'; -import store from '@/store'; +import { defineStore } from 'pinia'; +import { useModulesStore } from '@/store/modules'; -const getters = { - breadcrumbs() { - const name = router.app.$route.name; - const breadcrumbs = []; +import { useRouter } from 'vue-router'; - if (['Home', 'ClassesListAll', 'ClassPage'].includes(name)) { - breadcrumbs.push({ - name: "Trilhas", - path: { - name: 'Onboarding', - } - }); - breadcrumbs.push({ - name: store.getters.currentModule?.title, - path: { - name: 'Home', - params: { - module_id: store.getters.currentModule?.id, +export const useHeaderStore = defineStore('header', { + getters: { + breadcrumbs() { + const router = useRouter(); + const name = router.currentRoute.name; + const breadcrumbs = []; + + if (['Home', 'ClassesListAll', 'ClassPage'].includes(name)) { + breadcrumbs.push({ + name: 'Trilhas', + path: { + name: 'Onboarding', + }, + }); + breadcrumbs.push({ + name: useModulesStore.currentModule?.title, + path: { + name: 'Home', + params: { + module_id: useModulesStore.currentModule?.id, + }, }, - } - }); - } + }); + } - if (['ClassesListAll', 'ClassPage'].includes(name)) { - breadcrumbs.push({ - name: store.getters.currentCategory?.title, - path: { - name: 'ClassesListAll', - params: { - category_id: store.getters.currentCategory?.id, + if (['ClassesListAll', 'ClassPage'].includes(name)) { + breadcrumbs.push({ + name: useModulesStore.currentCategory?.title, + path: { + name: 'ClassesListAll', + params: { + category_id: useModulesStore.currentCategory?.id, + }, }, - } - }); - } + }); + } - if (name === 'ClassPage') { - breadcrumbs.push({ - name: store.getters.currentClass?.title, - path: { - name: 'ClassPage', - params: { - id_class: store.getters.currentClass?.id, + if (name === 'ClassPage') { + breadcrumbs.push({ + name: useModulesStore.currentClass?.title, + path: { + name: 'ClassPage', + params: { + id_class: useModulesStore.currentClass?.id, + }, }, - } - }); - } + }); + } - return breadcrumbs; + return breadcrumbs; + }, }, -}; - -export default { - getters, -}; +}); diff --git a/src/store/index.js b/src/store/index.js index 7a2d295..bfa18f4 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1,33 +1,20 @@ -import Vue from 'vue' -import Vuex from 'vuex' - -import Modules from './modules'; -import Header from './header'; +import { defineStore } from 'pinia'; import { api } from '@/services/api'; -Vue.use(Vuex) - -export default new Vuex.Store({ - state: { +export const useLoginStore = defineStore('login', { + state: () => ({ token: '', - }, - mutations: { - SET_TOKEN: (state, token) => { - state.token = token; + }), + actions: { + SET_TOKEN(token) { + this.token = token; api.defaults.headers.common['Authorization'] = token; localStorage.setItem('token', token); }, + externalLogin(token) { + if (!token) return; + this.SET_TOKEN(token); + }, }, - actions: { - externalLogin({ commit }, token){ - if(!token) return; - //TO-DO HANDLE ERROR - commit('SET_TOKEN', token) - } - }, - modules: { - Modules, - Header - } -}) +}); diff --git a/src/store/modules/actions.js b/src/store/modules/actions.js deleted file mode 100644 index d53c3be..0000000 --- a/src/store/modules/actions.js +++ /dev/null @@ -1,72 +0,0 @@ -import { api } from '@/services/api'; - -export default { - async fetchModules({ commit }) { - commit('MODULES_REQUEST'); - - try { - const response = await api.get('modules'); - commit('MODULES__SUCCESS', response.data); - } catch (e) { - commit('MODULES_ERROR', e); - } - }, - - createClassComment(_store, { classId, text }) { - return api.post(`classes/${classId}/comment/`, { - text, - }); - }, - - removeClassComment(_store, { classId, commentId }) { - return api.delete(`classes/${classId}/comment/`, { - data: { - comment_id: commentId, - }, - }); - }, - - getClassComments(_store, { classId }) { - return api.get(`classes/${classId}/comment/`); - }, - - getClassAnnotation(_store, { classId }) { - return api.get(`classes/${classId}/update_annotation/`); - }, - - setClassAnnotation(_store, { classId, annotation }) { - return api.put(`classes/${classId}/update_annotation/`, { annotation }); - }, - - setClassMood(_store, { classId, mood }) { - return api.put(`classes/${classId}/rating_mood/`, { mood }); - }, - - async fetchSingleModule({ commit }, moduleID) { - commit('SINGLE_MODULE_REQUEST'); - - try { - const response = await api.get(`modules/${moduleID}`); - commit('SINGLE_MODULE__SUCCESS', response.data); - } catch (e) { - commit('SINGLE_MODULE_ERROR', e); - } - }, - - async toggleCheckClass({ commit, getters }, { classID, value }) { - commit('TOGGLE_CHECK_CLASS_REQUEST', { value, getters }); - try { - const { data } = await api.patch(`classes/${classID}/update_watched/`, { - watched: value, - }); - commit('TOGGLE_CHECK_CLASS__SUCCESS', data.watched_percentage); - } catch (error) { - commit('TOGGLE_CHECK_CLASS_ERROR', { error, getters, value }); - } - }, - - // setCurrentModule({ commit }, moduleID){ - - // commit('SET_CURRENT_MODULE', module) - // } -}; diff --git a/src/store/modules/getters.js b/src/store/modules/getters.js deleted file mode 100644 index 07e9cc6..0000000 --- a/src/store/modules/getters.js +++ /dev/null @@ -1,41 +0,0 @@ -import router from '@/router'; - -export default { - currentModule(state) { - const id = router.app.$route.params.module_id; - - return state.modules.find((item) => { - return item.id == id; - }); - }, - - currentCategory(_state, getters) { - const module = getters.currentModule; - const idCategory = router.app.$route.params.id_category; - - return module?.category_set.find(({ id }) => id == idCategory); - }, - - currentClass(_state, getters) { - const category = getters.currentCategory; - const idClass = router.app.$route.params.id_class; - - return category?.class_set.find(({ id }) => id == idClass); - }, - - getTotalClasses(state, getters) { - const category = getters.currentCategory; - - return category?.class_set.length; - }, - getTotalCompletedClasses(state, getters) { - const category = getters.currentCategory; - - const number = category?.class_set.reduce((acumulator, lesson) => { - if (lesson.lesson_monitoring.watched) acumulator++; - return acumulator; - }, 0); - - return number; - }, -}; diff --git a/src/store/modules/index.js b/src/store/modules/index.js index d40da38..a5ec19a 100644 --- a/src/store/modules/index.js +++ b/src/store/modules/index.js @@ -1,14 +1,160 @@ -import actions from './actions'; -import mutations from './mutations'; -import getters from './getters'; - -const state = { - loading: null, - modules: [], -}; -export default { - state, - getters, - mutations, - actions, -}; +import { defineStore } from 'pinia'; + +import { api } from '@/services/api'; + +export const useModulesStore = defineStore('modules', { + state: () => ({ + loading: null, + modules: [], + }), + getters: { + currentModule: (state) => (routeParams) => { + const id = routeParams.params.module_id; + + return state.modules.find((item) => item.id == id); + }, + + currentCategory: (getters) => (routeParams) => { + const module = getters.currentModule; + const idCategory = routeParams.params.id_category; + + return module?.category_set.find(({ id }) => id == idCategory); + }, + + currentClass: (getters) => (routeParams) => { + const category = getters.currentCategory; + const idClass = routeParams.params.id_class; + + return category?.class_set.find(({ id }) => id == idClass); + }, + + getTotalClasses(getters) { + const category = getters.currentCategory; + + return category?.class_set.length; + }, + + getTotalCompletedClasses(getters) { + const category = getters.currentCategory; + + const number = category?.class_set.reduce((accumulator, lesson) => { + if (lesson.lesson_monitoring.watched) accumulator++; + return accumulator; + }, 0); + + return number; + }, + }, + actions: { + MODULES_REQUEST: (state) => (state.loadingModules = true), + + MODULES__SUCCESS: (state, modules) => { + state.loadingModules = false; + state.modules = modules; + }, + + MODULES_ERROR: (state, profileError) => { + state.error = profileError; + state.loadingModules = false; + }, + + SINGLE_MODULE_REQUEST: (state) => (state.loadingSingleModule = true), + + SINGLE_MODULE__SUCCESS: (state, module) => { + state.loadingSingleModule = false; + state.currentModule = module; + }, + + SINGLE_MODULE_ERROR: (state, profileError) => { + state.error = profileError; + state.loadingSingleModule = false; + }, + + SET_CURRENT_MODULE: (state, module) => { + state.currentModule = module; + }, + + TOGGLE_CHECK_CLASS_REQUEST: (state, { value, getters }) => { + getters.currentClass.lesson_monitoring.watched = value; + state.loadingToggleCurrentClass = true; + }, + + TOGGLE_CHECK_CLASS__SUCCESS: (state, watched_percentage) => { + state.loadingToggleCurrentClass = false; + state.modules.find( + (mod) => mod.id === state.currentModule.id, + ).watched_percentage = watched_percentage; + state.currentModule.watched_percentage = watched_percentage; + }, + + TOGGLE_CHECK_CLASS_ERROR: (state, { error, getters, value }) => { + state.error = error; + state.loadingSingleModule = false; + getters.currentClass.lesson_monitoring.watched = !value; + }, + + async fetchModules({ commit }) { + commit('MODULES_REQUEST'); + + try { + const response = await api.get('modules'); + commit('MODULES__SUCCESS', response.data); + } catch (e) { + commit('MODULES_ERROR', e); + } + }, + + createClassComment({ classId, text }) { + return api.post(`classes/${classId}/comment/`, { + text, + }); + }, + + removeClassComment({ classId, commentId }) { + return api.delete(`classes/${classId}/comment/`, { + data: { + comment_id: commentId, + }, + }); + }, + + getClassComments({ classId }) { + return api.get(`classes/${classId}/comment/`); + }, + + getClassAnnotation({ classId }) { + return api.get(`classes/${classId}/update_annotation/`); + }, + + setClassAnnotation({ classId, annotation }) { + return api.put(`classes/${classId}/update_annotation/`, { annotation }); + }, + + setClassMood({ classId, mood }) { + return api.put(`classes/${classId}/rating_mood/`, { mood }); + }, + + async fetchSingleModule({ commit }, moduleID) { + commit('SINGLE_MODULE_REQUEST'); + + try { + const response = await api.get(`modules/${moduleID}`); + commit('SINGLE_MODULE__SUCCESS', response.data); + } catch (e) { + commit('SINGLE_MODULE_ERROR', e); + } + }, + + async toggleCheckClass({ commit, getters }, { classID, value }) { + commit('TOGGLE_CHECK_CLASS_REQUEST', { value, getters }); + try { + const { data } = await api.patch(`classes/${classID}/update_watched/`, { + watched: value, + }); + commit('TOGGLE_CHECK_CLASS__SUCCESS', data.watched_percentage); + } catch (error) { + commit('TOGGLE_CHECK_CLASS_ERROR', { error, getters, value }); + } + }, + }, +}); diff --git a/src/store/modules/mutations.js b/src/store/modules/mutations.js deleted file mode 100644 index 1b15d2c..0000000 --- a/src/store/modules/mutations.js +++ /dev/null @@ -1,41 +0,0 @@ -export default { - MODULES_REQUEST: (state) => (state.loadingModules = true), - MODULES__SUCCESS: (state, modules) => { - state.loadingModules = false; - state.modules = modules; - }, - MODULES_ERROR: (state, profileError) => { - state.error = profileError; - state.loadingModules = false; - }, - SINGLE_MODULE_REQUEST: (state) => (state.loadingSingleModule = true), - SINGLE_MODULE__SUCCESS: (state, module) => { - state.loadingSingleModule = false; - state.currentModule = module; - }, - SINGLE_MODULE_ERROR: (state, profileError) => { - state.error = profileError; - state.loadingSingleModule = false; - }, - SET_CURRENT_MODULE: (state, module) => { - state.currentModule = module; - }, - - //CLASS - TOGGLE_CHECK_CLASS_REQUEST: (state, { value, getters }) => { - getters.currentClass.lesson_monitoring.watched = value; - state.loadingToggleCurrentClass = true; - }, - TOGGLE_CHECK_CLASS__SUCCESS: (state, watched_percentage) => { - state.loadingToggleCurrentClass = false; - state.modules.find( - (mod) => mod.id === state.currentModule.id, - ).watched_percentage = watched_percentage; - state.currentModule.watched_percentage = watched_percentage; - }, - TOGGLE_CHECK_CLASS_ERROR: (state, { error, getters, value }) => { - state.error = error; - state.loadingSingleModule = false; - getters.currentClass.lesson_monitoring.watched = !value; - }, -}; diff --git a/src/views/ClassPage.vue b/src/views/ClassPage.vue index 1ff93d7..0925042 100644 --- a/src/views/ClassPage.vue +++ b/src/views/ClassPage.vue @@ -17,16 +17,35 @@
Suas anotações
- +
-
- Clique aqui para começar a fazer anotações. +
+ Clique aqui + para começar a fazer anotações.
- +
@@ -38,13 +57,16 @@
- -
+
Deixe um comentário
@@ -57,15 +79,21 @@
--> - - - @@ -472,7 +572,7 @@ h2 { &.yellowed { // background-color: $unnnic-color-aux-baby-yellow; - background-color: #FBF7C9; + background-color: #fbf7c9; outline: none; } @@ -658,7 +758,7 @@ aside { margin-bottom: $unnnic-spacing-stack-sm; } - ::v-deep { + ::v-deep { p { font-family: $unnnic-font-family-secondary; font-weight: $unnnic-font-weight-regular; @@ -749,11 +849,11 @@ aside { } @keyframes spin { - from { - transform:rotate(0deg); - } - to { - transform:rotate(360deg); - } + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } } diff --git a/src/views/ClassesListAll.vue b/src/views/ClassesListAll.vue index 9ce9266..d61be4b 100644 --- a/src/views/ClassesListAll.vue +++ b/src/views/ClassesListAll.vue @@ -2,7 +2,7 @@
- @@ -10,8 +10,11 @@
    -
  • - + - - +
@@ -40,19 +49,30 @@ @@ -95,4 +115,4 @@ main { justify-content: flex-end; } } - \ No newline at end of file + diff --git a/src/views/Home.vue b/src/views/Home.vue index 9449a57..6275415 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -19,7 +19,11 @@ --> - +
-

{{ category.title }}

- Ver tudo - Ver tudo + - - - - +
@@ -88,31 +104,33 @@ // import Fluxs from '@/components/tabs/fluxsTab.vue'; // import HumanCare from '@/components/tabs/humanCare.vue'; // import Ia from '@/components/tabs/iaTab.vue'; -import { mapActions, mapGetters, mapState } from "vuex"; -import { Swiper, SwiperSlide } from "vue-awesome-swiper"; -import Banner from "@/components/Banner.vue"; +import { useModulesStore } from '@/store/modules'; +import { Swiper, SwiperSlide } from 'vue-awesome-swiper'; +import Banner from '@/components/Banner.vue'; export default { - name: "Home", + // eslint-disable-next-line vue/multi-word-component-names + name: 'Home', data() { return { + modulesStore: useModulesStore(), swiperOption: { slidesPerView: 3, spaceBetween: 16, navigation: { - nextEl: ".swiper-button-next", - prevEl: ".swiper-button-prev", + nextEl: '.swiper-button-next', + prevEl: '.swiper-button-prev', }, }, colors: [ - "green-yellow", - "yellow-pink", - "pink-blue", - "red-blue", - "red-blue", - "pink-blue", - "yellow-pink", - "green-yellow", + 'green-yellow', + 'yellow-pink', + 'pink-blue', + 'red-blue', + 'red-blue', + 'pink-blue', + 'yellow-pink', + 'green-yellow', ], }; }, @@ -131,40 +149,45 @@ export default { await this.fetchSingleModule(module_id); }, methods: { - ...mapActions(["fetchSingleModule"]), + fetchSingleModule() { + return this.modulesStore.fetchSingleModule; + }, backSlide(index) { this.$refs.mySwiperRef[index].$swiper.slidePrev(); }, nextSlide(index) { this.$refs.mySwiperRef[index].$swiper.slideNext(); }, - getAllClasses(category){ + getAllClasses(category) { return category.class_set.length; }, - getAllCompletedClasses(category){ + getAllCompletedClasses(category) { const number = category.class_set.reduce((acumulator, lesson) => { if (lesson.lesson_monitoring.watched) acumulator++; return acumulator; }, 0); return number; - } + }, }, computed: { - ...mapGetters(['currentModule']), - ...mapState({ - loading: (state) => state.Modules.loadingSingleModule, - modules: (state) => state.Modules.modules, - }), + currentModule() { + return this.modulesStore.currentModule; + }, + loading() { + return this.modulesStore.loadingSingleModule; + }, + modules() { + return this.modulesStore.modules; + }, }, }; \ No newline at end of file + From 5c5ab9b7a6cc38c2febebb24d2667d31d849972c Mon Sep 17 00:00:00 2001 From: Mariana Date: Thu, 28 Mar 2024 16:59:49 -0300 Subject: [PATCH 3/8] fix: Fixing some errors on stores --- src/components/Header.vue | 2 +- src/router/index.js | 8 ++--- src/{store => stores}/header/index.js | 2 +- src/{store => stores}/index.js | 0 src/{store => stores}/modules/index.js | 46 ++++++++++++++---------- src/views/ClassesListAll.vue | 2 +- src/views/Home.vue | 2 +- src/views/Onboarding.vue | 2 +- tests/unit/store/modules/actions.spec.js | 38 ++++++++++---------- 9 files changed, 54 insertions(+), 48 deletions(-) rename src/{store => stores}/header/index.js (96%) rename src/{store => stores}/index.js (100%) rename src/{store => stores}/modules/index.js (79%) diff --git a/src/components/Header.vue b/src/components/Header.vue index 9b205d0..a789a1f 100644 --- a/src/components/Header.vue +++ b/src/components/Header.vue @@ -8,7 +8,7 @@