Skip to content

Commit e9ef828

Browse files
committed
feat(insights): publisher table improvements
- Add ranking explanation - Remove inactive feeds column - Change name of permissioned feeds column from "FEEDS" to "PERMISSIONED"
1 parent d3d4b5c commit e9ef828

File tree

4 files changed

+32
-31
lines changed

4 files changed

+32
-31
lines changed

apps/insights/src/components/Explanations/index.tsx

+16
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,22 @@ import { useMemo } from "react";
44
import { Explain } from "../Explain";
55
import { FormattedDate } from "../FormattedDate";
66

7+
export const ExplainRanking = ({
8+
scoreTime,
9+
}: {
10+
scoreTime?: Date | undefined;
11+
}) => {
12+
return (
13+
<Explain size="xs" title="Permissioned Feeds">
14+
<p>
15+
The publisher{"'"}s <b>ranking</b> is determined by the number of{" "}
16+
<b>Price Feeds</b> that publisher has permissions to publish to.
17+
</p>
18+
{scoreTime && <EvaluationTime scoreTime={scoreTime} />}
19+
</Explain>
20+
);
21+
};
22+
723
export const ExplainPermissioned = ({
824
scoreTime,
925
}: {

apps/insights/src/components/Publishers/index.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ const toTableRow = ({
148148
key,
149149
rank,
150150
permissionedFeeds,
151-
inactiveFeeds,
152151
activeFeeds,
153152
averageScore,
154153
}: Awaited<ReturnType<typeof getPublishers>>[number]) => {
@@ -158,7 +157,6 @@ const toTableRow = ({
158157
ranking: rank,
159158
permissionedFeeds,
160159
activeFeeds,
161-
inactiveFeeds,
162160
averageScore,
163161
...(knownPublisher && {
164162
name: knownPublisher.name,

apps/insights/src/components/Publishers/publishers-card.tsx

+9-29
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { EntityList } from "../EntityList";
2727
import {
2828
ExplainPermissioned,
2929
ExplainActive,
30-
ExplainInactive,
30+
ExplainRanking,
3131
} from "../Explanations";
3232
import { NoResults } from "../NoResults";
3333
import { PublisherTag } from "../PublisherTag";
@@ -49,7 +49,6 @@ type Publisher = {
4949
ranking: number;
5050
permissionedFeeds: number;
5151
activeFeeds: number;
52-
inactiveFeeds: number;
5352
averageScore: number;
5453
} & (
5554
| { name: string; icon: ReactNode }
@@ -106,7 +105,6 @@ const ResolvedPublishersCard = ({
106105
case "ranking":
107106
case "permissionedFeeds":
108107
case "activeFeeds":
109-
case "inactiveFeeds":
110108
case "averageScore": {
111109
return (
112110
(direction === "descending" ? -1 : 1) * (a[column] - b[column])
@@ -139,7 +137,6 @@ const ResolvedPublishersCard = ({
139137
averageScore,
140138
permissionedFeeds,
141139
activeFeeds,
142-
inactiveFeeds,
143140
...publisher
144141
}) => ({
145142
id,
@@ -165,14 +162,6 @@ const ResolvedPublishersCard = ({
165162
{activeFeeds}
166163
</Link>
167164
),
168-
inactiveFeeds: (
169-
<Link
170-
href={`/publishers/${cluster}/${id}/price-feeds?status=Inactive`}
171-
invert
172-
>
173-
{inactiveFeeds}
174-
</Link>
175-
),
176165
averageScore: (
177166
<Score score={averageScore} width={PUBLISHER_SCORE_WIDTH} />
178167
),
@@ -236,7 +225,6 @@ type PublishersCardContentsProps = Pick<Props, "className" | "explainAverage"> &
236225
| "name"
237226
| "permissionedFeeds"
238227
| "activeFeeds"
239-
| "inactiveFeeds"
240228
| "averageScore"
241229
> & { textValue: string })[];
242230
}
@@ -314,7 +302,6 @@ const PublishersCardContents = ({
314302
{ id: "averageScore", name: "Average Score" },
315303
{ id: "permissionedFeeds", name: "Permissioned Feeds" },
316304
{ id: "activeFeeds", name: "Active Feeds" },
317-
{ id: "inactiveFeeds", name: "Inactive Feeds" },
318305
]}
319306
isLoading={props.isLoading}
320307
rows={
@@ -340,7 +327,12 @@ const PublishersCardContents = ({
340327
columns={[
341328
{
342329
id: "ranking",
343-
name: "RANKING",
330+
name: (
331+
<>
332+
RANKING
333+
<ExplainRanking />
334+
</>
335+
),
344336
width: 25,
345337
loadingSkeleton: <Ranking isLoading />,
346338
allowsSorting: true,
@@ -357,7 +349,7 @@ const PublishersCardContents = ({
357349
id: "permissionedFeeds",
358350
name: (
359351
<>
360-
FEEDS
352+
PERMISSIONED
361353
<ExplainPermissioned />
362354
</>
363355
),
@@ -374,19 +366,7 @@ const PublishersCardContents = ({
374366
</>
375367
),
376368
alignment: "center",
377-
width: 30,
378-
allowsSorting: true,
379-
},
380-
{
381-
id: "inactiveFeeds",
382-
name: (
383-
<>
384-
INACTIVE
385-
<ExplainInactive />
386-
</>
387-
),
388-
alignment: "center",
389-
width: 30,
369+
width: 24,
390370
allowsSorting: true,
391371
},
392372
{

apps/insights/turbo.json

+7
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414
"DISABLE_ACCESSIBILITY_REPORTING"
1515
]
1616
},
17+
"start:dev": {
18+
"dependsOn": [
19+
"//#install:modules",
20+
"pull:env",
21+
"@pythnetwork/solana-utils#build"
22+
]
23+
},
1724
"fix:lint": {
1825
"dependsOn": [
1926
"//#install:modules",

0 commit comments

Comments
 (0)