diff --git a/src/FilterLists.Web/ClientApp/modules/home/Home.tsx b/src/FilterLists.Web/ClientApp/modules/home/Home.tsx index 34b5a2870..6119da76d 100644 --- a/src/FilterLists.Web/ClientApp/modules/home/Home.tsx +++ b/src/FilterLists.Web/ClientApp/modules/home/Home.tsx @@ -8,7 +8,6 @@ const columnVisibilityDefaults: IColumnVisibility[] = [ { column: "Tags", visible: true }, { column: "Updated", visible: false }, { column: "Rules", visible: false }, - //{ column: "Syntax", visible: false }, { column: "License", visible: false }, { column: "Maintainers", visible: false } ]; diff --git a/src/FilterLists.Web/ClientApp/modules/home/components/detailsExpander/DetailsExpander.tsx b/src/FilterLists.Web/ClientApp/modules/home/components/detailsExpander/DetailsExpander.tsx index 881f8fc6e..852dbea32 100644 --- a/src/FilterLists.Web/ClientApp/modules/home/components/detailsExpander/DetailsExpander.tsx +++ b/src/FilterLists.Web/ClientApp/modules/home/components/detailsExpander/DetailsExpander.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { IColumnVisibility } from "../../interfaces"; +import { IColumnVisibility, ISoftware } from "../../interfaces"; import { IListDetails } from "./IListDetails"; import { InfoCard } from "./infoCard"; import { LinkButtonGroup } from "./LinkButtonGroup"; @@ -8,6 +8,7 @@ import { MaintainersInfoCard } from "./maintainersInfoCard"; interface IProps { columnVisibility: IColumnVisibility[]; list: IListDetails; + software: ISoftware[]; }; export const DetailsExpander = (props: IProps) => @@ -15,7 +16,7 @@ export const DetailsExpander = (props: IProps) =>
- +
diff --git a/src/FilterLists.Web/ClientApp/modules/home/components/detailsExpander/IListDetails.ts b/src/FilterLists.Web/ClientApp/modules/home/components/detailsExpander/IListDetails.ts index e1c4f368f..dbcf23a88 100644 --- a/src/FilterLists.Web/ClientApp/modules/home/components/detailsExpander/IListDetails.ts +++ b/src/FilterLists.Web/ClientApp/modules/home/components/detailsExpander/IListDetails.ts @@ -1,4 +1,4 @@ -import { ILanguage, IMaintainer, ITag } from "../../interfaces"; +import { ILanguage, IMaintainer, ISyntax, ITag } from "../../interfaces"; export interface IListDetails { id: number; @@ -12,33 +12,15 @@ export interface IListDetails { homeUrl: string; issuesUrl: string; languages: ILanguage[]; - license: IListLicense; maintainers: IMaintainer[]; name: string; policyUrl: string; publishedDate: string; ruleCount: number; submissionUrl: string; - syntax: IListSyntax; + syntax: ISyntax; tags: ITag[]; updatedDate: string; viewUrl: string; viewUrlMirrors: string[]; -}; - -export interface IListLicense { - descriptionUrl: string; - name: string; -}; - -export interface IListSyntax { - definitionUrl: string; - name: string; - supportedSoftware: ISyntaxSupportedSoftware[]; -}; - -export interface ISyntaxSupportedSoftware { - homeUrl: string; - id: number; - name: string; }; \ No newline at end of file diff --git a/src/FilterLists.Web/ClientApp/modules/home/components/detailsExpander/infoCard/InfoCard.tsx b/src/FilterLists.Web/ClientApp/modules/home/components/detailsExpander/infoCard/InfoCard.tsx index 6be473113..11d04f630 100644 --- a/src/FilterLists.Web/ClientApp/modules/home/components/detailsExpander/infoCard/InfoCard.tsx +++ b/src/FilterLists.Web/ClientApp/modules/home/components/detailsExpander/infoCard/InfoCard.tsx @@ -1,11 +1,9 @@ import * as React from "react"; import { IColumnVisibility } from "../../../interfaces"; -import { IListLicense, IListSyntax, ISyntaxSupportedSoftware } from "../IListDetails"; -import { ILanguage, ITag } from "../../../interfaces"; +import { ILanguage, ISoftware, ISyntax, ITag } from "../../../interfaces"; import { Description } from "./Description"; import { DiscontinuedDate } from "./DiscontinuedDate"; import { Languages } from "./Languages"; -import { License } from "./License"; import { PublishedDate } from "./PublishedDate"; import { RuleCount } from "./RuleCount"; import { SoftwareIcon } from "../../softwareIcon"; @@ -19,11 +17,11 @@ interface IProps { descriptionSourceUrl: string; discontinuedDate: string; languages: ILanguage[]; - license: IListLicense; name: string; publishedDate: string; ruleCount: number; - syntax: IListSyntax; + software: ISoftware[]; + syntax: ISyntax; tags: ITag[]; updatedDate: string; }; @@ -34,13 +32,12 @@ export const InfoCard = (props: IProps) => ? null : }
- {props.syntax - ? props.syntax.supportedSoftware.map( - (s: ISyntaxSupportedSoftware, i: number) => - - - ) - : null} + {props.columnVisibility.filter((c: IColumnVisibility) => c.column === "Software")[0].visible + ? null + : props.syntax + ? props.software.filter((s: ISoftware) => s.syntaxIds.indexOf(props.syntax.id) > -1) + .map((s: ISoftware, i: number) => ) + : null}
    @@ -54,6 +51,6 @@ export const InfoCard = (props: IProps) => : } - + { /**/ }
