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(#minor); dashboard; add toggle for listing substreams based subgraphs separately #2338

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 dashboard/src/common/DashboardVersion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const DashboardTag = styled("div")`
z-index: 2;
`;

export const dashboardVersion = "v2.2.20";
export const dashboardVersion = "v2.2.21";

export const DashboardVersion = () => {
return <DashboardTag>{dashboardVersion}</DashboardTag>;
Expand Down
40 changes: 38 additions & 2 deletions dashboard/src/deployments/DeploymentsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,33 @@ function DeploymentsPage({
const [indexingStatus, setIndexingStatus] = useState<any>(false);
const [pendingIndexingStatus, setPendingIndexingStatus] = useState<any>(false);

const [substreamsBasedSubgraphs, setSubstreamsBasedSubgraphs] = useState<{
[type: string]: { [proto: string]: { [network: string]: string } };
}>({});
const [nonSubstreamsBasedSubgraphs, setNonSubstreamsBasedSubgraphs] = useState<{
[type: string]: { [proto: string]: { [network: string]: string } };
}>({});
const [showSubstreamsBasedSubgraphs, setShowSubstreamsBasedSubgraphs] = useState<boolean>(false);

useEffect(() => {
getData();
}, []);

useEffect(() => {
let substreamsBasedSubgraphs: any = {};
let nonSubstreamsBasedSubgraphs: any = {};
Object.keys(protocolsToQuery).forEach((protocolName: string) => {
const protocol: { [x: string]: any } = protocolsToQuery[protocolName];
if (protocol.base === "substreams") {
substreamsBasedSubgraphs[protocolName] = protocolsToQuery[protocolName];
} else {
nonSubstreamsBasedSubgraphs[protocolName] = protocolsToQuery[protocolName];
}
});
setSubstreamsBasedSubgraphs(substreamsBasedSubgraphs);
setNonSubstreamsBasedSubgraphs(nonSubstreamsBasedSubgraphs);
}, [protocolsToQuery]);

const navigate = useNavigate();
window.scrollTo(0, 0);

Expand Down Expand Up @@ -289,16 +312,29 @@ function DeploymentsPage({
>
Protocols To Develop
</span>
<span style={{ padding: "0 30px" }} className="Menu-Options" onClick={() => navigate("version-comparison")}>
<span
style={{ padding: "0 30px", borderRight: "#6656F8 2px solid" }}
className="Menu-Options"
onClick={() => navigate("version-comparison")}
>
Version Comparison
</span>
<span
style={{ padding: "0 30px" }}
className="Menu-Options"
onClick={() => {
setShowSubstreamsBasedSubgraphs(!showSubstreamsBasedSubgraphs);
}}
>
Show {showSubstreamsBasedSubgraphs ? "Non" : ""} Substreams Based Subgraphs
</span>
</div>
{devCountTable}
<DeploymentsTable
getData={() => getData()}
decenDepoIndexingStatus={decenDepoIndexingStatus}
issuesMapping={issuesMapping}
protocolsToQuery={protocolsToQuery}
protocolsToQuery={showSubstreamsBasedSubgraphs ? substreamsBasedSubgraphs : nonSubstreamsBasedSubgraphs}
decenDeposToSubgraphIds={decenDeposToSubgraphIds}
indexingStatusLoaded={indexingStatusLoaded}
indexingStatusLoadedPending={indexingStatusLoadedPending}
Expand Down
10 changes: 5 additions & 5 deletions dashboard/src/deployments/ProtocolSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ function ProtocolSection({
return;
}
if (!pendingObject?.fatalError) {
navigate(`subgraph?endpoint=messari/${depo.hostedServiceId}&tab=protocol&version=pending`);
navigate(`/subgraph?endpoint=messari/${depo.hostedServiceId}&tab=protocol&version=pending`);
} else {
window.location.href = "https://okgraph.xyz/?q=" + pendingObject?.subgraph;
}
Expand Down Expand Up @@ -370,7 +370,7 @@ function ProtocolSection({
return;
}
if (!pendingObject?.fatalError) {
navigate(`subgraph?endpoint=messari/${depo.hostedServiceId}&tab=protocol&version=pending`);
navigate(`/subgraph?endpoint=messari/${depo.hostedServiceId}&tab=protocol&version=pending`);
} else {
window.location.href = "https://okgraph.xyz/?q=" + pendingObject?.subgraph;
}
Expand Down Expand Up @@ -681,7 +681,7 @@ function ProtocolSection({
return;
}
if (!decenObject?.fatalError) {
navigate(`subgraph?endpoint=${endpointURL}&tab=protocol`);
navigate(`/subgraph?endpoint=${endpointURL}&tab=protocol`);
} else {
window.location.href = "https://okgraph.xyz/?q=" + depo.decentralizedNetworkId;
}
Expand Down Expand Up @@ -950,7 +950,7 @@ function ProtocolSection({
return;
}
if (!currentObject?.fatalError) {
navigate(`subgraph?endpoint=${subgraphUrlBase}messari/${depo.hostedServiceId}&tab=protocol`);
navigate(`/subgraph?endpoint=${subgraphUrlBase}messari/${depo.hostedServiceId}&tab=protocol`);
} else {
window.location.href = "https://okgraph.xyz/?q=messari/" + depo.hostedServiceId;
}
Expand Down Expand Up @@ -1148,7 +1148,7 @@ function ProtocolSection({
return;
}
if (!currentObject?.fatalError) {
navigate(`subgraph?endpoint=${subgraphUrlBase}messari/${depo.hostedServiceId}&tab=protocol`);
navigate(`/subgraph?endpoint=${subgraphUrlBase}messari/${depo.hostedServiceId}&tab=protocol`);
} else {
window.location.href = "https://okgraph.xyz/?q=messari/" + depo.hostedServiceId;
}
Expand Down
Loading