From 9ad5ac950a174c625320625b3549c0d72da58114 Mon Sep 17 00:00:00 2001 From: Roshaan Siddiqui Date: Thu, 12 Oct 2023 11:26:03 -0500 Subject: [PATCH 1/5] feat: add registeration button (#285) Add registeration link to QueryAPI image --- frontend/widgets/src/QueryApi.Dashboard.jsx | 26 ++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/frontend/widgets/src/QueryApi.Dashboard.jsx b/frontend/widgets/src/QueryApi.Dashboard.jsx index fb9f7d765..23a937c91 100644 --- a/frontend/widgets/src/QueryApi.Dashboard.jsx +++ b/frontend/widgets/src/QueryApi.Dashboard.jsx @@ -60,7 +60,7 @@ const Wrapper = styled.div` const NavBarLogo = styled.a` padding-top: 0.3125rem; padding-bottom: 0.3125rem; - margin-right: 1rem; + margin-right: .01rem; font-size: 1.25rem; text-decoration: none; white-space: nowrap; @@ -274,6 +274,27 @@ const ButtonLink = styled.a` }} `; +const SignUpLink = styled.a` + --blue: RGBA(13, 110, 253, 1); + display: ${({ hidden }) => (hidden ? "none" : "inline-block")}; + font-size: 14px; + cursor: pointer; + color: var(--blue); + text-decoration: none; + margin-left: 0.1em; + padding: 0; + white-space: nowrap; + + &:hover { + color: var(--blue); + text-decoration: none; + } + + &:visited { + color: var(--blue); + text-decoration: none; + } +`; // TODO fix activeTab // const previousSelectedTab = Storage.privateGet("queryapi:activeTab"); // if (previousSelectedTab && previousSelectedTab !== state.activeTab) { @@ -398,6 +419,9 @@ return ( QueryApi + + (Sign Up) +
Date: Fri, 13 Oct 2023 11:19:41 -0500 Subject: [PATCH 2/5] fix: fix playground issue + update readme for env vars for react app (#284) Fix playground issue of featuers not opening in grahpiql --- frontend/README.md | 14 ++++++++++++++ frontend/package.json | 6 +++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/frontend/README.md b/frontend/README.md index 824d47482..993717fed 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -32,3 +32,17 @@ yarn dev - Prod App: `https://near.org/dataplatform.near/widget/QueryApi.App` + +### ENV variables +The React app does not use the replacement files. Instead, we need to provide an `.env` file to make sure we are accessing the right enviornment + +By default, the React app will use the `dev` enviornment vars +``` +Prod: + NEXT_PUBLIC_HASURA_ENDPOINT=https://near-queryapi.api.pagoda.co + NEXT_PUBLIC_REGISTRY_CONTRACT_ID=queryapi.dataplatform.near +``` +``` +Dev: + NEXT_PUBLIC_HASURA_ENDPOINT=https://near-queryapi.dev.api.pagoda.co + NEXT_PUBLIC_REGISTRY_CONTRACT_ID=dev-queryapi.dataplatform.near diff --git a/frontend/package.json b/frontend/package.json index 521197bf3..7ce4a1c14 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -12,8 +12,8 @@ "lint": "next lint" }, "dependencies": { - "@graphiql/plugin-code-exporter": "0.3.0", - "@graphiql/plugin-explorer": "0.3.0", + "@graphiql/plugin-code-exporter": "0.3.5", + "@graphiql/plugin-explorer": "0.3.5", "@monaco-editor/react": "^4.1.3", "@near-lake/primitives": "0.1.0", "@next/font": "13.1.6", @@ -24,7 +24,7 @@ "buffer": "^6.0.3", "eslint": "8.34.0", "eslint-config-next": "13.1.6", - "graphiql": "^2.4.1", + "graphiql": "3.0.6", "graphql": "^16.6.0", "near-api-js": "1.1.0", "near-social-bridge": "^1.4.1", From db16f1fdc6fcea8de3b79a1be87a63402e453c45 Mon Sep 17 00:00:00 2001 From: Roshaan Siddiqui Date: Mon, 16 Oct 2023 10:05:13 -0500 Subject: [PATCH 3/5] feat: remove logs when toggle pressed --- frontend/widgets/src/QueryApi.IndexerStatus.jsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/frontend/widgets/src/QueryApi.IndexerStatus.jsx b/frontend/widgets/src/QueryApi.IndexerStatus.jsx index ba61af987..ef6989c43 100644 --- a/frontend/widgets/src/QueryApi.IndexerStatus.jsx +++ b/frontend/widgets/src/QueryApi.IndexerStatus.jsx @@ -170,6 +170,17 @@ if ( (prevV2ToggleSelected !== state.v2Toggle) ) { Storage.privateSet("QueryApiV2Toggle", state.v2Toggle); + State.update({ + logs: [], + state: [], + indexer_res: [], + indexer_resCount: 0, + logsCount: 0, + stateCount: 0, + indexer_resPage: 0, + logsPage: 0, + statePage: 0, + }) fetchGraphQL(logsDoc, "QueryLogs", { offset: state.logsPage * LIMIT, }).then((result) => { From cb91dcf63f964e1dfa18ef0fcb233ceed1893824 Mon Sep 17 00:00:00 2001 From: Roshaan Siddiqui Date: Mon, 16 Oct 2023 14:06:09 -0500 Subject: [PATCH 4/5] hot-fix: skip context.db (#294) --- indexer-js-queue-handler/handler.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/indexer-js-queue-handler/handler.js b/indexer-js-queue-handler/handler.js index 450671937..1b6978386 100644 --- a/indexer-js-queue-handler/handler.js +++ b/indexer-js-queue-handler/handler.js @@ -15,6 +15,11 @@ export const consumer = async (event) => { const functions = {}; const function_config = jsonBody.indexer_function; + const code = function_config.code; + if (code.indexOf('context.db') >= 0) { + continue + } + const function_name = function_config.account_id + '/' + function_config.function_name; functions[function_name] = function_config; From 4636dbcb3db67904702667ed540eebe12b3a5772 Mon Sep 17 00:00:00 2001 From: Gabe Hamilton Date: Mon, 16 Oct 2023 14:35:31 -0600 Subject: [PATCH 5/5] ignore all runner errors in V1 rather than sending them to the DLQ (#295) --- indexer-js-queue-handler/handler.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/indexer-js-queue-handler/handler.js b/indexer-js-queue-handler/handler.js index 1b6978386..52e90abd0 100644 --- a/indexer-js-queue-handler/handler.js +++ b/indexer-js-queue-handler/handler.js @@ -23,6 +23,10 @@ export const consumer = async (event) => { const function_name = function_config.account_id + '/' + function_config.function_name; functions[function_name] = function_config; - const mutations = await indexer.runFunctions(block_height, functions, is_historical, {imperative: true, provision: true}); + try { + const mutations = await indexer.runFunctions(block_height, functions, is_historical, {imperative: true, provision: true}); + } catch(e) { + console.error(e); + } } };