Skip to content

Commit

Permalink
Quick fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jessupjn committed Jun 10, 2024
1 parent b11cf2a commit 6321a4f
Show file tree
Hide file tree
Showing 4 changed files with 503 additions and 298 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from "react";
import Link from "@docusaurus/Link";
import React from "react";

import {
type Enum,
type FileDescriptor,
Expand Down
18 changes: 12 additions & 6 deletions plugins/docusaurus-plugin-api-docs/src/components/ProtoPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ export interface ProtoPageProps extends Pick<DocItemProps, "route"> {}
export default function ProtoPage({ route }: ProtoPageProps) {
const id = (route as unknown as { id: string }).id;
const message = useProto(id)!;
const showDescription = message?.name !== "Task";
const fields = message.fields.sort((a, b) =>
a.name.toLowerCase().localeCompare(b.name.toLowerCase())
);

return (
<ApiItemLayout
Expand Down Expand Up @@ -39,7 +43,7 @@ export default function ProtoPage({ route }: ProtoPageProps) {

<h2>Fields</h2>

{message.fields.length === 0 ? (
{fields.length === 0 ? (
<p>{message.name} has no fields.</p>
) : (
<div id="fields">
Expand All @@ -48,11 +52,11 @@ export default function ProtoPage({ route }: ProtoPageProps) {
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
{showDescription && <th>Description</th>}
</tr>
</thead>
<tbody>
{message.fields.map((field, index) => (
{fields.map((field, index) => (
<tr key={index}>
<td>
<i
Expand All @@ -68,9 +72,11 @@ export default function ProtoPage({ route }: ProtoPageProps) {
<td>
<Markdown content={field.type} />
</td>
<td>
<Markdown content={field.description} />
</td>
{showDescription && (
<td>
<Markdown content={field.description} />
</td>
)}
</tr>
))}
</tbody>
Expand Down
7 changes: 6 additions & 1 deletion protos/job_schemas.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,12 @@ _**Example**_: SecretsTask

/// Represents a singular operation performed by an oracle to yield an eventual numerical result.
message Task {
// Reserve obsolete task keys / field numbers.
reserved 27;
reserved "defi_kingdoms_task";
reserved 28;
reserved "tps_task";

oneof Task {
HttpTask http_task = 1;
JsonParseTask json_parse_task = 2;
Expand All @@ -1127,7 +1133,6 @@ _**Example**_: SecretsTask
PerpMarketTask perp_market_task = 24;
OracleTask oracle_task = 25;
AnchorFetchTask anchor_fetch_task = 26;
// reserved 27, 28;
SplStakePoolTask spl_stake_pool_task = 29;
SplTokenParseTask spl_token_parse_task = 30;
UniswapExchangeRateTask uniswap_exchange_rate_task = 31;
Expand Down
Loading

0 comments on commit 6321a4f

Please sign in to comment.