mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
Revert "Revert "refactor(web): ♻🚧 match dto interfaces with revised api/data model""
This reverts commit 451ff31f171acce6887a7ff2ead03865c7c80ce3.
This commit is contained in:
parent
2bfaadf6f7
commit
dc97319d75
12 changed files with 52 additions and 43 deletions
|
|
@ -80,7 +80,7 @@ export const ListInfoDrawer = (props: RouteComponentProps & Props) => {
|
|||
{props.syntax && (
|
||||
<SyntaxTag
|
||||
name={props.syntax.name}
|
||||
definitionUrl={props.syntax.definitionUrl}
|
||||
definitionUrl={props.syntax.url}
|
||||
showLabel={true}
|
||||
/>
|
||||
)}
|
||||
|
|
|
|||
|
|
@ -32,9 +32,9 @@ export const ListDrawer = (props: Props) => {
|
|||
<ListInfoDrawer
|
||||
list={list as List}
|
||||
languages={
|
||||
list.languageIds &&
|
||||
list.languageIso6391s &&
|
||||
props.languages.filter((l: Language) =>
|
||||
list.languageIds.includes(l.id)
|
||||
list.languageIso6391s.includes(l.id)
|
||||
)
|
||||
}
|
||||
license={
|
||||
|
|
|
|||
|
|
@ -217,10 +217,7 @@ export const ListsTable = (props: RouteComponentProps & Props) => {
|
|||
render={(syntaxId: number) => {
|
||||
const syntax = syntaxes.find((s) => s.id === syntaxId);
|
||||
return syntax ? (
|
||||
<SyntaxTag
|
||||
name={syntax.name}
|
||||
definitionUrl={syntax.definitionUrl}
|
||||
/>
|
||||
<SyntaxTag name={syntax.name} definitionUrl={syntax.url} />
|
||||
) : null;
|
||||
}}
|
||||
/>
|
||||
|
|
@ -231,7 +228,7 @@ export const ListsTable = (props: RouteComponentProps & Props) => {
|
|||
key="Languages"
|
||||
dataIndex={nameof<List>("languageIds")}
|
||||
sorter={(a, b) =>
|
||||
arraySorter(a.languageIds, b.languageIds, languages)
|
||||
arraySorter(a.languageIso6391s, b.languageIso6391s, languages)
|
||||
}
|
||||
width={129}
|
||||
className={styles.nogrow}
|
||||
|
|
@ -242,7 +239,8 @@ export const ListsTable = (props: RouteComponentProps & Props) => {
|
|||
{l.name} (
|
||||
{
|
||||
visibleLists.filter(
|
||||
(li) => li.languageIds && li.languageIds.includes(l.id)
|
||||
(li) =>
|
||||
li.languageIso6391s && li.languageIso6391s.includes(l.id)
|
||||
).length
|
||||
}
|
||||
)
|
||||
|
|
@ -251,7 +249,9 @@ export const ListsTable = (props: RouteComponentProps & Props) => {
|
|||
value: l.id.toString(),
|
||||
}))}
|
||||
onFilter={(value, record) =>
|
||||
record.languageIds ? record.languageIds.includes(+value) : false
|
||||
record.languageIso6391s
|
||||
? record.languageIso6391s.includes(+value)
|
||||
: false
|
||||
}
|
||||
render={(languageIds: number[]) =>
|
||||
languageIds ? (
|
||||
|
|
|
|||
|
|
@ -12,10 +12,10 @@ export const MaintainerCloud = (props: Props) =>
|
|||
props.maintainers && props.maintainers.length ? (
|
||||
<div className={styles.grow}>
|
||||
{props.maintainers.map((m: Maintainer, i: number) =>
|
||||
m.homeUrl ? (
|
||||
m.url ? (
|
||||
<Tag key={i}>
|
||||
<a
|
||||
href={m.homeUrl}
|
||||
href={m.url}
|
||||
title={`View ${m.name}'s homepage.`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
|
|
|
|||
|
|
@ -27,10 +27,10 @@ interface MaintainerComponentProps {
|
|||
|
||||
const MaintainerComponent = (props: MaintainerComponentProps) => {
|
||||
let actions = [];
|
||||
if (props.maintainer.homeUrl) {
|
||||
if (props.maintainer.url) {
|
||||
actions.push(
|
||||
<a
|
||||
href={props.maintainer.homeUrl}
|
||||
href={props.maintainer.url}
|
||||
title={`View ${props.maintainer.name}'s homepage.`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
export interface Language {
|
||||
id: number;
|
||||
filterListIds: number[];
|
||||
iso6391: string;
|
||||
name: string;
|
||||
filterListIds: number[];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
export interface License {
|
||||
id: number;
|
||||
descriptionUrl: string;
|
||||
filterListIds: number[];
|
||||
name: string;
|
||||
url: string;
|
||||
permitsModification: boolean;
|
||||
permitsDistribution: boolean;
|
||||
permitsCommercialUse: boolean;
|
||||
filterListIds: number[];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,24 +1,28 @@
|
|||
export interface List {
|
||||
id: number;
|
||||
chatUrl: string;
|
||||
description: string;
|
||||
descriptionSourceUrl: string;
|
||||
donateUrl: string;
|
||||
emailAddress: string;
|
||||
forumUrl: string;
|
||||
homeUrl: string;
|
||||
issuesUrl: string;
|
||||
languageIds: number[];
|
||||
licenseId: number;
|
||||
maintainerIds: number[];
|
||||
name: string;
|
||||
policyUrl: string;
|
||||
publishedDate: string;
|
||||
submissionUrl: string;
|
||||
syntaxId: number;
|
||||
description: string;
|
||||
licenseId: number;
|
||||
syntaxIds: number[];
|
||||
languageIso6391s: number[];
|
||||
tagIds: number[];
|
||||
viewUrl: string;
|
||||
viewUrlMirrors: string[];
|
||||
// viewUrls: unknown[];
|
||||
homeUrl: string;
|
||||
onionUrl: string;
|
||||
policyUrl: string;
|
||||
submissionUrl: string;
|
||||
issuesUrl: string;
|
||||
forumUrl: string;
|
||||
chatUrl: string;
|
||||
emailAddress: string;
|
||||
donateUrl: string;
|
||||
maintainerIds: number[];
|
||||
upstreamFilterListIds: number[];
|
||||
forkFilterListIds: number[];
|
||||
includedInFilterListIds: number[];
|
||||
includesFilterListIds: number[];
|
||||
dependencyFilterListIds: number[];
|
||||
dependentFilterListIds: number[];
|
||||
|
||||
// auto-generated by useLists hook
|
||||
slug: string;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
export interface Maintainer {
|
||||
id: number;
|
||||
emailAddress: string;
|
||||
filterListIds: number[];
|
||||
homeUrl: string;
|
||||
name: string;
|
||||
url: string;
|
||||
emailAddress: string;
|
||||
twitterHandle: string;
|
||||
filterListIds: number[];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
export interface Software {
|
||||
id: number;
|
||||
homeUrl: string;
|
||||
isAbpSubscribable: boolean;
|
||||
name: string;
|
||||
description: string;
|
||||
homeUrl: string;
|
||||
downloadUrl: string;
|
||||
supportsAbpUrlScheme: boolean;
|
||||
syntaxIds: number[];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
export interface Syntax {
|
||||
id: number;
|
||||
definitionUrl: string;
|
||||
filterListIds: number[];
|
||||
name: string;
|
||||
description: string;
|
||||
url: string;
|
||||
filterListIds: number[];
|
||||
softwareIds: number[];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
export interface Tag {
|
||||
id: number;
|
||||
name: string;
|
||||
description: string;
|
||||
filterListIds: number[];
|
||||
name: string;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue