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

feat: Improved Editor to match Logs Component #769

Merged
merged 32 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
789858a
feat: mvp
Kevin101Zhang May 10, 2024
1af0c7e
feat: mvp
Kevin101Zhang May 10, 2024
9e07418
chore: cleanup
Kevin101Zhang May 10, 2024
8ea32f2
Merge branch 'main' of https://github.com/near/queryapi into 726-gridjs
Kevin101Zhang May 13, 2024
a167d41
merge
Kevin101Zhang May 13, 2024
5808c72
merge
Kevin101Zhang May 13, 2024
fcf7b4b
fixed message
Kevin101Zhang May 13, 2024
5771752
added queries page
Kevin101Zhang May 13, 2024
ab7893e
feat: added severity
Kevin101Zhang May 13, 2024
9ff6365
reusable components introducing filter
Kevin101Zhang May 14, 2024
c911953
view/container
Kevin101Zhang May 16, 2024
4d15dcb
search with logtype
Kevin101Zhang May 17, 2024
19d39ed
feat: timestamp select
Kevin101Zhang May 17, 2024
3099d32
visual changes
Kevin101Zhang May 21, 2024
bf7c5da
LogsMenu Redesign
Kevin101Zhang May 21, 2024
de4c318
Merge branch 'main' into 726-gridjs
Kevin101Zhang May 21, 2024
5df668a
chores
Kevin101Zhang May 21, 2024
0d7bd55
chores
Kevin101Zhang May 21, 2024
e22725f
feat: refactor queries to use default var
Kevin101Zhang May 22, 2024
c9507b8
grouped and refactored timestamp
Kevin101Zhang May 23, 2024
3e932c2
added env
Kevin101Zhang May 25, 2024
78d3daa
Merge branch 'main' into 726-gridjs
Kevin101Zhang May 25, 2024
516c385
chore: spacing/cleanup
Kevin101Zhang May 25, 2024
b236723
Merge branch 'main' of https://github.com/near/queryapi into 751-addi…
Kevin101Zhang May 28, 2024
b0f5637
added EditorMenu view container
Kevin101Zhang Jun 4, 2024
50c2a35
revamp blockpicker
Kevin101Zhang Jun 4, 2024
8547fa7
Merge branch 'main' of https://github.com/near/queryapi into 751-addi…
Kevin101Zhang Jun 4, 2024
f431a32
visual improvements
Kevin101Zhang Jun 4, 2024
31d0073
feat:quick redesign of comp
Kevin101Zhang Jun 5, 2024
6353f81
chores: whitespace
Kevin101Zhang Jun 5, 2024
22f2786
chores: fix tsconfig.json
Kevin101Zhang Jun 5, 2024
c33f506
chores: fix whitespace
Kevin101Zhang Jun 5, 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
2 changes: 1 addition & 1 deletion frontend/replacement.dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"REPL_GRAPHQL_ENDPOINT": "https://near-queryapi.dev.api.pagoda.co",
"REPL_EXTERNAL_APP_URL": "https://queryapi-frontend-vcqilefdcq-ew.a.run.app",
"REPL_REGISTRY_CONTRACT_ID": "dev-queryapi.dataplatform.near"
}
}
110 changes: 0 additions & 110 deletions frontend/src/components/Editor/BlockPicker.jsx

This file was deleted.

61 changes: 43 additions & 18 deletions frontend/src/components/Editor/Editor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ import { block_details } from "./block_details";
import ResizableLayoutEditor from "./ResizableLayoutEditor";
import { ResetChangesModal } from "../Modals/resetChanges";
import { FileSwitcher } from "./FileSwitcher";
import EditorButtons from "./EditorButtons";
import EditorMenuContainer from "./EditorViewContainer/EditorMenuContainer"
import DeveloperToolsContainer from "./EditorViewContainer/DeveloperToolsContainer";

import { PublishModal } from "../Modals/PublishModal";
import { ForkIndexerModal } from "../Modals/ForkIndexerModal";
import { getLatestBlockHeight } from "../../utils/getLatestBlockHeight";
Expand All @@ -32,6 +34,7 @@ import { InfoModal } from "@/core/InfoModal";
import { useModal } from "@/contexts/ModalContext";
import { GlyphContainer } from "./GlyphContainer";


