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 dbcf23a88..d60409e7c 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, ISyntax, ITag } from "../../interfaces"; +import { ILanguage, ILicense, IMaintainer, ISyntax, ITag } from "../../interfaces"; export interface IListDetails { id: number; @@ -12,6 +12,7 @@ export interface IListDetails { homeUrl: string; issuesUrl: string; languages: ILanguage[]; + license: ILicense; maintainers: IMaintainer[]; name: string; policyUrl: string; 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 a1c88246e..a4fe95645 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,9 +1,10 @@ import * as React from "react"; import { IColumnVisibility } from "../../../interfaces"; -import { ILanguage, ISoftware, ISyntax, ITag } from "../../../interfaces"; +import { ILanguage, ILicense, 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"; @@ -17,6 +18,7 @@ interface IProps { descriptionSourceUrl: string; discontinuedDate: string; languages: ILanguage[]; + license: ILicense; name: string; publishedDate: string; ruleCount: number; @@ -50,7 +52,9 @@ export const InfoCard = (props: IProps) => ? null : } - - { /**/ } + + {props.columnVisibility.filter((c: IColumnVisibility) => c.column === "License")[0].visible + ? null + : } ; \ 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 4bf26f4c1..a6222c8a9 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,12 +1,17 @@ import * as React from "react"; +import { ILicense } from "../../../interfaces"; -export const License = (props: any) => - props.name - ? (props.descriptionUrl +interface IProps { + license: ILicense; +}; + +export const License = (props: IProps) => + props.license.name + ? (props.license.descriptionUrl ?
  • -

    License: {props.name}

    +

    License: {props.license.name}

  • :
  • -

    License: {props.name}

    +

    License: {props.license.name}

  • ) : null; \ No newline at end of file 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 c527a3267..3c12cdd3c 100644 --- a/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/ListsTable.tsx +++ b/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/ListsTable.tsx @@ -44,6 +44,7 @@ export const ListsTable = (props: IProps) => list={mapListDetails(({ list: r.original, languages: props.languages, + licenses: props.licenses, maintainers: props.maintainers, syntaxes: props.syntaxes, tags: props.tags @@ -55,6 +56,7 @@ export const ListsTable = (props: IProps) => interface ICreateListDtoProps { list: IList; languages: ILanguage[]; + licenses: ILicense[]; maintainers: IMaintainer[]; syntaxes: ISyntax[]; tags: ITag[]; @@ -75,6 +77,7 @@ const mapListDetails = (props: ICreateListDtoProps): IListDetails => languages: props.list.languageIds ? props.languages.filter((l: ILanguage) => props.list.languageIds.indexOf(l.id) > -1) : undefined, + license: props.licenses.filter((l: ILicense) => props.list.licenseId === l.id)[0], maintainers: props.list.maintainerIds ? props.maintainers.filter((m: IMaintainer) => props.list.maintainerIds.indexOf(m.id) > -1) : undefined, diff --git a/src/FilterLists.Web/ClientApp/modules/home/interfaces/IList.ts b/src/FilterLists.Web/ClientApp/modules/home/interfaces/IList.ts index a5b5e08dd..91861295d 100644 --- a/src/FilterLists.Web/ClientApp/modules/home/interfaces/IList.ts +++ b/src/FilterLists.Web/ClientApp/modules/home/interfaces/IList.ts @@ -10,7 +10,7 @@ homeUrl: string; issuesUrl: string; languageIds: number[]; - licenseId: string; + licenseId: number; maintainerIds: number[]; name: string; policyUrl: string;