From 785182813e8902fb11db0d9390a312345360c17e Mon Sep 17 00:00:00 2001 From: "Collin M. Barrett" Date: Fri, 28 Sep 2018 15:14:50 -0500 Subject: [PATCH] rely on columnVisibility for visible state rather than bootstrap responsive ref #531 --- src/FilterLists.Web/ClientApp/modules/home/Home.tsx | 9 +++++++++ .../components/detailsExpander/infoCard/InfoCard.tsx | 2 +- .../components/detailsExpander/infoCard/UpdatedDate.tsx | 2 +- .../home/components/listsTable/columns/Languages.tsx | 2 -- .../home/components/listsTable/columns/License.tsx | 2 -- .../home/components/listsTable/columns/Maintainers.tsx | 2 -- .../home/components/listsTable/columns/RuleCount.tsx | 2 -- .../home/components/listsTable/columns/Software.tsx | 2 -- .../modules/home/components/listsTable/columns/Tags.tsx | 2 -- .../home/components/listsTable/columns/UpdatedDate.tsx | 2 -- 10 files changed, 11 insertions(+), 16 deletions(-) diff --git a/src/FilterLists.Web/ClientApp/modules/home/Home.tsx b/src/FilterLists.Web/ClientApp/modules/home/Home.tsx index 873f487d1..165f7965d 100644 --- a/src/FilterLists.Web/ClientApp/modules/home/Home.tsx +++ b/src/FilterLists.Web/ClientApp/modules/home/Home.tsx @@ -38,8 +38,17 @@ export class Home extends React.Component { } componentDidMount() { + this.setMobileColumnVisibility(); this.updatePageSize(); }; + + setMobileColumnVisibility() { + if (window.innerWidth < 768) { + this.state.columnVisibility.forEach((c: IColumnVisibility) => { + c.visible = false; + }); + } + }; updatePageSize() { this.setState({ 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 342567986..7fdf7b020 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 @@ -29,7 +29,7 @@ interface IProps { export const InfoCard = (props: IProps) =>
-
+
{props.syntax ? props.syntax.supportedSoftware.map( (s: ISyntaxSupportedSoftware, i: number) => diff --git a/src/FilterLists.Web/ClientApp/modules/home/components/detailsExpander/infoCard/UpdatedDate.tsx b/src/FilterLists.Web/ClientApp/modules/home/components/detailsExpander/infoCard/UpdatedDate.tsx index 29c02aefa..b0c85ed84 100644 --- a/src/FilterLists.Web/ClientApp/modules/home/components/detailsExpander/infoCard/UpdatedDate.tsx +++ b/src/FilterLists.Web/ClientApp/modules/home/components/detailsExpander/infoCard/UpdatedDate.tsx @@ -10,7 +10,7 @@ export const UpdatedDate = (props: IProps) => props.discontinuedDate ? null : props.updatedDate - ?
  • + ?
  • Updated: {moment(props.updatedDate).isValid() ? moment(props.updatedDate).format("l") : "N/A"}

    diff --git a/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/columns/Languages.tsx b/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/columns/Languages.tsx index fc939225f..f1e6e7950 100644 --- a/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/columns/Languages.tsx +++ b/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/columns/Languages.tsx @@ -13,8 +13,6 @@ export const Languages = (columnVisibility: IColumnVisibility[], languages: ILan Cell: (c: any) => Cell(c.value, languages), style: { whiteSpace: "inherit" }, width: 95, - headerClassName: "d-none d-md-block", - className: "d-none d-md-block", show: columnVisibility.filter((c: IColumnVisibility) => c.column === "Languages")[0].visible } as Column); diff --git a/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/columns/License.tsx b/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/columns/License.tsx index 75ee2ecd4..a5bf2a75a 100644 --- a/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/columns/License.tsx +++ b/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/columns/License.tsx @@ -12,8 +12,6 @@ export const License = (columnVisibility: IColumnVisibility[], licenses: ILicens sortMethod: (a: number, b: number) => sortMethod(a, b, licenses), Cell: (c: any) => Cell(c.value, licenses), width: 140, - headerClassName: "d-none d-md-block", - className: "d-none d-md-block", show: columnVisibility.filter((c: IColumnVisibility) => c.column === "License")[0].visible } as Column); diff --git a/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/columns/Maintainers.tsx b/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/columns/Maintainers.tsx index ced46ded8..08c9746cf 100644 --- a/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/columns/Maintainers.tsx +++ b/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/columns/Maintainers.tsx @@ -12,8 +12,6 @@ export const Maintainers = (columnVisibility: IColumnVisibility[], maintainers: sortMethod: (a: number[], b: number[]) => sortMethod(a, b, maintainers), Cell: (c: any) => Cell(c.value, maintainers), width: 140, - headerClassName: "d-none d-md-block", - className: "d-none d-md-block", show: columnVisibility.filter((c: IColumnVisibility) => c.column === "Maintainers")[0].visible } as Column); diff --git a/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/columns/RuleCount.tsx b/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/columns/RuleCount.tsx index 2782219bb..87da98a84 100644 --- a/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/columns/RuleCount.tsx +++ b/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/columns/RuleCount.tsx @@ -10,8 +10,6 @@ export const RuleCount = (columnVisibility: IColumnVisibility[]) => Cell: (c: any) => Cell(c.value), style: { whiteSpace: "inherit" }, width: 85, - headerClassName: "d-none d-md-block", - className: "d-none d-md-block", show: columnVisibility.filter((c: IColumnVisibility) => c.column === "Rules")[0].visible } as Column); diff --git a/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/columns/Software.tsx b/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/columns/Software.tsx index 2c8bd174c..2a7fe0209 100644 --- a/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/columns/Software.tsx +++ b/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/columns/Software.tsx @@ -12,8 +12,6 @@ export const Software = (columnVisibility: IColumnVisibility[], software: ISoftw sortable: false, Cell: (c: any) => Cell(c.value, software), width: 155, - headerClassName: "d-none d-md-block", - className: "d-none d-md-block", show: columnVisibility.filter((c: IColumnVisibility) => c.column === "Software")[0].visible } as Column); diff --git a/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/columns/Tags.tsx b/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/columns/Tags.tsx index c4ed14886..404736dcb 100644 --- a/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/columns/Tags.tsx +++ b/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/columns/Tags.tsx @@ -13,8 +13,6 @@ export const Tags = (columnVisibility: IColumnVisibility[], tags: ITag[]) => sortMethod: (a: number[], b: number[]) => sortMethod(a, b), Cell: (c: any) => Cell(c.value, tags), width: 215, - headerClassName: "d-none d-md-block", - className: "d-none d-md-block", show: columnVisibility.filter((c: IColumnVisibility) => c.column === "Tags")[0].visible } as Column); diff --git a/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/columns/UpdatedDate.tsx b/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/columns/UpdatedDate.tsx index 5d22e6fa0..32a582d15 100644 --- a/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/columns/UpdatedDate.tsx +++ b/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/columns/UpdatedDate.tsx @@ -11,8 +11,6 @@ export const UpdatedDate = (columnVisibility: IColumnVisibility[]) => Cell: (c: any) => Cell(c.value), style: { whiteSpace: "inherit" }, width: 100, - headerClassName: "d-none d-md-block", - className: "d-none d-md-block", show: columnVisibility.filter((c: IColumnVisibility) => c.column === "Updated")[0].visible } as Column);