From f27dd79dccb2136f1e07cc653a5d854bbfb060cc Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Tue, 12 Nov 2024 17:42:56 +0100 Subject: [PATCH 1/5] feat: proposal updates --- README.md | 4 ++-- src/components/common/VnSelect.vue | 11 ++--------- src/i18n/ca-ES/index.js | 2 +- src/i18n/en-US/index.js | 22 +++++++++++----------- src/i18n/es-ES/index.js | 23 ++++++++++++----------- src/i18n/fr-FR/index.js | 2 +- src/i18n/pt-PT/index.js | 1 + src/layouts/MainLayout.vue | 4 +++- src/pages/Cms/Home.vue | 18 +++--------------- src/pages/Cms/HomeView.vue | 26 +++++++------------------- src/pages/Ecomerce/OrdersView.vue | 5 +++-- 11 files changed, 46 insertions(+), 72 deletions(-) diff --git a/README.md b/README.md index ffa251dc..c5032e41 100644 --- a/README.md +++ b/README.md @@ -7,12 +7,12 @@ Hedera is the main web page for Verdnatura. Required dependencies. - PHP >= 7.0 -- Node.js >= 18.0 +- Node.js >= 8.0 Launch application for development. ``` -$ quasar dev +$ npm run dev ``` Launch project backend. diff --git a/src/components/common/VnSelect.vue b/src/components/common/VnSelect.vue index dab32500..24b82017 100644 --- a/src/components/common/VnSelect.vue +++ b/src/components/common/VnSelect.vue @@ -162,10 +162,7 @@ async function filterHandler(val, update) { :rules="$attrs.required ? [requiredFieldRule] : null" virtual-scroll-slice-size="options.length" > - diff --git a/src/i18n/ca-ES/index.js b/src/i18n/ca-ES/index.js index 0a3d7b1a..20b088cf 100644 --- a/src/i18n/ca-ES/index.js +++ b/src/i18n/ca-ES/index.js @@ -49,7 +49,7 @@ export default { ] }, of: 'de', - + startOrder: 'Començar comanda', // Sections titles titles: { Home: 'Inici', diff --git a/src/i18n/en-US/index.js b/src/i18n/en-US/index.js index b18d90cc..e68add91 100644 --- a/src/i18n/en-US/index.js +++ b/src/i18n/en-US/index.js @@ -2,16 +2,6 @@ // so you can safely delete all default props below export default { - failed: 'Action failed', - success: 'Action was successful', - internalServerError: 'Internal server error', - somethingWentWrong: 'Something went wrong', - loginFailed: 'Login failed', - authenticationRequired: 'Authentication required', - notFound: 'Not found', - today: 'Today', - yesterday: 'Yesterday', - tomorrow: 'Tomorrow', language: 'Language', langs: { en: 'English', @@ -61,7 +51,17 @@ export default { 'Dec' ] }, - + startOrder: 'Start order', + failed: 'Action failed', + success: 'Action was successful', + internalServerError: 'Internal server error', + somethingWentWrong: 'Something went wrong', + loginFailed: 'Login failed', + authenticationRequired: 'Authentication required', + notFound: 'Not found', + today: 'Today', + yesterday: 'Yesterday', + tomorrow: 'Tomorrow', // Sections titles titles: { Home: 'Home', diff --git a/src/i18n/es-ES/index.js b/src/i18n/es-ES/index.js index dda8dab9..b30f3ed4 100644 --- a/src/i18n/es-ES/index.js +++ b/src/i18n/es-ES/index.js @@ -1,14 +1,4 @@ export default { - failed: 'Acción fallida', - success: 'Acción exitosa', - internalServerError: 'Error interno del servidor', - somethingWentWrong: 'Algo salió mal', - loginFailed: 'Usuario o contraseña incorrectos', - authenticationRequired: 'Autenticación requerida', - notFound: 'No encontrado', - today: 'Hoy', - yesterday: 'Ayer', - tomorrow: 'Mañana', language: 'Idioma', langs: { en: 'Inglés', @@ -58,6 +48,16 @@ export default { 'Dic' ] }, + failed: 'Acción fallida', + success: 'Acción exitosa', + internalServerError: 'Error interno del servidor', + somethingWentWrong: 'Algo salió mal', + loginFailed: 'Usuario o contraseña incorrectos', + authenticationRequired: 'Autenticación requerida', + notFound: 'No encontrado', + today: 'Hoy', + yesterday: 'Ayer', + tomorrow: 'Mañana', // Sections titles titles: { @@ -128,7 +128,6 @@ export default { delete: 'Borrar', confirmDelete: '¿Estás seguro de que quieres borrar la línea?', emptyList: 'Lista vacía', - orders: 'Pedidos', order: 'Pedido pendiente', ticket: 'Pedido', @@ -149,6 +148,7 @@ export default { remindMe: 'Recuérdame', logInAsGuest: 'Entrar como invitado', logIn: 'Iniciar sesión', + logOut: 'Cerrar sesión', loginMail: "{'info'}{'@'}{'verdnatura.es'}", loginPhone: '+34 963 242 100', haveForgottenPassword: '¿Has olvidado tu contraseña?', @@ -161,6 +161,7 @@ export default { cancel: 'Cancelar', of: 'de', modify: 'Modificar', + startOrder: 'Empezar pedido', shoppingCart: 'Cesta de la compra', available: 'Disponible', minQuantity: 'Cantidad mínima', diff --git a/src/i18n/fr-FR/index.js b/src/i18n/fr-FR/index.js index 56a5742e..4ad3ec06 100644 --- a/src/i18n/fr-FR/index.js +++ b/src/i18n/fr-FR/index.js @@ -49,7 +49,7 @@ export default { ] }, of: 'de', - + startOrder: 'Lancer commande', // Sections titles titles: { Home: 'Accueil', diff --git a/src/i18n/pt-PT/index.js b/src/i18n/pt-PT/index.js index f49db9f4..7a193eb7 100644 --- a/src/i18n/pt-PT/index.js +++ b/src/i18n/pt-PT/index.js @@ -49,6 +49,7 @@ export default { ] }, of: 'de', + startOrder: 'Comece uma encomenda', // Sections titles titles: { Home: 'Início', diff --git a/src/layouts/MainLayout.vue b/src/layouts/MainLayout.vue index 8a84f6a7..26093e6b 100644 --- a/src/layouts/MainLayout.vue +++ b/src/layouts/MainLayout.vue @@ -97,7 +97,9 @@ const logoutSupplantedUser = async () => { alt="_Exit" @click="logout()" data-testid="logoutButton" - /> + > + {{ $t('logOut') }} +
+ > + {{ $t('startOrder') }}
@@ -62,16 +63,3 @@ export default { } }; - - -en-US: - startOrder: Start order -es-ES: - startOrder: Empezar pedido -ca-ES: - startOrder: Començar comanda -fr-FR: - startOrder: Lancer commande -pt-PT: - startOrder: Comece uma encomenda - diff --git a/src/pages/Cms/HomeView.vue b/src/pages/Cms/HomeView.vue index b368a15f..8bc5e166 100644 --- a/src/pages/Cms/HomeView.vue +++ b/src/pages/Cms/HomeView.vue @@ -20,16 +20,9 @@ onMounted(async () => await fetchData()); diff --git a/src/pages/Ecomerce/OrdersView.vue b/src/pages/Ecomerce/OrdersView.vue index 97450c71..c3787f50 100644 --- a/src/pages/Ecomerce/OrdersView.vue +++ b/src/pages/Ecomerce/OrdersView.vue @@ -118,8 +118,9 @@ const onConfirmPay = async () => { icon="add_shopping_cart" color="accent" :to="{ name: 'catalog' }" - :title="t('startOrder')" - /> + > + {{ t('startOrder') }} Date: Tue, 12 Nov 2024 17:47:21 +0100 Subject: [PATCH 2/5] feat: cypress reporter --- cypress.config.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cypress.config.js b/cypress.config.js index f4e3c34c..3da46965 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -12,9 +12,20 @@ module.exports = defineConfig({ numTestsKeptInMemory: 0, video: false, screenshotOnRunFailure: false, + reporter: 'cypress-mochawesome-reporter', + reporterOptions: { + charts: true, + reportPageTitle: 'Hedera-Web E2E Reporter', + embeddedScreenshots: true, + reportDir: 'src/test/cypress/reports', + inlineAssets: true + }, setupNodeEvents(on, config) { + require('cypress-mochawesome-reporter/plugin')(on); on('after:spec', (spec, results) => { console.log('Finished running', spec.relative); + console.log('❌spec:', results.stats.failures); + console.log('✅spec:', results.stats.passes); }); } } From 5a0dc0a92708a32f9cb17d92dc034e055c3495d2 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Tue, 12 Nov 2024 17:58:39 +0100 Subject: [PATCH 3/5] perf: proposal package.json pnpm manager --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 1d390328..c25c1ca7 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "license": "GPL-3.0", "productName": "Salix", "author": "Verdnatura", + "packageManager": "pnpm@8.15.1", "repository": { "type": "git", "url": "https://git.verdnatura.es/hedera-web" From e554dd1cb1d1e439250a31c6995fc4470faf476f Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Tue, 12 Nov 2024 17:58:52 +0100 Subject: [PATCH 4/5] feat: cypress reporter --- package.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index c25c1ca7..c8de067e 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,6 @@ "license": "GPL-3.0", "productName": "Salix", "author": "Verdnatura", - "packageManager": "pnpm@8.15.1", "repository": { "type": "git", "url": "https://git.verdnatura.es/hedera-web" @@ -19,11 +18,11 @@ "assets-webpack-plugin": "^7.1.1", "babel-loader": "^9.1.0", "bundle-loader": "^0.5.6", - "css-loader": "^5.2.7", - "cypress": "^13.15.0", + "cypress-mochawesome-reporter": "^3.8.2", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "eslint-config-standard": "^17.0.0", + "eslint-plugin-cypress": "^4.1.0", "eslint-plugin-import": "^2.19.1", "eslint-plugin-n": "^15.0.0", "eslint-plugin-prettier": "^5.1.3", From 247ad94199dbce414aa29cbfe891ad315c60372e Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Tue, 12 Nov 2024 17:59:24 +0100 Subject: [PATCH 5/5] feat: porposal remove dependencies --- package.json | 26 ++++---------------------- webpack.config.js | 13 ++++++------- 2 files changed, 10 insertions(+), 29 deletions(-) diff --git a/package.json b/package.json index c8de067e..27234e87 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "license": "GPL-3.0", "productName": "Salix", "author": "Verdnatura", + "packageManager": "pnpm@8.15.1", "repository": { "type": "git", "url": "https://git.verdnatura.es/hedera-web" @@ -34,47 +35,28 @@ "glob": "^8.0.3", "html-webpack-plugin": "^5.5.0", "json-loader": "^0.5.7", - "mini-css-extract-plugin": "^2.7.0", - "node-sass": "^7.0.1", - "postcss": "^8.4.39", - "postcss-import": "^13.0.0", - "postcss-loader": "^4.3.0", - "postcss-url": "^10.1.3", - "raw-loader": "^4.0.2", - "sass-loader": "^12.6.0", - "style-loader": "^3.3.1", - "url-loader": "^4.1.1", - "webpack": "^5.75.0", - "webpack-cli": "^4.10.0", - "webpack-dev-server": "^4.11.1", - "webpack-merge": "^5.8.0", "yaml-loader": "^0.5.0" }, "dependencies": { - "@quasar/extras": "^1.0.0", + "@quasar/cli": "^2.3.0", + "@quasar/extras": "^1.16.9", "axios": "^0.21.1", "core-js": "^3.6.5", - "eslint-plugin-cypress": "^2.13.3", "js-yaml": "^3.12.1", - "mootools": "^1.5.2", "pinia": "^2.0.11", - "promise-polyfill": "^8.2.3", - "quasar": "^2.6.0", + "quasar": "^2.14.5", "require-yaml": "0.0.1", - "tinymce": "^6.3.0", "vue": "^3.3.4", "vue-i18n": "^9.2.2", "vue-router": "^4.0.0" }, "scripts": { - "front": "webpack serve --open", "back": "cd ../vn-database && myvc start && cd ../salix && gulp backOnly", "resetDatabase": "cd ../salix && gulp docker", "cy:open": "npm run resetDatabase && cd ../hedera-web && cypress open", "test:e2e": "npm run resetDatabase && cd ../hedera-web && cypress run", "cy:open-mindshore": "npm run resetDatabase && cd ../hedera-web-mindshore && cypress open", "test:e2e-mindshore": "npm run resetDatabase && cd ../hedera-web-mindshore && cypress run", - "build": "rm -rf build/ ; webpack", "clean": "rm -rf build/", "lint": "eslint --ext .js,.vue ./" }, diff --git a/webpack.config.js b/webpack.config.js index 6f266ab9..99a55f35 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -5,7 +5,7 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const merge = require('webpack-merge').merge; const wpConfig = require('./webpack.config.json'); -let env = process.env.NODE_ENV || 'development'; +const env = process.env.NODE_ENV || 'development'; const devMode = env === 'development'; const outputPath = path.join(__dirname, wpConfig.buildDir); const publicPath = '/' + wpConfig.buildDir + '/'; @@ -15,7 +15,7 @@ const baseConfig = { mode: devMode ? 'development' : 'production', output: { path: outputPath, - publicPath: publicPath + publicPath }, module: { rules: [ @@ -31,16 +31,16 @@ const baseConfig = { }, { test: /tinymce\/.*\/skin\.css$/i, - use: [MiniCssExtractPlugin.loader, 'css-loader'] + use: [MiniCssExtractPlugin.loader] }, { test: /tinymce\/.*\/content\.css$/i, - loader: 'css-loader', + url: false, options: { esModule: false } }, { test: /\.css$/, - use: ['style-loader', 'css-loader'], + use: ['style-loader'], exclude: [/node_modules/] }, { @@ -59,9 +59,9 @@ const baseConfig = { test: /\.scss$/, use: [ 'style-loader', - 'css-loader', { loader: 'sass-loader', + url: false, options: { sourceMap: true } @@ -141,7 +141,6 @@ const devConfig = { static: __dirname, port: wpConfig.devServerPort, headers: { 'Access-Control-Allow-Origin': '*' }, - //stats: { chunks: false }, proxy: { '/api': 'http://localhost:3000', '/': {