diff --git a/hapi/src/services/eosio.service.js b/hapi/src/services/eosio.service.js index 3ce5e48a..c7699745 100644 --- a/hapi/src/services/eosio.service.js +++ b/hapi/src/services/eosio.service.js @@ -233,15 +233,15 @@ const getChains = async producerUrl => { } const getProducerHealthStatus = bpJson => { + if (!bpJson || !Object.keys(bpJson).length) return [] + const healthStatus = [] healthStatus.push({ name: 'bpJson', - valid: !!bpJson && !!Object.keys(bpJson).length + valid: true }) - if (!healthStatus[0].valid) return healthStatus - healthStatus.push({ name: 'organization_name', valid: !!bpJson.org?.candidate_name diff --git a/hapi/src/services/producer.service.js b/hapi/src/services/producer.service.js index af8f5dcf..801f6c79 100644 --- a/hapi/src/services/producer.service.js +++ b/hapi/src/services/producer.service.js @@ -9,7 +9,7 @@ const statsService = require('./stats.service') const updateBPJSONs = async (producers = []) => { const upsertMutation = ` mutation ($producers: [producer_insert_input!]!) { - insert_producer(objects: $producers, on_conflict: {constraint: producer_owner_key, update_columns: [ bp_json ]}) { + insert_producer(objects: $producers, on_conflict: {constraint: producer_owner_key, update_columns: [ bp_json, health_status ]}) { affected_rows, } } @@ -21,7 +21,7 @@ const updateBPJSONs = async (producers = []) => { const updateProducers = async (producers = []) => { const upsertMutation = ` mutation ($producers: [producer_insert_input!]!) { - insert_producer(objects: $producers, on_conflict: {constraint: producer_owner_key, update_columns: [ producer_key, unpaid_blocks,last_claim_time, url, location, producer_authority, is_active, total_votes, total_votes_percent, total_votes_eos, vote_rewards,block_rewards, total_rewards, health_status, endpoints, rank]}) { + insert_producer(objects: $producers, on_conflict: {constraint: producer_owner_key, update_columns: [ producer_key, unpaid_blocks,last_claim_time, url, location, producer_authority, is_active, total_votes, total_votes_percent, total_votes_eos, vote_rewards,block_rewards, total_rewards, endpoints, rank]}) { affected_rows, returning { id, diff --git a/webapp/public/empty-states/Error.webp b/webapp/public/empty-states/Error.webp new file mode 100644 index 00000000..1c08de7c Binary files /dev/null and b/webapp/public/empty-states/Error.webp differ diff --git a/webapp/src/components/InformationCard/EmptyState.js b/webapp/src/components/InformationCard/EmptyState.js new file mode 100644 index 00000000..a87198f5 --- /dev/null +++ b/webapp/src/components/InformationCard/EmptyState.js @@ -0,0 +1,30 @@ +import React, { memo } from 'react' +import PropTypes from 'prop-types' + +const EmptyState = ({ classes, t }) => { + return ( +