; \ No newline at end of file diff --git a/src/FilterLists.Web/ClientApp/modules/home/components/detailsExpander/infoCard/License.tsx b/src/FilterLists.Web/ClientApp/modules/home/components/detailsExpander/infoCard/License.tsx index 2a5846b59..4bf26f4c1 100644 --- a/src/FilterLists.Web/ClientApp/modules/home/components/detailsExpander/infoCard/License.tsx +++ b/src/FilterLists.Web/ClientApp/modules/home/components/detailsExpander/infoCard/License.tsx @@ -1,7 +1,6 @@ import * as React from "react"; -import { IListLicense as IListLicenseDto } from "../IListDetails"; -export const License = (props: IListLicenseDto) => +export const License = (props: any) => props.name ? (props.descriptionUrl ?
  • diff --git a/src/FilterLists.Web/ClientApp/modules/home/components/detailsExpander/infoCard/Syntax.tsx b/src/FilterLists.Web/ClientApp/modules/home/components/detailsExpander/infoCard/Syntax.tsx index 1657883ec..928f0c47c 100644 --- a/src/FilterLists.Web/ClientApp/modules/home/components/detailsExpander/infoCard/Syntax.tsx +++ b/src/FilterLists.Web/ClientApp/modules/home/components/detailsExpander/infoCard/Syntax.tsx @@ -1,7 +1,6 @@ import * as React from "react"; -import { IListSyntax as IListSyntaxDto } from "../IListDetails"; -export const Syntax = (props: IListSyntaxDto) => +export const Syntax = (props: any) => props.name ? (props.definitionUrl ?
  • diff --git a/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/ListsTable.tsx b/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/ListsTable.tsx index c814329ea..c527a3267 100644 --- a/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/ListsTable.tsx +++ b/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/ListsTable.tsx @@ -4,7 +4,7 @@ import "../../../../utils/loader.css"; import ReactTable from "react-table"; import "react-table/react-table.css"; import "./listsTable.css"; -import { DetailsButton, Languages, License, Maintainers, Name, RuleCount, Software, Syntax, Tags, UpdatedDate } from +import { DetailsButton, Languages, License, Maintainers, Name, RuleCount, Software, Tags, UpdatedDate } from "./columns"; import { IListDetails } from "../../components/detailsExpander"; import { DetailsExpander } from "../../components"; @@ -34,7 +34,6 @@ export const ListsTable = (props: IProps) => Tags(props.columnVisibility, props.tags), UpdatedDate(props.columnVisibility), RuleCount(props.columnVisibility), - //Syntax(props.columnVisibility, props.syntaxes), License(props.columnVisibility, props.licenses), Maintainers(props.columnVisibility, props.maintainers), DetailsButton @@ -46,8 +45,10 @@ export const ListsTable = (props: IProps) => list: r.original, languages: props.languages, maintainers: props.maintainers, + syntaxes: props.syntaxes, tags: props.tags - } as ICreateListDtoProps))}/>} + } as ICreateListDtoProps))} + software={props.software}/>} className="-striped -highlight"/> :
    Loading...
    ; @@ -55,6 +56,7 @@ interface ICreateListDtoProps { list: IList; languages: ILanguage[]; maintainers: IMaintainer[]; + syntaxes: ISyntax[]; tags: ITag[]; }; @@ -73,7 +75,6 @@ const mapListDetails = (props: ICreateListDtoProps): IListDetails => languages: props.list.languageIds ? props.languages.filter((l: ILanguage) => props.list.languageIds.indexOf(l.id) > -1) : undefined, - //license:, maintainers: props.list.maintainerIds ? props.maintainers.filter((m: IMaintainer) => props.list.maintainerIds.indexOf(m.id) > -1) : undefined, @@ -82,7 +83,7 @@ const mapListDetails = (props: ICreateListDtoProps): IListDetails => publishedDate: props.list.publishedDate, ruleCount: props.list.ruleCount, submissionUrl: props.list.submissionUrl, - //syntax:, + syntax: props.syntaxes.filter((s: ISyntax) => props.list.syntaxId === s.id)[0], tags: props.list.tagIds ? props.tags.filter((t: ITag) => props.list.tagIds.indexOf(t.id) > -1) : undefined, updatedDate: props.list.updatedDate, viewUrl: props.list.viewUrl,