0
1
Fork 0

Resolve main layout conflicts

This commit is contained in:
William Buezas 2024-11-12 15:12:39 -03:00
commit 56262d91b4
14 changed files with 69 additions and 104 deletions

View File

@ -7,12 +7,12 @@ Hedera is the main web page for Verdnatura.
Required dependencies. Required dependencies.
- PHP >= 7.0 - PHP >= 7.0
- Node.js >= 18.0 - Node.js >= 8.0
Launch application for development. Launch application for development.
``` ```
$ quasar dev $ npm run dev
``` ```
Launch project backend. Launch project backend.

View File

@ -12,9 +12,20 @@ module.exports = defineConfig({
numTestsKeptInMemory: 0, numTestsKeptInMemory: 0,
video: false, video: false,
screenshotOnRunFailure: 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) { setupNodeEvents(on, config) {
require('cypress-mochawesome-reporter/plugin')(on);
on('after:spec', (spec, results) => { on('after:spec', (spec, results) => {
console.log('Finished running', spec.relative); console.log('Finished running', spec.relative);
console.log('❌spec:', results.stats.failures);
console.log('✅spec:', results.stats.passes);
}); });
} }
} }

View File

@ -5,6 +5,7 @@
"license": "GPL-3.0", "license": "GPL-3.0",
"productName": "Salix", "productName": "Salix",
"author": "Verdnatura", "author": "Verdnatura",
"packageManager": "pnpm@8.15.1",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://git.verdnatura.es/hedera-web" "url": "https://git.verdnatura.es/hedera-web"
@ -18,11 +19,11 @@
"assets-webpack-plugin": "^7.1.1", "assets-webpack-plugin": "^7.1.1",
"babel-loader": "^9.1.0", "babel-loader": "^9.1.0",
"bundle-loader": "^0.5.6", "bundle-loader": "^0.5.6",
"css-loader": "^5.2.7", "cypress-mochawesome-reporter": "^3.8.2",
"cypress": "^13.15.0",
"eslint": "^8.57.0", "eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0", "eslint-config-prettier": "^9.1.0",
"eslint-config-standard": "^17.0.0", "eslint-config-standard": "^17.0.0",
"eslint-plugin-cypress": "^4.1.0",
"eslint-plugin-import": "^2.19.1", "eslint-plugin-import": "^2.19.1",
"eslint-plugin-n": "^15.0.0", "eslint-plugin-n": "^15.0.0",
"eslint-plugin-prettier": "^5.1.3", "eslint-plugin-prettier": "^5.1.3",
@ -34,47 +35,28 @@
"glob": "^8.0.3", "glob": "^8.0.3",
"html-webpack-plugin": "^5.5.0", "html-webpack-plugin": "^5.5.0",
"json-loader": "^0.5.7", "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" "yaml-loader": "^0.5.0"
}, },
"dependencies": { "dependencies": {
"@quasar/extras": "^1.0.0", "@quasar/cli": "^2.3.0",
"@quasar/extras": "^1.16.9",
"axios": "^0.21.1", "axios": "^0.21.1",
"core-js": "^3.6.5", "core-js": "^3.6.5",
"eslint-plugin-cypress": "^2.13.3",
"js-yaml": "^3.12.1", "js-yaml": "^3.12.1",
"mootools": "^1.5.2",
"pinia": "^2.0.11", "pinia": "^2.0.11",
"promise-polyfill": "^8.2.3", "quasar": "^2.14.5",
"quasar": "^2.6.0",
"require-yaml": "0.0.1", "require-yaml": "0.0.1",
"tinymce": "^6.3.0",
"vue": "^3.3.4", "vue": "^3.3.4",
"vue-i18n": "^9.2.2", "vue-i18n": "^9.2.2",
"vue-router": "^4.0.0" "vue-router": "^4.0.0"
}, },
"scripts": { "scripts": {
"front": "webpack serve --open",
"back": "cd ../vn-database && myvc start && cd ../salix && gulp backOnly", "back": "cd ../vn-database && myvc start && cd ../salix && gulp backOnly",
"resetDatabase": "cd ../salix && gulp docker", "resetDatabase": "cd ../salix && gulp docker",
"cy:open": "npm run resetDatabase && cd ../hedera-web && cypress open", "cy:open": "npm run resetDatabase && cd ../hedera-web && cypress open",
"test:e2e": "npm run resetDatabase && cd ../hedera-web && cypress run", "test:e2e": "npm run resetDatabase && cd ../hedera-web && cypress run",
"cy:open-mindshore": "npm run resetDatabase && cd ../hedera-web-mindshore && cypress open", "cy:open-mindshore": "npm run resetDatabase && cd ../hedera-web-mindshore && cypress open",
"test:e2e-mindshore": "npm run resetDatabase && cd ../hedera-web-mindshore && cypress run", "test:e2e-mindshore": "npm run resetDatabase && cd ../hedera-web-mindshore && cypress run",
"build": "rm -rf build/ ; webpack",
"clean": "rm -rf build/", "clean": "rm -rf build/",
"lint": "eslint --ext .js,.vue ./" "lint": "eslint --ext .js,.vue ./"
}, },