const Editor = ({ actionButtonText }) => {
const {
indexerDetails,
Expand Down Expand Up @@ -199,7 +202,7 @@ const Editor = ({ actionButtonText }) => {
if (newDisposable != null) {
console.log("Types successfully imported to Editor");
}

disposableRef.current = newDisposable;
}
};
Expand Down Expand Up @@ -234,17 +237,17 @@ const Editor = ({ actionButtonText }) => {
/getBlock\s*\([^)]*\)\s*{([\s\S]*)}/
)[1];
indexerName = indexerName.replaceAll(" ", "_");
let forkedFrom =
let forkedFrom =
(indexerDetails.forkedAccountId && indexerDetails.forkedIndexerName)
? { account_id: indexerDetails.forkedAccountId, function_name: indexerDetails.forkedIndexerName }
: null;
? { account_id: indexerDetails.forkedAccountId, function_name: indexerDetails.forkedIndexerName }
: null;

const startBlock =
indexerConfig.startBlock === "startBlockHeight"
? { HEIGHT: indexerConfig.height }
: indexerConfig.startBlock === "startBlockLatest"
? "LATEST"
: "CONTINUE";
indexerConfig.startBlock === "startBlockHeight"
? { HEIGHT: indexerConfig.height }
: indexerConfig.startBlock === "startBlockLatest"
? "LATEST"
: "CONTINUE";

if (schemaValidationError?.type === FORMATTING_ERROR_TYPE) {
setError(SCHEMA_FORMATTING_ERROR_MESSAGE);
Expand Down Expand Up @@ -464,14 +467,17 @@ const Editor = ({ actionButtonText }) => {
}}
>
{!indexerDetails.code && !isCreateNewIndexer && (
<Alert className="px-3 pt-3" variant="danger">
Indexer Function could not be found. Are you sure this indexer
exists?
<Alert
className="px-4 py-3 mb-4 font-semibold text-red-700 text-sm text-center border border-red-300 bg-red-50 rounded-lg shadow-md"
variant="danger"
>
Indexer Function could not be found. Are you sure this indexer exists?
</Alert>

)}
{(indexerDetails.code || isCreateNewIndexer) && (
<>
<EditorButtons
<EditorMenuContainer
handleFormating={handleFormating}
handleCodeGen={handleCodeGen}
error={error}
Expand All @@ -485,6 +491,26 @@ const Editor = ({ actionButtonText }) => {
isUserIndexer={indexerDetails.accountId === currentUserAccountId}
handleDeleteIndexer={handleDeleteIndexer}
/>
<DeveloperToolsContainer
handleFormating={handleFormating}
handleCodeGen={handleCodeGen}
error={error}
executeIndexerFunction={executeIndexerFunction}
heights={heights}
setHeights={setHeights}
isCreateNewIndexer={isCreateNewIndexer}
isExecuting={isExecutingIndexerFunction}
stopExecution={() => indexerRunner.stop()}
latestHeight={height}
isUserIndexer={indexerDetails.accountId === currentUserAccountId}
handleDeleteIndexer={handleDeleteIndexer}

fileName={fileName}
setFileName={setFileName}
diffView={diffView}
setDiffView={setDiffView}
/>

<ResetChangesModal handleReload={handleReload} />
<PublishModal
registerFunction={registerFunction}
Expand All @@ -506,21 +532,20 @@ const Editor = ({ actionButtonText }) => {
<Alert
dismissible="true"
onClose={() => setError()}
className="px-3 pt-3"
className="px-4 py-3 mb-4 font-semibold text-red-700 text-sm text-center border border-red-300 bg-red-50 rounded-lg shadow-md"
variant="danger"
>
{error}
</Alert>
)}
{debugMode && !debugModeInfoDisabled && (
<Alert
className="px-3 pt-3"
className="px-4 py-3 mb-4 font-semibold text-gray-700 text-sm text-center border border-blue-300 bg-blue-50 rounded-lg shadow-md"
dismissible="true"
onClose={() => setDebugModeInfoDisabled(true)}
variant="info"
>
To debug, you will need to open your browser console window in
order to see the logs.
To debug, you will need to open your browser console window in order to see the logs.
</Alert>
)}
<FileSwitcher
Expand Down
Loading