Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prod Release 17/01/24 #513

Merged
merged 37 commits into from
Jan 24, 2024
Merged
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
3317b21
fix: upgrade eslint-config-next from 13.1.6 to 13.5.3
snyk-bot Oct 21, 2023
d83396c
feat: Make log/state Hasura tables `backend_only` (#462)
morgsmccauley Dec 20, 2023
e63024a
fix: Prune Unnecessary Logs (#465)
Dec 20, 2023
38ea895
feat: Runner gRPC endpoint (#446)
Dec 21, 2023
a6c43d0
feat: Create function to validate types and format from SQL schema
Jan 3, 2024
fb96993
refactor: Reduce the error states and remove unnecessary Alerts
Jan 3, 2024
12bdb26
refactor: Debounce the schema validation
Jan 3, 2024
7f6d07c
chore: Create __tests__ folder for improved folder structure
Jan 3, 2024
dfcd365
Merge pull request #312 from near/snyk-upgrade-3314477209d6a8eada3c91…
jl-santana Jan 3, 2024
a829917
Merge branch 'main' into feat/editor-error-logging
Jan 3, 2024
314dc2c
Merge pull request #480 from near/feat/editor-error-logging
jl-santana Jan 3, 2024
ed72374
feat: Add created/updated at block heights to registry (#458)
morgsmccauley Jan 4, 2024
313ccbe
remove side effects from reformatAll function
Jan 4, 2024
d333b84
refactor: make codeValidation reusable and separate concerns in refor…
Jan 4, 2024
efb5bde
refactor: separate concern con useEffect, and react separately to cha…
Jan 4, 2024
e43d57e
fix: remove dead code
Jan 4, 2024
fabed5c
refactor: Replace requestLatestBlockHeight with direct getLatestBlock…
Jan 4, 2024
ae8315e
refactor: Replace requestLatestBlockHeight with direct getLatestBlock…
Jan 4, 2024
c342947
Merge branch 'fix/load-schema-from-registry' of github.com:near/query…
Jan 4, 2024
1dcdb3b
refactor: only validate schemas different from the default
Jan 5, 2024
f844da0
refactor: remove log
Jan 5, 2024
3715782
fix: fix issue when generating types, based on response type from ast…
Jan 5, 2024
ed08165
refactor: decouple ResizableLayourEditor from Editor
Jan 5, 2024
55cbb72
chore: Add description to function
Jan 5, 2024
83c861d
fix: change reference to variable
Jan 5, 2024
8634c39
refactor: Make error messages constants
Jan 5, 2024
b1e0a5f
fix: Solve an issue on the reformatAll function, also added real-time…
Jan 5, 2024
538cd39
fix: Reset errors if code/schemar are ok when reloading
Jan 6, 2024
b486ced
Merge pull request #489 from near/fix/load-schema-from-registry
jl-santana Jan 8, 2024
7655aef
feat: Create rust GRPC client for Runner (#491)
morgsmccauley Jan 8, 2024
b76fac0
feat: Create initial Coordinator V2 service (#444)
morgsmccauley Jan 11, 2024
81edb7e
Improve code/schema validation before registering (#495)
jl-santana Jan 11, 2024
c4f47bf
refactor: Remove hard-coded shard count (#502)
morgsmccauley Jan 16, 2024
13f7094
fix: Ensure array is returned to `Promise.all` (#504)
morgsmccauley Jan 16, 2024
a4d8c34
refactor: Configure `coordinator`/`block-streamer` via environment (#…
morgsmccauley Jan 16, 2024
d403006
feat: Toggle Runner Version (#488)
Jan 17, 2024
420405b
fix: Resolve Proto File Not Found Build Error (#514)
Jan 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: Make error messages constants
Juan Luis Santana committed Jan 5, 2024
commit 8634c39dbe8d20b30d0ae45eaf57ae54413418ad
17 changes: 9 additions & 8 deletions frontend/src/components/Editor/Editor.jsx
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@ import { IndexerDetailsContext } from '../../contexts/IndexerDetailsContext';
import { PgSchemaTypeGen } from "../../utils/pgSchemaTypeGen";
import { validateJSCode, validateSQLSchema } from "@/utils/validators";
import { useDebouncedCallback } from "use-debounce";
import { SCHEMA_GENERAL_ERROR, CODE_GENERAL_ERROR, CODE_FORMATTING_ERROR, SCHEMA_FORMATTING_ERROR } from '../../constants/Strings';

const BLOCKHEIGHT_LIMIT = 3600;

@@ -96,7 +97,7 @@ const Editor = ({
const { data: formattedCode, error: codeError } = await validateJSCode(indexerDetails.code)

if (codeError) {
setError("There was an error while formatting your code. Please check the console for more details")
setError(CODE_FORMATTING_ERROR)
}

setOriginalIndexingCode(formattedCode)
@@ -111,7 +112,7 @@ const Editor = ({
(async () => {
const { data: formattedSchema, error: schemaError } = await validateSQLSchema(indexerDetails.schema);
if (schemaError) {
setError("There was an error in your schema. Please check the console for more details")
setError(SCHEMA_GENERAL_ERROR)
}

setSchema(formattedSchema)
@@ -124,8 +125,8 @@ const Editor = ({
const { error: schemaError } = await validateSQLSchema(schema);
const { error: codeError } = await validateJSCode(indexingCode);

if (schemaError) setError("There is an error in your schema. Please check the console for more details")
else if (codeError) setError("There is an error in your code. Please check the console for more details")
if (schemaError) setError(SCHEMA_GENERAL_ERROR)
else if (codeError) setError(CODE_GENERAL_ERROR)
else setError();
})()

@@ -188,7 +189,7 @@ const Editor = ({
const { data: formattedSchema, error: schemaError } = await validateSQLSchema(schema);

if (schemaError) {
setError("There was an error in your schema, please check the console for more details");
setError(SCHEMA_GENERAL_ERROR);
return;
}

@@ -260,14 +261,14 @@ const Editor = ({

if (codeError) {
formattedCode = indexingCode
setError("Oh snap! We could not format your code. Make sure it is proper Javascript code.");
setError(CODE_FORMATTING_ERROR);
}

let { data: formattedSchema, error: schemaError } = await validateSQLSchema(schema);

if (schemaError) {
formattedSchema = schema;
setError("There was an error in your SQL schema. Make sure it is proper SQL DDL");
setError(SCHEMA_GENERAL_ERROR);
}

return { formattedCode, formattedSchema }
@@ -279,7 +280,7 @@ const Editor = ({
attachTypesToMonaco(); // Just in case schema types have been updated but weren't added to monaco
} catch (_error) {
console.error("Error generating types for saved schema.\n", _error);
setError("Oh snap! We could not generate types for your SQL schema. Make sure it is proper SQL DDL.");
setError(SCHEMA_FORMATTING_ERROR);
}
}

5 changes: 5 additions & 0 deletions frontend/src/constants/Strings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//errors
export const SCHEMA_GENERAL_ERROR = "There was an error in your schema. Please check the console for more details";
export const CODE_GENERAL_ERROR = "There is an error in your code. Please check the console for more details";
export const CODE_FORMATTING_ERROR = "There was an error while formatting your code. Please check the console for more details";
export const SCHEMA_FORMATTING_ERROR = "Oh snap! We could not generate types for your SQL schema. Make sure it is proper SQL DDL.";