feat(macros): add IndexerName (#1511)

* feat(macros): add IndexerName

* fix: tests

* fix: tests
This commit is contained in:
ze0s 2024-04-16 17:35:17 +02:00 committed by GitHub
parent c43e2c76d6
commit 3c3b47fa10
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
37 changed files with 310 additions and 235 deletions

View file

@ -317,7 +317,7 @@ export const APIClient = {
if (!filter.value)
return;
if (filter.id == "indexer") {
if (filter.id == "indexer.identifier") {
params["indexer"].push(filter.value);
} else if (filter.id === "action_status") {
params["push_status"].push(filter.value); // push_status is the correct value here otherwise the releases table won't load when filtered by push status

View file

@ -60,7 +60,7 @@ export const LinksCell = (props: CellProps<Release>) => {
>
<div className="mb-1">
<CellLine title="Release">{props.row.original.name}</CellLine>
<CellLine title="Indexer">{props.row.original.indexer}</CellLine>
<CellLine title="Indexer">{props.row.original.indexer.identifier}</CellLine>
<CellLine title="Protocol">{props.row.original.protocol}</CellLine>
<CellLine title="Implementation">{props.row.original.implementation}</CellLine>
<CellLine title="Category">{props.row.original.category}</CellLine>

View file

@ -28,7 +28,7 @@ interface UpdateProps {
interface InitialValues {
id: number;
indexer: string;
indexer: IndexerMinimal;
enabled: boolean;
type: FeedType;
name: string;

View file

@ -207,7 +207,7 @@ export const ActivityTable = () => {
},
{
Header: "Indexer",
accessor: "indexer",
accessor: "indexer.identifier",
Cell: DataTable.TitleCell,
Filter: SelectColumnFilter,
filter: "includes"
@ -239,7 +239,11 @@ export const ActivityTable = () => {
const newData: Release[] = data.data.map((item, index) => ({
...item,
name: `${randomNames[index]}.iso`,
indexer: index % 2 === 0 ? "distrowatch" : "linuxtracker"
indexer: {
id: 0,
name: index % 2 === 0 ? "distrowatch" : "linuxtracker",
identifier: index % 2 === 0 ? "distrowatch" : "linuxtracker",
},
}));
setModifiedData(newData);
}
@ -290,7 +294,7 @@ export const ActivityTableContent = () => {
},
{
Header: "Indexer",
accessor: "indexer",
accessor: "indexer.identifier",
Cell: DataTable.TitleCell,
Filter: SelectColumnFilter,
filter: "includes"
@ -315,7 +319,11 @@ export const ActivityTableContent = () => {
const newData: Release[] = data.data.map((item, index) => ({
...item,
name: `${randomNames[index]}.iso`,
indexer: index % 2 === 0 ? "distrowatch" : "linuxtracker"
indexer: {
id: 0,
name: index % 2 === 0 ? "distrowatch" : "linuxtracker",
identifier: index % 2 === 0 ? "distrowatch" : "linuxtracker",
},
}));
setModifiedData(newData);
}

View file

@ -122,7 +122,7 @@ export const ReleaseTable = () => {
},
{
Header: "Indexer",
accessor: "indexer",
accessor: "indexer.identifier",
Cell: DataTable.IndexerCell,
Filter: IndexerSelectColumnFilter,
filter: "equal"
@ -148,7 +148,11 @@ export const ReleaseTable = () => {
const newData: Release[] = data.data.map((item, index) => ({
...item,
name: `${randomNames[index]}.iso`,
indexer: index % 2 === 0 ? "distrowatch" : "linuxtracker",
indexer: {
id: 0,
name: index % 2 === 0 ? "distrowatch" : "linuxtracker",
identifier: index % 2 === 0 ? "distrowatch" : "linuxtracker",
},
category: "Linux ISOs",
size: index % 2 === 0 ? 4566784529 : (index % 3 === 0 ? 7427019812 : 2312122455),
source: "",

View file

@ -179,7 +179,7 @@ function ListItem({ feed }: ListItemProps) {
<div className="col-span-9 md:col-span-4 pl-10 sm:pl-12 py-3 flex flex-col">
<span className="pr-2 dark:text-white truncate">{feed.name}</span>
<span className="pr-3 text-xs truncate">
{feed.indexer}
{feed.indexer.identifier}
</span>
</div>
<div className="hidden md:flex col-span-2 py-3 items-center">

View file

@ -5,7 +5,7 @@
interface Feed {
id: number;
indexer: string;
indexer: IndexerMinimal;
name: string;
type: FeedType;
enabled: boolean;

View file

@ -13,6 +13,12 @@ interface Indexer {
settings: Array<IndexerSetting>;
}
interface IndexerMinimal {
id: number;
name: string;
identifier: string;
}
interface IndexerDefinition {
id: number;
name: string;

View file

@ -7,7 +7,7 @@ interface Release {
id: number;
filter_status: string;
rejections: string[];
indexer: string;
indexer: IndexerMinimal;
filter: string;
protocol: string;
implementation: string;