From 04a9ce2232a0f4f5bd0d4b2e7931a0fe1be765cf Mon Sep 17 00:00:00 2001 From: Paolo Arena Date: Thu, 2 Sep 2021 03:22:13 +0200 Subject: [PATCH] continua upgrade Vue 3 --- .eslintrc.js | 4 +- package.json | 34 +- src/boot/i18n.ts | 7 +- src/components/CMyAvatar/CMyAvatar.scss | 4 + src/components/CMyAvatar/CMyAvatar.ts | 62 + src/components/CMyAvatar/CMyAvatar.vue | 17 + src/components/CMyAvatar/index.ts | 1 + src/components/CMyCart/CMyCart.scss | 18 + src/components/CMyCart/CMyCart.ts.old | 55 + src/components/CMyCart/CMyCart.vue.old | 46 + src/components/CMyCart/index.ts | 1 + src/components/Header/Header.ts | 62 +- src/components/Header/Header.vue | 38 +- src/components/index.ts | 1 + src/db/lang/ws_it.js | 96 +- src/globalroutines/index.ts | 2 +- .../toolbar/messagePopover/messagePopover.ts | 2 - src/mixins/mixin-users.ts | 256 +- src/model/Products.ts | 6 +- src/model/Todos.ts | 2 +- src/root/home/home.vue | 16 +- src/store/Api/Instance.ts | 3 +- src/store/MessageStore.ts | 173 + src/store/Modules/tools.ts | 2949 ++++++++++++++++- src/store/Products.ts | 382 +++ src/store/Projects.ts | 558 ++++ src/store/Todos.ts | 501 +++ src/store/UserStore.ts | 22 +- src/store/globalStore.ts | 18 +- src/store/testStore.ts | 10 +- yarn.lock | 990 +++--- 31 files changed, 5615 insertions(+), 721 deletions(-) create mode 100755 src/components/CMyAvatar/CMyAvatar.scss create mode 100755 src/components/CMyAvatar/CMyAvatar.ts create mode 100755 src/components/CMyAvatar/CMyAvatar.vue create mode 100755 src/components/CMyAvatar/index.ts create mode 100755 src/components/CMyCart/CMyCart.scss create mode 100755 src/components/CMyCart/CMyCart.ts.old create mode 100755 src/components/CMyCart/CMyCart.vue.old create mode 100755 src/components/CMyCart/index.ts create mode 100755 src/store/MessageStore.ts create mode 100755 src/store/Products.ts create mode 100755 src/store/Projects.ts create mode 100755 src/store/Todos.ts diff --git a/.eslintrc.js b/.eslintrc.js index 4691c4d1..8d8e506b 100755 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -32,9 +32,9 @@ module.exports = { // https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#usage // ESLint typescript rules - // 'plugin:@typescript-eslint/recommended', + 'plugin:@typescript-eslint/recommended', // consider disabling this class of rules if linting takes too long - // 'plugin:@typescript-eslint/recommended-requiring-type-checking', + 'plugin:@typescript-eslint/recommended-requiring-type-checking', // Uncomment any of the lines below to choose desired strictness, // but leave only one uncommented! diff --git a/package.json b/package.json index 07b3d61c..bfec1b97 100755 --- a/package.json +++ b/package.json @@ -17,38 +17,38 @@ "generate-sw": "workbox generateSW workbox-config.js" }, "dependencies": { - "@quasar/extras": "^1.10.11", + "@quasar/extras": "^1.10.12", "@types/googlemaps": "^3.43.3", "@types/vuelidate": "^0.7.15", - "@vue/compat": "^3.2.6", - "@vue/compiler-sfc": "^3.2.6", + "@vue/compat": "^3.2.7", + "@vue/compiler-sfc": "^3.2.7", "@vue/eslint-config-standard": "^6.1.0", "acorn": "^8.4.1", - "autoprefixer": "^10.3.2", + "autoprefixer": "^10.3.3", "axios": "^0.21.1", "bcrypt-nodejs": "0.0.3", "bcryptjs": "^2.4.3", - "core-js": "^3.16.2", + "core-js": "^3.17.1", "date-fns": "^2.23.0", "dotenv": "^10.0.0", "element-ui": "^2.15.5", "eslint-plugin-quasar": "^1.0.0", - "graphql": "^15.5.1", + "graphql": "^15.5.2", "graphql-tag": "^2.12.5", "gsap": "^3.7.1", "jquery": "^3.6.0", - "js-cookie": "^3.0.0", + "js-cookie": "^3.0.1", "localforage": "^1.10.0", "lodash": "^4.17.21", "normalize.css": "^8.0.1", - "npm": "^7.21.0", + "npm": "^7.21.1", "nprogress": "^0.2.0", - "pinia": "^2.0.0-beta.5", + "pinia": "^2.0.0-rc.6", "prerender-spa-plugin": "^3.4.0", "quasar": "^2.0.4", "quasar-extras": "^2.0.9", "register-service-worker": "^1.7.2", - "vee-validate": "^3.4.11", + "vee-validate": "^3.4.12", "vue": "^3.1.0", "vue-class-component": "^8.0.0-rc.1", "vue-i18n": "^9.1.7", @@ -72,20 +72,20 @@ "@types/dotenv": "^8.2.0", "@types/jest": "^27.0.1", "@types/js-cookie": "^2.2.7", - "@types/node": "^16.7.1", + "@types/node": "^16.7.10", "@types/nprogress": "^0.2.0", - "@typescript-eslint/eslint-plugin": "^4.29.3", - "@typescript-eslint/parser": "^4.29.3", + "@typescript-eslint/eslint-plugin": "^4.30.0", + "@typescript-eslint/parser": "^4.30.0", "eslint": "^7.32.0", "eslint-config-airbnb-base": "^14.2.1", "eslint-config-airbnb-typescript": "^14.0.0", - "eslint-plugin-import": "^2.24.1", - "eslint-plugin-vue": "^7.16.0", + "eslint-plugin-import": "^2.24.2", + "eslint-plugin-vue": "^7.17.0", "eslint-webpack-plugin": "^3.0.1", "file-loader": "^6.2.0", "html-webpack-plugin": "^5.3.2", "http-proxy-middleware": "^2.0.1", - "jest": "^27.0.6", + "jest": "^27.1.0", "json-loader": "^0.5.7", "node-sass": "^6.0.1", "npm-check-updates": "^11.8.3", @@ -98,7 +98,7 @@ "tslint": "^6.1.3", "tslint-config-standard": "^9.0.0", "tslint-loader": "^3.5.4", - "typescript": "^4.3.5", + "typescript": "^4.4.2", "vue-cli-plugin-element-ui": "^1.1.4", "vueify": "^9.4.1", "workbox-cli": "^6.2.4", diff --git a/src/boot/i18n.ts b/src/boot/i18n.ts index 219b12e5..37064aa3 100755 --- a/src/boot/i18n.ts +++ b/src/boot/i18n.ts @@ -1,4 +1,5 @@ -import { createI18n } from 'vue-i18n' +// @ts-ignore +import { createI18n } from 'vue-i18n/dist/vue-i18n.esm-bundler' import messages from '../statics/i18n' import { boot } from 'quasar/wrappers' // you'll need to create the src/i18n/index.js file too @@ -15,9 +16,7 @@ export default ({ app }: { app: any }) => { export function useI18n() { // eslint-disable-next-line @typescript-eslint/unbound-method - const { - t, te, tm, rt, d, n, ...globalApi - } = i18n.global; + const { t, te, tm, rt, d, n, ...globalApi } = i18n.global; return { t: t.bind(i18n), diff --git a/src/components/CMyAvatar/CMyAvatar.scss b/src/components/CMyAvatar/CMyAvatar.scss new file mode 100755 index 00000000..b892863a --- /dev/null +++ b/src/components/CMyAvatar/CMyAvatar.scss @@ -0,0 +1,4 @@ +.myflex{ + display: flex; + flex: 1; +} diff --git a/src/components/CMyAvatar/CMyAvatar.ts b/src/components/CMyAvatar/CMyAvatar.ts new file mode 100755 index 00000000..a1fb6afd --- /dev/null +++ b/src/components/CMyAvatar/CMyAvatar.ts @@ -0,0 +1,62 @@ +import { defineComponent, onMounted, ref, watch } from 'vue' +import { useUserStore } from '@store/UserStore' + +export default defineComponent({ + name: 'CMyAvatar', + props: { + myimg: { + type: String, + required: false, + default: '', + }, + size: { + type: String, + required: false, + default: '40px', + }, + }, + + setup(props) { + + let myicon = ref('') + let myimgint = ref('') + + const userStore = useUserStore() + const imgprofile = ref(userStore.my.profile.img) + + function refresh() { + if (!props.myimg) { + myicon.value = 'fas fa-user-circle' + } else { + myimgint.value = props.myimg + } + // console.log('myimgint', this.myimgint) + } + + watch( + imgprofile, + // @ts-ignore + (value: string, oldValue: string) => { + userStore.my.profile.img = value + refresh() + }, + ) + + + watch( + // @ts-ignore + props.myimg, + // @ts-ignore + (value: string, oldValue: string) => { + myimgint.value = '' + refresh() + }, + ) + + onMounted(refresh) + + return { + myimgint, + } + }, +}) diff --git a/src/components/CMyAvatar/CMyAvatar.vue b/src/components/CMyAvatar/CMyAvatar.vue new file mode 100755 index 00000000..c2056b9c --- /dev/null +++ b/src/components/CMyAvatar/CMyAvatar.vue @@ -0,0 +1,17 @@ + + + + + diff --git a/src/components/CMyAvatar/index.ts b/src/components/CMyAvatar/index.ts new file mode 100755 index 00000000..5acf57dc --- /dev/null +++ b/src/components/CMyAvatar/index.ts @@ -0,0 +1 @@ +export { default as CMyAvatar } from './CMyAvatar.vue' diff --git a/src/components/CMyCart/CMyCart.scss b/src/components/CMyCart/CMyCart.scss new file mode 100755 index 00000000..240850ac --- /dev/null +++ b/src/components/CMyCart/CMyCart.scss @@ -0,0 +1,18 @@ +.card .product-image { + height: 300px; +} + +html, body { + margin:0; + padding:0; + height:100%; +} + +.text-title { + font-size: 0.9rem; +} + +.centeritems{ + place-content: center; +} + diff --git a/src/components/CMyCart/CMyCart.ts.old b/src/components/CMyCart/CMyCart.ts.old new file mode 100755 index 00000000..c43377e4 --- /dev/null +++ b/src/components/CMyCart/CMyCart.ts.old @@ -0,0 +1,55 @@ +import { Component, Prop, Watch } from 'vue-property-decorator' +import { tools } from '../../store/Modules/tools' +import MixinBase from '@src/mixins/mixin-base' +import { CTitleBanner } from '@components' +import { CCardState } from '../CCardState' +import { CCopyBtn } from '../CCopyBtn' + +import { IOrder, IProduct } from '@src/model' +import { CSingleCart } from '../../components/CSingleCart' +import MixinUsers from '@src/mixins/mixin-users' +import { computed, defineComponent, ref } from "vue" +import { useGlobalStore } from "@store/globalStore" + +@Component({ + name: 'CMyCart', + components: { CTitleBanner, CCardState, CCopyBtn, CSingleCart } +}) + +export default defineComponent({ + name: 'CMyCart', + props: {}, + + setup() { + const globalStore = useGlobalStore() + + const myCart = computed(() => Products.cart) + const myTotalPrice = computed(() => { + if (Products.cart) { + return Products.cart.totalPrice + } else { + return 0 + } + }) + + const ordersCart = computed(() => { + if (!!Products.cart) { + return Products.cart.items + } else { + return null + } + }) + + const numOrders = computed(() => { + if (!!Products.cart) { + return Products.cart.items.length + } else { + return 0 + } + }) + + + function closecart() { + globalStore.rightCartOpen = false + } +} diff --git a/src/components/CMyCart/CMyCart.vue.old b/src/components/CMyCart/CMyCart.vue.old new file mode 100755 index 00000000..517c7983 --- /dev/null +++ b/src/components/CMyCart/CMyCart.vue.old @@ -0,0 +1,46 @@ + + + + + diff --git a/src/components/CMyCart/index.ts b/src/components/CMyCart/index.ts new file mode 100755 index 00000000..e2236d14 --- /dev/null +++ b/src/components/CMyCart/index.ts @@ -0,0 +1 @@ +export { default as CMyCart } from './CMyCart.vue' diff --git a/src/components/Header/Header.ts b/src/components/Header/Header.ts index 26ac4b53..5570805f 100755 --- a/src/components/Header/Header.ts +++ b/src/components/Header/Header.ts @@ -9,20 +9,22 @@ import { shared_consts } from '@src/common/shared_vuejs' import { useI18n } from '@src/boot/i18n' import { boot } from 'quasar/wrappers' import { useRouter } from 'vue-router' -import MixinUsers from '../../mixins/mixin-users' import { static_data } from '../../db/static_data' import messagePopover from '../../layouts/toolbar/messagePopover/messagePopover.vue' import drawer from '../../layouts/drawer/drawer.vue' +import CMyAvatar from '../../components/CMyAvatar/CMyAvatar' import { toolsext } from '@store/Modules/toolsext' import { useGlobalStore } from '@store/globalStore' import { useTestStore } from '@store/testStore' import { useUserStore } from '@store/UserStore' +import MixinUsers from '../../mixins/mixin-users' + + export default defineComponent({ name: 'Header', - mixins: [MixinUsers], components: { - drawer, messagePopover, // CSigninNoreg, CMyAvatar, CMyCart + drawer, messagePopover, CMyAvatar, // CSigninNoreg, CMyCart }, props: { extraContent: { @@ -36,7 +38,6 @@ export default defineComponent({ }, setup() { - const store = inject('store') const $q = useQuasar() const { t } = useI18n() @@ -59,6 +60,27 @@ export default defineComponent({ const stateconn = ref(globalStore.stateConnection) + const { + getUsernameChatByMsg, + getMyUsername, + Username, + myName, + mySurname, + myCell, + Verificato, + MadeGift, + Email, + getMyImg, + getMyImgforIcon, + getImgByMsg, + getUserByUsername, + getImgByUsername, + isValidUsername, + getNumMsg, + getNumMsgUnread, + getMsgText, + paotest } = MixinUsers(); + function isonline() { return globalStore.stateConnection === 'online' } @@ -82,8 +104,7 @@ export default defineComponent({ } function getcolormenu() { - // @ts-ignore - return this.isSocio ? 'green-7' : 'white' + return isSocio.value ? 'green-7' : 'white' } function isTutor() { @@ -267,7 +288,7 @@ export default defineComponent({ registration.unregister() } }) - window.location.reload(true) + window.location.reload() } function changeIconConn() { @@ -432,13 +453,13 @@ export default defineComponent({ onMounted(mounted) return { - store, static_data, globalStore, leftDrawerOpen, rightDrawerOpen, rightCartOpen, lang, + langshort, isLogged, isEmailVerified, getnumOrdersCart, @@ -453,6 +474,31 @@ export default defineComponent({ imglogo, getappname, toggleanimation, + getClassColorHeader, + getcart, + getnumItemsCart, + isTutor, + isZoomeri, + isTratuttrici, + getUsernameChatByMsg, + getMyUsername, + Username, + myName, + mySurname, + myCell, + Verificato, + MadeGift, + Email, + getMyImg, + getMyImgforIcon, + getImgByMsg, + getUserByUsername, + getImgByUsername, + isValidUsername, + getNumMsg, + getNumMsgUnread, + getMsgText, + paotest, } }, diff --git a/src/components/Header/Header.vue b/src/components/Header/Header.vue index e3212a09..a44a5da5 100755 --- a/src/components/Header/Header.vue +++ b/src/components/Header/Header.vue @@ -104,13 +104,13 @@ @@ -123,14 +123,14 @@ round dense flat to="/orderinfo" icon="fas fa-list-ol"> - - {{ getnumOrdersCart }} + + {{ getnumOrdersCart() }} + class="q-mx-xs" v-if="static_data.functionality.SHOW_USER_MENU && isLogged()" round dense flat + @click="rightDrawerOpen = !rightDrawerOpen" :icon="getMyImgforIcon()" :color="getcolormenu()"> @@ -159,7 +159,7 @@ class="absolute-top-right" style="margin-right: 10px; color: white;" dense flat round icon="close" @click="rightCartOpen = !rightCartOpen"> -
Carrello +
Carrello
@@ -180,22 +180,22 @@ dense flat round icon="close" @click="rightDrawerOpen = !rightDrawerOpen"> -
{{ Username }} - {{ myName }} +
{{ Username() }} - {{ myName() }}
-
Admin
+
Admin
Socio
-
Residente
-
Consiglio
-
Segreteria
-
Tutor
-
Editor
+
Residente
+
Consiglio
+
Segreteria
+
Tutor
+
Editor
-
+
{{ t('user.loggati') }}
-
{{ +
{{ t('components.authentication.email_verification.verify_email') }}
@@ -203,7 +203,7 @@ -
+
{{ t('pages.profile') }} {{ t('login.esci') }} @@ -211,7 +211,7 @@
-
+
@@ -221,7 +221,7 @@
-
+
diff --git a/src/components/index.ts b/src/components/index.ts index 3b72a8ee..5fa22770 100755 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -1,5 +1,6 @@ export * from './logo' export * from './CMyPage' +export * from './CMyAvatar' export * from './CTitle' export * from './CImgTitle' export * from './BannerCookies' diff --git a/src/db/lang/ws_it.js b/src/db/lang/ws_it.js index 834701e9..92ce554e 100755 --- a/src/db/lang/ws_it.js +++ b/src/db/lang/ws_it.js @@ -95,13 +95,14 @@ const msg_website_it = { hours: 'Ore', }, msg: { - myAppDescription: '', - keywords_base: '', + myAppName: 'FreePlanet', + myAppDescription: 'Il primo Vero Social Libero, Equo e Solidale, dove Vive Consapevolezza e Aiuto Comunitario. Gratuito e senza Pubblicità', + underconstruction: 'App in costruzione...', myDescriz: '', sottoTitoloApp: 'Il primo Vero Social', - sottoTitoloApp2: '', - sottoTitoloApp3: '', - sottoTitoloApp4: '', + sottoTitoloApp2: 'Libero, Equo e Solidale', + sottoTitoloApp3: 'dove Vive Consapevolezza e Aiuto Comunitario', + sottoTitoloApp4: 'Gratuito e senza Pubblicità', }, homepage: { descrapp_title1: 'Uniti per Evolvere e Sperimentare', @@ -111,11 +112,86 @@ const msg_website_it = { descrapp_pag2: 'E\' giunta l\'ora di utilizzare i nuovi strumenti Tecnologici a nostro favore, per Liberarci ' + 'così piano piano dalla schiavitù del "Lavoro per generare Denaro" e trasformando le nostre Capacitá in ' + 'Risorse Umane per poterci sostenere e vivere in Armonia con gli altri.', - nostra_missione: 'Nostra Missione', - associazione: '', - tit_come_associarsi: 'Come Associarsi', - testo_come_associarsi: '', - titlecontatti: 'CONTATTI', + freesocial: { + title: 'Free Social', + descr: 'Una Community organizzata per Categorie, dove potrai unirti a Gruppi Tematici, ' + + 'Condividere Esperienze e unire Competenze per organizzare e sostenere Progetti Innovativi per il Popolo.

' + + 'Verranno evidenziati sviluppi Etici come l\'Auto-Produzione, la Sostenibilitá, ' + + 'la Buona Salute Naturale e il Rispetto per l\'Ambiente e per tutti gli Esseri Viventi di questo ' + + 'Pianeta. Chiunque potrá esprimere il proprio Consenso o Dissenso partecipando a Sondaggi Interattivi' + + ' e realizzare insieme i Cambiamenti necessari alla nostra Società.', + }, + freetalent: { + title: 'Free Talent', + descr: 'Condividi i tuoi Talenti e Abilità, ' + + 'al posto del denaro guadagnagnerai Tempo.
' + + '"1 ora" diventa moneta di scambio, uguale per tutti.
' + + 'Potrai utilizzare questi tuoi "Crediti Tempo" per soddisfare le tue necessità, cercando nelle Competenze Disponibili.
' + + 'Nel Dare e Ricevere, si creeranno così legami di Amicizia, Solidarietà, Cooperazione e Divertimento

' + + 'Questo progetto vuole diffondere, ora in maniera informatizzata, questa realtà che gia esiste da tanti anni, e viene chiamata "Banca del Tempo". ' + + 'Le segreterie sparse in tutto il mondo, serviranno a dare maggiore affidabilità e fiducia negli scambi di talenti tra persone sconosciute. ' + + 'Creeremo così una rete di fiducia nel vicinato, come giá viene praticato in numerosi Ecovillaggi e Comunità del mondo.', + }, + freegas: { + title: 'Free G.A.S.', + descr: 'Ti piacerebbe utilizzare una App che ti permetta facilmente di acquistare Prodotti Locali direttamente dal Produttore?
' + + 'Con i Gruppi di Acquisto Solidale si evitano intermediazioni inutili, ottenendo parecchi benefici tra cui:
' + + '
  • Qualitá Superiore del prodotto
  • ' + + '
  • Le Recensioni dei consumatori favoriranno i Produttori con Sani Intenti
  • ' + + '
  • Possiblità d\'interagire con il Produttore
  • ' + + '
  • Apertura alle Relazioni tra persone, condividendo Ricette e Consigli preziosi
  • ' + + '
  • Risparmio di soldi (prezzi all\'Ingrosso)
  • ' + + '
  • Valorizzare il Territorio e l\'Economia Locale
  • ' + + '
  • Condizioni Eque per i Lavoratori
  • ' + + '
  • Ridotto Impatto Ambientale
', + }, + freeliving: { + title: 'Free Co-Living', + descr: 'Unire più realtà, condividendo l\'esperienza di abitare insieme, per un periodo definito:
' + + '1) C\'è chi Vive solo ed ha una casa.
' + + '2) Chi ha bisogno di un alloggio temporaneo.

' + + 'Oggi sempre più persone abitano da sole e vorrebbero continuare a vivere nella propria abitazione.
' + + 'Altre persone invece hanno bisogno di una stanza, per scelta o per necessita, ed in cambio sono disponibili a ' + + 'contribuire alle spese per le utenze domestiche o magari aiutare la persona a fare la spesa, cucinare, pulire casa oppure offrendogli semplicemente compagnia.

' + + 'Tramite questo strumento, le persone potranno trovarsi, mettersi in contatto e decidere in che forma co-abitare e per quanto tempo. Le recensioni rilasciate ed il dettaglio dei profili utenti, ' + + 'aiuterà nella scelta della persona più in sintonia.', + + }, + freecollabora: { + title: 'Chi può Collaborare?', + descr: 'Tutti coloro che sono in linea con Princìpi Etici e ricerca del Benessere Globale del Pianeta
' + + 'Pertanto sono i benvenuti:' + + '
    ' + + '
  • Associazioni no-profit, Ecovillaggi, Comunità
  • ' + + '
  • Gruppi che intendono promuovere Progetti Sociali Innovativi per una Decrescita Felice
  • ' + + '
  • Chi gestisce un Gruppo di Acquisto Solidale (G.A.S.)
  • ' + + '
  • Produttori Locali Etici
  • ' + + '
  • Chi gestisce una Banca del Tempo
  • ' + + '
  • Chiunque voglia partecipare, nella forma che ritiene più opportuna.
  • ' + + '
', + }, + freesostieni: { + title: 'Come Sostenere il progetto?', + descr: '
    ' + + '
  • Condividendolo a tutti coloro che vogliono far parte insieme della crescita e sviluppo di una Nuova Era
  • ' + + '
  • Rispondendo ai Sondaggi Popolari e lasciando Feedback
  • ' + + '
  • Tramite una donazione (anche 1€ ) per le spese.
    ' + + '
' + + 'Vedo un futuro dove non si utilizzerà più denaro. Dove le persone si aiuteranno a vicenda e non avranno bisogno di "possedere" cose, ma le condivideranno con gli altri.
', + }, + multiplatform: { + title: 'Multi-piattaforma', + descr: 'E\' compatibile con Google Chrome, Firefox, Safari, iOS, Android e PC. L\'Applicazione s\'installa facilmente, senza passare dallo store. ' + + 'basta condividere il nome del sito www.freeplanet.app.
' + + 'Dopo la registrazione chiederà di aggiungerlo alla lista delle applicazioni e sullo sfondo', + }, + free: { + title: 'Gratuita, Open Source e Niente Pubblicità', + descr: 'Questa App non è in vendita, non ha scopi commerciali, non ha prezzo ed appartiene al Popolo del Nuovo Mondo.
Chiunque potrá utilizzarla e beneficiarne.
A me il compito di gestirla e proteggerla. ' + + 'Verranno accettate solo donazioni Libere di privati ed Associazioni no-profit, in linea con i Principi, che serviranno per coprire le spese.
' + + 'Grazie a Tutti per il sostegno. ', + }, + contacts: 'Contatti', }, }; diff --git a/src/globalroutines/index.ts b/src/globalroutines/index.ts index 41dea926..75a74ca7 100755 --- a/src/globalroutines/index.ts +++ b/src/globalroutines/index.ts @@ -3,7 +3,7 @@ import { idbKeyval as storage } from '@src/js/storage' -export default async (context: any, cmd: string, table: string, data: any = null, id = '') => { +export default async (cmd: string, table: string, data: any = null, id = '') => { // const globalStore = useGlobalStore() // const descr = data !== null ? data.descr : '' diff --git a/src/layouts/toolbar/messagePopover/messagePopover.ts b/src/layouts/toolbar/messagePopover/messagePopover.ts index 1afcaa7d..3c14cffc 100755 --- a/src/layouts/toolbar/messagePopover/messagePopover.ts +++ b/src/layouts/toolbar/messagePopover/messagePopover.ts @@ -15,8 +15,6 @@ const namespace = 'MessageModule' export default defineComponent({ name: 'MessagePopover', - mixins: [MixinUsers], - setup(props) { const $router = useRouter() // function lasts_messages (state: IUserState) => IMessage[] { diff --git a/src/mixins/mixin-users.ts b/src/mixins/mixin-users.ts index 665a41fa..2e28a4b2 100755 --- a/src/mixins/mixin-users.ts +++ b/src/mixins/mixin-users.ts @@ -1,153 +1,167 @@ -import { Vue, Options } from 'vue-class-component' -import { defineComponent, ref } from 'vue' - import { IMessage } from '@src/model' import { useUserStore } from '@store/UserStore' import { useGlobalStore } from '@store/globalStore' -import { tools } from '../store/Modules/tools' -import { func_tools } from '../store/Modules/toolsext' // You can declare a mixin as the same style as components. -export default defineComponent({ - name: 'MixinUsers', - setup(props) { - function getUserByUsername(username: string) { - const userStore = useUserStore() - return userStore.getNameSurnameByUsername(username) - } +export default function () { + function getUserByUsername(username: string) { + const userStore = useUserStore() + return userStore.getNameSurnameByUsername(username) + } - function getImgByUsername(username: string) { - const userStore = useUserStore() - return `public/${userStore.getImgByUsername(username)}` - } + function getImgByUsername(username: string) { + const userStore = useUserStore() + return `public/${userStore.getImgByUsername(username)}` + } - function isValidUsername(username: string) { - return username && username !== 'nessuno' && username !== 'none' - } + function isValidUsername(username: string) { + return username && username !== 'nessuno' && username !== 'none' + } - function getMyUsername() { - const userStore = useUserStore() - return userStore.my.username - } + function getMyUsername() { + const userStore = useUserStore() + return userStore.my.username + } - function getUsernameChatByMsg(msg: IMessage) { - if (msg) { - if (msg.dest) { - if (msg.dest.username !== getMyUsername()) return msg.dest.username - return msg.origin ? msg.origin.username : {} - } - } else { - return '' + function getUsernameChatByMsg(msg: IMessage) { + if (msg) { + if (msg.dest) { + if (msg.dest.username !== getMyUsername()) return msg.dest.username + return msg.origin ? msg.origin.username : {} } + } else { return '' } + return '' + } - function getnumItemsCart(): any { - // ++Todo: conv - /* const arrcart = Products.cart - if (!!arrcart) { - if (!!arrcart.items) { - // @ts-ignore - const total = arrcart.items.reduce((sum, item) => sum + item.order.quantity, 0) - return total - } - } */ - return 0 - } + function getnumItemsCart(): any { + // ++Todo: conv + /* const arrcart = Products.cart + if (!!arrcart) { + if (!!arrcart.items) { + // @ts-ignore + const total = arrcart.items.reduce((sum, item) => sum + item.order.quantity, 0) + return total + } + } */ + return 0 + } - function getImgByMsg(msg: IMessage) { - const userStore = useUserStore() - // @ts-ignore - return `public/${userStore.getImgByUsername(this.getUsernameChatByMsg(msg))}` - } + function getImgByMsg(msg: IMessage) { + const userStore = useUserStore() + // @ts-ignore + return `public/${userStore.getImgByUsername(this.getUsernameChatByMsg(msg))}` + } - function getMyImg() { - const userStore = useUserStore() - const ris = userStore.getImgByUsername(userStore.my.username) - return (ris !== '') ? `public/${ris}` : '' - } + function getMyImg() { + const userStore = useUserStore() + const ris = userStore.getImgByUsername(userStore.my.username) + return (ris !== '') ? `public/${ris}` : '' + } - function getMyImgforIcon() { - const userStore = useUserStore() - const ris = userStore.getImgByUsername(userStore.my.username) - return (ris !== '') ? `img:public/${ris}` : 'fas fa-user' - } + function getMyImgforIcon() { + const userStore = useUserStore() + const ris = userStore.getImgByUsername(userStore.my.username) + return (ris !== '') ? `img:public/${ris}` : 'fas fa-user' + } - function getIconCart() { - const iconcart = 'fas fa-shopping-cart' + function getIconCart() { + const iconcart = 'fas fa-shopping-cart' - return iconcart - } + return iconcart + } - function MenuCollapse() { - const globalStore = useGlobalStore() - return globalStore.menuCollapse - // return true - } + function MenuCollapse() { + const globalStore = useGlobalStore() + return globalStore.menuCollapse + // return true + } - function Username() { - const userStore = useUserStore() - return userStore.my.username - } + function Username() { + const userStore = useUserStore() + return userStore.my.username + } - function myName() { - const userStore = useUserStore() - return userStore.my.name - } + function myName() { + const userStore = useUserStore() + return userStore.my.name + } - function mySurname() { - const userStore = useUserStore() - return userStore.my.surname - } + function mySurname() { + const userStore = useUserStore() + return userStore.my.surname + } - function myCell() { - const userStore = useUserStore() - return userStore.my.profile.cell - } + function myCell() { + const userStore = useUserStore() + return userStore.my.profile.cell + } - function Verificato() { - const userStore = useUserStore() - return userStore.my.verified_email - } + function Verificato() { + const userStore = useUserStore() + return userStore.my.verified_email + } - function MadeGift() { - const userStore = useUserStore() - return userStore.my.made_gift - } + function paotest() { + return 'Ciaoooooooooooooooo!' + } - function Email() { - const userStore = useUserStore() - return userStore.my.email - } + function MadeGift() { + const userStore = useUserStore() + return userStore.my.made_gift + } - function getNumMsg() { - // ++Todo: conv - /* - return MessageStore.getlasts_messages().length - */ + function Email() { + const userStore = useUserStore() + return userStore.my.email + } - return 0 - } + function getNumMsg() { + // ++Todo: conv + /* + return MessageStore.getlasts_messages().length + */ - function getNumMsgUnread() { - // return userStore.getlasts_messages().length - // ++Todo: conv - // return MessageStore.getnumMsgUnread() - return 0 - } + return 0 + } - function getMsgText(msg: IMessage, inarray: boolean) { - let add = '' - if (msg.origin && msg.origin.username === getMyUsername()) add = 'Tu: ' + function getNumMsgUnread() { + // return userStore.getlasts_messages().length + // ++Todo: conv + // return MessageStore.getnumMsgUnread() + return 0 + } - const ris = add + msg.message - if (inarray) return [ris] - return ris - } + function getMsgText(msg: IMessage, inarray: boolean) { + let add = '' + if (msg.origin && msg.origin.username === getMyUsername()) add = 'Tu: ' - return { - getUsernameChatByMsg, - getMyUsername, - } - }, -}) + const ris = add + msg.message + if (inarray) return [ris] + return ris + } + + return { + getUsernameChatByMsg, + getMyUsername, + Username, + myName, + mySurname, + myCell, + Verificato, + MadeGift, + Email, + getMyImg, + getMyImgforIcon, + getImgByMsg, + getnumItemsCart, + getUserByUsername, + getImgByUsername, + isValidUsername, + getNumMsg, + getNumMsgUnread, + getMsgText, + paotest, + } +} diff --git a/src/model/Products.ts b/src/model/Products.ts index 4488d157..fa71d49a 100755 --- a/src/model/Products.ts +++ b/src/model/Products.ts @@ -3,8 +3,8 @@ export interface IProduct { active?: boolean idProducer?: string, idStorehouses?: string[], - producer?: IProducer, - storehouses?: IStorehouse[], + producer: IProducer, + storehouses: IStorehouse[], code?: string, name?: string, description?: string, @@ -25,7 +25,7 @@ export interface IProduct { } export interface IBaseOrder { - order?: IOrder + order: IOrder } export interface IOrder { diff --git a/src/model/Todos.ts b/src/model/Todos.ts index ba75d094..d99b7812 100755 --- a/src/model/Todos.ts +++ b/src/model/Todos.ts @@ -50,7 +50,7 @@ export interface IDrag { export interface ITodosState { showtype: number - todos: {} + todos: any categories: string[] // todos_changed: number reload_fromServer: number diff --git a/src/root/home/home.vue b/src/root/home/home.vue index 3c166863..2676fab6 100755 --- a/src/root/home/home.vue +++ b/src/root/home/home.vue @@ -50,7 +50,7 @@
-
+
@@ -64,7 +64,7 @@
-
+
@@ -141,7 +141,7 @@
-
+
@@ -155,7 +155,7 @@
-
+
@@ -236,7 +236,7 @@
-
+
@@ -250,7 +250,7 @@
-
+
@@ -392,10 +392,10 @@