From 5b4eed0a4145a20680363a7944e74ed93d78f3e8 Mon Sep 17 00:00:00 2001 From: AngeloCG97 <51149817+AngeloCG97@users.noreply.github.com> Date: Tue, 7 Sep 2021 12:42:58 -0600 Subject: [PATCH] Add new design feat (#751) * Publish changes to prod (#566) * avoid statefulsets update errors on actions runs refs #535. (#536) * deprecate demux service. refs #538 (#540) * add handler url from env var & other minor bug fixes (#542) * Add missing env var to config map (#543) * add handler url from env var & other minor bug fixes * add missing env var * fix: update some env vars * fix: update some env vars * fix: replace .env values with the previous ones * Feat/add tx link (#545) * feat: add tx link * feat: remove secrets * setup env workflow (#546) * wip * wip: add env files & db_data to .gitignore * fix: remove .env files * fix: remove .env files * fix: delete unnecessary code * refactor: remove unnecessary code * fix: minimal * Fix/rate action buttons not showing (#547) * wip * wip: add env files & db_data to .gitignore * fix: remove .env files * fix: remove .env files * fix: delete unnecessary code * refactor: remove unnecessary code * fix: minimal * fix: rate buttons not showing in certains densities * Fix/hasura console config (#556) * Deploy to mainnet (#544) * avoid statefulsets update errors on actions runs refs #535. (#536) * deprecate demux service. refs #538 (#540) * add handler url from env var & other minor bug fixes (#542) * Add missing env var to config map (#543) * add handler url from env var & other minor bug fixes * add missing env var * fix: update some env vars * fix: update some env vars * fix: replace .env values with the previous ones Co-authored-by: Andres Gomez Co-authored-by: JustinCast * wip * wip: add env files & db_data to .gitignore * fix: remove .env files * fix: remove .env files * fix: delete unnecessary code * refactor: remove unnecessary code * fix: minimal * feat: voting tool revamp * fix: remove comments * fix: add i18n entries * fix: bug fixes * fix: hasura console config Co-authored-by: Xavier <5632966+xavier506@users.noreply.github.com> Co-authored-by: Andres Gomez * Fix/add missing i18n entries (#554) * Deploy to mainnet (#544) * avoid statefulsets update errors on actions runs refs #535. (#536) * deprecate demux service. refs #538 (#540) * add handler url from env var & other minor bug fixes (#542) * Add missing env var to config map (#543) * add handler url from env var & other minor bug fixes * add missing env var * fix: update some env vars * fix: update some env vars * fix: replace .env values with the previous ones Co-authored-by: Andres Gomez Co-authored-by: JustinCast * wip * wip: add env files & db_data to .gitignore * fix: remove .env files * fix: remove .env files * fix: delete unnecessary code * refactor: remove unnecessary code * fix: minimal * feat: voting tool revamp * fix: remove comments * fix: add i18n entries * fix: bug fixes Co-authored-by: Xavier <5632966+xavier506@users.noreply.github.com> Co-authored-by: Andres Gomez * docs: add env example (#565) * fix: not able to sync proxies locally (#564) * fix: update hasura version * fix: hasura version && other minor bug fixes * Fix/update hasura version (#567) * fix: remove build:staging statement * latest changes Co-authored-by: Andres Gomez Co-authored-by: JustinCast * Update push-master-environment.yaml (#576) * fix(cron): update config values (#579) * Revert "fix(cron): update config values (#579)" (#580) This reverts commit 13ecf78f0cec5c1a938a1ee0aee646828995d940. * fix(backend): use envarioment variables * fix(backend): update .env.example variables * fix(backend): rename envarioment variables * fix(backend): minor change * fix(backend): update docker-compose * fix(backend): update .env.example values * fix(backend): refactor variables names * fix(backend): add config.yaml file and remove .gitignore from it * fix(backend): update cryptolions to jungle.eosio * fix(.env.example): update unauthorized role to anonymous * fix(push-enviroment): remove duplicated variable * fix(home page): fix show button vote * fix(design): Fix broken titles on card component * fix(conflicts) * delete(package) * refactor(design): change design on volting tool * fix(voting-tool): apply new design on this component * fix(radar-design): update use to react-chart2 library * fix(compare-graph-view): fix merge conflicts * fix(compare-graph-view): fix broken pagen when load page * refactor(block-producer-profile): update design * refactor(front-end): update bp profile design * fix(block-producer-profile.js): fix merge conflicts * refactor(front-end): update proxies profile design * refactor(front-end): update proxies profile design * fix(proxy-profile): align design on all dimensions * refactor(card-design): change rates and average position * fix(front-end): update design on various components * fix(content): changes texts * fix(front-end): add drop shadow to voting tool * feat(front-end): add message when voting tool is empty * fix(front-end): align * fix(content): apply changes in content * fix(design): update profile design * feat(rate-bp): change text button text when user update rate * feat(logo): change logo in jungle and mainnet * fix(env-vars): change content to env vars * fix(merge): fix conflicts * fix(env-vars): change content to env vars * fix(workflows): remove unnecessary env var Co-authored-by: Xavier <5632966+xavier506@users.noreply.github.com> Co-authored-by: Andres Gomez Co-authored-by: JustinCast Co-authored-by: Xavier Fernandez Co-authored-by: Leister Francisco Alvarez Campos --- .env.example | 3 ++- .github/workflows/push-master-environment.yaml | 15 ++------------- .github/workflows/push-staging-environment.yaml | 16 ++-------------- docker-compose.yml | 1 + webapp/makefile | 1 + webapp/public/logo-mainnet.svg | 10 ++++++++++ webapp/public/logo-testnet.svg | 4 ++++ webapp/src/components/app-bar/index.js | 9 +++++++-- webapp/src/config/index.js | 1 + webapp/src/language/en.json | 1 + webapp/src/language/es.json | 1 + .../block-producers/block-producer-rate.js | 10 ++++++++-- 12 files changed, 40 insertions(+), 32 deletions(-) create mode 100644 webapp/public/logo-mainnet.svg create mode 100644 webapp/public/logo-testnet.svg diff --git a/.env.example b/.env.example index 4f74cb77..5bc5066c 100644 --- a/.env.example +++ b/.env.example @@ -32,7 +32,8 @@ HASURA_GRAPHQL_ACTION_BASE_URL=http://hapi:9090 # WEBAPP REACT_APP_RATING_CONTRACT=rateproducer -REACT_APP_EDEN_CONTRACT=genesis.eden // si es jungle genesisdeden +REACT_APP_MAINNET_VERSION=true +REACT_APP_EDEN_CONTRACT=genesis.eden // if is jungle genesisdeden REACT_APP_GRAPHQL_HTTP_URL=http://localhost:8080/v1/graphql REACT_APP_API_URL=https://jungle.eosio.cr REACT_APP_GRAPHQL_WS_URL=ws://localhost:8080/v1/graphql diff --git a/.github/workflows/push-master-environment.yaml b/.github/workflows/push-master-environment.yaml index 59b493a1..d5c3a845 100644 --- a/.github/workflows/push-master-environment.yaml +++ b/.github/workflows/push-master-environment.yaml @@ -43,8 +43,9 @@ jobs: NAMESPACE: mainnet-eosrate # webapp REACT_APP_RATING_CONTRACT: rateproducer - REACT_APP_EDEN_CONTRACT: ${{ secrets.REACT_APP_EDEN_CONTRACT }} REACT_APP_PROXY_CONTRACT: regproxyinfo + REACT_APP_MAINNET_VERSION: true + REACT_APP_EDEN_CONTRACT: genesis.eden REACT_APP_GRAPHQL_HTTP_URL: https://graphql.eosrate.io/v1/graphql REACT_APP_GRAPHQL_WS_URL: wss://graphql.eosrate.io/v1/graphql REACT_APP_EOS_API_URL: https://api.main.alohaeos.com @@ -68,18 +69,6 @@ jobs: NAMESPACE: mainnet-eosrate INGRESS_HOST: eosrate.io INGRESS_GRAPHQL_HOST: graphql.eosrate.io - # webapp - REACT_APP_RATING_CONTRACT: rateproducer - REACT_APP_EDEN_CONTRACT: ${{ secrets.REACT_APP_EDEN_CONTRACT }} - REACT_APP_GRAPHQL_HTTP_URL: https://graphql.eosrate.io/v1/graphql - REACT_APP_GRAPHQL_WS_URL: wss://graphql.eosrate.io/v1/graphql - REACT_APP_EOS_API_URL: https://api.main.alohaeos.com - REACT_APP_EOS_API_HOST: api.main.alohaeos.com - REACT_APP_EOS_API_PORT: 443 - REACT_APP_EOS_API_PROTOCOL: https - REACT_APP_EOS_CHAIN_ID: aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906 - REACT_APP_BLOCK_EXPLORER: https://bloks.io - REACT_APP_NETWORK_MONITOR_URL: https://jungle.eosio.online/ # postgres POSTGRES_DB: ${{ secrets.POSTGRES_DB }} POSTGRES_USER: ${{ secrets.POSTGRES_USER }} diff --git a/.github/workflows/push-staging-environment.yaml b/.github/workflows/push-staging-environment.yaml index 57ff1061..df20ad75 100644 --- a/.github/workflows/push-staging-environment.yaml +++ b/.github/workflows/push-staging-environment.yaml @@ -43,7 +43,8 @@ jobs: NAMESPACE: jungle-eosrate # webapp REACT_APP_RATING_CONTRACT: rateproducer - REACT_APP_EDEN_CONTRACT: ${{ secrets.REACT_APP_EDEN_CONTRACT }} + REACT_APP_MAINNET_VERSION: false + REACT_APP_EDEN_CONTRACT: genesisdeden REACT_APP_PROXY_CONTRACT: regproxyinfo REACT_APP_GRAPHQL_HTTP_URL: https://graphql-jungle.eosrate.io/v1/graphql REACT_APP_GRAPHQL_WS_URL: wss://graphql-jungle.eosrate.io/v1/graphql @@ -68,19 +69,6 @@ jobs: NAMESPACE: jungle-eosrate INGRESS_HOST: jungle.eosrate.io INGRESS_GRAPHQL_HOST: graphql-jungle.eosrate.io - # webapp - REACT_APP_RATING_CONTRACT: rateproducer - REACT_APP_EDEN_CONTRACT: ${{ secrets.REACT_APP_EDEN_CONTRACT }} - REACT_APP_PROXY_CONTRACT: regproxyinfo - REACT_APP_GRAPHQL_HTTP_URL: https://graphql-jungle.eosrate.io/v1/graphql - REACT_APP_GRAPHQL_WS_URL: wss://graphql-jungle.eosrate.io/v1/graphql - REACT_APP_EOS_API_URL: https://jungle3.cryptolions.io - REACT_APP_EOS_API_HOST: jungle3.cryptolions.io - REACT_APP_EOS_API_PORT: 443 - REACT_APP_EOS_API_PROTOCOL: https - REACT_APP_EOS_CHAIN_ID: 2a02a0053e5a8cf73a56ba0fda11e4d92e0238a4a2aa74fccf46d5a910746840 - REACT_APP_BLOCK_EXPLORER: https://jungle3.bloks.io - REACT_APP_NETWORK_MONITOR_URL: https://jungle.eosio.online/ # postgres DATABASE_DIRECTORY: database POSTGRES_DB: ${{ secrets.POSTGRES_DB }} diff --git a/docker-compose.yml b/docker-compose.yml index b5314499..2c390a2b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -87,6 +87,7 @@ services: restart: always environment: REACT_APP_RATING_CONTRACT: "${REACT_APP_RATING_CONTRACT}" + REACT_APP_MAINNET_VERSION: "${REACT_APP_MAINNET_VERSION}" REACT_APP_EDEN_CONTRACT: "${REACT_APP_EDEN_CONTRACT}" HASURA_GRAPHQL_DATABASE_URL: "${HASURA_GRAPHQL_DATABASE_URL}" HASURA_GRAPHQL_MIGRATIONS_DIR: /migrations diff --git a/webapp/makefile b/webapp/makefile index 195aa6f5..7d0fe7e5 100644 --- a/webapp/makefile +++ b/webapp/makefile @@ -25,6 +25,7 @@ build-docker: ./Dockerfile -t $(DOCKER_REGISTRY)/$(IMAGE_NAME_WEBAPP):$(VERSION) --target server \ -t $(DOCKER_REGISTRY)/$(IMAGE_NAME_WEBAPP):$(LATEST_TAG) --target server \ --build-arg REACT_APP_RATING_CONTRACT="$(REACT_APP_RATING_CONTRACT)" \ + --build-arg REACT_APP_MAINNET_VERSION="$(REACT_APP_MAINNET_VERSION)" \ --build-arg REACT_APP_EDEN_CONTRACT="$(REACT_APP_EDEN_CONTRACT)" \ --build-arg REACT_APP_GRAPHQL_HTTP_URL="$(REACT_APP_GRAPHQL_HTTP_URL)" \ --build-arg REACT_APP_GRAPHQL_WS_URL="$(REACT_APP_GRAPHQL_WS_URL)" \ diff --git a/webapp/public/logo-mainnet.svg b/webapp/public/logo-mainnet.svg new file mode 100644 index 00000000..645d8d11 --- /dev/null +++ b/webapp/public/logo-mainnet.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/webapp/public/logo-testnet.svg b/webapp/public/logo-testnet.svg new file mode 100644 index 00000000..ebb70651 --- /dev/null +++ b/webapp/public/logo-testnet.svg @@ -0,0 +1,4 @@ + + + + diff --git a/webapp/src/components/app-bar/index.js b/webapp/src/components/app-bar/index.js index 224d65d4..c61d2d8c 100644 --- a/webapp/src/components/app-bar/index.js +++ b/webapp/src/components/app-bar/index.js @@ -21,8 +21,9 @@ import Tooltip from '@material-ui/core/Tooltip' import Box from '@material-ui/core/Box' import InputAutocomplete from 'components/input-autocomplete' -import MobileSearch from 'components/mobile-search' import LanguageSelect from 'components/language-select' +import MobileSearch from 'components/mobile-search' +import { stage } from '../../config' import styles from './styles' @@ -96,7 +97,11 @@ const MainTopBar = ({ - EOS Rate + EOS Rate
diff --git a/webapp/src/config/index.js b/webapp/src/config/index.js index 05f55849..41a0e990 100644 --- a/webapp/src/config/index.js +++ b/webapp/src/config/index.js @@ -1,4 +1,5 @@ export const appName = 'EOSRate' +export const stage = process.env.REACT_APP_MAINNET_VERSION export const contract = process.env.REACT_APP_RATING_CONTRACT || 'rateproducer' export const contractEden = process.env.REACT_APP_EDEN_CONTRACT || 'genesis.eden' diff --git a/webapp/src/language/en.json b/webapp/src/language/en.json index e7ca16b9..ad9ff830 100644 --- a/webapp/src/language/en.json +++ b/webapp/src/language/en.json @@ -172,6 +172,7 @@ "rateText": "If you feel that you do not have enough knowledge about a specific category you can disable it.", "helpText": "Publish your BP rating by signing in with your favorite wallet.", "publishRatingButton": "Publish Rating", + "updateRatingButton": "Update Rating", "cancelRatingButton": "Cancel", "transparency": "Transparency", "transparencyTooltip": "Compliance with disclosure of ownership.", diff --git a/webapp/src/language/es.json b/webapp/src/language/es.json index 2e74af9f..28556acf 100644 --- a/webapp/src/language/es.json +++ b/webapp/src/language/es.json @@ -172,6 +172,7 @@ "rateText": "Si cree que no tiene suficiente conocimiento sobre una categoría específica, puede deshabilitarla.", "helpText": "Publique su calificación iniciando sesión con tu billetera favorita.", "publishRatingButton": "Publicar Calificación", + "updateRatingButton": "Actualizar calificación", "cancelRatingButton": "Cancelar", "transparency": "Transparencia", "transparencyTooltip": "Cumplimiento de la divulgación de la información.", diff --git a/webapp/src/routes/block-producers/block-producer-rate.js b/webapp/src/routes/block-producers/block-producer-rate.js index 7a699301..b1c00f10 100644 --- a/webapp/src/routes/block-producers/block-producer-rate.js +++ b/webapp/src/routes/block-producers/block-producer-rate.js @@ -53,6 +53,7 @@ const INIT_RATING_STATE_DATA = { const BlockProducerRate = ({ account, ual }) => { const [ratingState, setRatingState] = useState(INIT_RATING_STATE_DATA) + const [isNewRate, setIsNewRate] = useState(true) const [showMessage, setShowMessage] = useState(false) const [showAlert, setShowAlert] = useState(false) const { t } = useTranslation('bpRatePage') @@ -132,6 +133,7 @@ const BlockProducerRate = ({ account, ual }) => { transparency: accountName ? userRate.transparency : 1, trustiness: accountName ? userRate.trustiness : 1 }) + setIsNewRate(false) } else { setRatingState(INIT_RATING_STATE_DATA) } @@ -419,7 +421,9 @@ const BlockProducerRate = ({ account, ual }) => { style={{ margin: '0 10px' }} variant='contained' > - {t('publishRatingButton')} + {isNewRate + ? t('publishRatingButton') + : t('updateRatingButton')} @@ -510,7 +514,9 @@ const BlockProducerRate = ({ account, ual }) => { style={{ margin: '0 10px' }} variant='contained' > - {t('publishRatingButton')} + {isNewRate + ? t('publishRatingButton') + : t('updateRatingButton')}