-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: UI changes for Apicurio integration (#1242)
* feat: UI work for Apicurio integration * Add external link to view schema content --------- Signed-off-by: hemahg <[email protected]>
- Loading branch information
Showing
11 changed files
with
381 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
"use server"; | ||
|
||
import { getHeaders } from "../api"; | ||
|
||
export async function getSchema(contentLink: string) { | ||
const url = `${process.env.BACKEND_URL}/${contentLink}`; | ||
const res = await fetch(url, { | ||
headers: await getHeaders(), | ||
}); | ||
const rawData = await res.text(); | ||
return rawData; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...locale]/(authorized)/kafka/[kafkaId]/topics/[topicId]/messages/schema/ConnectedSchema.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
"use client"; | ||
|
||
import { SchemaValue } from "@/components/MessagesTable/components/SchemaValue"; | ||
import { PageSection, Title } from "@patternfly/react-core"; | ||
|
||
export function ConnectedSchema({ | ||
content, | ||
name, | ||
}: { | ||
content: string; | ||
name: string; | ||
}) { | ||
return ( | ||
<PageSection variant="light"> | ||
<Title headingLevel={"h4"}>{name}</Title> | ||
<SchemaValue schema={content} name={name} /> | ||
</PageSection> | ||
); | ||
} |
21 changes: 21 additions & 0 deletions
21
ui/app/[locale]/(authorized)/kafka/[kafkaId]/topics/[topicId]/messages/schema/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { getSchema } from "@/api/schema/action"; | ||
import { ConnectedSchema } from "./ConnectedSchema"; | ||
|
||
export default async function ConnectedSchemaPage({ | ||
searchParams, | ||
}: { | ||
searchParams: { content?: string; schemaname?: string }; | ||
}) { | ||
const urlSearchParams = new URLSearchParams(searchParams); | ||
|
||
const content = urlSearchParams.get("content"); | ||
const schemaname = urlSearchParams.get("schemaname"); | ||
|
||
if (!content) { | ||
throw new Error("Content parameter is missing."); | ||
} | ||
|
||
const schemaContent = await getSchema(content); | ||
|
||
return <ConnectedSchema content={schemaContent} name={schemaname || ""} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.