View File

@ -162,10 +162,7 @@ async function filterHandler(val, update) {
:rules="$attrs.required ? [requiredFieldRule] : null" :rules="$attrs.required ? [requiredFieldRule] : null"
virtual-scroll-slice-size="options.length" virtual-scroll-slice-size="options.length"
> >
<template <template v-if="isClearable" #append>
v-if="isClearable"
#append
>
<QIcon <QIcon
v-show="value" v-show="value"
name="close" name="close"
@ -179,11 +176,7 @@ async function filterHandler(val, update) {
#[slotName]="slotData" #[slotName]="slotData"
:key="slotName" :key="slotName"
> >
<slot <slot :name="slotName" v-bind="slotData ?? {}" :key="slotName" />
:name="slotName"
v-bind="slotData ?? {}"
:key="slotName"
/>
</template> </template>
</QSelect> </QSelect>
</template> </template>

View File

@ -49,7 +49,7 @@ export default {
] ]
}, },
of: 'de', of: 'de',
startOrder: 'Començar comanda',
// Sections titles // Sections titles
titles: { titles: {
Home: 'Inici', Home: 'Inici',

View File

@ -2,16 +2,6 @@
// so you can safely delete all default props below // so you can safely delete all default props below
export default { 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', language: 'Language',
langs: { langs: {
en: 'English', en: 'English',
@ -61,7 +51,17 @@ export default {
'Dec' '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 // Sections titles
titles: { titles: {
Home: 'Home', Home: 'Home',

View File

@ -1,14 +1,4 @@
export default { 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', language: 'Idioma',
langs: { langs: {
en: 'Inglés', en: 'Inglés',
@ -58,6 +48,16 @@ export default {
'Dic' '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 // Sections titles
titles: { titles: {
@ -128,7 +128,6 @@ export default {
delete: 'Borrar', delete: 'Borrar',
confirmDelete: '¿Estás seguro de que quieres borrar la línea?', confirmDelete: '¿Estás seguro de que quieres borrar la línea?',
emptyList: 'Lista vacía', emptyList: 'Lista vacía',
orders: 'Pedidos', orders: 'Pedidos',
order: 'Pedido pendiente', order: 'Pedido pendiente',
ticket: 'Pedido', ticket: 'Pedido',
@ -149,6 +148,7 @@ export default {
remindMe: 'Recuérdame', remindMe: 'Recuérdame',
logInAsGuest: 'Entrar como invitado', logInAsGuest: 'Entrar como invitado',
logIn: 'Iniciar sesión', logIn: 'Iniciar sesión',
logOut: 'Cerrar sesión',
loginMail: "{'info'}{'@'}{'verdnatura.es'}", loginMail: "{'info'}{'@'}{'verdnatura.es'}",
loginPhone: '+34 963 242 100', loginPhone: '+34 963 242 100',
haveForgottenPassword: '¿Has olvidado tu contraseña?', haveForgottenPassword: '¿Has olvidado tu contraseña?',
@ -161,6 +161,7 @@ export default {
cancel: 'Cancelar', cancel: 'Cancelar',
of: 'de', of: 'de',
modify: 'Modificar', modify: 'Modificar',
startOrder: 'Empezar pedido',
shoppingCart: 'Cesta de la compra', shoppingCart: 'Cesta de la compra',
available: 'Disponible', available: 'Disponible',
minQuantity: 'Cantidad mínima', minQuantity: 'Cantidad mínima',

View File

@ -49,7 +49,7 @@ export default {
] ]
}, },
of: 'de', of: 'de',
startOrder: 'Lancer commande',
// Sections titles // Sections titles
titles: { titles: {
Home: 'Accueil', Home: 'Accueil',

View File

@ -49,6 +49,7 @@ export default {
] ]
}, },
of: 'de', of: 'de',
startOrder: 'Comece uma encomenda',
// Sections titles // Sections titles
titles: { titles: {
Home: 'Início', Home: 'Início',

View File

@ -79,7 +79,6 @@ const logoutSupplantedUser = async () => {
</QBtn> </QBtn>
</QToolbar> </QToolbar>
</QHeader> </QHeader>
<QPageContainer :key="refreshContentKey"> <QPageContainer :key="refreshContentKey">
<QDrawer <QDrawer
v-model="leftDrawerOpen" v-model="leftDrawerOpen"
@ -98,7 +97,9 @@ const logoutSupplantedUser = async () => {
alt="_Exit" alt="_Exit"
@click="logout()" @click="logout()"
data-testid="logoutButton" data-testid="logoutButton"
/> >
<QTooltip>{{ $t('logOut') }}</QTooltip>
</QBtn>
</div> </div>
<div <div
v-if="supplantedUser" v-if="supplantedUser"

View File

@ -20,8 +20,9 @@
icon="add_shopping_cart" icon="add_shopping_cart"
color="accent" color="accent"
to="/ecomerce/catalog" to="/ecomerce/catalog"
:title="$t('startOrder')" >
/> <QTooltip>{{ $t('startOrder') }}</QTooltip></QBtn
>
</QPageSticky> </QPageSticky>
</div> </div>
</template> </template>
@ -62,16 +63,3 @@ export default {
} }
}; };
</script> </script>
<i18n lang="yaml">
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
</i18n>

View File

@ -20,16 +20,9 @@ onMounted(async () => await fetchData());
<template> <template>
<div style="padding: 0"> <div style="padding: 0">
<div class="q-pa-sm row items-start"> <div class="q-pa-sm row items-start">
<div <div class="new-card q-pa-sm" v-for="myNew in news" :key="myNew.id">
class="new-card q-pa-sm"
v-for="myNew in news"
:key="myNew.id"
>
<QCard> <QCard>
<VnImg <VnImg :id="myNew.image" storage="news" />
:id="myNew.image"
storage="news"
/>
<QCardSection> <QCardSection>
<div class="text-h5"> <div class="text-h5">
@ -37,10 +30,7 @@ onMounted(async () => await fetchData());
</div> </div>
</QCardSection> </QCardSection>
<QCardSection class="new-body"> <QCardSection class="new-body">
<div <div v-html="myNew.text" class="card-text" />
v-html="myNew.text"
class="card-text"
/>
</QCardSection> </QCardSection>
</QCard> </QCard>
</div> </div>
@ -51,14 +41,12 @@ onMounted(async () => await fetchData());
icon="add_shopping_cart" icon="add_shopping_cart"
color="accent" color="accent"
to="/ecomerce/catalog" to="/ecomerce/catalog"
:title="$t('startOrder')" >
/> <QTooltip>{{ $t('startOrder') }}</QTooltip></QBtn
>
</QPageSticky> </QPageSticky>
</div> </div>
<QDialog <QDialog v-model="showPreview" @hide="selectedImageSrc = ''">
v-model="showPreview"
@hide="selectedImageSrc = ''"
>
<QImg :src="selectedImageSrc" /> <QImg :src="selectedImageSrc" />
</QDialog> </QDialog>
</template> </template>

View File

@ -118,8 +118,9 @@ const onConfirmPay = async () => {
icon="add_shopping_cart" icon="add_shopping_cart"
color="accent" color="accent"
:to="{ name: 'catalog' }" :to="{ name: 'catalog' }"
:title="t('startOrder')" >
/> <QTooltip>{{ t('startOrder') }}</QTooltip></QBtn
>
</QPageSticky> </QPageSticky>
<VnConfirm <VnConfirm
v-model="showAmountToPayDialog" v-model="showAmountToPayDialog"

View File

@ -5,7 +5,7 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const merge = require('webpack-merge').merge; const merge = require('webpack-merge').merge;
const wpConfig = require('./webpack.config.json'); 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 devMode = env === 'development';
const outputPath = path.join(__dirname, wpConfig.buildDir); const outputPath = path.join(__dirname, wpConfig.buildDir);
const publicPath = '/' + wpConfig.buildDir + '/'; const publicPath = '/' + wpConfig.buildDir + '/';
@ -15,7 +15,7 @@ const baseConfig = {
mode: devMode ? 'development' : 'production', mode: devMode ? 'development' : 'production',
output: { output: {
path: outputPath, path: outputPath,
publicPath: publicPath publicPath
}, },
module: { module: {
rules: [ rules: [
@ -31,16 +31,16 @@ const baseConfig = {
}, },
{ {
test: /tinymce\/.*\/skin\.css$/i, test: /tinymce\/.*\/skin\.css$/i,
use: [MiniCssExtractPlugin.loader, 'css-loader'] use: [MiniCssExtractPlugin.loader]
}, },
{ {
test: /tinymce\/.*\/content\.css$/i, test: /tinymce\/.*\/content\.css$/i,
loader: 'css-loader', url: false,
options: { esModule: false } options: { esModule: false }
}, },
{ {
test: /\.css$/, test: /\.css$/,
use: ['style-loader', 'css-loader'], use: ['style-loader'],
exclude: [/node_modules/] exclude: [/node_modules/]
}, },
{ {
@ -59,9 +59,9 @@ const baseConfig = {
test: /\.scss$/, test: /\.scss$/,
use: [ use: [
'style-loader', 'style-loader',
'css-loader',
{ {
loader: 'sass-loader', loader: 'sass-loader',
url: false,
options: { options: {
sourceMap: true sourceMap: true
} }
@ -141,7 +141,6 @@ const devConfig = {
static: __dirname, static: __dirname,
port: wpConfig.devServerPort, port: wpConfig.devServerPort,
headers: { 'Access-Control-Allow-Origin': '*' }, headers: { 'Access-Control-Allow-Origin': '*' },
//stats: { chunks: false },
proxy: { proxy: {
'/api': 'http://localhost:3000', '/api': 'http://localhost:3000',
'/': { '/': {