Skip to content

Commit a308a2a

Browse files
committed
new joinWith
1 parent 0db7ce8 commit a308a2a

10 files changed

Lines changed: 37954 additions & 9157 deletions

File tree

web/src/components/app.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ interface AppProps {
1212
repo: string;
1313
}
1414

15-
type FieldType = "link" | "version" | "size" | "date" | "hash" | "files" | "number" | "metric" | "category" | "default" | "links" | "tags" | "repology" | "provides";
15+
type FieldType = "link" | "version" | "size" | "date" | "hash" | "files" | "number" | "metric" | "category" | "default" | "links" | "tags" | "repology" | "provides" | "string[]";
1616

1717
interface ResolverField {
1818
label: string;
1919
type: FieldType;
20+
joinWith?: string;
2021
}
2122

2223
const resolver: { [key: string]: ResolverField } = {
@@ -28,13 +29,13 @@ const resolver: { [key: string]: ResolverField } = {
2829
bsum: { label: "BLAKE3SUM", type: "hash" },
2930
repology: { label: "Repology", type: "repology" },
3031
appstream: { label: "AppStream", type: "link" },
31-
license: { label: "License", type: "default" },
32+
license: { label: "License", type: "string[]", joinWith: ", " },
3233
snapshots: { label: "Snapshots", type: "version" },
3334
tag: { label: "Tags", type: "tags" },
3435
app_id: { label: "Application ID", type: "default" },
3536
version: { label: "Version", type: "version" },
3637
version_upstream: { label: "Upstream Version", type: "version" },
37-
note: { label: "Note", type: "default" },
38+
note: { label: "Note", type: "string[]", joinWith: "\n" },
3839
build_date: { label: "Build Date", type: "date" },
3940
size: { label: "Size", type: "size" },
4041
download_url: { label: "Download URL", type: "link" },
@@ -51,7 +52,7 @@ const resolver: { [key: string]: ResolverField } = {
5152
host: { label: "Host", type: "default" },
5253
pkg_type: { label: "Package Type", type: "default" },
5354
pkg_webpage: { label: "Package Webpage", type: "link" },
54-
maintainer: { label: "Maintainer", type: "default" },
55+
maintainer: { label: "Maintainer", type: "string[]", joinWith: ", " },
5556
rank: { label: "Rank", type: "metric" },
5657
build_ghactions: { label: "GH Actions Build", type: "link" },
5758
ghcr_blob: { label: "GHCR Blob", type: "link" },
@@ -70,9 +71,16 @@ const resolver: { [key: string]: ResolverField } = {
7071

7172
function Show({ value, Key, props }: { value: any, props: AppProps, Key?: string }) {
7273
const { copy, copied } = useClipboard();
73-
const field = Key ? resolver[Key] || { label: Key, type: "default" } : { label: "Default", type: "default" };
74+
const field: ResolverField = Key ? resolver[Key] || { label: Key, type: "default" } : { label: "Default", type: "default" };
7475

7576
switch (field.type) {
77+
case "string[]":
78+
return (
79+
<span>
80+
{value.join(field?.joinWith || ", ")}
81+
</span>
82+
);
83+
7684
case "link":
7785
return (
7886
<a href={value} target="_blank" rel="noreferrer"

web/src/metadata_bincache_aarch64-linux.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

web/src/metadata_bincache_x86_64-linux.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

web/src/metadata_soarpkgs_linux.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)