diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 1d2aef77e..08e03c5b7 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -5,21 +5,5 @@ labels: bug title: 🐛 [Bug] --- -## :bug: Bugreport - - -### Steps to reproduce the behavior -1. -2. -3. -4. ... -5. Profit - -### Expected behavior - - -### Version & Environment - - -### Additional context - +## 🐛 Bugreport + - -### Motive - - -### Related issues - - -### Implementation - - -### Validation - - -### Additional context - diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index ef3b30be2..94e5e5d80 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -5,20 +5,5 @@ labels: feature title: 🚀 [Feature] --- -## :rocket: Feature +## 🚀 Feature - -### User Problem - - -### Implementation - - -### Design & Layout - - -### Validation - - -### Additional context - diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md index ef10a53ef..886faae20 100644 --- a/.github/ISSUE_TEMPLATE/question.md +++ b/.github/ISSUE_TEMPLATE/question.md @@ -1,11 +1,11 @@ --- name: 💬 Question -about: If you need help understanding HumanConnection. +about: If you need help understanding Gradido. labels: question title: 💬 [Question] --- -## :speech_balloon: Question +## 💬 Question diff --git a/.github/ISSUE_TEMPLATE/refactor_tickets.md b/.github/ISSUE_TEMPLATE/refactor_tickets.md index b595abd5d..969595dee 100644 --- a/.github/ISSUE_TEMPLATE/refactor_tickets.md +++ b/.github/ISSUE_TEMPLATE/refactor_tickets.md @@ -5,17 +5,5 @@ labels: refactor title: 🔧 [Refactor] --- -## :zap: Refactor ticket +## 🔧 Refactor ticket - -### Motive - - -### Related issues - - -### Implementation - - -### Additional context - diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d14e385a3..f9f98748e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -212,7 +212,7 @@ jobs: report_name: Coverage Frontend type: lcov result_path: ./coverage/lcov.info - min_coverage: 13 + min_coverage: 15 token: ${{ github.token }} #test: diff --git a/community_server/src/Controller/AppController.php b/community_server/src/Controller/AppController.php index 98a690bd1..1cdcf4418 100644 --- a/community_server/src/Controller/AppController.php +++ b/community_server/src/Controller/AppController.php @@ -167,13 +167,15 @@ class AppController extends Controller $php_session_id = intval($session->read('session_id')); } $cookie_session_id = intval($this->request->getCookie('GRADIDO_LOGIN', '')); - if($php_session_id != 0) { + // decide in which order session_ids are tried + if($sessionId != 0) { + $session_id = $sessionId; + } else if($php_session_id != 0) { $session_id = $php_session_id; } else if($cookie_session_id != 0) { $session_id = $cookie_session_id; - } else { - $session_id = $sessionId; - } + } + $ip = $this->request->clientIp(); if (!$session->check('client_ip')) { $session->write('client_ip', $ip); diff --git a/community_server/src/Controller/AppRequestsController.php b/community_server/src/Controller/AppRequestsController.php index 9419cf28e..dfc11d4a2 100644 --- a/community_server/src/Controller/AppRequestsController.php +++ b/community_server/src/Controller/AppRequestsController.php @@ -61,8 +61,8 @@ class AppRequestsController extends AppController if(is_array($field)) { $one_exist = false; foreach($field as $oneField) { - if(isset($data[$oneField])) { - $param[$oneField] = $data[$oneField]; + if(isset($data->$oneField)) { + $param[$oneField] = $data->$oneField; $one_exist = true; break; } @@ -71,10 +71,10 @@ class AppRequestsController extends AppController return ['state' => 'error', 'msg' => 'missing field of set', 'details' => $field]; } } else { - if(!isset($data[$field])) { + if(!isset($data->$field)) { return ['state' => 'error', 'msg' => 'missing field', 'details' => $field . ' not found']; } else { - $param[$field] = $data[$field]; + $param[$field] = $data->$field; } } } @@ -85,9 +85,9 @@ class AppRequestsController extends AppController { foreach(array_keys($replaceKeys) as $key) { $newKey = $replaceKeys[$key]; - if(isset($data[$key])) { - $data[$newKey] = $data[$key]; - unset($data[$key]); + if(isset($data->$key)) { + $data->$newKey = $data->$key; + unset($data->$key); } } } @@ -98,8 +98,8 @@ class AppRequestsController extends AppController $data = $this->request->input('json_decode'); } $session_id = 0; - if(isset($data['session_id'])) { - $session_id = $data['session_id']; + if(isset($data->session_id)) { + $session_id = $data->session_id; } $login_request_result = $this->requestLogin($session_id, false); if($login_request_result !== true) { @@ -119,12 +119,12 @@ class AppRequestsController extends AppController return ['state' => 'error', 'msg' => 'amount is invalid', 'details' => $param['amount']]; } - if(isset($data['memo'])) { - $param['memo'] = $data['memo']; + if(isset($data->memo)) { + $param['memo'] = $data->memo; } - if(isset($data['auto_sign'])) { - $param['auto_sign'] = boolval($data['auto_sign']); + if(isset($data->auto_sign)) { + $param['auto_sign'] = boolval($data->auto_sign); } return true; diff --git a/community_server/src/Model/Table/StateBalancesTable.php b/community_server/src/Model/Table/StateBalancesTable.php index d3dfa0709..7564c30f2 100644 --- a/community_server/src/Model/Table/StateBalancesTable.php +++ b/community_server/src/Model/Table/StateBalancesTable.php @@ -199,7 +199,7 @@ class StateBalancesTable extends Table $amount = 0; if($transaction->transaction_type_id == 1) { // creation - $temp = $transaction->transaction_creations[0]; + $temp = $transaction->transaction_creation; /*$balance_temp = $this->newEntity(); $balance_temp->amount = $temp->amount; @@ -211,7 +211,7 @@ class StateBalancesTable extends Table //$amount_date = } else if($transaction->transaction_type_id == 2) { // transfer - $temp = $transaction->transaction_send_coins[0]; + $temp = $transaction->transaction_send_coin; $amount = intval($temp->amount); // reverse if sender if($stateUserId == $temp->state_user_id) { diff --git a/docker-compose.override.yml b/docker-compose.override.yml index 5a505478b..944f8d976 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -8,6 +8,8 @@ services: image: gradido/frontend:development build: target: development + networks: + - external-net environment: - NODE_ENV="development" # - DEBUG=true diff --git a/docker-compose.yml b/docker-compose.yml index 8b5bf33de..59e617d71 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,13 +15,13 @@ services: context: ./frontend target: production networks: - - external-net + - internal-net ports: - - 8080:8080 + - 3000:3000 environment: # Envs used in Dockerfile # - DOCKER_WORKDIR="/app" - # - PORT="8080" + # - PORT=3000 - BUILD_DATE - BUILD_VERSION - BUILD_COMMIT diff --git a/frontend/.env.dist b/frontend/.env.dist index 39edd4b4e..ffe4869fa 100644 --- a/frontend/.env.dist +++ b/frontend/.env.dist @@ -1,3 +1,3 @@ LOGIN_API_URL=http://localhost/login_api/ COMMUNITY_API_URL=http://localhost/api/ -VUE_PATH=/vue +ALLOW_REGISTER=true \ No newline at end of file diff --git a/frontend/Dockerfile b/frontend/Dockerfile index f133926b2..5ec90fe81 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -15,7 +15,7 @@ ENV BUILD_COMMIT="0000000" ## SET NODE_ENV ENV NODE_ENV="production" ## App relevant Envs -ENV PORT="8080" +ENV PORT="3000" # Labels LABEL org.label-schema.build-date="${BUILD_DATE}" @@ -82,15 +82,14 @@ FROM base as production # Copy "binary"-files from build image COPY --from=build ${DOCKER_WORKDIR}/dist ./dist -#COPY --from=build ${DOCKER_WORKDIR}/node_modules ./node_modules -#COPY --from=build ${DOCKER_WORKDIR}/nuxt.config.js ./nuxt.config.js +# We also copy the node_modules express and serve-static for the run script +COPY --from=build ${DOCKER_WORKDIR}/node_modules ./node_modules # Copy static files -# TODO - this should be one Folder containign all stuff needed to be copied -#COPY --from=build ${DOCKER_WORKDIR}/constants ./constants -#COPY --from=build ${DOCKER_WORKDIR}/static ./static -#COPY --from=build ${DOCKER_WORKDIR}/locales ./locales +COPY --from=build ${DOCKER_WORKDIR}/public ./public # Copy package.json for script definitions (lock file should not be needed) COPY --from=build ${DOCKER_WORKDIR}/package.json ./package.json +# Copy run scripts run/ +COPY --from=build ${DOCKER_WORKDIR}/run ./run # Run command CMD /bin/sh -c "yarn run start" diff --git a/frontend/package.json b/frontend/package.json index 00e0ca45b..a7f59eaa1 100755 --- a/frontend/package.json +++ b/frontend/package.json @@ -3,7 +3,7 @@ "version": "0.9.4", "private": true, "scripts": { - "start": "node server.js", + "start": "node run/server.js", "serve": "vue-cli-service serve --open", "build": "vue-cli-service build", "lint": "eslint --ext .js,.vue .", @@ -69,6 +69,7 @@ "vue-good-table": "^2.21.3", "vue-i18n": "^8.22.4", "vue-jest": "^3.0.7", + "vue-loading-overlay": "^3.4.2", "vue-moment": "^4.1.0", "vue-qrcode": "^0.3.5", "vue-qrcode-reader": "^2.3.16", diff --git a/frontend/run/server.js b/frontend/run/server.js new file mode 100644 index 000000000..470acdc4e --- /dev/null +++ b/frontend/run/server.js @@ -0,0 +1,14 @@ +// Imports +const express = require('express') +const serveStatic = require('serve-static') + +// Port +const port = process.env.PORT || 3000 + +// Express Server +const app = express() +app.use(serveStatic(__dirname + '/../dist')) +app.listen(port) + +// eslint-disable-next-line no-console +console.log(`http://frontend:${port} server started.`) diff --git a/frontend/server.js b/frontend/server.js deleted file mode 100644 index 5bcebd90a..000000000 --- a/frontend/server.js +++ /dev/null @@ -1,7 +0,0 @@ -var express = require('express') -var serveStatic = require('serve-static') -var app = express() -app.use(serveStatic(__dirname + '/dist')) -var port = process.env.PORT || 5000 -app.listen(port) -// console.log('http://localhost:5000 server started.'); diff --git a/frontend/src/apis/communityAPI.js b/frontend/src/apis/communityAPI.js index d675a65bf..589794635 100644 --- a/frontend/src/apis/communityAPI.js +++ b/frontend/src/apis/communityAPI.js @@ -49,12 +49,13 @@ const communityAPI = { } return apiPost(CONFIG.COMMUNITY_API__URL + 'createCoins/', payload) },*/ - send: async (session_id, email, amount, memo) => { + send: async (session_id, email, amount, memo, target_date) => { const payload = { session_id, email, amount, memo, + target_date, auto_sign: true, } return apiPost(CONFIG.COMMUNITY_API_URL + 'sendCoins/', payload) diff --git a/frontend/src/components/SidebarPlugin/SideBar.vue b/frontend/src/components/SidebarPlugin/SideBar.vue index 5e4af9ad6..6542bd23e 100755 --- a/frontend/src/components/SidebarPlugin/SideBar.vue +++ b/frontend/src/components/SidebarPlugin/SideBar.vue @@ -10,7 +10,7 @@ ... - {{ $n($store.state.user.balance) }} GDD + {{ $n(balance) }} GDD