From a4ae543d813a475c5a6e6ad0c20ed8a2d53c5c1c Mon Sep 17 00:00:00 2001 From: AngeloCG97 <51149817+AngeloCG97@users.noreply.github.com> Date: Fri, 27 Aug 2021 12:39:39 -0600 Subject: [PATCH] Fix some bugs (#720) * 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. * add(link sidebar): Add network Monitor in sidebar * fix(design): Align BP cards in all screen resolutions * fix(bp page): Fix broke design in bp page * fix(voting-tool): apply changes on design * fix(proxy-component): change cards and voting tool proxy design * fix(vote-bp): change method got to top page * fix(content): delete unnecessary console.log * fix(design): delete unnecessary backgraound color * fix(front-end): delete unnecessary code * fix(radar-component): change radar label font size * fix(code): delete unnecessary code * fix(code): delete unnecessary code * fix(code): delete unnecessary code * fix(front-end): change size proxy cards * fix(front-end): fix homepage design * fix(rate-tool): fix mobile design * fix(radar): change radar size * fix(envar): update envar * fix(db): add select permission to eden_rating_stats * fix(bp-profile): delete horizontal overflow * feat(filter): create eden top date * fix(design): fix broke design on proxy profile * fix(bp-profile): fix load eden rate * fix(front-end): change button texts Co-authored-by: Xavier <5632966+xavier506@users.noreply.github.com> Co-authored-by: Andres Gomez Co-authored-by: JustinCast Co-authored-by: Xavier Fernandez --- .../default/tables/public_producers_list.yaml | 18 +++++++++------- .../1630079306181_run_sql_migration/down.sql | 19 +++++++++++++++++ .../1630079306181_run_sql_migration/up.sql | 17 +++++++++++++++ .../1630081052611_run_sql_migration/down.sql | 3 +++ .../1630081052611_run_sql_migration/up.sql | 1 + .../1630081060538_run_sql_migration/down.sql | 21 +++++++++++++++++++ .../1630081060538_run_sql_migration/up.sql | 19 +++++++++++++++++ webapp/src/components/card/index.js | 2 +- webapp/src/language/en.json | 5 +++-- webapp/src/language/es.json | 3 ++- .../models/BlockProducer/blockProducers.js | 2 +- webapp/src/routes/block-producers/index.js | 1 + webapp/src/routes/proxies/index.js | 1 - webapp/src/routes/proxies/proxy-profile.js | 2 +- webapp/src/services/bps.js | 3 ++- webapp/src/utils/sortedBy.js | 6 ++++++ 16 files changed, 107 insertions(+), 16 deletions(-) create mode 100644 hasura/migrations/default/1630079306181_run_sql_migration/down.sql create mode 100644 hasura/migrations/default/1630079306181_run_sql_migration/up.sql create mode 100644 hasura/migrations/default/1630081052611_run_sql_migration/down.sql create mode 100644 hasura/migrations/default/1630081052611_run_sql_migration/up.sql create mode 100644 hasura/migrations/default/1630081060538_run_sql_migration/down.sql create mode 100644 hasura/migrations/default/1630081060538_run_sql_migration/up.sql diff --git a/hasura/metadata/databases/default/tables/public_producers_list.yaml b/hasura/metadata/databases/default/tables/public_producers_list.yaml index 8162fc57..5ad3726a 100644 --- a/hasura/metadata/databases/default/tables/public_producers_list.yaml +++ b/hasura/metadata/databases/default/tables/public_producers_list.yaml @@ -4,18 +4,20 @@ table: select_permissions: - permission: columns: - - average - - bpjson - - candidate_name - - community - - development - - general_info - - infrastructure - owner - - ratings_cntr + - bpjson - system + - candidate_name - total_votes + - eden_average + - eden_ratings_cntr + - average - transparency + - infrastructure - trustiness + - community + - development + - ratings_cntr + - general_info filter: {} role: anonymous diff --git a/hasura/migrations/default/1630079306181_run_sql_migration/down.sql b/hasura/migrations/default/1630079306181_run_sql_migration/down.sql new file mode 100644 index 00000000..4231e960 --- /dev/null +++ b/hasura/migrations/default/1630079306181_run_sql_migration/down.sql @@ -0,0 +1,19 @@ +-- Could not auto-generate a down migration. +-- Please write an appropriate down migration for the SQL below: +-- CREATE OR REPLACE VIEW "public"."producers_list" AS +-- SELECT producers.owner, +-- producers.bpjson, +-- producers.system, +-- ((producers.bpjson -> 'org'::text) ->> 'candidate_name'::text) AS candidate_name, +-- (producers.system ->> 'total_votes'::text) AS total_votes, +-- ratings_stats.average, +-- ratings_stats.transparency, +-- ratings_stats.infrastructure, +-- ratings_stats.trustiness, +-- ratings_stats.community, +-- ratings_stats.development, +-- ratings_stats.ratings_cntr, +-- producers.general_info +-- FROM (producers +-- FULL JOIN ratings_stats ON (((ratings_stats.bp)::text = producers.owner)) +-- FULL JOIN eden_ratings_stats ON eden_ratings_stats.bp = producers.owner); diff --git a/hasura/migrations/default/1630079306181_run_sql_migration/up.sql b/hasura/migrations/default/1630079306181_run_sql_migration/up.sql new file mode 100644 index 00000000..23a17d4f --- /dev/null +++ b/hasura/migrations/default/1630079306181_run_sql_migration/up.sql @@ -0,0 +1,17 @@ +CREATE OR REPLACE VIEW "public"."producers_list" AS + SELECT producers.owner, + producers.bpjson, + producers.system, + ((producers.bpjson -> 'org'::text) ->> 'candidate_name'::text) AS candidate_name, + (producers.system ->> 'total_votes'::text) AS total_votes, + ratings_stats.average, + ratings_stats.transparency, + ratings_stats.infrastructure, + ratings_stats.trustiness, + ratings_stats.community, + ratings_stats.development, + ratings_stats.ratings_cntr, + producers.general_info + FROM (producers + FULL JOIN ratings_stats ON (((ratings_stats.bp)::text = producers.owner)) + FULL JOIN eden_ratings_stats ON eden_ratings_stats.bp = producers.owner); diff --git a/hasura/migrations/default/1630081052611_run_sql_migration/down.sql b/hasura/migrations/default/1630081052611_run_sql_migration/down.sql new file mode 100644 index 00000000..be9cf87c --- /dev/null +++ b/hasura/migrations/default/1630081052611_run_sql_migration/down.sql @@ -0,0 +1,3 @@ +-- Could not auto-generate a down migration. +-- Please write an appropriate down migration for the SQL below: +-- drop view "public"."producers_list"; diff --git a/hasura/migrations/default/1630081052611_run_sql_migration/up.sql b/hasura/migrations/default/1630081052611_run_sql_migration/up.sql new file mode 100644 index 00000000..17d262ff --- /dev/null +++ b/hasura/migrations/default/1630081052611_run_sql_migration/up.sql @@ -0,0 +1 @@ +drop view "public"."producers_list"; diff --git a/hasura/migrations/default/1630081060538_run_sql_migration/down.sql b/hasura/migrations/default/1630081060538_run_sql_migration/down.sql new file mode 100644 index 00000000..c0ad8e15 --- /dev/null +++ b/hasura/migrations/default/1630081060538_run_sql_migration/down.sql @@ -0,0 +1,21 @@ +-- Could not auto-generate a down migration. +-- Please write an appropriate down migration for the SQL below: +-- CREATE OR REPLACE VIEW "public"."producers_list" AS +-- SELECT producers.owner, +-- producers.bpjson, +-- producers.system, +-- ((producers.bpjson -> 'org'::text) ->> 'candidate_name'::text) AS candidate_name, +-- (producers.system ->> 'total_votes'::text) AS total_votes, +-- eden_ratings_stats.average AS eden_average, +-- eden_ratings_stats.ratings_cntr AS eden_ratings_cntr, +-- ratings_stats.average, +-- ratings_stats.transparency, +-- ratings_stats.infrastructure, +-- ratings_stats.trustiness, +-- ratings_stats.community, +-- ratings_stats.development, +-- ratings_stats.ratings_cntr, +-- producers.general_info +-- FROM (producers +-- FULL JOIN ratings_stats ON (((ratings_stats.bp)::text = producers.owner)) +-- FULL JOIN eden_ratings_stats ON ((eden_ratings_stats.bp)::text = producers.owner)); diff --git a/hasura/migrations/default/1630081060538_run_sql_migration/up.sql b/hasura/migrations/default/1630081060538_run_sql_migration/up.sql new file mode 100644 index 00000000..eacbcf6f --- /dev/null +++ b/hasura/migrations/default/1630081060538_run_sql_migration/up.sql @@ -0,0 +1,19 @@ +CREATE OR REPLACE VIEW "public"."producers_list" AS + SELECT producers.owner, + producers.bpjson, + producers.system, + ((producers.bpjson -> 'org'::text) ->> 'candidate_name'::text) AS candidate_name, + (producers.system ->> 'total_votes'::text) AS total_votes, + eden_ratings_stats.average AS eden_average, + eden_ratings_stats.ratings_cntr AS eden_ratings_cntr, + ratings_stats.average, + ratings_stats.transparency, + ratings_stats.infrastructure, + ratings_stats.trustiness, + ratings_stats.community, + ratings_stats.development, + ratings_stats.ratings_cntr, + producers.general_info + FROM (producers + FULL JOIN ratings_stats ON (((ratings_stats.bp)::text = producers.owner)) + FULL JOIN eden_ratings_stats ON ((eden_ratings_stats.bp)::text = producers.owner)); diff --git a/webapp/src/components/card/index.js b/webapp/src/components/card/index.js index 11cb453c..0e31d5e7 100644 --- a/webapp/src/components/card/index.js +++ b/webapp/src/components/card/index.js @@ -170,7 +170,7 @@ const CardData = ({ {...props} ref={ref} state={{ owner: owner }} - to={`/block-producers/${owner}/rate`} + to={`/${pathLink}/${owner}`} /> ))} className={classes.btnRate} diff --git a/webapp/src/language/en.json b/webapp/src/language/en.json index a7c93f55..62476c25 100644 --- a/webapp/src/language/en.json +++ b/webapp/src/language/en.json @@ -14,8 +14,8 @@ "btnVoteBPs": "Vote", "clearSelection": "Clear selection", "loadMore": "Load more", - "view": "View", - "remove": "Remove", + "view": "More info", + "remove": "Remove vote", "addToVote": "Add to vote", "selected": "Selected", "details": "Details", @@ -81,6 +81,7 @@ "alphabetical": "Alphabetical", "ratings": "Number of Ratings", "generalRate": "Top Rated General", + "edenRate": "Top Rated Eden", "infrastructure": "Top Rated Infrastructure", "community": "Top Rated Community", "trustiness": "Top Rated Trustiness", diff --git a/webapp/src/language/es.json b/webapp/src/language/es.json index 2752de21..76576a2e 100644 --- a/webapp/src/language/es.json +++ b/webapp/src/language/es.json @@ -14,7 +14,7 @@ "btnVoteBPs": "Votar", "clearSelection": "Borrar selección", "loadMore": "Cargar más", - "view": "Ver", + "view": "Más información", "remove": "Remover", "addToVote": "Agregar para votar", "selected": "Seleccionado", @@ -81,6 +81,7 @@ "alphabetical": "Alfabético", "ratings": "Número de Evaluaciones", "generalRate": "Mayor Calificación General", + "edenRate": "Mayor Calificación Eden", "infrastructure": "Mayor Calificación Infraestructura", "community": "Mayor Calificación Comunidad", "trustiness": "Mayor Calificación Confianza", diff --git a/webapp/src/models/BlockProducer/blockProducers.js b/webapp/src/models/BlockProducer/blockProducers.js index c1428885..648a68c6 100644 --- a/webapp/src/models/BlockProducer/blockProducers.js +++ b/webapp/src/models/BlockProducer/blockProducers.js @@ -196,7 +196,7 @@ const Proxies = { fetchPolicy: 'network-only' }) - if (edenRatings.length > 0) this.addEdenRate(edenRatings[0]) + this.addEdenRate(edenRatings.length > 0 ? edenRatings[0] : null) dispatch.isLoading.storeIsContentLoading(false) } catch (error) { diff --git a/webapp/src/routes/block-producers/index.js b/webapp/src/routes/block-producers/index.js index 36f0d6cf..7a1a8c6e 100644 --- a/webapp/src/routes/block-producers/index.js +++ b/webapp/src/routes/block-producers/index.js @@ -276,6 +276,7 @@ export default AllBps export const blockProducersDrawer = [ { value: 'alphabetical' }, { value: 'generalRate' }, + { value: 'edenRate' }, { value: 'infrastructure' }, { value: 'community' }, { value: 'trustiness' }, diff --git a/webapp/src/routes/proxies/index.js b/webapp/src/routes/proxies/index.js index faf5e6c5..b8c51ae0 100644 --- a/webapp/src/routes/proxies/index.js +++ b/webapp/src/routes/proxies/index.js @@ -217,7 +217,6 @@ const AllProxies = ({ ual }) => { owner={_get(proxy, 'owner')} title={_get(proxy, 'name')} useRateButton={false} - buttonLabel={t('view')} pathLink='proxies' showOptions={false} /> diff --git a/webapp/src/routes/proxies/proxy-profile.js b/webapp/src/routes/proxies/proxy-profile.js index 5e3eab27..d08de354 100644 --- a/webapp/src/routes/proxies/proxy-profile.js +++ b/webapp/src/routes/proxies/proxy-profile.js @@ -263,7 +263,7 @@ const ProxyProfile = ({ account, ual, ...props }) => { {!isMobile && ( - + {} } = {}) => { transparency ratings_cntr general_info + eden_average + eden_ratings_cntr } } `, @@ -68,7 +70,6 @@ export const getAllBPs = ({ nameFilter = null, setBPs = () => {} } = {}) => { const votesInEos = calculateEosFromVotes( _get(bp, 'system.total_votes', 0) ) - return { ...bp, system: { diff --git a/webapp/src/utils/sortedBy.js b/webapp/src/utils/sortedBy.js index 3aa91cf5..dab2b0b5 100644 --- a/webapp/src/utils/sortedBy.js +++ b/webapp/src/utils/sortedBy.js @@ -30,6 +30,12 @@ export default (sortBy, blockProducers) => { return (blockProducers || []).sort((a, b) => _sortValues(a, b, 'average')) } + case 'edenRate': { + return (blockProducers || []).sort((a, b) => + _sortValues(a, b, 'eden_average') + ) + } + case 'infrastructure': { return (blockProducers || []).sort((a, b) => _sortValues(a, b, 'system.parameters.infrastructure')