From 1fb7231a83d12373468c977dcaa70489dcffddb3 Mon Sep 17 00:00:00 2001 From: "Collin M. Barrett" Date: Sun, 1 Sep 2019 15:25:15 -0500 Subject: [PATCH] add SoftwareCloud to list drawer --- src/FilterLists.Web.V2/src/components/ListInfoDrawer.tsx | 6 ++++++ .../src/components/listsTable/ListDrawer.tsx | 3 +++ .../src/components/listsTable/ListsTableHoc.tsx | 2 +- .../src/components/softwareCloud/SoftwareCloud.tsx | 2 ++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/FilterLists.Web.V2/src/components/ListInfoDrawer.tsx b/src/FilterLists.Web.V2/src/components/ListInfoDrawer.tsx index 0aebf639e..897295db6 100644 --- a/src/FilterLists.Web.V2/src/components/ListInfoDrawer.tsx +++ b/src/FilterLists.Web.V2/src/components/ListInfoDrawer.tsx @@ -6,11 +6,13 @@ import { RouteComponentProps } from 'react-router-dom'; import { Language } from '../interfaces/Language'; import { License } from '../interfaces/License'; import { List } from '../interfaces/List'; +import { Software } from '../interfaces/Software'; import { Tag } from '../interfaces/Tag'; import { Description } from './Description'; import { LanguageCloud } from './languageCloud'; import { LicenseTag } from './LicenseTag'; import { LinkButton } from './LinkButton'; +import { SoftwareCloud } from './softwareCloud'; import { SubscribeButtons } from './SubscribeButtons'; import { TagCloud } from './tagCloud'; @@ -18,6 +20,7 @@ interface Props { list: List; languages: Language[]; license?: License; + software: Software[]; tags: Tag[]; }; @@ -47,6 +50,9 @@ export const ListInfoDrawer = (props: RouteComponentProps & Props) => { {props.license ? : null} + {props.list.syntaxId + ? + : null} {props.list.publishedDate ?

First Published Date:

diff --git a/src/FilterLists.Web.V2/src/components/listsTable/ListDrawer.tsx b/src/FilterLists.Web.V2/src/components/listsTable/ListDrawer.tsx index 1b8b02f0b..cfabe643b 100644 --- a/src/FilterLists.Web.V2/src/components/listsTable/ListDrawer.tsx +++ b/src/FilterLists.Web.V2/src/components/listsTable/ListDrawer.tsx @@ -4,6 +4,7 @@ import { Redirect, Route, RouteComponentProps, StaticContext } from 'react-route import { Language } from '../../interfaces/Language'; import { License } from '../../interfaces/License'; import { List } from '../../interfaces/List'; +import { Software } from '../../interfaces/Software'; import { Tag } from '../../interfaces/Tag'; import { ListInfoDrawer } from '../ListInfoDrawer'; @@ -11,6 +12,7 @@ interface Props { lists: List[]; languages: Language[]; licenses: License[]; + software: Software[]; tags: Tag[]; }; @@ -22,6 +24,7 @@ export const ListDrawer = (props: Props) => { list={list as List} languages={list.languageIds && props.languages.filter((l: Language) => list.languageIds.includes(l.id))} license={list.licenseId ? props.licenses.find((l: License) => list.licenseId === l.id) : undefined} + software={list.syntaxId ? props.software.filter((s: Software) => s.syntaxIds.includes(list.syntaxId)) : []} tags={list.tagIds && props.tags.filter((t: Tag) => list.tagIds.includes(t.id))} {...rp} /> : props.lists && props.lists.length && ; diff --git a/src/FilterLists.Web.V2/src/components/listsTable/ListsTableHoc.tsx b/src/FilterLists.Web.V2/src/components/listsTable/ListsTableHoc.tsx index 215ffbf8e..244a606f6 100644 --- a/src/FilterLists.Web.V2/src/components/listsTable/ListsTableHoc.tsx +++ b/src/FilterLists.Web.V2/src/components/listsTable/ListsTableHoc.tsx @@ -14,7 +14,7 @@ export const ListsTableHoc = (props: RouteComponentProps) => { return ( <> - + ); }; \ No newline at end of file diff --git a/src/FilterLists.Web.V2/src/components/softwareCloud/SoftwareCloud.tsx b/src/FilterLists.Web.V2/src/components/softwareCloud/SoftwareCloud.tsx index f055a8a18..ebbed97b4 100644 --- a/src/FilterLists.Web.V2/src/components/softwareCloud/SoftwareCloud.tsx +++ b/src/FilterLists.Web.V2/src/components/softwareCloud/SoftwareCloud.tsx @@ -5,11 +5,13 @@ import { SoftwareIcon } from './SoftwareIcon'; interface Props { software: Software[]; + showLabel?: boolean; }; export const SoftwareCloud = (props: Props) => props.software && props.software.length ?
+ {props.showLabel &&

{`Software:`}

} {props.software.map((s: Software, i: number) => s.homeUrl ?