-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(webapp): refactor producerList view (#817)
* fix(front-end): fix eden ratign action * fix(front-end): fix eden ratign action * fix(webapp): load eden ratings stats from view * fix(webapp): style radar on rating page * fix(webapp): remove comments
- Loading branch information
1 parent
dc8e83a
commit b892b97
Showing
31 changed files
with
459 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
|
||
module.exports = { | ||
host: process.env.HAPI_POSTGRES_HOST || 'postgres', | ||
port: process.env.HAPI_POSTGRES_PORT || 5432, | ||
database: process.env.HAPI_POSTGRES_DB || 'eosrate', | ||
user: process.env.HAPI_POSTGRES_USER || 'eoscr', | ||
password: process.env.HAPI_POSTGRES_PASSWORD || 'password' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,25 @@ | ||
type Mutation { | ||
rateProducer ( | ||
rateProducer( | ||
ratingInput: RatingInput! | ||
): RatingOutput | ||
} | ||
|
||
|
||
|
||
|
||
input RatingInput { | ||
user : String! | ||
producer : String! | ||
transaction : jsonb! | ||
user: String! | ||
isEden: Boolean! | ||
producer: String! | ||
transaction: jsonb! | ||
} | ||
|
||
type RatingOutput { | ||
message : String! | ||
resultEden : jsonb | ||
uniq_rating : String | ||
user : String | ||
bp : String | ||
ratings : jsonb | ||
message: String! | ||
resultEden: jsonb | ||
user: String | ||
bp: String | ||
ratings: jsonb | ||
} | ||
|
||
type deleteUserRateOutput { | ||
message : String! | ||
message: String! | ||
} | ||
|
21 changes: 0 additions & 21 deletions
21
hasura/metadata/databases/default/tables/public_producers_list.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,3 @@ | ||
table: | ||
name: producers_list | ||
schema: public | ||
select_permissions: | ||
- permission: | ||
allow_aggregations: true | ||
columns: | ||
- owner | ||
- bpjson | ||
- system | ||
- candidate_name | ||
- total_votes | ||
- eden_average | ||
- eden_ratings_cntr | ||
- average | ||
- transparency | ||
- infrastructure | ||
- trustiness | ||
- community | ||
- development | ||
- ratings_cntr | ||
- general_info | ||
filter: {} | ||
role: anonymous |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
...a/migrations/default/1633651553068_alter_table_public_user_ratings_add_column_id/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
-- Could not auto-generate a down migration. | ||
-- Please write an appropriate down migration for the SQL below: | ||
-- alter table "public"."user_ratings" add column "id" serial | ||
-- not null unique; |
2 changes: 2 additions & 0 deletions
2
hasura/migrations/default/1633651553068_alter_table_public_user_ratings_add_column_id/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
alter table "public"."user_ratings" add column "id" serial | ||
not null unique; |
4 changes: 4 additions & 0 deletions
4
hasura/migrations/default/1633651564624_modify_primarykey_public_user_ratings/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
alter table "public"."user_ratings" drop constraint "user_ratings_pkey"; | ||
alter table "public"."user_ratings" | ||
add constraint "user_ratings_pkey" | ||
primary key ("uniq_rating"); |
6 changes: 6 additions & 0 deletions
6
hasura/migrations/default/1633651564624_modify_primarykey_public_user_ratings/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
BEGIN TRANSACTION; | ||
ALTER TABLE "public"."user_ratings" DROP CONSTRAINT "user_ratings_pkey"; | ||
|
||
ALTER TABLE "public"."user_ratings" | ||
ADD CONSTRAINT "user_ratings_pkey" PRIMARY KEY ("id"); | ||
COMMIT TRANSACTION; |
3 changes: 3 additions & 0 deletions
3
...ns/default/1633651780354_alter_table_public_user_ratings_drop_column_uniq_rating/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
alter table "public"."user_ratings" add constraint "user_ratings_uniq_rating_key" unique (uniq_rating); | ||
alter table "public"."user_ratings" alter column "uniq_rating" drop not null; | ||
alter table "public"."user_ratings" add column "uniq_rating" text; |
1 change: 1 addition & 0 deletions
1
...ions/default/1633651780354_alter_table_public_user_ratings_drop_column_uniq_rating/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
alter table "public"."user_ratings" drop column "uniq_rating" cascade; |
29 changes: 29 additions & 0 deletions
29
hasura/migrations/default/1633699031493_update_producer_list_view/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
-- Could not auto-generate a down migration. | ||
-- Please write an appropriate down migration for the SQL below: | ||
-- DROP VIEW "public"."producers_list"; | ||
-- | ||
-- 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, | ||
-- -- Eden Ratings Stats | ||
-- eden_ratings_stats.average AS eden_average, | ||
-- eden_ratings_stats.transparency AS eden_transparency, | ||
-- eden_ratings_stats.infrastructure AS eden_infrastructure, | ||
-- eden_ratings_stats.trustiness AS eden_trustiness, | ||
-- eden_ratings_stats.community AS eden_community, | ||
-- eden_ratings_stats.development AS eden_development, | ||
-- eden_ratings_stats.ratings_cntr AS eden_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))); |
27 changes: 27 additions & 0 deletions
27
hasura/migrations/default/1633699031493_update_producer_list_view/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
DROP VIEW "public"."producers_list"; | ||
|
||
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, | ||
-- Eden Ratings Stats | ||
eden_ratings_stats.average AS eden_average, | ||
eden_ratings_stats.transparency AS eden_transparency, | ||
eden_ratings_stats.infrastructure AS eden_infrastructure, | ||
eden_ratings_stats.trustiness AS eden_trustiness, | ||
eden_ratings_stats.community AS eden_community, | ||
eden_ratings_stats.development AS eden_development, | ||
eden_ratings_stats.ratings_cntr AS eden_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))); |
Oops, something went wrong.