Skip to content

Commit

Permalink
Merge pull request #414 from near/main
Browse files Browse the repository at this point in the history
Prod Release 20/11
  • Loading branch information
morgsmccauley authored Nov 28, 2023
2 parents 46a91ba + c028f92 commit b257f65
Show file tree
Hide file tree
Showing 40 changed files with 4,962 additions and 1,038 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,22 @@ env:

jobs:
check:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Run check
working-directory: ./indexer
run: cargo check

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run check
working-directory: ./indexer
run: cargo test


rustfmt:
name: rustfmt
runs-on: ubuntu-20.04
Expand Down
16 changes: 16 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,23 @@ services:
HASURA_GRAPHQL_ENABLED_LOG_TYPES: startup, http-log, webhook-log, websocket-log, query-log
HASURA_GRAPHQL_ADMIN_SECRET: myadminsecretkey
HASURA_GRAPHQL_AUTH_HOOK: http://hasura-auth:4000/auth
grafana:
image: grafana/grafana
volumes:
- grafana:/var/lib/grafana
ports:
- "3000:3000"
environment:
- GF_SECURITY_ADMIN_PASSWORD=secret

prometheus:
image: prom/prometheus
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
ports:
- "9090:9090"

volumes:
postgres:
redis:
grafana:
4 changes: 3 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"lint": "next lint"
},
"dependencies": {
"@apollo/client": "^3.8.7",
"@graphiql/plugin-code-exporter": "0.3.5",
"@graphiql/plugin-explorer": "0.3.5",
"@monaco-editor/react": "^4.1.3",
Expand All @@ -25,7 +26,8 @@
"eslint": "8.34.0",
"eslint-config-next": "13.1.6",
"graphiql": "3.0.6",
"graphql": "^16.6.0",
"graphql": "^16.8.1",
"gridjs": "6.0.6",
"near-api-js": "1.1.0",
"near-social-bridge": "^1.4.1",
"next": "13.1.6",
Expand Down
7 changes: 7 additions & 0 deletions frontend/src/components/Editor/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,12 @@ const Editor = ({
height: "85vh",
}}
>
{!indexerDetails.code && !isCreateNewIndexer && (
<Alert className="px-3 pt-3" variant="danger">
Indexer Function could not be found. Are you sure this indexer exists?
</Alert>
)}
{(indexerDetails.code || isCreateNewIndexer) && <>
<EditorButtons
handleFormating={handleFormating}
handleCodeGen={handleCodeGen}
Expand Down Expand Up @@ -455,6 +461,7 @@ const Editor = ({
handleEditorMount={handleEditorMount}
/>
</div>
</>}
</div>
);
};
Expand Down
110 changes: 66 additions & 44 deletions frontend/src/components/Editor/EditorButtons.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import {
TrashFill,
XCircle,
NodePlus,
Code
Code,
FileText,
} from "react-bootstrap-icons";
import { BlockPicker } from "./BlockPicker";
import { IndexerDetailsContext } from '../../contexts/IndexerDetailsContext';
Expand Down Expand Up @@ -49,7 +50,9 @@ const EditorButtons = ({
debugMode,
isCreateNewIndexer,
indexerNameField,
setIndexerNameField
setIndexerNameField,
setShowLogsView,
showLogsView,
} = useContext(IndexerDetailsContext);

const removeHeight = (index) => {
Expand All @@ -69,7 +72,6 @@ const EditorButtons = ({
>
<Row className="w-100">
<Col style={{ display: "flex", justifyContent: "start", flexDirection: "column" }}>

<Breadcrumb className="flex">
<Breadcrumb.Item className="flex align-center " href="#">
{accountId}
Expand Down Expand Up @@ -107,7 +109,7 @@ const EditorButtons = ({
)}
</Col>
<Col
style={{ display: "flex", justifyContent: "end", height: "40px" }}
style={{ display: "flex", justifyContent: "end", flexDirection: "column", alignItems: "flex-end" }}
>
<ButtonGroup
className="inline-block"
Expand Down Expand Up @@ -144,47 +146,22 @@ const EditorButtons = ({
</>
)}

<OverlayTrigger
placement="bottom"
overlay={<Tooltip>Reset Changes To Code</Tooltip>}
>
<Button
size="sm"
className="flex align-center"
variant="secondary"
onClick={() => setShowResetCodeModel(true)}
>
<ArrowCounterclockwise size={22} />
</Button>
</OverlayTrigger>

<OverlayTrigger
placement="bottom"
overlay={<Tooltip>Format Code</Tooltip>}
>
<Button
size="sm"
variant="secondary"
className="flex align-center"
onClick={() => handleFormating()}
>
<Justify style={{ paddingRight: "2px" }} size={24} />
</Button>
</OverlayTrigger>

<OverlayTrigger
placement="bottom"
overlay={<Tooltip>Generate Types</Tooltip>}
>
<Button
size="sm"
variant="secondary"
className="flex align-center"
onClick={() => handleCodeGen()}
{!isCreateNewIndexer && (
<OverlayTrigger
placement="bottom"
overlay={<Tooltip>Open Logs</Tooltip>}
>
<Code style={{ paddingRight: "2px" }} size={24} />
</Button>
</OverlayTrigger>
<Button
size="sm"
variant="secondary"
className="flex align-center"
onClick={() => setShowLogsView(true)}
>
<FileText style={{ paddingRight: "2px" }} size={24} />
Show Logs
</Button>
</OverlayTrigger>
)}
{(!isUserIndexer && !isCreateNewIndexer) ? (
<OverlayTrigger
placement="bottom"
Expand Down Expand Up @@ -213,6 +190,51 @@ const EditorButtons = ({
</OverlayTrigger>
)}
</ButtonGroup>
<Row
style={{ display: "flex", justifyContent: "center", width: "60%", padding: "5px" }}
>
<ButtonGroup>
<OverlayTrigger
placement="bottom"
overlay={<Tooltip>Reset Changes To Code</Tooltip>}
>
<Button
size="sm"
className="flex align-center"
variant="secondary"
onClick={() => setShowResetCodeModel(true)}
>
<ArrowCounterclockwise size={22} />
</Button>
</OverlayTrigger>
<OverlayTrigger
placement="bottom"
overlay={<Tooltip>Format Code</Tooltip>}
>
<Button
size="sm"
variant="secondary"
className="flex align-center"
onClick={() => handleFormating()}
>
<Justify style={{ paddingRight: "2px" }} size={24} />
</Button>
</OverlayTrigger>
<OverlayTrigger
placement="bottom"
overlay={<Tooltip>Generate Types</Tooltip>}
>
<Button
size="sm"
variant="secondary"
className="flex align-center"
onClick={() => handleCodeGen()}
>
<Code style={{ paddingRight: "2px" }} size={24} />
</Button>
</OverlayTrigger>
</ButtonGroup>
</Row>
</Col>
</Row>
{debugMode && heights.length > 0 && (
Expand Down
Loading

0 comments on commit b257f65

Please sign in to comment.