Merge branch 'develop' of https://github.com/paoloar77/newfreeplanet into develop

 Conflicts:
	.env.development
This commit is contained in:
paoloar77
2022-04-05 15:02:11 +02:00
21 changed files with 170 additions and 33 deletions

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.3.13"
APP_VERSION="0.3.14"
SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13"
DIRECTORY_LOCAL="newfreeplanet"

27
.env.example.production Executable file
View File

@@ -0,0 +1,27 @@
APP_VERSION="0.3.14"
SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13"
DIRECTORY_LOCAL=newfreeplanet
DIRECTORY_SERVER=freeplanet_serverside
SERVERDIR_WEBSITE=riso.app
SERVERPW_WEBSITE=<password-website-here>
APP_URL="https://riso.app"
URL_FACEBOOK=""
PROVA_PAOLO=""
LANG_DEFAULT="it"
PAO_APP_ID="KKPPAA5KJK435J3KSS9F9D8S9F8SD98F9SDF"
MASTER_KEY="KKPPSS5KJK435J3KSS9F9D8S9F8SD3CR3T"
MONGODB_HOST="https://www.freeplanet.app:3000"
LOGO_REG='riso-logo-full.png'
TEST_NAME=""
TEST_SURNAME=""
TEST_EMAIL=""
TEST_USERNAME=""
TEST_PASSWORD=""
TEST_APORTADOR="------"
PUBLICKEY_PUSH="<publickey-push-here>"
DEBUG="1"
TELEGRAM_SUPPORT=""
PROJECT_ID_MAIN="5cc0a13fe5c9d156728f400a"
TEST_CELL=""
ISTEST=0

View File

