Skip to content

Commit 814ab15

Browse files
authored
Merge pull request #2061 from input-output-hk/djo/2025/remove_pending_cert_from_explorer
Remove pending certificate from explorer
2 parents 678e6e9 + 825e6ab commit 814ab15

File tree

10 files changed

+67
-195
lines changed

10 files changed

+67
-195
lines changed

mithril-explorer/package-lock.json

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mithril-explorer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mithril-explorer",
3-
"version": "0.7.12",
3+
"version": "0.7.13",
44
"private": true,
55
"scripts": {
66
"dev": "next dev",

mithril-explorer/src/app/page.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import {
1717
} from "chart.js";
1818
import initMithrilClient from "@mithril-dev/mithril-client-wasm";
1919
import EpochSettings from "#/EpochSettings";
20-
import PendingCertificate from "#/PendingCertificate";
2120
import CardanoDbSnapshotsList from "#/Artifacts/CardanoDbSnapshotsList";
2221
import CardanoStakeDistributionsList from "#/Artifacts/CardanoStakeDistributionsList";
2322
import CardanoTransactionsSnapshotsList from "#/Artifacts/CardanoTransactionsSnapshotsList";
@@ -116,14 +115,9 @@ export default function Explorer() {
116115
<IntervalSetter />
117116
</Row>
118117
</Form>
119-
<Row className="row-gap-3">
120-
<Col xs={12} sm={4} lg={3} xl={2}>
121-
<EpochSettings />
122-
</Col>
123-
<Col xs={12} sm={8} lg={9} xl={10}>
124-
<PendingCertificate />
125-
</Col>
126-
</Row>
118+
<Stack direction="horizontal">
119+
<EpochSettings />
120+
</Stack>
127121
<Tabs activeKey={currentTab} onSelect={(key) => setCurrentTab(key)}>
128122
<Tab title="Cardano Db" eventKey={signedEntityType.CardanoImmutableFilesFull}>
129123
<CardanoDbSnapshotsList />

mithril-explorer/src/components/Artifacts/CardanoDbSnapshotsList/index.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ export default function CardanoDbSnapshotsList(props) {
1818
const updateInterval = useSelector((state) => state.settings.updateInterval);
1919

2020
useEffect(() => {
21-
if (!autoUpdate) {
22-
return;
23-
}
24-
2521
let fetchSnapshots = () => {
2622
fetch(artifactsEndpoint)
2723
.then((response) => response.json())
@@ -35,8 +31,10 @@ export default function CardanoDbSnapshotsList(props) {
3531
// Fetch them once without waiting
3632
fetchSnapshots();
3733

38-
const interval = setInterval(fetchSnapshots, updateInterval);
39-
return () => clearInterval(interval);
34+
if (autoUpdate) {
35+
const interval = setInterval(fetchSnapshots, updateInterval);
36+
return () => clearInterval(interval);
37+
}
4038
}, [artifactsEndpoint, updateInterval, autoUpdate]);
4139

4240
function handleCertificateHashChange(hash) {

mithril-explorer/src/components/Artifacts/CardanoStakeDistributionsList/index.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ export default function CardanoStakeDistributionsList(props) {
1717
const updateInterval = useSelector((state) => state.settings.updateInterval);
1818

1919
useEffect(() => {
20-
if (!autoUpdate) {
21-
return;
22-
}
23-
2420
let fetchCardanoStakeDistribution = () => {
2521
fetch(artifactsEndpoint)
2622
.then((response) => response.json())
@@ -34,8 +30,10 @@ export default function CardanoStakeDistributionsList(props) {
3430
// Fetch them once without waiting
3531
fetchCardanoStakeDistribution();
3632

37-
const interval = setInterval(fetchCardanoStakeDistribution, updateInterval);
38-
return () => clearInterval(interval);
33+
if (autoUpdate) {
34+
const interval = setInterval(fetchCardanoStakeDistribution, updateInterval);
35+
return () => clearInterval(interval);
36+
}
3937
}, [artifactsEndpoint, updateInterval, autoUpdate]);
4038

4139
function handleCertificateHashChange(hash) {

mithril-explorer/src/components/Artifacts/CardanoTransactionsSnapshotsList/index.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ export default function CardanoTransactionsSnapshotsList(props) {
2525
);
2626

2727
useEffect(() => {
28-
if (!autoUpdate) {
29-
return;
30-
}
31-
3228
let fetchSnapshots = () => {
3329
fetch(artifactsEndpoint)
3430
.then((response) => response.json())
@@ -42,8 +38,10 @@ export default function CardanoTransactionsSnapshotsList(props) {
4238
// Fetch them once without waiting
4339
fetchSnapshots();
4440

45-
const interval = setInterval(fetchSnapshots, updateInterval);
46-
return () => clearInterval(interval);
41+
if (autoUpdate) {
42+
const interval = setInterval(fetchSnapshots, updateInterval);
43+
return () => clearInterval(interval);
44+
}
4745
}, [artifactsEndpoint, updateInterval, autoUpdate]);
4846

4947
function handleCertificateHashChange(hash) {

mithril-explorer/src/components/Artifacts/CertificatesList/index.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ export default function CertificatesList(props) {
1616
const updateInterval = useSelector((state) => state.settings.updateInterval);
1717

1818
useEffect(() => {
19-
if (!autoUpdate) {
20-
return;
21-
}
22-
2319
let fetchCertificates = () => {
2420
fetch(certificatesEndpoint)
2521
.then((response) => response.json())
@@ -33,8 +29,10 @@ export default function CertificatesList(props) {
3329
// Fetch them once without waiting
3430
fetchCertificates();
3531

36-
const interval = setInterval(fetchCertificates, updateInterval);
37-
return () => clearInterval(interval);
32+
if (autoUpdate) {
33+
const interval = setInterval(fetchCertificates, updateInterval);
34+
return () => clearInterval(interval);
35+
}
3836
}, [certificatesEndpoint, updateInterval, autoUpdate]);
3937

4038
function handleCertificateHashChange(hash) {

mithril-explorer/src/components/Artifacts/MithrilStakeDistributionsList/index.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ export default function MithrilStakeDistributionsList(props) {
1717
const updateInterval = useSelector((state) => state.settings.updateInterval);
1818

1919
useEffect(() => {
20-
if (!autoUpdate) {
21-
return;
22-
}
23-
2420
let fetchMithrilStakeDistribution = () => {
2521
fetch(artifactsEndpoint)
2622
.then((response) => response.json())
@@ -34,8 +30,10 @@ export default function MithrilStakeDistributionsList(props) {
3430
// Fetch them once without waiting
3531
fetchMithrilStakeDistribution();
3632

37-
const interval = setInterval(fetchMithrilStakeDistribution, updateInterval);
38-
return () => clearInterval(interval);
33+
if (autoUpdate) {
34+
const interval = setInterval(fetchMithrilStakeDistribution, updateInterval);
35+
return () => clearInterval(interval);
36+
}
3937
}, [artifactsEndpoint, updateInterval, autoUpdate]);
4038

4139
function handleCertificateHashChange(hash) {

mithril-explorer/src/components/EpochSettings/index.js

Lines changed: 38 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useEffect, useState } from "react";
2-
import { Card, ButtonGroup, DropdownButton } from "react-bootstrap";
2+
import { Card, Row, Col, Stack, Container } from "react-bootstrap";
33
import { useSelector } from "react-redux";
44
import LinkButton from "#/LinkButton";
55
import RawJsonButton from "#/RawJsonButton";
@@ -19,10 +19,6 @@ export default function EpochSettings() {
1919
const [inOutRegistrationsPageUrl, setInOutRegistrationsPageUrl] = useState(undefined);
2020

2121
useEffect(() => {
22-
if (!autoUpdate) {
23-
return;
24-
}
25-
2622
let fetchEpochSettings = () => {
2723
fetch(epochSettingsEndpoint)
2824
.then((response) => (response.status === 200 ? response.json() : {}))
@@ -36,8 +32,10 @@ export default function EpochSettings() {
3632
// Fetch it once without waiting
3733
fetchEpochSettings();
3834

39-
const interval = setInterval(fetchEpochSettings, updateInterval);
40-
return () => clearInterval(interval);
35+
if (autoUpdate) {
36+
const interval = setInterval(fetchEpochSettings, updateInterval);
37+
return () => clearInterval(interval);
38+
}
4139
}, [epochSettingsEndpoint, updateInterval, autoUpdate]);
4240

4341
useEffect(() => {
@@ -66,25 +64,40 @@ export default function EpochSettings() {
6664

6765
<Card>
6866
<Card.Body>
69-
<Card.Title>Current Epoch</Card.Title>
70-
<div className="mb-2 ps-3">{epochSettings.epoch}</div>
71-
<Card.Title>Protocol Parameters</Card.Title>
72-
<ProtocolParameters className="mb-2" protocolParameters={epochSettings.protocol} />
73-
<Card.Title>Next Protocol Parameters</Card.Title>
74-
<ProtocolParameters protocolParameters={epochSettings.next_protocol} />
67+
<Container>
68+
<Row>
69+
<Col xs={12} md="auto">
70+
<h5>Current Epoch</h5>
71+
<div className="mb-2 ps-3">{epochSettings.epoch}</div>
72+
</Col>
73+
<Col xs={12} md="auto">
74+
<h5>Registration Protocol Parameters</h5>
75+
<ProtocolParameters
76+
protocolParameters={
77+
epochSettings.signer_registration_protocol ?? epochSettings.next_protocol
78+
}
79+
/>
80+
</Col>
81+
</Row>
82+
</Container>
7583
</Card.Body>
76-
{registrationPageUrl && inOutRegistrationsPageUrl && (
77-
<Card.Footer className="text-center">
78-
<ButtonGroup>
79-
<LinkButton href={registrationPageUrl}>Registered Signers</LinkButton>
80-
<DropdownButton as={ButtonGroup}>
81-
<LinkButton href={inOutRegistrationsPageUrl} variant="light">
82-
In/Out Registrations
83-
</LinkButton>
84-
</DropdownButton>
85-
</ButtonGroup>
86-
</Card.Footer>
87-
)}
84+
<Card.Footer>
85+
<Stack
86+
direction="horizontal"
87+
gap={1}
88+
className="justify-content-md-end align-items-stretch justify-content-sm-center">
89+
<LinkButton
90+
href={registrationPageUrl ?? "#"}
91+
disabled={registrationPageUrl === undefined}>
92+
<i className="bi bi-pen"></i> Registered Signers
93+
</LinkButton>
94+
<LinkButton
95+
href={inOutRegistrationsPageUrl ?? "#"}
96+
disabled={inOutRegistrationsPageUrl === undefined}>
97+
<i className="bi bi-arrow-left-right translate-middle-y"></i> In/Out Registrations
98+
</LinkButton>
99+
</Stack>
100+
</Card.Footer>
88101
</Card>
89102
</div>
90103
);

mithril-explorer/src/components/PendingCertificate/index.js

Lines changed: 0 additions & 127 deletions
This file was deleted.

0 commit comments

Comments
 (0)