diff --git a/web/config-overrides.js b/web/config-overrides.js index d43116387..b2a41e367 100644 --- a/web/config-overrides.js +++ b/web/config-overrides.js @@ -4,6 +4,6 @@ module.exports = override( fixBabelImports("import", { libraryName: "antd", libraryDirectory: "es", - style: "css" + style: "css", }) ); diff --git a/web/public/manifest.json b/web/public/manifest.json index 143de534b..452af93c5 100644 --- a/web/public/manifest.json +++ b/web/public/manifest.json @@ -12,4 +12,4 @@ "display": "standalone", "theme_color": "#000000", "background_color": "#ffffff" -} \ No newline at end of file +} diff --git a/web/src/App.tsx b/web/src/App.tsx index 6d36cc739..63e026449 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -3,7 +3,7 @@ import { DollarOutlined, GithubOutlined, TeamOutlined, - TwitterOutlined + TwitterOutlined, } from "@ant-design/icons"; import { Layout, Menu, Tag } from "antd"; import React from "react"; @@ -12,7 +12,7 @@ import { Link, Route, RouteComponentProps, - Switch + Switch, } from "react-router-dom"; import { ListsTable } from "./components"; @@ -33,7 +33,7 @@ export const App: React.FC = () => ( paddingLeft: 12, paddingTop: 12, paddingRight: 12, - minHeight: 280 + minHeight: 280, }} > @@ -47,7 +47,7 @@ export const App: React.FC = () => ( textAlign: "center", padding: "6px 50px", background: "#fff", - lineHeight: "28px" + lineHeight: "28px", }} > diff --git a/web/src/components/listInfoDrawer/ListInfoDrawer.tsx b/web/src/components/listInfoDrawer/ListInfoDrawer.tsx index 4ac25497d..9a80c9b4b 100644 --- a/web/src/components/listInfoDrawer/ListInfoDrawer.tsx +++ b/web/src/components/listInfoDrawer/ListInfoDrawer.tsx @@ -10,7 +10,7 @@ import { MailOutlined, MessageOutlined, SearchOutlined, - TeamOutlined + TeamOutlined, } from "@ant-design/icons"; import React, { useEffect, useState } from "react"; diff --git a/web/src/components/listsTable/ListDrawer.tsx b/web/src/components/listsTable/ListDrawer.tsx index 2903030c7..7c23b7074 100644 --- a/web/src/components/listsTable/ListDrawer.tsx +++ b/web/src/components/listsTable/ListDrawer.tsx @@ -3,7 +3,7 @@ import { Redirect, Route, RouteComponentProps, - StaticContext + StaticContext, } from "react-router"; import { Language } from "../../interfaces/Language"; @@ -27,7 +27,7 @@ interface Props { export const ListDrawer = (props: Props) => { const renderDrawer = (rp: RouteComponentProps) => { - const list = props.lists.find(l => l.slug === rp.match.params.listSlug); + const list = props.lists.find((l) => l.slug === rp.match.params.listSlug); return list ? ( { } syntax={ list.syntaxId - ? props.syntaxes.find(s => s.id === list.syntaxId) + ? props.syntaxes.find((s) => s.id === list.syntaxId) : undefined } tags={ diff --git a/web/src/components/listsTable/ListsTable.tsx b/web/src/components/listsTable/ListsTable.tsx index 1689eac99..c7ddd2970 100644 --- a/web/src/components/listsTable/ListsTable.tsx +++ b/web/src/components/listsTable/ListsTable.tsx @@ -3,7 +3,7 @@ import "./listsTable.css"; import { Key, SorterResult, - TableCurrentDataSource + TableCurrentDataSource, } from "antd/lib/table/interface"; import React, { useEffect, useState } from "react"; import { SoftwareCloud, SoftwareIcon } from "../softwareCloud"; @@ -63,19 +63,19 @@ export const ListsTable = (props: RouteComponentProps & Props) => { return ( dataSource={lists} - rowKey={record => record.id.toString()} + rowKey={(record) => record.id.toString()} loading={lists.length ? false : true} size="small" pagination={{ simple: true, style: { float: "left", margin: "4px 4px" }, - pageSize: tablePageSize.pageSize + pageSize: tablePageSize.pageSize, }} scroll={{ x: tablePageSize.isNarrowWindow || tablePageSize.isWideWindow ? undefined - : 1892 + : 1892, }} onChange={( _pagination: PaginationConfig, @@ -143,12 +143,12 @@ export const ListsTable = (props: RouteComponentProps & Props) => { (s: Software) => s.syntaxIds && s.syntaxIds.includes(l.syntaxId) ) - .map(s => s.id); + .map((s) => s.id); return arraySorter(getSoftwareIds(a), getSoftwareIds(b), software); }} width={170} className={styles.nogrow} - filters={software.map(s => ({ + filters={software.map((s) => ({ text: ( <> @@ -156,18 +156,18 @@ export const ListsTable = (props: RouteComponentProps & Props) => { {s.name}  ( { visibleLists.filter( - l => s.syntaxIds && s.syntaxIds.includes(l.syntaxId) + (l) => s.syntaxIds && s.syntaxIds.includes(l.syntaxId) ).length } ) ), - value: s.name + value: s.name, }))} onFilter={(value, record) => software .filter((s: Software) => s.name === value) - .flatMap(s => s.syntaxIds) + .flatMap((s) => s.syntaxIds) .includes(record.syntaxId) } render={(syntaxId: number) => @@ -187,8 +187,8 @@ export const ListsTable = (props: RouteComponentProps & Props) => { key="Syntax" dataIndex={nameof("syntaxId")} sorter={(a, b) => { - const syntaxA = syntaxes.find(s => s.id === a.syntaxId); - const syntaxB = syntaxes.find(s => s.id === b.syntaxId); + const syntaxA = syntaxes.find((s) => s.id === a.syntaxId); + const syntaxB = syntaxes.find((s) => s.id === b.syntaxId); return syntaxA ? syntaxB ? syntaxA.name.localeCompare(syntaxB.name) @@ -197,24 +197,24 @@ export const ListsTable = (props: RouteComponentProps & Props) => { }} width={254} className={styles.nogrow} - filters={syntaxes.map(s => ({ + filters={syntaxes.map((s) => ({ text: ( <> ( { - visibleLists.filter(l => l.syntaxId && l.syntaxId === s.id) + visibleLists.filter((l) => l.syntaxId && l.syntaxId === s.id) .length } ) ), - value: s.id.toString() + value: s.id.toString(), }))} onFilter={(value, record) => record.syntaxId ? record.syntaxId.toString() === value : false } render={(syntaxId: number) => { - const syntax = syntaxes.find(s => s.id === syntaxId); + const syntax = syntaxes.find((s) => s.id === syntaxId); return syntax ? ( { } width={129} className={styles.nogrow} - filters={languages.map(l => ({ + filters={languages.map((l) => ({ text: ( <> {l.iso6391}  {l.name}  ( { visibleLists.filter( - li => li.languageIds && li.languageIds.includes(l.id) + (li) => li.languageIds && li.languageIds.includes(l.id) ).length } ) ), - value: l.id.toString() + value: l.id.toString(), }))} onFilter={(value, record) => record.languageIds ? record.languageIds.includes(+value) : false @@ -271,18 +271,19 @@ export const ListsTable = (props: RouteComponentProps & Props) => { sorter={(a, b) => arraySorter(a.tagIds, b.tagIds, tags)} width={275} className={styles.nogrow} - filters={tags.map(t => ({ + filters={tags.map((t) => ({ text: ( <> {t.name}( { - visibleLists.filter(l => l.tagIds && l.tagIds.includes(t.id)) - .length + visibleLists.filter( + (l) => l.tagIds && l.tagIds.includes(t.id) + ).length } ) ), - value: t.id.toString() + value: t.id.toString(), }))} onFilter={(value, record) => record.tagIds ? record.tagIds.includes(+value) : false @@ -306,19 +307,19 @@ export const ListsTable = (props: RouteComponentProps & Props) => { } width={191} className={styles.nogrow} - filters={maintainers.map(t => ({ + filters={maintainers.map((t) => ({ text: ( <> {t.name}( { visibleLists.filter( - l => l.maintainerIds && l.maintainerIds.includes(t.id) + (l) => l.maintainerIds && l.maintainerIds.includes(t.id) ).length } ) ), - value: t.id.toString() + value: t.id.toString(), }))} onFilter={(value, record) => record.maintainerIds ? record.maintainerIds.includes(+value) : false @@ -340,8 +341,8 @@ export const ListsTable = (props: RouteComponentProps & Props) => { key="License" dataIndex={nameof("licenseId")} sorter={(a, b) => { - const licenseA = licenses.find(s => s.id === a.licenseId); - const licenseB = licenses.find(s => s.id === b.licenseId); + const licenseA = licenses.find((s) => s.id === a.licenseId); + const licenseB = licenses.find((s) => s.id === b.licenseId); return licenseA ? licenseB ? licenseA.name.localeCompare(licenseB.name) @@ -350,25 +351,25 @@ export const ListsTable = (props: RouteComponentProps & Props) => { }} width={215} className={styles.nogrow} - filters={licenses.map(l => ({ + filters={licenses.map((l) => ({ text: ( <> ( { visibleLists.filter( - li => li.licenseId && li.licenseId === l.id + (li) => li.licenseId && li.licenseId === l.id ).length } ) ), - value: l.id.toString() + value: l.id.toString(), }))} onFilter={(value, record) => record.licenseId ? record.licenseId.toString() === value : false } render={(licenseId: number) => { - const license = licenses.find(l => l.id === licenseId); + const license = licenses.find((l) => l.id === licenseId); return license ? ( (url: string) => { const [data, setData] = useState(); useEffect(() => { const fetchData = async () => - (await fetch(url)).json().then(r => setData(r)); + (await fetch(url)).json().then((r) => setData(r)); fetchData(); }, [url]); return data; diff --git a/web/src/hooks/useLanguages.tsx b/web/src/hooks/useLanguages.tsx index f24b042f6..ece2dd0eb 100644 --- a/web/src/hooks/useLanguages.tsx +++ b/web/src/hooks/useLanguages.tsx @@ -2,6 +2,6 @@ import { Language } from "../interfaces/Language"; import { useApiData } from "./useApiData"; export const useLanguages = () => - (useApiData("/api/v1/languages") || []).sort( - (a: Language, b: Language) => a.name.localeCompare(b.name) - ); + ( + useApiData("/api/v1/languages") || [] + ).sort((a: Language, b: Language) => a.name.localeCompare(b.name)); diff --git a/web/src/hooks/useLicenses.tsx b/web/src/hooks/useLicenses.tsx index 94ae7c968..ccaeb9092 100644 --- a/web/src/hooks/useLicenses.tsx +++ b/web/src/hooks/useLicenses.tsx @@ -2,6 +2,6 @@ import { License } from "../interfaces/License"; import { useApiData } from "./useApiData"; export const useLicenses = () => - (useApiData("/api/v1/licenses") || []).sort( - (a: License, b: License) => a.name.localeCompare(b.name) - ); + ( + useApiData("/api/v1/licenses") || [] + ).sort((a: License, b: License) => a.name.localeCompare(b.name)); diff --git a/web/src/hooks/useLists.tsx b/web/src/hooks/useLists.tsx index 265ede5d9..bdaa0f5b7 100644 --- a/web/src/hooks/useLists.tsx +++ b/web/src/hooks/useLists.tsx @@ -6,6 +6,6 @@ import { useApiData } from "./useApiData"; export const useLists = () => { const lists = useApiData("/api/v1/lists"); - lists && lists.forEach(l => (l.slug = slugify(l.name, SlugifyOptions))); + lists && lists.forEach((l) => (l.slug = slugify(l.name, SlugifyOptions))); return (lists || []).sort((a: List, b: List) => a.name.localeCompare(b.name)); }; diff --git a/web/src/hooks/useMaintainers.tsx b/web/src/hooks/useMaintainers.tsx index 4acd1c445..66964df97 100644 --- a/web/src/hooks/useMaintainers.tsx +++ b/web/src/hooks/useMaintainers.tsx @@ -2,6 +2,6 @@ import { Maintainer } from "../interfaces/Maintainer"; import { useApiData } from "./useApiData"; export const useMaintainers = () => - (useApiData("/api/v1/maintainers") || []).sort( - (a: Maintainer, b: Maintainer) => a.name.localeCompare(b.name) - ); + ( + useApiData("/api/v1/maintainers") || [] + ).sort((a: Maintainer, b: Maintainer) => a.name.localeCompare(b.name)); diff --git a/web/src/hooks/useSearchColumnFilter.tsx b/web/src/hooks/useSearchColumnFilter.tsx index 2814ceb80..41872bd8b 100644 --- a/web/src/hooks/useSearchColumnFilter.tsx +++ b/web/src/hooks/useSearchColumnFilter.tsx @@ -15,7 +15,7 @@ export const useSearchColumnFilter = (dataIndex: string) => { const [filterProps, setFilterProps] = useState>({ filterDropdown: undefined, filterIcon: undefined, - onFilter: undefined + onFilter: undefined, }); useEffect(() => { const handleSearch = (confirm?: () => void) => { @@ -29,14 +29,15 @@ export const useSearchColumnFilter = (dataIndex: string) => { setSelectedKeys, selectedKeys, confirm, - clearFilters + clearFilters, }) => (
+ onChange={(e) => setSelectedKeys && setSelectedKeys(e.target.value ? [e.target.value] : []) } @@ -61,7 +62,7 @@ export const useSearchColumnFilter = (dataIndex: string) => {
), - filterIcon: filtered => ( + filterIcon: (filtered) => ( ), onFilter: (value, record) => { @@ -73,7 +74,7 @@ export const useSearchColumnFilter = (dataIndex: string) => { .toLowerCase() .includes(value.toString().toLowerCase()) ); - } + }, }); }, [dataIndex]); return filterProps; diff --git a/web/src/hooks/useSoftware.tsx b/web/src/hooks/useSoftware.tsx index 4f20e12bf..2f33c0c3f 100644 --- a/web/src/hooks/useSoftware.tsx +++ b/web/src/hooks/useSoftware.tsx @@ -2,6 +2,6 @@ import { Software } from "../interfaces/Software"; import { useApiData } from "./useApiData"; export const useSoftware = () => - (useApiData("/api/v1/software") || []).sort( - (a: Software, b: Software) => a.name.localeCompare(b.name) - ); + ( + useApiData("/api/v1/software") || [] + ).sort((a: Software, b: Software) => a.name.localeCompare(b.name)); diff --git a/web/src/hooks/useSyntaxes.tsx b/web/src/hooks/useSyntaxes.tsx index a3ae4a2db..cf217ce06 100644 --- a/web/src/hooks/useSyntaxes.tsx +++ b/web/src/hooks/useSyntaxes.tsx @@ -2,6 +2,6 @@ import { Syntax } from "../interfaces/Syntax"; import { useApiData } from "./useApiData"; export const useSyntaxes = () => - (useApiData("/api/v1/syntaxes") || []).sort( - (a: Syntax, b: Syntax) => a.name.localeCompare(b.name) - ); + ( + useApiData("/api/v1/syntaxes") || [] + ).sort((a: Syntax, b: Syntax) => a.name.localeCompare(b.name)); diff --git a/web/src/hooks/useTablePageSizer.tsx b/web/src/hooks/useTablePageSizer.tsx index 6e1c6e95c..eee29d7d5 100644 --- a/web/src/hooks/useTablePageSizer.tsx +++ b/web/src/hooks/useTablePageSizer.tsx @@ -19,5 +19,5 @@ export const useTablePageSizer = () => { const calculateSize = () => ({ pageSize: Math.floor((window.innerHeight - 184) / 57), isNarrowWindow: window.innerWidth < 576 ? true : false, - isWideWindow: window.innerWidth > 1918 ? true : false + isWideWindow: window.innerWidth > 1918 ? true : false, });