@@ -1,6 +1,69 @@
# NewFreePlanet
<div>
# NewFreePlanet
#### (FrontEnd)
## Riso.app
**Il primo Vero Social**<br>
**Libero, Equo e Solidale**<br>
**dove Vive Consapevolezza e Aiuto Comunitario**<br>
## Uniti per Evolvere e Sperimentare
- Siamo la Rete Italiana di Scambio Orizzontale, abbiamo creato questa piattaforma per metterla al servizio di chi vuole riscoprire il valore della condivisione e della cooperazione. Valori semplici e profondi che ci aiutano a ritrovare il Senso della Vita, perduto in questa società consumista, e riporti quei Sani Pricìpi Naturali ed Umani di Fratellanza che intere popolazioni antiche conoscevano bene.<br>
- 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.
</div>
<div>
This app was made mixing all this languages and tools:<br>
<ul>
<li>Quasar Framework v2.0</li>
<li>Vue.js 3 with Typescript and Composition API</li>
<li>Progressive Web App (PWA) amazing native-looking apps</li>
<li>Node.js (backend source)</li>
</ul>
Thanks to the Quasar Framework and TypeScript !
</div>
<br>
<br>
<div align="center">
[![Made with Quasar](https://img.shields.io/badge/made%20with-Quasar-blue.svg?style=for-the-badge)](https://github.com/quasarframework/quasar)
[![Uses TypeScript](https://img.shields.io/badge/uses-TypeScript-3F51B5.svg?style=for-the-badge)](https://github.com/Microsoft/TypeScript)
<!--[![License MIT](https://img.shields.io/github/license/paoloar77/freeplanet-blue.svg?style=for-the-badge)](https://opensource.org/licenses/MIT) -->
</div>
<div align="center">
[![js-standard-style](https://cdn.rawgit.com/standard/standard/master/badge.svg)](https://github.com/standard/standard)
</div>
## Installation 🔧
**System prerequisites :**
- Node.js 16.14.0 or latest
- yarn > 1.21.1 or latest
Clone this repository :
```bash
$ git clone git@github.com:paoloar77/newfreeplanet example
$ cd example
$ yarn
```
## License
[MIT](https://opensource.org/licenses/MIT)
Copyright (c) 2018-present, Paolo Arena
A Quasar Framework app
## Install the dependencies
```bash
@@ -14,12 +77,19 @@ npm run pwa
### Build the app for test Server
```bash
cp .env.example.production .env.test
nano .env.test
# and change SERVERPW_WEBSITE and PUBLICKEY_PUSH keys in this file
./deploy_on_test_server.sh
```
### Build the app for production
```bash
cp .env.example.production .env.production
nano .env.production
# and change SERVERPW_WEBSITE and PUBLICKEY_PUSH keys in this file
./deploy_on_production.sh
```

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.3.12"
APP_VERSION="0.3.14"
SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13"
DIRECTORY_LOCAL="newfreeplanet"

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.3.12"
APP_VERSION="0.3.14"
SERVICE_WORKER_FILE="service-worker.js"
APP_ID="12"
DIRECTORY_LOCAL="newfreeplanet"

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.3.12"
APP_VERSION="0.3.14"
SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13"
DIRECTORY_LOCAL="newfreeplanet"

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.3.12"
APP_VERSION="0.3.14"
SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13"
DIRECTORY_LOCAL=newfreeplanet

View File

@@ -119,15 +119,15 @@
"crypto": false
},
"browserslist": [
"last 13 Chrome versions",
"last 13 Firefox versions",
"last 16 Chrome versions",
"last 16 Firefox versions",
"last 4 Edge versions",
"last 13 Safari versions",
"last 14 Android versions",
"last 14 ChromeAndroid versions",
"last 14 FirefoxAndroid versions",
"last 10 iOS versions",
"last 5 Opera versions"
"last 16 Android versions",
"last 16 ChromeAndroid versions",
"last 16 FirefoxAndroid versions",
"last 12 iOS versions",
"last 7 Opera versions"
],
"engines": {
"node": ">= 16.14.0",

View File

@@ -796,7 +796,13 @@ export default defineComponent({
recCatGrp: 1,
}
},
lookup5: {
lk_tab: 'cities',
lk_LF: 'idCity',
lk_FF: '_id',
lk_as: 'mycities',
af_objId_tab: '',
},
}
} else if (props.table === toolsext.TABMYGOODS) {

View File

@@ -76,7 +76,8 @@ export default defineComponent({
}
function condividipag() {
return tools.copyStringToClipboard($q, self.location.host + tools.getPathByGroup(myrec.value, props.table), true)
const msg = self.location.host + tools.getPathByGroup(myrec.value, props.table)
return tools.copyStringToClipboard($q, msg, true)
}
onMounted(mounted)

View File

@@ -312,6 +312,7 @@ export default defineComponent({
// Check if exist other array:
if (props.col) {
if (props.col.remote_table && props.col.remote_key && props.col.remote_field) {
try {

View File

@@ -118,13 +118,14 @@ export default defineComponent({
})
.then((riscode: number) => {
if (riscode === tools.OK) {
// console.log(' -> eseguo emit(loginOk)')
console.log(' -> eseguo emit(loginOk)')
emit('loginOk')
globalStore.createPushSubscription()
} else {
console.log(' -> eseguo emit(checkErrors)')
emit('checkErrors', riscode)
}

View File

@@ -23,9 +23,11 @@ export default defineComponent({
setup(props) {
const userStore = useUserStore()
const globalStore = useGlobalStore()
return {
userStore,
globalStore,
tools,
}
},

View File

@@ -1,5 +1,5 @@
<template>
<div class="q-ma-md">
<div v-if="!globalStore.serverError" class="q-ma-md">
<CVerifyTelegram v-if="!tools.TelegVerificato() || !tools.isUsernameTelegOk()">
</CVerifyTelegram>

View File

@@ -145,7 +145,7 @@ const msg_website_it = {
},
homepage: {
descrapp_title1: 'Uniti per Evolvere e Sperimentare',
descrapp_pag1: 'Siamo la Rete Italiana di Scambio Orizzontale, abbiamo creato questa piattaforma per metterla al servizio di chi vuole riscoprire il valore della <strong>condivisione</strong> e della <strong>cooperazione</strong>. ' +
descrapp_pag1: 'Siamo la <strong>Rete Italiana di Scambio Orizzontale</strong>, abbiamo creato questa piattaforma per metterla al servizio di chi vuole riscoprire il valore della <strong>condivisione</strong> e della <strong>cooperazione</strong>. ' +
'Valori semplici e profondi che ci aiutano a ritrovare il <strong>Senso della Vita</strong>, perduto in questa società consumista, e riporti quei <strong>Sani Pricìpi Naturali</strong> ed Umani di <strong>Fratellanza</strong>'
+ ' che intere popolazioni antiche conoscevano bene.',
descrapp_pag2: 'E\' giunta l\'ora di utilizzare i nuovi strumenti <strong>Tecnologici</strong> a nostro <strong>favore</strong>, per <strong>Liberarci</strong> '

View File

@@ -84,11 +84,11 @@ async function Request(type: string, path: string, payload: any): Promise<Types.
}
if (setAuthToken) {
userStore.UpdatePwd(x_auth_token)
tools.localStSetItem(toolsext.localStorage.token, x_auth_token)
localStorage.setItem(toolsext.localStorage.token, x_auth_token)
}
userStore.setAuth(x_auth_token)
tools.localStSetItem(toolsext.localStorage.token, x_auth_token)
localStorage.setItem(toolsext.localStorage.token, x_auth_token)
}
globalStore.setStateConnection(ricevuto ? 'online' : 'offline')

View File

@@ -670,7 +670,7 @@ export const colmyGoods = [
fieldtype: costanti.FieldType.string,
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist,
noshowlabel: true,
maxlength: 90,
maxlength: 120,
required: true,
sortable: false,
}),
@@ -837,7 +837,7 @@ export const colmySkills = [
fieldtype: costanti.FieldType.string,
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist,
noshowlabel: true,
maxlength: 90,
maxlength: 120,
required: true,
sortable: false,
}),
@@ -1010,7 +1010,7 @@ export const colmyBachecas = [
fieldtype: costanti.FieldType.string,
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist,
noshowlabel: true,
maxlength: 90,
maxlength: 120,
required: true,
sortable: false,
}),

View File

@@ -3364,6 +3364,10 @@ export const tools = {
localStorage.setItem(item, value)
},
localStReal(item: string, value : string) {
localStorage.setItem(item, value)
},
setCookie(mytok: any, value: string) {
// console.log('setCookie', mytok, value)
if (localStorage.getItem('cookie-id') === 'decline')
@@ -4138,8 +4142,9 @@ export const tools = {
isLogged() {
const userStore = useUserStore()
const globalStore = useGlobalStore()
if (!!userStore)
return userStore.isLogged
return userStore.isLogged && !globalStore.serverError
else
return false
},

View File

@@ -540,8 +540,8 @@ export const useUserStore = defineStore('UserStore', {
tools.localStSetItem(toolsext.localStorage.perm, String(myuser.perm) || '')
if (myuser.profile !== undefined) tools.localStSetItem(toolsext.localStorage.img, (myuser.profile.img) ? String(myuser.profile.img) || '' : '')
else tools.localStSetItem(toolsext.localStorage.img, '')
tools.localStSetItem(toolsext.localStorage.token, this.x_auth_token)
tools.localStSetItem(toolsext.localStorage.expirationDate, expirationDate.toString())
localStorage.setItem(toolsext.localStorage.token, this.x_auth_token)
localStorage.setItem(toolsext.localStorage.expirationDate, expirationDate.toString())
tools.localStSetItem(toolsext.localStorage.isLogged, String(true))
tools.localStSetItem(toolsext.localStorage.verified_email, String(myuser.verified_email))
tools.localStSetItem(toolsext.localStorage.verified_by_aportador, String(myuser.verified_by_aportador))
@@ -600,8 +600,8 @@ export const useUserStore = defineStore('UserStore', {
tools.localStSetItem(toolsext.localStorage.username, newuser.username)
tools.localStSetItem(toolsext.localStorage.name, newuser.name)
tools.localStSetItem(toolsext.localStorage.surname, newuser.surname)
tools.localStSetItem(toolsext.localStorage.token, this.x_auth_token)
tools.localStSetItem(toolsext.localStorage.expirationDate, expirationDate.toString())
localStorage.setItem(toolsext.localStorage.token, this.x_auth_token)
localStorage.setItem(toolsext.localStorage.expirationDate, expirationDate.toString())
tools.localStSetItem(toolsext.localStorage.verified_email, String(false))
tools.localStSetItem(toolsext.localStorage.verified_by_aportador, String(false))
@@ -815,6 +815,8 @@ export const useUserStore = defineStore('UserStore', {
this.isLogged = isok && isLogged
console.log('this.isLogged', this.isLogged, 'isok', isok, 'isLogged', isLogged)
if (static_data.functionality.ENABLE_TODOS_LOADING)
await todos.dbLoad({ checkPending: true })
@@ -842,7 +844,7 @@ export const useUserStore = defineStore('UserStore', {
try {
const globalStore = useGlobalStore()
// console.log('*** autologin_FromLocalStorage ***')
console.log('*** autologin_FromLocalStorage ***')
// INIT
let isLogged = false
@@ -850,7 +852,23 @@ export const useUserStore = defineStore('UserStore', {
this.lang = tools.getItemLS(toolsext.localStorage.lang)
const token = localStorage.getItem(toolsext.localStorage.token)
if (token) {
const expirationDateStr = localStorage.getItem(toolsext.localStorage.expirationDate)
const expirationDate = new Date(String(expirationDateStr))
const now = tools.getDateNow()
if (now < expirationDate) {
this.setAuth(token)
isLogged = true
} else {
// ++ ?? che fare qui
}
} else {
isLogged = tools.isLogged()
}
/*if (token) {
const expirationDateStr = localStorage.getItem(toolsext.localStorage.expirationDate)
const expirationDate = new Date(String(expirationDateStr))
const now = tools.getDateNow()
@@ -900,7 +918,9 @@ export const useUserStore = defineStore('UserStore', {
isLogged = true
}
}
}*/
return await this.setGlobal($router, isLogged)
.then((loadstorage: any) => {

View File

@@ -1327,17 +1327,21 @@ export const useGlobalStore = defineStore('GlobalStore', {
this.mypage = (res.data.mypage) ? [...res.data.mypage] : []
}
let isLogged = false
// console.log('res.data.myuser', res.data.myuser)
if (res.data.myuser) {
userStore.authUser(res.data.myuser)
userStore.updateLocalStorage(res.data.myuser)
isLogged = !!res.data.myuser.username
} else {
// User not exist !!
}
const isLogged = localStorage.getItem(toolsext.localStorage.username)
// const isLogged = localStorage.getItem(toolsext.localStorage.username)
console.log('isLogged', isLogged)
// calendarStore.editable = userStore.isAdmin || userStore.isManager || userStore.isTutor

View File

@@ -99,7 +99,7 @@
<CMyUser
:mycontact="user"
:visu="costanti.FIND_PEOPLE"
@setCmd="setCmd"
@setCmd="tools.setCmd"
>
</CMyUser>
</div>