From 64d153a245d5b96202c576eaf5d50891ef447247 Mon Sep 17 00:00:00 2001 From: ogerly Date: Wed, 24 Feb 2021 15:23:15 +0100 Subject: [PATCH 01/45] add axios for gdd balance --- frontend/src/store/store.js | 37 ++++++++++++++++++++++------ frontend/src/views/KontoOverview.vue | 5 ++++ 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/frontend/src/store/store.js b/frontend/src/store/store.js index b97bf47a1..d330e2e2b 100644 --- a/frontend/src/store/store.js +++ b/frontend/src/store/store.js @@ -12,11 +12,12 @@ export const store = new Vuex.Store({ is_admin: false, active: false, modals: false, + url: "", user : { name:"", - email:"" - }, - dataLogout: {"session_id": -127182} + email:"", + sessionID: 0 + } }, mutations: { isActive(state) { @@ -31,14 +32,16 @@ export const store = new Vuex.Store({ //console.log("Im Store LOGIN() axios then.statusText ", ldata.statusText); if (ldata.statusText === "OK") { - console.log("STORE login() ldatasession_id", ldata.data.session_id) + //console.log("STORE login() ldatasession_id", ldata.data.session_id) state.is_auth = true state.active = true + state.user.sessionID = ldata.data.session_id + state.user.email = logindata.email $cookies.set('gdd_is_auth','true'); $cookies.set('gdd_session_id', ldata.data.session_id); $cookies.set('gdd_email',logindata.email); - state.user.email = logindata.email - + console.log("cookie ? GRADIDO_LOGIN", $cookies.get('GRADIDO_LOGIN')) + //console.log("STORE login() to " + state.is_auth) router.push('/KontoOverview') @@ -71,7 +74,7 @@ export const store = new Vuex.Store({ }); }, logout(state){ - axios.post("http://localhost/login_api/logout", this.dataLogout).then((ldata) => { + axios.post("http://localhost/login_api/logout", {"session_id": state.user.sessionID}).then((ldata) => { //console.log("Im Store logout() axios then ", ldata); // this.ldata = ldata.data; @@ -79,6 +82,8 @@ export const store = new Vuex.Store({ state.is_auth = false state.is_admin = false state.active = false + state.user.sessionID = '' + state.user.email = '' $cookies.set('gdd_is_auth','false'); $cookies.remove('gdd_email'); $cookies.remove('gdd_session_id'); @@ -87,6 +92,24 @@ export const store = new Vuex.Store({ console.log(error); }); + }, + accountBalance0(state) { + console.log("accountBalance0 => START") + axios.get("http://localhost/state-balances/ajaxGetBalance/739420303").then((req) => { + console.log("accountBalance => ", req) + }, (error) => { + console.log(error); + }); + }, + accountBalance1(state) { + console.log("accountBalance1 => START") + state.url = "http://localhost/state-balances/ajaxGetBalance/"+ state.user.sessionID + console.log(state.url) + axios.get(state.url).then((req) => { + console.log("accountBalance => ", req) + }, (error) => { + console.log(error); + }); } } }) \ No newline at end of file diff --git a/frontend/src/views/KontoOverview.vue b/frontend/src/views/KontoOverview.vue index b568bf8f0..ce5ef6985 100644 --- a/frontend/src/views/KontoOverview.vue +++ b/frontend/src/views/KontoOverview.vue @@ -30,6 +30,8 @@ +
this.$store.commit('accountBalance0')
+
this.$store.commit('accountBalance1')

User Data

/public/json-example/userdata.json @@ -80,6 +82,9 @@ GddAddWork, GddWorkTable, axios + }, + created() { + }, methods: { UserData() { From 613f3a732f1aae69338bbadfcb0c64f77bf74080 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Thu, 25 Feb 2021 14:21:08 +0100 Subject: [PATCH 02/45] basic gn config --- .../node_server/.gradido/sibling_nodes.txt | 0 configs/node_server/gradido.conf | 20 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 configs/node_server/.gradido/sibling_nodes.txt create mode 100644 configs/node_server/gradido.conf diff --git a/configs/node_server/.gradido/sibling_nodes.txt b/configs/node_server/.gradido/sibling_nodes.txt new file mode 100644 index 000000000..e69de29bb diff --git a/configs/node_server/gradido.conf b/configs/node_server/gradido.conf new file mode 100644 index 000000000..3edf0897c --- /dev/null +++ b/configs/node_server/gradido.conf @@ -0,0 +1,20 @@ +worker_count = 2 +io_worker_count = 1 +data_root_folder = /opt/instance/.gradido +hedera_mirror_endpoint = hcs.testnet.mirrornode.hedera.com:5600 +sibling_node_file = /opt/instance/.gradido/sibling_nodes.txt +#group_requests_endpoint = 0.0.0.0:13701 +#record_requests_endpoint = 0.0.0.0:13702 +#manage_network_requests_endpoint = 0.0.0.0:13703 +grpc_endpoint = 0.0.0.0:13701 +json_rpc_port = 13702 + + +# larger value, larger batch, less concurrency +blockchain_append_batch_size = 1000 +#blochchain_init_batch_size = 1000 +#block_record_outbound_batch_size = 100 +general_batch_size = 1000 +group_register_topic_id = 0.0.79574 + +topic_reset_allowed = 1 From fb0a8500571f8786e16d696f6bd72b7078198910 Mon Sep 17 00:00:00 2001 From: ogerly Date: Thu, 25 Feb 2021 15:15:39 +0100 Subject: [PATCH 03/45] loginAPI.js change mathods to actions --- frontend/src/mixins/loginAPI.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/mixins/loginAPI.js b/frontend/src/mixins/loginAPI.js index 69c5e1441..d102f381d 100644 --- a/frontend/src/mixins/loginAPI.js +++ b/frontend/src/mixins/loginAPI.js @@ -3,7 +3,7 @@ const LOGIN_API_URL = 'http://localhost/login_api/' // define a mixin object const loginAPI = { - mutations: { + actions: { login: async () => { return axios.post(LOGIN_API_URL + 'unsecureLogin', data); }, From da1cb4e7b6e77745a7d63e6b096952669b6103be Mon Sep 17 00:00:00 2001 From: ogerly Date: Thu, 25 Feb 2021 15:22:47 +0100 Subject: [PATCH 04/45] merge master --- frontend/src/store/store.js | 14 ++++++++------ frontend/src/views/KontoOverview.vue | 14 ++++++++++---- frontend/src/views/KontoOverview/GddStatus.vue | 13 +++++++++---- login_server | 2 +- 4 files changed, 28 insertions(+), 15 deletions(-) diff --git a/frontend/src/store/store.js b/frontend/src/store/store.js index d330e2e2b..82a25c42c 100644 --- a/frontend/src/store/store.js +++ b/frontend/src/store/store.js @@ -16,7 +16,8 @@ export const store = new Vuex.Store({ user : { name:"", email:"", - sessionID: 0 + sessionID: 0, + balance: 0 } }, mutations: { @@ -30,7 +31,7 @@ export const store = new Vuex.Store({ //console.log("logon TEST =>", logindata ) axios.post("http://localhost/login_api/unsecureLogin", logindata).then((ldata) => { - //console.log("Im Store LOGIN() axios then.statusText ", ldata.statusText); + console.log("Im Store LOGIN() axios then.statusText ", ldata); if (ldata.statusText === "OK") { //console.log("STORE login() ldatasession_id", ldata.data.session_id) state.is_auth = true @@ -41,7 +42,7 @@ export const store = new Vuex.Store({ $cookies.set('gdd_session_id', ldata.data.session_id); $cookies.set('gdd_email',logindata.email); console.log("cookie ? GRADIDO_LOGIN", $cookies.get('GRADIDO_LOGIN')) - + //this.$store.commit('accountBalance') //console.log("STORE login() to " + state.is_auth) router.push('/KontoOverview') @@ -101,12 +102,13 @@ export const store = new Vuex.Store({ console.log(error); }); }, - accountBalance1(state) { - console.log("accountBalance1 => START") + accountBalance(state) { + console.log(" => START") state.url = "http://localhost/state-balances/ajaxGetBalance/"+ state.user.sessionID console.log(state.url) axios.get(state.url).then((req) => { - console.log("accountBalance => ", req) + console.log("accountBalance => ", req.data.balance) + state.user.balance = req.data.balance }, (error) => { console.log(error); }); diff --git a/frontend/src/views/KontoOverview.vue b/frontend/src/views/KontoOverview.vue index ce5ef6985..8ad94fe3a 100644 --- a/frontend/src/views/KontoOverview.vue +++ b/frontend/src/views/KontoOverview.vue @@ -31,12 +31,18 @@
this.$store.commit('accountBalance0')
-
this.$store.commit('accountBalance1')
+
this.$store.commit('accountBalance')

-

User Data

- /public/json-example/userdata.json +

User Balanace

+ this.$store.state.user.balance

- {{userdata}} + {{this.$store.state.user}} +

+
+

User Balanace

+ this.$store.state.user.balance +

+ {{this.$store.state.user.balance}}


diff --git a/frontend/src/views/KontoOverview/GddStatus.vue b/frontend/src/views/KontoOverview/GddStatus.vue index 1b0985665..87825d232 100644 --- a/frontend/src/views/KontoOverview/GddStatus.vue +++ b/frontend/src/views/KontoOverview/GddStatus.vue @@ -4,13 +4,12 @@ - + {{ balance_gdd }} GDD @@ -34,5 +33,11 @@ \ No newline at end of file diff --git a/login_server b/login_server index 2a033c34e..9b9115290 160000 --- a/login_server +++ b/login_server @@ -1 +1 @@ -Subproject commit 2a033c34e4657e84a4387ecfda1cd6102032e95e +Subproject commit 9b9115290c8d2ead756d64b70ae63a6571aa4693 From d82744bf4da607417d484dd9270768f8a99eee39 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Thu, 25 Feb 2021 21:36:29 +0100 Subject: [PATCH 05/45] dont restart phpmyadmin when docker is started --- docker-compose.override.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.override.yml b/docker-compose.override.yml index 2672f0651..97cdb3155 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -49,7 +49,7 @@ services: container_name: phpmyadmin environment: - PMA_ARBITRARY=1 - restart: always + #restart: always ports: - 8074:80 networks: From 5c5486ab89c9648e1684d25f607846c2733e1719 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Thu, 25 Feb 2021 21:39:16 +0100 Subject: [PATCH 06/45] updated README.md - use yarn instead of npm --- frontend/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/README.md b/frontend/README.md index 75d17f120..71dfcd39c 100755 --- a/frontend/README.md +++ b/frontend/README.md @@ -1,14 +1,14 @@ # Vue Gradido Wallet -## install mit npm +## install mit yarn ```bash cd frontend -npm install -npm run serve +yarn install +yarn run serve # build -npm run build +yarn run build ``` ## install mit docker From 42625fbecb9401e5221fe84bcc9dd8b360ad5125 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Thu, 25 Feb 2021 22:03:30 +0100 Subject: [PATCH 07/45] removed gradido-node from docker compose since it is not working out of the box --- docker-compose.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 574360911..e3b5427d8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -110,13 +110,13 @@ services: ######################################################### ## GRADIDO NODE v1 ###################################### ######################################################### - gradido-node: - build: - context: . - dockerfile: ./gn/docker/deprecated-hedera-node/Dockerfile - volumes: - - ${GN_INSTANCE_FOLDER}:/opt/instance - container_name: ${GN_CONTAINER_NAME} + #gradido-node: + # build: + # context: . + # dockerfile: ./gn/docker/deprecated-hedera-node/Dockerfile + # volumes: + # - ${GN_INSTANCE_FOLDER}:/opt/instance + # container_name: ${GN_CONTAINER_NAME} networks: external-net: From 088e126e0c6ecd0b20fd8c51dd74f18b3e094254 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Thu, 25 Feb 2021 22:04:25 +0100 Subject: [PATCH 08/45] added babel-eslint as dev dependency to avoid webpack error --- frontend/package.json | 1 + frontend/yarn.lock | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/package.json b/frontend/package.json index 3974ba151..d0cb09f54 100755 --- a/frontend/package.json +++ b/frontend/package.json @@ -52,6 +52,7 @@ "@vue/cli-plugin-eslint": "^3.7.0", "@vue/cli-service": "^3.7.0", "@vue/eslint-config-prettier": "^4.0.1", + "babel-eslint": "^10.1.0", "babel-plugin-component": "^1.1.0", "node-sass": "^4.12.0", "sass-loader": "^7.1.0", diff --git a/frontend/yarn.lock b/frontend/yarn.lock index aa27e61b7..fcf5528ae 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -1600,7 +1600,7 @@ babel-code-frame@^6.22.0, babel-code-frame@^6.26.0: esutils "^2.0.2" js-tokens "^3.0.2" -babel-eslint@^10.0.1: +babel-eslint@^10.0.1, babel-eslint@^10.1.0: version "10.1.0" resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.1.0.tgz#6968e568a910b78fb3779cdd8b6ac2f479943232" integrity sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg== From beb21f40545472bffa4ca47559ad2e3446df2b3c Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Fri, 26 Feb 2021 00:35:47 +0100 Subject: [PATCH 09/45] updated login_server ref --- login_server | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/login_server b/login_server index 2a033c34e..2001d238e 160000 --- a/login_server +++ b/login_server @@ -1 +1 @@ -Subproject commit 2a033c34e4657e84a4387ecfda1cd6102032e95e +Subproject commit 2001d238ef312fd4136d0373543df3a5c252261b From d4530e2b415e745d568f236d7acc5240e0193a09 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Fri, 26 Feb 2021 00:36:17 +0100 Subject: [PATCH 10/45] implemented loginAPI --- frontend/src/apis/loginAPI.js | 82 +++++++++++++++++++++++++++++++++ frontend/src/mixins/loginAPI.js | 19 -------- 2 files changed, 82 insertions(+), 19 deletions(-) create mode 100644 frontend/src/apis/loginAPI.js delete mode 100644 frontend/src/mixins/loginAPI.js diff --git a/frontend/src/apis/loginAPI.js b/frontend/src/apis/loginAPI.js new file mode 100644 index 000000000..3a58957ea --- /dev/null +++ b/frontend/src/apis/loginAPI.js @@ -0,0 +1,82 @@ +import axios from 'axios'; + +// TODO move this +const LOGIN_API_URL = 'http://localhost/login_api/' + +// control email-text sended with email verification code +const EMAIL_TYPE = { + DEFAULT: 2, // if user has registered directly + ADMIN: 5, // if user was registered by an admin +} + +// define a mixin object +const loginAPI = { + login: async (email, password) => { + const payload = { + email, + password, + } + try { + const result = await axios.post(LOGIN_API_URL + 'unsecureLogin', payload); + if(result.status !== 200){ + throw new Error('HTTP Status Error '+result.status) + } + if(result.data.state === 'error'){ + throw new Error(result.data.msg) + } + if(result.data.state !== 'success'){ + throw new Error(result.data) + } + return { success: true, result } + } catch(error){ + return { success: false, result: error} + } + }, + logout: async (session_id) => { + const payload= { session_id } + try { + const result = await axios.post(LOGIN_API_URL + 'logout', payload); + if(result.status !== 200){ + throw new Error('HTTP Status Error '+result.status) + } + if(result.data.state === 'error'){ + throw new Error(result.data.details) + } + if(result.data.state !== 'success'){ + throw new Error(result.data) + } + return { success: true, result } + } catch(error){ + return { success: false, result: error} + } + }, + create : async (email, first_name, last_name, password) => { + const payload = { + email, + first_name, + last_name, + password, + emailType: EMAIL_TYPE.DEFAULT + } + try { + const result = await axios.post(LOGIN_API_URL + 'createUser', payload); + if(result.status !== 200){ + throw new Error('HTTP Status Error '+result.status) + } + if(result.data.state === 'error'){ + throw new Error(result.data.details) + } + if(result.data.state === 'exists'){ + throw new Error(result.data.msg) + } + if(result.data.state !== 'success'){ + throw new Error(result.data) + } + return { success: true, result } + } catch(error){ + return { success: false, result: error} + } + }, +} + +export default loginAPI \ No newline at end of file diff --git a/frontend/src/mixins/loginAPI.js b/frontend/src/mixins/loginAPI.js deleted file mode 100644 index 69c5e1441..000000000 --- a/frontend/src/mixins/loginAPI.js +++ /dev/null @@ -1,19 +0,0 @@ -// TODO move this -const LOGIN_API_URL = 'http://localhost/login_api/' - -// define a mixin object -const loginAPI = { - mutations: { - login: async () => { - return axios.post(LOGIN_API_URL + 'unsecureLogin', data); - }, - creatUser : async () => { - return axios.post(LOGIN_API_URL + 'createUser', data); - }, - logout: async () => { - return axios.post(LOGIN_API_URL + 'logout', data); - }, - } -} - -export default loginAPI \ No newline at end of file From 1960ce109c6d920a0c475a43db8591d96084f655 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Fri, 26 Feb 2021 00:36:45 +0100 Subject: [PATCH 11/45] implemented store + api calls --- frontend/src/store/store.js | 130 ++++++++---------- frontend/src/views/Landing.vue | 25 +--- frontend/src/views/Layout/DashboardLayout.vue | 4 +- frontend/src/views/Layout/DashboardNavbar.vue | 8 +- 4 files changed, 71 insertions(+), 96 deletions(-) diff --git a/frontend/src/store/store.js b/frontend/src/store/store.js index b97bf47a1..b59f2ceb8 100644 --- a/frontend/src/store/store.js +++ b/frontend/src/store/store.js @@ -1,13 +1,13 @@ import Vue from 'vue' import Vuex from 'vuex' Vue.use(Vuex) -import axios from 'axios'; -import VueCookies from 'vue-cookies'; -import router from '../routes/router.js'; +import router from '../routes/router.js' +import loginAPI from '../apis/loginAPI' +// TODO make persistent: https://translate.google.de/translate?hl=de&sl=en&u=https://sandulat.com/safely-persisting-vuex-store-in-local-storage/&prev=search&pto=aue export const store = new Vuex.Store({ state: { - path: 'http://192.168.0.89/account/', + /*path: 'http://192.168.0.89/account/', is_auth: false, is_admin: false, active: false, @@ -16,77 +16,65 @@ export const store = new Vuex.Store({ name:"", email:"" }, - dataLogout: {"session_id": -127182} + dataLogout: {"session_id": -127182}*/ + session_id: null, + email: null }, - mutations: { - isActive(state) { - //("Im Store PRÜFEN PRÜFEN" ) - return true + // Retrieve a state variable + getters: { + /*isActive: (state, getters) => { + return state.active; + }*/ + }, + // Syncronous mutation of the state + mutations: { + email: (state, email) => { + console.log('mutation: email') + state.email = email }, - login (state, logindata) { - //console.log("Im Store LOGIN() start " ) - //console.log("logon state =>", state ) - //console.log("logon TEST =>", logindata ) - axios.post("http://localhost/login_api/unsecureLogin", logindata).then((ldata) => { - - //console.log("Im Store LOGIN() axios then.statusText ", ldata.statusText); - if (ldata.statusText === "OK") { - console.log("STORE login() ldatasession_id", ldata.data.session_id) - state.is_auth = true - state.active = true - $cookies.set('gdd_is_auth','true'); - $cookies.set('gdd_session_id', ldata.data.session_id); - $cookies.set('gdd_email',logindata.email); - state.user.email = logindata.email - - //console.log("STORE login() to " + state.is_auth) - router.push('/KontoOverview') - - } - - return true - }, (error) => { - console.log(error); - }); - //console.log("STORE login() from" + state.is_auth) - //if (state.is_auth) { - // state.is_auth = false - // state.active = false - //} else { - // state.is_auth = true - // state.active = true - //} - // console.log("STORE login() to " + state.is_auth) + session_id: (state,session_id) => { + console.log('mutation: session_id') + state.session_id = session_id }, - creatUser( state, formdata) { - //console.log("Im Store creatUser() start " ) - axios.post("http://localhost/login_api/createUser", formdata).then((ldata) => { - - console.log("Im Store creatUser() axios then ", ldata); - // this.ldata = ldata.data; - return true - - }, (error) => { - console.log(error); - }); + }, + // Asyncronous actions - used for api calls + actions: { + login: async ({ dispatch, commit }, data) => { + console.log('action: login') + const result = await loginAPI.login(data.email,data.password) + console.log(result) + if( result.success ){ + // We are not logged in, we need to do that manually. + // TODO show user a success message + commit('session_id', result.result.data.session_id) + commit('email', data.email) + router.push('/KontoOverview') + } else { + // Register failed, we perform a logout + dispatch('logout') + } + }, + createUser: async ({ dispatch }, data) => { + console.log('action: createUser') + const result = await loginAPI.create(data.email,data.first_name,data.last_name,data.password) + if( result.success ){ + // TODO We are not logged in, we need to do that manually. + // TODO show user a success message + } else { + // Register failed, we perform a logout + dispatch('logout') + } }, - logout(state){ - axios.post("http://localhost/login_api/logout", this.dataLogout).then((ldata) => { - - //console.log("Im Store logout() axios then ", ldata); - // this.ldata = ldata.data; - //return true - state.is_auth = false - state.is_admin = false - state.active = false - $cookies.set('gdd_is_auth','false'); - $cookies.remove('gdd_email'); - $cookies.remove('gdd_session_id'); - router.push('/Landing') - }, (error) => { - console.log(error); - }); - + logout: async ({ commit , state }) => { + // Are we actually logged in? + if(state.session_id){ + const result = await loginAPI.logout(state.session_id) + // The result can be error, but thats ok with us + } + + commit('session_id', null) + commit('email', null) + router.push('/landing') } } }) \ No newline at end of file diff --git a/frontend/src/views/Landing.vue b/frontend/src/views/Landing.vue index 856565a25..72f0cb88f 100644 --- a/frontend/src/views/Landing.vue +++ b/frontend/src/views/Landing.vue @@ -81,7 +81,7 @@ - Anmelden + Anmelden @@ -114,25 +114,12 @@ export default { }, methods: { login() { - if (this.lemail != '' || this.lpwd != '') { - //console.log("landingpage login() ") - //console.log("landingpage login() lemail ", this.lemail) - //console.log("landingpage login() lpwd ", this.lpwd) - this.$store.commit('login', {"email": this.lemail, "password": this.lpwd}) - } - - //this.$router.push('/KontoOverview') - + //if (this.lemail !== '' || this.lpwd !== '') { // TODO this should be done via form validation + this.$store.dispatch('login', {email: this.lemail, password: this.lpwd}) + //} }, - creatUser() { - console.log("landingpage creatUser() ") - console.log("landingpage login() remail ", this.remail) - console.log("landingpage login() rfname ", this.rfname) - console.log("landingpage login() rlname ", this.rlname) - console.log("landingpage login() rpwd ", this.rpwd) - this.$store.commit('creatUser', {"email":this.remail, "first_name":this.rfname, "last_name":this.rlname , "emailType": 2, "password":this.rpwd}) - //this.$router.push('/KontoOverview') - + createUser() { + this.$store.dispatch('createUser', {email:this.remail, first_name:this.rfname, last_name:this.rlname, password:this.rpwd}) }, loginAsAdmin () { console.log("app.vue admin login(): " + this.$store.state.is_admin) diff --git a/frontend/src/views/Layout/DashboardLayout.vue b/frontend/src/views/Layout/DashboardLayout.vue index 72793376d..d05f49b7e 100755 --- a/frontend/src/views/Layout/DashboardLayout.vue +++ b/frontend/src/views/Layout/DashboardLayout.vue @@ -88,7 +88,7 @@ components: { DashboardNavbar, ContentFooter, - DashboardContent, + // DashboardContent, FadeTransition }, methods: { @@ -100,7 +100,7 @@ }, logout(){ //console.log("DashboardLayout.vue user logout() : ") - this.$store.commit('logout') + this.$store.dispatch('logout') } }, mounted() { diff --git a/frontend/src/views/Layout/DashboardNavbar.vue b/frontend/src/views/Layout/DashboardNavbar.vue index a373a058c..b6b31cef4 100755 --- a/frontend/src/views/Layout/DashboardNavbar.vue +++ b/frontend/src/views/Layout/DashboardNavbar.vue @@ -41,7 +41,7 @@ Image placeholder - {{this.$store.state.user.email}} + {{this.$store.state.email}} @@ -84,9 +84,9 @@ import { BaseNav, Modal } from '@/components'; export default { components: { - CollapseTransition, + // CollapseTransition, BaseNav, - Modal + // Modal }, props: { type: { @@ -121,7 +121,7 @@ export default { }, logout(){ //console.log("DashboardNavbar.vue user logout() : ") - this.$store.commit('logout') + this.$store.dispatch('logout') } } }; From c40b085b3d06e83e2f064de045eed8980cbda529 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Fri, 26 Feb 2021 00:44:41 +0100 Subject: [PATCH 12/45] lint fixes --- frontend/src/components/BaseTable.vue | 1 - frontend/src/components/Inputs/BaseCheckbox.vue | 1 + frontend/src/components/SidebarPlugin/SidebarItem.vue | 1 + frontend/src/views/AdminOverview.vue | 6 +++--- frontend/src/views/Dashboard.vue | 2 +- frontend/src/views/KontoOverview.vue | 2 +- frontend/src/views/Layout/AdminLayout.vue | 2 +- frontend/src/views/Layout/AuthLayout_gdd.vue | 4 ++-- frontend/src/views/Starter/SampleLayout.vue | 4 ++-- frontend/src/views/Starter/SampleNavbar.vue | 4 ++-- 10 files changed, 14 insertions(+), 13 deletions(-) diff --git a/frontend/src/components/BaseTable.vue b/frontend/src/components/BaseTable.vue index 40cb6eae4..979cb6618 100644 --- a/frontend/src/components/BaseTable.vue +++ b/frontend/src/components/BaseTable.vue @@ -13,7 +13,6 @@ {{ itemValue(item, column) }} diff --git a/frontend/src/components/Inputs/BaseCheckbox.vue b/frontend/src/components/Inputs/BaseCheckbox.vue index dd39f21b4..5de6ef500 100755 --- a/frontend/src/components/Inputs/BaseCheckbox.vue +++ b/frontend/src/components/Inputs/BaseCheckbox.vue @@ -66,6 +66,7 @@ if (this.inline) { return `form-check-inline`; } + return '' } }, created() { diff --git a/frontend/src/components/SidebarPlugin/SidebarItem.vue b/frontend/src/components/SidebarPlugin/SidebarItem.vue index aea2ccfb4..2699bef25 100755 --- a/frontend/src/components/SidebarPlugin/SidebarItem.vue +++ b/frontend/src/components/SidebarPlugin/SidebarItem.vue @@ -116,6 +116,7 @@ export default { let words = this.link.name.split(' '); return words.map(word => word.substring(0, 1)).join(''); } + return '' }, isMenu() { return this.children.length > 0 || this.menu === true; diff --git a/frontend/src/views/AdminOverview.vue b/frontend/src/views/AdminOverview.vue index b54920a9d..888df8380 100644 --- a/frontend/src/views/AdminOverview.vue +++ b/frontend/src/views/AdminOverview.vue @@ -232,12 +232,12 @@ components: { LineChart, BarChart, - BaseProgress, + //BaseProgress, StatsCard, - PageVisitsTable, + //PageVisitsTable, AdminUserSearch, AdminUserCreation, - SearchUser + //SearchUser }, data() { return { diff --git a/frontend/src/views/Dashboard.vue b/frontend/src/views/Dashboard.vue index 0e9e6c012..b52871131 100644 --- a/frontend/src/views/Dashboard.vue +++ b/frontend/src/views/Dashboard.vue @@ -153,7 +153,7 @@ components: { LineChart, BarChart, - BaseProgress, + //BaseProgress, StatsCard, PageVisitsTable, SocialTrafficTable diff --git a/frontend/src/views/KontoOverview.vue b/frontend/src/views/KontoOverview.vue index b568bf8f0..a72d1d3eb 100644 --- a/frontend/src/views/KontoOverview.vue +++ b/frontend/src/views/KontoOverview.vue @@ -79,7 +79,7 @@ GddTable, GddAddWork, GddWorkTable, - axios + //axios }, methods: { UserData() { diff --git a/frontend/src/views/Layout/AdminLayout.vue b/frontend/src/views/Layout/AdminLayout.vue index cbed877b1..b582bb588 100644 --- a/frontend/src/views/Layout/AdminLayout.vue +++ b/frontend/src/views/Layout/AdminLayout.vue @@ -98,7 +98,7 @@ components: { DashboardNavbar, ContentFooter, - DashboardContent, + //DashboardContent, FadeTransition }, methods: { diff --git a/frontend/src/views/Layout/AuthLayout_gdd.vue b/frontend/src/views/Layout/AuthLayout_gdd.vue index 840be9876..a58e2a791 100644 --- a/frontend/src/views/Layout/AuthLayout_gdd.vue +++ b/frontend/src/views/Layout/AuthLayout_gdd.vue @@ -45,8 +45,8 @@ export default { components: { - BaseNav, - ZoomCenterTransition + //BaseNav, + //ZoomCenterTransition }, props: { backgroundColor: { diff --git a/frontend/src/views/Starter/SampleLayout.vue b/frontend/src/views/Starter/SampleLayout.vue index f0faaaa55..5b3d69f21 100755 --- a/frontend/src/views/Starter/SampleLayout.vue +++ b/frontend/src/views/Starter/SampleLayout.vue @@ -2,7 +2,7 @@
- @@ -35,15 +36,6 @@ export default { balance_gdd: this.$store.state.user.balance, balance_gdt: this.$store.state.user.balance_gdt, } - }, - methods: { - setComma(int){ - if (int !== '' || int !== undefined || int !== 0 || int !== '0' || int !== null) { - int = int /10000 - return int.toFixed(2).replace(/(\d)(?=(\d{3})+(?:\.\d+)?$)/g, "$1,") - //return int / 10000 - } - } - }, + } }; \ No newline at end of file diff --git a/frontend/src/views/KontoOverview/GddTable.vue b/frontend/src/views/KontoOverview/GddTable.vue index 563931866..656bb17b9 100644 --- a/frontend/src/views/KontoOverview/GddTable.vue +++ b/frontend/src/views/KontoOverview/GddTable.vue @@ -6,7 +6,7 @@
-

{{ setComma(item.balance) }} GDD

+

{{ $n((item.balance)/1000) }} GDD

{{item.name}}

i
@@ -80,12 +80,6 @@ export default { toogle(item) { const temp = 'xxx porta' - }, - setComma(int){ - if (int !== '' || int !== undefined || int !== 0 || int !== '0' || int !== null) { - int = int /10000 - return int.toFixed(2).replace(/(\d)(?=(\d{3})+(?:\.\d+)?$)/g, "$1,") - } } } }; diff --git a/frontend/src/views/Layout/ContentFooter.vue b/frontend/src/views/Layout/ContentFooter.vue index 1424984d2..2190a4a40 100755 --- a/frontend/src/views/Layout/ContentFooter.vue +++ b/frontend/src/views/Layout/ContentFooter.vue @@ -8,16 +8,16 @@ - + Gradido - + Impressum - + Datenschutzerklärung - + License diff --git a/frontend/src/views/Pages/UserProfile/UserCard.vue b/frontend/src/views/Pages/UserProfile/UserCard.vue index 66d3c48c0..e55a9f1f5 100755 --- a/frontend/src/views/Pages/UserProfile/UserCard.vue +++ b/frontend/src/views/Pages/UserProfile/UserCard.vue @@ -29,7 +29,7 @@ Community
- {{ setComma(this.$store.state.user.balance) }} + {{ $n(this.$store.state.user.balance) }} GDD
@@ -63,15 +63,7 @@ export default { name: "profilecard", components: { VueQrcode, - }, - methods: { - setComma(int){ - if (int !== '' || int !== undefined || int !== 0 || int !== '0' || int !== null) { - int = int /10000 - return int.toFixed(2).replace(/(\d)(?=(\d{3})+(?:\.\d+)?$)/g, "$1,") - } - } - } + } }; From 1430c703254697f9e2eb92a93c3576ff0ffc9b9d Mon Sep 17 00:00:00 2001 From: ogerly Date: Thu, 4 Mar 2021 11:48:32 +0100 Subject: [PATCH 45/45] switch language und switch clare format for currency in english and german, europa --- frontend/src/views/KontoOverview/GddTable.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/views/KontoOverview/GddTable.vue b/frontend/src/views/KontoOverview/GddTable.vue index 656bb17b9..82a7c0b22 100644 --- a/frontend/src/views/KontoOverview/GddTable.vue +++ b/frontend/src/views/KontoOverview/GddTable.vue @@ -6,7 +6,7 @@
-

{{ $n((item.balance)/1000) }} GDD

+

{{ $n((item.balance)/10000) }} GDD

{{item.name}}

i