Revert "refactor(web): ♻🚧 match dto interfaces with revised api/data model"

This reverts commit cf01a8260b62ab291ef2e9887def3523c3562b98.
This commit is contained in:
Collin M. Barrett 2020-08-29 09:18:44 -05:00
parent 3c696f877c
commit 8dc6d5d427
12 changed files with 42 additions and 51 deletions

View file

@ -80,7 +80,7 @@ export const ListInfoDrawer = (props: RouteComponentProps & Props) => {
{props.syntax && (
<SyntaxTag
name={props.syntax.name}
definitionUrl={props.syntax.url}
definitionUrl={props.syntax.definitionUrl}
showLabel={true}
/>
)}

View file

@ -32,9 +32,9 @@ export const ListDrawer = (props: Props) => {
<ListInfoDrawer
list={list as List}
languages={
list.languageIso6391s &&
list.languageIds &&
props.languages.filter((l: Language) =>
list.languageIso6391s.includes(l.id)
list.languageIds.includes(l.id)
)
}
license={

View file

@ -217,7 +217,10 @@ 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.url} />
<SyntaxTag
name={syntax.name}
definitionUrl={syntax.definitionUrl}
/>
) : null;
}}
/>
@ -228,7 +231,7 @@ export const ListsTable = (props: RouteComponentProps & Props) => {
key="Languages"
dataIndex={nameof<List>("languageIds")}
sorter={(a, b) =>
arraySorter(a.languageIso6391s, b.languageIso6391s, languages)
arraySorter(a.languageIds, b.languageIds, languages)
}
width={129}
className={styles.nogrow}
@ -239,8 +242,7 @@ export const ListsTable = (props: RouteComponentProps & Props) => {
{l.name}&nbsp; (
{
visibleLists.filter(
(li) =>
li.languageIso6391s && li.languageIso6391s.includes(l.id)
(li) => li.languageIds && li.languageIds.includes(l.id)
).length
}
)
@ -249,9 +251,7 @@ export const ListsTable = (props: RouteComponentProps & Props) => {
value: l.id.toString(),
}))}
onFilter={(value, record) =>
record.languageIso6391s
? record.languageIso6391s.includes(+value)
: false
record.languageIds ? record.languageIds.includes(+value) : false
}
render={(languageIds: number[]) =>
languageIds ? (

View file

@ -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.url ? (
m.homeUrl ? (
<Tag key={i}>
<a
href={m.url}
href={m.homeUrl}
title={`View ${m.name}'s homepage.`}
target="_blank"
rel="noopener noreferrer"

View file

@ -27,10 +27,10 @@ interface MaintainerComponentProps {
const MaintainerComponent = (props: MaintainerComponentProps) => {
let actions = [];
if (props.maintainer.url) {
if (props.maintainer.homeUrl) {
actions.push(
<a
href={props.maintainer.url}
href={props.maintainer.homeUrl}
title={`View ${props.maintainer.name}'s homepage.`}
target="_blank"
rel="noopener noreferrer"

View file

@ -1,5 +1,6 @@
export interface Language {
id: number;
filterListIds: number[];
iso6391: string;
name: string;
filterListIds: number[];
}

View file

@ -1,9 +1,6 @@
export interface License {
id: number;
name: string;
url: string;
permitsModification: boolean;
permitsDistribution: boolean;
permitsCommercialUse: boolean;
descriptionUrl: string;
filterListIds: number[];
name: string;
}

View file

@ -1,28 +1,24 @@
export interface List {
id: number;
name: string;
description: string;
licenseId: number;
syntaxIds: number[];
languageIso6391s: number[];
tagIds: number[];
// viewUrls: unknown[];
homeUrl: string;
onionUrl: string;
policyUrl: string;
submissionUrl: string;
issuesUrl: string;
forumUrl: string;
chatUrl: string;
emailAddress: string;
description: string;
descriptionSourceUrl: string;
donateUrl: string;
emailAddress: string;
forumUrl: string;
homeUrl: string;
issuesUrl: string;
languageIds: number[];
licenseId: number;
maintainerIds: number[];
upstreamFilterListIds: number[];
forkFilterListIds: number[];
includedInFilterListIds: number[];
includesFilterListIds: number[];
dependencyFilterListIds: number[];
dependentFilterListIds: number[];
name: string;
policyUrl: string;
publishedDate: string;
submissionUrl: string;
syntaxId: number;
tagIds: number[];
viewUrl: string;
viewUrlMirrors: string[];
// auto-generated by useLists hook
slug: string;

View file

@ -1,8 +1,8 @@
export interface Maintainer {
id: number;
name: string;
url: string;
emailAddress: string;
twitterHandle: string;
filterListIds: number[];
homeUrl: string;
name: string;
twitterHandle: string;
}

View file

@ -1,9 +1,7 @@
export interface Software {
id: number;
name: string;
description: string;
homeUrl: string;
downloadUrl: string;
supportsAbpUrlScheme: boolean;
isAbpSubscribable: boolean;
name: string;
syntaxIds: number[];
}

View file

@ -1,8 +1,7 @@
export interface Syntax {
id: number;
name: string;
description: string;
url: string;
definitionUrl: string;
filterListIds: number[];
name: string;
softwareIds: number[];
}

View file

@ -1,6 +1,6 @@
export interface Tag {
id: number;
name: string;
description: string;
filterListIds: number[];
name: string;
}