diff --git a/.env.development b/.env.development new file mode 100755 index 00000000..cf696866 --- /dev/null +++ b/.env.development @@ -0,0 +1,28 @@ +APP_VERSION="0.0.63" +SERVICE_WORKER_FILE="service-worker.js" +APP_ID="1" +DIRECTORY_LOCAL="freeplanet" +DIRECTORY_SERVER="freeplanet_serverside" +SERVERDIR_WEBSITE="" +SERVERPW_WEBSITE="" +APP_URL="http://localhost" +URL_FACEBOOK="https://www.facebook.com/freeplanetapp" +PROVA_PAOLO="PROVA ENV FUNZIONA!" +LANG_DEFAULT="it" +PAO_APP_ID="KKPPAA5KJK435J3KSS9F9D8S9F8SD98F9SDF" +MASTER_KEY="KKPPSS5KJK435J3KSS9F9D8S9F8SD3CR3T" +MONGODB_HOST="http://localhost:3000" +LOGO_REG="freeplanet-logo-full.svg" +TEST_NAME="Paolo" +TEST_SURNAME="Arena" +TEST_EMAIL="paolo.arena77@gmail.com" +TEST_USERNAME="" +TEST_PASSWORD="" +TEST_APORTADOR="" +PUBLICKEY_PUSH='BGxRrFWnPoa_ImUaWXmeEOFVI9VNKVKaAPsvsM1XY6wn24yxp9MyOQ4crNYCJKxSXV65Y1GblW5_VLoamedcZ1I' +IN_CONSTRUCTION="0" +DEBUG="1" +TELEGRAM_SUPPORT="" +PROJECT_ID_MAIN="5cc0a13fe5c9d156728f400a" +TEST_CELL="" +ISTEST=true diff --git a/.env.production b/.env.production new file mode 100755 index 00000000..018a3553 --- /dev/null +++ b/.env.production @@ -0,0 +1,28 @@ +APP_VERSION="0.0.63" +SERVICE_WORKER_FILE="service-worker.js" +APP_ID="1" +DIRECTORY_LOCAL=freeplanet +DIRECTORY_SERVER=freeplanet_serverside +SERVERDIR_WEBSITE=www.freeplanet.app +SERVERPW_WEBSITE=pwdadmin@1AOK +APP_URL="https://www.freeplanet.app" +URL_FACEBOOK="https://www.facebook.com/freeplanetapp" +PROVA_PAOLO="PROVA ENV FUNZIONA!" +LANG_DEFAULT="it" +PAO_APP_ID="KKPPAA5KJK435J3KSS9F9D8S9F8SD98F9SDF" +MASTER_KEY="KKPPSS5KJK435J3KSS9F9D8S9F8SD3CR3T" +MONGODB_HOST="https://www.freeplanet.app:3000" +LOGO_REG='freeplanet-logo-full.svg' +TEST_NAME="" +TEST_SURNAME="" +TEST_EMAIL="" +TEST_USERNAME="" +TEST_PASSWORD="" +TEST_APORTADOR="------" +PUBLICKEY_PUSH="BNM-cEpTbPVc_ujXf3QOC8ggf7b-X44P44esfJUWqNOFq1XhWCoZJpOi71_cbXC5SnfO9HassQ6OouAYgtBA9Pw" +IN_CONSTRUCTION="1" +DEBUG="1" +TELEGRAM_SUPPORT="https://t.me/freeplanet_supporto" +PROJECT_ID_MAIN="5cc0a13fe5c9d156728f400a" +TEST_CELL="" +ISTEST=false diff --git a/.eslintrc.js b/.eslintrc.js index b63934e2..c02fb927 100755 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,4 +1,4 @@ -const { resolve } = require('path'); +const { resolve } = require('path') module.exports = { // https://eslint.org/docs/user-guide/configuring#configuration-cascading-and-hierarchy // This option interrupts the configuration hierarchy at this file @@ -21,20 +21,20 @@ module.exports = { }, env: { + node: true, browser: true, }, // Rules order is important, please avoid shuffling them extends: [ - 'airbnb-typescript/base', - // Base ESLint recommended rules +// Base ESLint recommended rules // 'eslint:recommended', // 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! @@ -43,6 +43,15 @@ module.exports = { // 'plugin:vue/vue3-strongly-recommended', // Priority B: Strongly Recommended (Improving Readability) // 'plugin:vue/vue3-recommended', // Priority C: Recommended (Minimizing Arbitrary Choices and Cognitive Overhead) + // https://github.com/prettier/eslint-config-prettier#installation + // usage with Prettier, provided by 'eslint-config-prettier'. + 'prettier', + /*'eslint:recommended', + 'plugin:import/errors', + 'plugin:import/warnings', + 'plugin:import/typescript', + 'plugin:@typescript-eslint/recommended', + 'plugin:vue/essential',*/ ], plugins: [ @@ -78,7 +87,8 @@ module.exports = { 'no-loop-func': 'off', 'one-var': 'off', 'no-void': 'off', - 'comma-dangle': [2, 'always-multiline'], + 'comma-dangle': 'off', + // 'comma-dangle': [2, 'always-multiline'], // 'multiline-ternary': 'off', 'vue/max-attributes-per-line': [ 'error', { @@ -92,7 +102,7 @@ module.exports = { }, }], 'import/first': 'off', - 'import/named': 'error', + 'import/named': 'off', 'import/namespace': 'error', 'import/default': 'error', 'import/export': 'error', @@ -112,6 +122,7 @@ module.exports = { '@typescript-eslint/explicit-module-boundary-types': 'off', '@typescript-eslint/semi': 'off', '@typescript-eslint/object-curly-spacing': 'off', + '@typescript-eslint/restrict-plus-operands': 'off', // allow debugger during development only 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', @@ -126,6 +137,29 @@ module.exports = { '@typescript-eslint/max-len': 'off', 'max-len': 'off', '@typescript-eslint/naming-convention': 'off', + '@typescript-eslint/no-unsafe-call': 'off', + '@typescript-eslint/no-unsafe-assignment': 'off', 'no-underscore-dangle': 'off', + + '@typescript-eslint/no-unsafe-member-access': 'off', + '@typescript-eslint/restrict-template-expressions': 'off', + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/ban-ts-comment': 'off', + '@typescript-eslint/no-unsafe-return': 'off', + '@typescript-eslint/no-non-null-assertion': 'off', + '@typescript-eslint/no-floating-promises': 'off', + 'prefer-const': 'off', + 'no-extra-boolean-cast': 'off', + 'max-attributes-per-line': 'off', + 'vue/no-v-model-argument': 'off', + '@typescript-eslint/ban-types': [ + 'error', + { + 'extendDefaults': true, + 'types': { + '{}': false, + }, + }, + ], }, -}; +} diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..650cb880 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,4 @@ +{ + "singleQuote": true, + "semi": true +} diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100755 index 00000000..5b048812 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,12 @@ +{ + "recommendations": [ + "dbaeumer.vscode-eslint", + + "octref.vetur" + ], + "unwantedRecommendations": [ + "hookyqr.beautify", + "dbaeumer.jshint", + "ms-vscode.vscode-typescript-tslint-plugin" + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100755 index 00000000..d4af05c8 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "vetur.validation.template": false, + "vetur.format.enable": false, + "eslint.validate": ["javascript", "javascriptreact", "typescript", "vue"], + "typescript.tsdk": "node_modules/typescript/lib", + "vetur.experimental.templateInterpolationService": true +} diff --git a/docs/nuovo_comp2.ts.old b/docs/nuovo_comp2.ts.old new file mode 100644 index 00000000..7bd4458c --- /dev/null +++ b/docs/nuovo_comp2.ts.old @@ -0,0 +1,54 @@ +import { defineComponent, ref, computed, PropType, onBeforeUpdate, reactive } from 'vue' +import { useI18n } from '@src/boot/i18n' +import { useUserStore } from '@store/UserStore' +import { useGlobalStore } from '@store/globalStore' +import { useQuasar } from 'quasar' + +export default defineComponent({ + name: '', + props: { + mystr: { + type: String, + required: true, + default: '', + }, + myval: { + type: Number, + required: true, + default: 0, + }, + mybool: { + type: Boolean, + required: true, + default: false, + }, + op: { + type: Object as PropType, + required: true, + }, + }, + components: { + + }, + setup(props, { emit, }) { + const $q = useQuasar() + const { t } = useI18n() + const userStore = useUserStore() + const globalStore = useGlobalStore() + + //
+ // const list = reactive([1, 2, 3]); + // const divs = ref([]); + + // Make sure to reset the refs before each update. + // onBeforeUpdate(() => { + // divs.value = []; + // }); + + const rec = ref(null) + + return { + + } + } +}) diff --git a/docs/nuovo_comp3.ts.old b/docs/nuovo_comp3.ts.old new file mode 100644 index 00000000..94923cb5 --- /dev/null +++ b/docs/nuovo_comp3.ts.old @@ -0,0 +1,69 @@ +import { defineComponent, ref, computed, PropType, onBeforeUpdate, reactive } from 'vue' +import { useI18n } from '@src/boot/i18n' +import { useUserStore } from '@store/UserStore' +import { useGlobalStore } from '@store/globalStore' +import { useQuasar } from 'quasar' + +export default defineComponent({ + name: '', + // inheritAttrs: false, + props: { + // Basic type check (`null` and `undefined` values will pass any type validation) + propA: Number, + // Multiple possible types + propB: [String, Number], + // Required string + propC: { + type: String, + required: true + }, + // Number with a default value + propD: { + type: Number, + default: 100 + }, + // Object with a default value + propE: { + type: Object, + // Object or array defaults must be returned from + // a factory function + default() { + return { message: 'hello' } + } + }, + // Custom validator function + propF: { + validator(value) { + // The value must match one of these strings + return ['success', 'warning', 'danger'].includes(value) + } + }, + // Function with a default value + propG: { + type: Function, + // Unlike object or array default, this is not a factory function - this is a function to serve as a default value + default() { + return 'Default function' + } + }, + components: {}, + setup(props, { emit, attrs, slots }) { + const $q = useQuasar() + const { t } = useI18n() + const userStore = useUserStore() + const globalStore = useGlobalStore() + + //
+ // const list = reactive([1, 2, 3]); + // const divs = ref([]); + + // Make sure to reset the refs before each update. + // onBeforeUpdate(() => { + // divs.value = []; + // }); + + const rec = ref(null) + + return {} + } + }) diff --git a/docs/nuovo_componente.ts.old b/docs/nuovo_componente.ts.old index d1cf6fb9..6587129c 100644 --- a/docs/nuovo_componente.ts.old +++ b/docs/nuovo_componente.ts.old @@ -1,7 +1,7 @@ -import { defineComponent, PropType } from "vue" -import { useI18n } from '../src/boot/i18n' -import { useUserStore } from '../src/store/UserStore' -import { useGlobalStore } from '../src/store/globalStore' +import { defineComponent, ref, computed } from 'vue' +import { useI18n } from '@src/boot/i18n' +import { useUserStore } from '@store/UserStore' +import { useGlobalStore } from '@store/globalStore' import { useQuasar } from 'quasar' export default defineComponent({ @@ -22,15 +22,14 @@ export default defineComponent({ required: true, default: false, }, - op: { - type: Object as PropType, - required: true, - }, }, - components: { + setup(props, { emit }) { + // context.attrs + // context.slots + // context.emit + // context.parent + // context.root - }, - setup() { const $q = useQuasar() const { t } = useI18n() const userStore = useUserStore() diff --git a/file.out.txt b/file.out.txt new file mode 100644 index 00000000..c412eba1 --- /dev/null +++ b/file.out.txt @@ -0,0 +1,12 @@ + +/home/paolo/myproject/newfreeplanet/src-pwa/pwa-flag.d.ts + 0:0 error Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser. +The file does not match your project config: src-pwa/pwa-flag.d.ts. +The file must be included in at least one of the projects provided + +/home/paolo/myproject/newfreeplanet/src/components/CMySingleEvent/CMySingleEvent.ts + 1:8 error No default export found in imported module "vue" import/default + 37:18 error Unexpected empty setter 'mythis' @typescript-eslint/no-empty-function + +✖ 3 problems (3 errors, 0 warnings) + diff --git a/package.json b/package.json index ec020605..611f0ba5 100755 --- a/package.json +++ b/package.json @@ -1,39 +1,43 @@ { - "name": "firstproj", - "version": "0.0.1", - "description": "A Quasar Framework app", + "name": "freeplanet", + "version": "0.0.6", + "description": "FreePlanet", "productName": "First Proj", - "author": "Paolo Arena ", + "author": "Paolo Arena", "private": true, + "keywords": [ + "freeplanet", + "free social" + ], + "license": "MIT", "scripts": { "dev": "quasar dev", "build": "quasar build", "lint": "eslint --ext .js,.ts,.vue --ignore-path .gitignore ./", "lintfile": "eslint --ext .js,.ts,.vue --ignore-path .gitignore ./ > file.out.txt", "lintfileNoJS": "eslint --ext .ts,.vue --ignore-path .gitignore ./ > file.out.txt", - "fix": "eslint --ext .js,.ts,.vue --ignore-path .gitignore ./ --fix", + "fix": "eslint --ext .ts,.vue --ignore-path .gitignore ./ --fix > file.out.txt", "pwa": "NODE_ENV=development NODE_OPTIONS=--max_old_space_size=4096 DEBUG=v8:* quasar dev -m pwa", "test": "echo \"No test specified\" && exit 0", "generate-sw": "workbox generateSW workbox-config.js" }, "dependencies": { "@quasar/extras": "^1.10.12", - "@types/googlemaps": "^3.43.3", - "@types/vuelidate": "^0.7.15", - "@vue/compat": "^3.2.8", - "@vue/compiler-sfc": "^3.2.8", + "@vue/compat": "^3.2.10", + "@vue/compiler-sfc": "^3.2.10", "@vue/eslint-config-standard": "^6.1.0", - "acorn": "^8.4.1", + "@vuelidate/core": "^2.0.0-alpha.25", + "@vuelidate/validators": "^2.0.0-alpha.21", + "acorn": "^8.5.0", "autoprefixer": "^10.3.4", - "axios": "^0.21.2", - "bcrypt-nodejs": "0.0.3", + "axios": "^0.21.4", "bcryptjs": "^2.4.3", "core-js": "^3.17.2", + "crypto": "^1.0.1", "date-fns": "^2.23.0", "dotenv": "^10.0.0", - "element-ui": "^2.15.6", "eslint-plugin-quasar": "^1.0.0", - "graphql": "^15.5.2", + "graphql": "^15.5.3", "graphql-tag": "^2.12.5", "gsap": "^3.7.1", "jquery": "^3.6.0", @@ -48,48 +52,53 @@ "quasar": "^2.0.4", "quasar-extras": "^2.0.9", "register-service-worker": "^1.7.2", - "vee-validate": "^3.4.12", - "vue": "^3.1.0", + "vee-validate": "^4.4.10", + "vue": "^3.2.10", "vue-class-component": "^8.0.0-rc.1", + "vue-country-code": "^1.1.2", "vue-i18n": "^9.1.7", "vue-idb": "^0.2.0", "vue-loader": "^16.0.0", "vue-property-decorator": "^10.0.0-rc.3", "vue-router": "^4.0.11", "vue-scroll-reveal": "^1.0.11", - "vue-svgicon": "^3.2.9", + "vue-svgicon": "^4.0.0-alpha.3", "vue2-dragula": "^2.5.5", - "vuelidate": "^0.7.6", + "vue3-tel-input": "^1.0.4", "vuex": "^4.0.1", - "vuex-module-decorators": "^1.0.1", - "vuex-router-sync": "^5.0.0", - "vuex-typex": "^3.1.9", - "workbox": "0.0.0" + "vuex-router-sync": "^6.0.0-rc.1", + "vuex-typex": "^3.1.9" }, "devDependencies": { "@babel/eslint-parser": "^7.15.4", "@quasar/app": "^3.1.0", + "@types/bcryptjs": "^2.4.2", + "@types/googlemaps": "^3.43.3", + "@types/vue-tel-input": "^2.1.2", + "@types/vuelidate": "^0.7.15", "@types/dotenv": "^8.2.0", "@types/jest": "^27.0.1", "@types/js-cookie": "^2.2.7", - "@types/node": "^16.7.10", + "@types/node": "^16.7.13", "@types/nprogress": "^0.2.0", - "@typescript-eslint/eslint-plugin": "^4.30.0", - "@typescript-eslint/parser": "^4.30.0", + "@typescript-eslint/eslint-plugin": "^4.31.0", + "@typescript-eslint/parser": "^4.31.0", "eslint": "^7.32.0", - "eslint-config-airbnb-base": "^14.2.1", - "eslint-config-airbnb-typescript": "^14.0.0", + "eslint-config-prettier": "^8.3.0", "eslint-plugin-import": "^2.24.2", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^5.1.0", "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.1.0", + "jest": "^27.1.1", "json-loader": "^0.5.7", "node-sass": "^6.0.1", "npm-check-updates": "^11.8.5", "optimize-css-assets-webpack-plugin": "^6.0.1", + "postcss": "^8.3.6", "postcss-loader": "^6.1.1", "sass-loader": "^12.1.0", "strip-ansi": "=7.0.0", @@ -104,6 +113,9 @@ "workbox-cli": "^6.2.4", "workbox-webpack-plugin": "^6.2.4" }, + "browser": { + "crypto": false + }, "browserslist": [ "last 10 Chrome versions", "last 10 Firefox versions", diff --git a/public/js/storage.js b/public/js/storage.js index 0ebdab0a..2b127be2 100755 --- a/public/js/storage.js +++ b/public/js/storage.js @@ -100,10 +100,15 @@ let idbKeyval = (() => { }, async set(key, value) { let req; - await withStore('readwrite', 'keyval', store => { + /*await withStore('readwrite', 'keyval', store => { req = store.put(value, key); }); - return req.result; + + */ + if (req) + return req.result; + else + return null }, async setdata(table, value) { let req; diff --git a/quasar.conf.js b/quasar.conf.js index a7787217..a91e05ca 100755 --- a/quasar.conf.js +++ b/quasar.conf.js @@ -35,7 +35,7 @@ module.exports = configure((ctx) => ({ // --> boot files are part of "main.js" // https://v2.quasar.dev/quasar-cli/boot-files // boot: ['vue-i18n', 'vue-meta', 'axios', 'vee-validate', 'myconfig', 'local-storage', 'error-handler', 'globalroutines', 'vue-idb', 'dragula', 'guard'], - boot: ['i18n', 'axios', 'vee-validate', 'myconfig', 'local-storage', 'error-handler', 'globalroutines'], + boot: ['i18n', 'axios', 'vee-validate', 'myconfig', 'local-storage', 'error-handler', 'globalroutines', 'vuetelinput'], // https://v2.quasar.dev/quasar-cli/quasar-conf-js#Property%3A-css css: [ @@ -90,6 +90,7 @@ module.exports = configure((ctx) => ({ chainWebpack(chain, { isServer, isClient }) { chain.resolve.alias // .set('myalias', path.resolve(__dirname, './src/somefolder')) + .set('@', helpers.root('src')) .set('@components', helpers.root('src/components/index.ts')) .set('@boot', helpers.root('src/boot/*')) .set('@costanti', helpers.root('src/store/Modules/costanti.ts')) diff --git a/send_to_production.sh b/send_to_production.sh new file mode 100755 index 00000000..97249572 --- /dev/null +++ b/send_to_production.sh @@ -0,0 +1,15 @@ +#!/bin/bash + + +source ./.env.production + +read -p "*** IN PRODUZIONE !!!!! SEI SICURO DI INVIARE GLI AGGIORNAMENTI SUL SERVER DI PRODUZIONE ?? $SERVERDIR_WEBSITE (Y/N) ? " risposta + +if [[ $risposta == "Y" || $risposta == "y" ]]; then + + + echo "Sincronizzazione in remoto $SERVERDIR_WEBSITE ..." + sshpass -p $SERVERPW_WEBSITE rsync --port=8822 -a dist/pwa/ ftpadmin@servereng:/var/www/$SERVERDIR_WEBSITE/ + echo "Finito $SERVERDIR_WEBSITE " + +fi diff --git a/send_to_test.sh b/send_to_test.sh new file mode 100755 index 00000000..41cdb7db --- /dev/null +++ b/send_to_test.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +source ./.env.test + +echo "Sincronizzazione in remoto $SERVERDIR_WEBSITE ..." +sshpass -p $SERVERPW_WEBSITE rsync -a dist/pwa/ ftpadmin@servereng:/var/www/$SERVERDIR_WEBSITE/ +echo "Finito $SERVERDIR_WEBSITE" diff --git a/src-pwa/pwa-flag.d.ts b/src-pwa/pwa-flag.d.ts new file mode 100644 index 00000000..cda1c0ec --- /dev/null +++ b/src-pwa/pwa-flag.d.ts @@ -0,0 +1,10 @@ +/* eslint-disable */ +// THIS FEATURE-FLAG FILE IS AUTOGENERATED, +// REMOVAL OR CHANGES WILL CAUSE RELATED TYPES TO STOP WORKING +import "quasar/dist/types/feature-flag"; + +declare module "quasar/dist/types/feature-flag" { + interface QuasarFeatureFlags { + pwa: true; + } +} diff --git a/src-pwa/pwa-flag.d.ts.off b/src-pwa/pwa-flag.d.ts.off new file mode 100644 index 00000000..cda1c0ec --- /dev/null +++ b/src-pwa/pwa-flag.d.ts.off @@ -0,0 +1,10 @@ +/* eslint-disable */ +// THIS FEATURE-FLAG FILE IS AUTOGENERATED, +// REMOVAL OR CHANGES WILL CAUSE RELATED TYPES TO STOP WORKING +import "quasar/dist/types/feature-flag"; + +declare module "quasar/dist/types/feature-flag" { + interface QuasarFeatureFlags { + pwa: true; + } +} diff --git a/src/App.ts b/src/App.ts index 989151fc..2a6db6eb 100755 --- a/src/App.ts +++ b/src/App.ts @@ -1,14 +1,19 @@ -import { useRoute } from 'vue-router' +import { useRoute, useRouter } from 'vue-router' import { useQuasar } from 'quasar' -import { BannerCookies } from '@components' +import { BannerCookies } from '@/components/BannerCookies' import { useI18n } from '@src/boot/i18n' -import { useGlobalStore } from './store/globalStore' -import { useUserStore } from './store/UserStore' -import { Header } from './components/Header' +import { useGlobalStore } from '@store/globalStore' +import { useUserStore } from '@store/UserStore' +import { Header } from '@/components/Header' +import { toolsext } from '@store/Modules/toolsext' +import globalroutines from './globalroutines/index' +import { computed } from 'vue' +import { CProvaPao } from '@/components/CProvaPao' export default { components: { appHeader: Header, + CProvaPao, BannerCookies, /* , CPreloadImages */ }, setup() { @@ -17,9 +22,12 @@ export default { const backgroundColor = 'whitesmoke' const $q = useQuasar() const userStore = useUserStore() + const $router = useRouter() const globalStore = useGlobalStore() const { t } = useI18n(); + const finishLoading = computed(() => globalStore.finishLoading) + const listaRoutingNoLogin = ['/vreg?', '/offline'] function meta() { @@ -54,28 +62,29 @@ export default { if (chiamaautologin) { // console.log('CHIAMA autologin_FromLocalStorage') - userStore.autologin_FromLocalStorage() + userStore.autologin_FromLocalStorage($router) .then((loadstorage) => { if (loadstorage) { - /* - if (toolsext.getLocale() !== '') { + + /*if (toolsext.getLocale() !== '') { // console.log('SETLOCALE :', this.$i18n.locale) - this.$i18n.locale = toolsext.getLocale() // Set Lang + $i18n.locale = toolsext.getLocale() // Set Lang } else { - userStore.setlang(this.$i18n.locale) - } - */ + userStore.setlang($router, this.$i18n.locale) + }*/ + // console.log('lang CARICATO:', this.$i18n.locale) - // ++Todo: conv: globalroutines(this, 'loadapp', '') - // this.$router.replace('/') + //++Todo PWA: globalroutines('loadapp', '') // Create Subscription to Push Notification - // ++Todo: conv: globalStore.createPushSubscription() + globalStore.createPushSubscription() } }) + } else { + globalStore.finishLoading = true } // Calling the Server for updates ? @@ -85,7 +94,7 @@ export default { created() return { - + finishLoading, } }, } diff --git a/src/App.vue b/src/App.vue index 3d555e39..3441fd9b 100755 --- a/src/App.vue +++ b/src/App.vue @@ -1,25 +1,29 @@ diff --git a/src/boot/vuetelinput.ts b/src/boot/vuetelinput.ts new file mode 100755 index 00000000..6bca3ca5 --- /dev/null +++ b/src/boot/vuetelinput.ts @@ -0,0 +1,10 @@ +// @ts-ignore +import { VueTelInput } from 'vue3-tel-input' +import { boot } from 'quasar/wrappers' + +// "async" is optional +export default boot( ({ app }) => { + // something to do + // @ts-ignore + app.use(VueTelInput) +}) diff --git a/src/boot/vuetelinput.ts.off b/src/boot/vuetelinput.ts.off deleted file mode 100755 index 0dd3a1b4..00000000 --- a/src/boot/vuetelinput.ts.off +++ /dev/null @@ -1,8 +0,0 @@ -import VueTelInput from 'vue-tel-input' -import { boot } from "quasar/wrappers" - -// "async" is optional -export default boot(async ({ app }) => { - // something to do - app.use(VueTelInput) -}) diff --git a/src/classes/debounce.ts b/src/classes/debounce.ts deleted file mode 100755 index 96146366..00000000 --- a/src/classes/debounce.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * A function that emits a side effect and does not return anything. - */ -export type Procedure = (...args: any[]) => void - -export type Options = { - isImmediate: boolean -} - -export function debounce( - func: F, - waitMilliseconds = 50, - options: Options = { - isImmediate: false, - }, -): F { - let timeoutId: NodeJS.Timeout | undefined - - return function retA(this: any, ...args: any[]) { - const context = this - - const doLater = function retB() { - timeoutId = undefined - if (!options.isImmediate) { - func.apply(context, args) - } - } - - const shouldCallNow = options.isImmediate && timeoutId === undefined - - if (timeoutId) { - clearTimeout(timeoutId) - } - - timeoutId = setTimeout(doLater, waitMilliseconds) - - if (shouldCallNow) { - func.apply(context, args) - } - } as any -} diff --git a/src/common/debounce.ts b/src/common/debounce.ts index f4d399fe..3535e1bc 100755 --- a/src/common/debounce.ts +++ b/src/common/debounce.ts @@ -13,6 +13,7 @@ * @api public */ +// eslint-disable-next-line @typescript-eslint/ban-types export function Debounce(func: Function, wait?: number, immediate?: boolean) { // @ts-ignore let timeout: any, diff --git a/src/components/CBook/CBook.scss b/src/components/CBook/CBook.scss new file mode 100755 index 00000000..8b6ae01f --- /dev/null +++ b/src/components/CBook/CBook.scss @@ -0,0 +1,66 @@ +$heightBtn: 100%; +$grayshadow: #555; + +.text-subtitle-carica { + font-size: 1rem; + font-weight: 400; + line-height: 1.75rem; + letter-spacing: .00937em; + text-shadow: .1rem .1rem .1rem $grayshadow; +} + +.text-subtitle-certificato { + font-size: 0.75rem; + line-height: 1rem; +} + +@media (max-width: 718px) { + // PER VERSIONE MOBILE + .text-subtitle-carica { + font-size: 1rem; + } +} + +.op { + text-align: center !important; + font-size: 1rem; + font-weight: 400; + line-height: 1.75rem; + letter-spacing: .00937em; + text-shadow: .1rem .1rem .1rem $grayshadow; + + &__cell { + font-size: 1rem; + color: red; + } + + &__email { + font-size: 1rem; + color: #3b5998; + } + + &__email a { + text-decoration: none; + } + + &__facebook a { + font-size: 1rem; + text-decoration: none; + } + + &__storia { + margin-top: 1rem; + margin-bottom: 1rem; + text-align: justify; + } +} + +.myimg { + border-radius: 300px !important; +} + +.q-img { + &__image { + border-radius: 300px !important; + } +} diff --git a/src/components/CBook/CBook.ts b/src/components/CBook/CBook.ts new file mode 100755 index 00000000..b2e251a6 --- /dev/null +++ b/src/components/CBook/CBook.ts @@ -0,0 +1,52 @@ +import { defineComponent, ref, computed, PropType, toRef } from 'vue' +import { IOperators } from 'model' + +export default defineComponent({ + name: 'CBook', + props: { + tab: { + type: String, + required: true, + }, + op: { + type: Object as PropType, + required: true, + }, + }, + setup(props, { emit }) { + + const mytab = toRef(props, 'tab') + + function clicca() { + mytab.value = 'two' + } + + function myop() { + if (!!props.op) { + return props.op + } else { + return { + index: 0, + tab: '', + name: '', + qualification: '', + sub2: '', + certifications: '', + img: '', + cell: '', + email: '', + paginaweb: '', + paginafb: '', + intro: '', + info: '' + } + } + } + + return { + myop, + clicca, + mytab, + } + } +}) diff --git a/src/components/CBook/CBook.vue b/src/components/CBook/CBook.vue new file mode 100755 index 00000000..7e336560 --- /dev/null +++ b/src/components/CBook/CBook.vue @@ -0,0 +1,47 @@ + + + + + diff --git a/src/components/CBook/index.ts b/src/components/CBook/index.ts new file mode 100755 index 00000000..a3d83ad1 --- /dev/null +++ b/src/components/CBook/index.ts @@ -0,0 +1 @@ +export {default as CBook} from './CBook.vue' diff --git a/src/components/CCard/CCard.vue b/src/components/CCard/CCard.vue index 24f3fad4..d817a945 100755 --- a/src/components/CCard/CCard.vue +++ b/src/components/CCard/CCard.vue @@ -2,7 +2,7 @@
- +
{{ myop.name }} {{ myop.surname }}
{{ myop.qualification }}
diff --git a/src/components/CCardCarousel/CCardCarousel.scss b/src/components/CCardCarousel/CCardCarousel.scss index d88f04d1..f0f1f6c1 100755 --- a/src/components/CCardCarousel/CCardCarousel.scss +++ b/src/components/CCardCarousel/CCardCarousel.scss @@ -2,7 +2,7 @@ background-repeat: no-repeat !important; background-position: top; background-size: contain !important; - background-image: url(../../statics/images/landing_first_section.png) !important + background-image: url(/public/images/landing_first_section.png) !important } .landing__features { diff --git a/src/components/CCardCarousel/CCardCarousel.vue b/src/components/CCardCarousel/CCardCarousel.vue index 65d07250..00974c48 100755 --- a/src/components/CCardCarousel/CCardCarousel.vue +++ b/src/components/CCardCarousel/CCardCarousel.vue @@ -75,7 +75,7 @@ dark color="white" v-model="globalStore.autoplaydisc" label="Auto Play" class="s :alt="myrec.label" :name="index">
- +
diff --git a/src/components/CCardDiscipline/CCardDiscipline.ts b/src/components/CCardDiscipline/CCardDiscipline.ts index c86f6164..d21737e4 100755 --- a/src/components/CCardDiscipline/CCardDiscipline.ts +++ b/src/components/CCardDiscipline/CCardDiscipline.ts @@ -5,11 +5,11 @@ import { IDiscipline, IEvents } from 'model' import { useCalendarStore } from '@store/CalendarStore' -import CMyTeacher from '@/components/CMyTeacher/CMyTeacher' +import { CMyTeacher } from '@src/components/CMyTeacher' // @ts-ignore import MixinOperator from '../../mixins/mixin-operator' -import MixinUsers from '@/mixins/mixin-users' +import MixinUsers from '../../mixins/mixin-users' export default defineComponent({ name: 'CCardDiscipline', diff --git a/src/components/CCardDiscipline/CCardDiscipline.vue b/src/components/CCardDiscipline/CCardDiscipline.vue index 1dc1cbbc..6332c7ac 100755 --- a/src/components/CCardDiscipline/CCardDiscipline.vue +++ b/src/components/CCardDiscipline/CCardDiscipline.vue @@ -1,7 +1,7 @@