confluentinc / confluentinc/vscode
Add boolean user setting for showing soft-deleted subjects and schemas
- Dominant language
- TypeScript
- Stars
- 34
- Forks
- 17
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 8
Description
A few of our requests use the default `deleted: false`, so we'll need to make a few updates that depend on this setting. To get started, the following will at least display soft-deleted subjects and schemas:
```diff
diff --git a/src/loaders/utils/loaderUtils.ts b/src/loaders/utils/loaderUtils.ts
index b5cc40f6..10957e69 100644
--- a/src/loaders/utils/loaderUtils.ts
+++ b/src/loaders/utils/loaderUtils.ts
@@ -135,7 +135,9 @@ export async function fetchSubjects(schemaRegistry: SchemaRegistry): Promise a.localeCompare(b));
+ const sortedSubjectStrings: string[] = (await client.list({ deleted: SHOW_SOFT_DELETED_SCHEMAS.value })).sort((a, b) =>
+ a.localeCompare(b),
+ );
// Promote to Subject objects carrying the schema registry's metadata.
return sortedSubjectStrings.map(
@@ -168,7 +170,7 @@ export async function fetchSchemasForSubject(
);
// Learn all of the live version numbers for the subject in one round trip.
- const versions: number[] = await client.listVersions({ subject });
+ const versions: number[] = await client.listVersions({ subject, deleted: SHOW_SOFT_DELETED_SCHEMAS.value });
// Reverse sort versions to get the highest version first. This will then
// become the order of the returned array of Schema.
```
This should also include some other visual indicator to separate soft-deleted subjects and/or schema versions from normal ones (tooltip adjustment, maybe file decorator?)
Contributor guide
Assessment
This issue has not been assessed yet.