diff --git a/bridge/github/import.go b/bridge/github/import.go index b30be73a16bb37a0bedebf34d2e29928025aba6c..e80b9cfdffaafbbb672789294b324c2e2325c701 100644 --- a/bridge/github/import.go +++ b/bridge/github/import.go @@ -161,7 +161,7 @@ func (gi *githubImporter) ensureIssue(repo *cache.RepoCache, issue issueTimeline b, _, err = repo.NewBugRaw( author, issue.CreatedAt.Unix(), - issue.Title, + issue.Title, // TODO: this is the *current* title, not the original one cleanText, nil, map[string]string{ diff --git a/webui/.eslintrc.js b/webui/.eslintrc.js index 7adbb8d549855736e12c1a4935cd83d73b916656..2dfa7543657db5d31cc4dcbae3b250f5461a2501 100644 --- a/webui/.eslintrc.js +++ b/webui/.eslintrc.js @@ -29,9 +29,13 @@ module.exports = { position: 'after', }, ], - groups: [['builtin', 'external'], 'parent', ['sibling', 'index']], + pathGroupsExcludedImportTypes: ["builtin"], + groups: [['builtin', 'external'], ['internal', 'parent'], ['sibling', 'index']], 'newlines-between': 'always', }, ], }, + settings: { + 'import/internal-regex': '^src/', + }, }; diff --git a/webui/package-lock.json b/webui/package-lock.json index 9bc9576c136098914a844fae987e922253055d32..d0c7d6f4bf5c9b4e2d9a36130037d8a116fe5614 100644 --- a/webui/package-lock.json +++ b/webui/package-lock.json @@ -14608,6 +14608,11 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.12.0.tgz", "integrity": "sha512-rPCkf/mWBtKc97aLL9/txD8DZdemK0vkA3JMLShjlJB3Pj3s+lpf1KaBzMfQrAmhMQB0n1cU/SUGgKKBCe837Q==" }, + "react-moment": { + "version": "0.9.7", + "resolved": "https://registry.npmjs.org/react-moment/-/react-moment-0.9.7.tgz", + "integrity": "sha512-ifzUrUGF6KRsUN2pRG5k56kO0mJBr8kRkWb0wNvtFIsBIxOuPxhUpL1YlXwpbQCbHq23hUu6A0VEk64HsFxk9g==" + }, "react-router": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.1.2.tgz", diff --git a/webui/package.json b/webui/package.json index cf61b883a9596aac10a7345cfc48cce71e665c51..902ed1db5ab790d062906dded97c79771394ec8b 100644 --- a/webui/package.json +++ b/webui/package.json @@ -21,6 +21,7 @@ "react": "^16.8.6", "react-apollo": "^3.1.3", "react-dom": "^16.8.6", + "react-moment": "^0.9.7", "react-router": "^5.0.0", "react-router-dom": "^5.0.0", "react-scripts": "^3.3.1", @@ -48,7 +49,8 @@ "test": "react-scripts test --env=jsdom", "eject": "react-scripts eject", "generate": "graphql-codegen", - "lint": "eslint src --ext .ts --ext .tsx --ext .js --ext .jsx --ext .graphql" + "lint": "eslint src --ext .ts --ext .tsx --ext .js --ext .jsx --ext .graphql", + "clean": "rimraf src/**.generated.* src/schema.json src/gqlTypes.* src/fragmentTypes.*" }, "proxy": "http://localhost:3001", "browserslist": [ diff --git a/webui/src/App.tsx b/webui/src/App.tsx index 6f66a6ecd6930907e2670b30e82209acf40a9386..16663870a0a4df58cb9419379aa580ac8f8ed73c 100644 --- a/webui/src/App.tsx +++ b/webui/src/App.tsx @@ -1,68 +1,17 @@ -import AppBar from '@material-ui/core/AppBar'; -import CssBaseline from '@material-ui/core/CssBaseline'; -import Toolbar from '@material-ui/core/Toolbar'; -import { - createMuiTheme, - ThemeProvider, - makeStyles, -} from '@material-ui/core/styles'; import React from 'react'; import { Route, Switch } from 'react-router'; -import { Link } from 'react-router-dom'; -import CurrentIdentity from './CurrentIdentity'; -import BugQuery from './bug/BugQuery'; -import ListQuery from './list/ListQuery'; - -const theme = createMuiTheme({ - palette: { - primary: { - main: '#263238', - }, - }, -}); - -const useStyles = makeStyles(theme => ({ - offset: { - ...theme.mixins.toolbar, - }, - filler: { - flexGrow: 1, - }, - appTitle: { - ...theme.typography.h6, - color: 'white', - textDecoration: 'none', - display: 'flex', - alignItems: 'center', - }, - logo: { - height: '42px', - marginRight: theme.spacing(2), - }, -})); +import Layout from './layout'; +import BugPage from './pages/bug'; +import ListPage from './pages/list'; export default function App() { - const classes = useStyles(); - return ( - - - - - - git-bug - git-bug - -
- -
-
-
+ - - + + - + ); } diff --git a/webui/src/Date.tsx b/webui/src/Date.tsx deleted file mode 100644 index 9380d2fcfa66f910d1886011ad308d077c2c1144..0000000000000000000000000000000000000000 --- a/webui/src/Date.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import Tooltip from '@material-ui/core/Tooltip/Tooltip'; -import moment from 'moment'; -import React from 'react'; - -type Props = { date: string }; -const Date = ({ date }: Props) => ( - - {moment(date).fromNow()} - -); - -export default Date; diff --git a/webui/src/Label.graphql b/webui/src/Label.graphql deleted file mode 100644 index 22522ada7d3539b695b9ce5ab86e87f84a518efa..0000000000000000000000000000000000000000 --- a/webui/src/Label.graphql +++ /dev/null @@ -1,8 +0,0 @@ -fragment Label on Label { - name - color { - R - G - B - } -} diff --git a/webui/src/__tests__/query.ts b/webui/src/__tests__/query.ts index 5f4b58eb85539a4dbf6ac7e7f6a9975e705c1721..2f04817c1ba1dd7e4473612b6e97234224a06724 100644 --- a/webui/src/__tests__/query.ts +++ b/webui/src/__tests__/query.ts @@ -1,4 +1,4 @@ -import { parse, stringify, quote } from '../list/Filter'; +import { parse, stringify, quote } from 'src/pages/list/Filter'; it('parses a simple query', () => { expect(parse('foo:bar')).toEqual({ diff --git a/webui/src/apollo.ts b/webui/src/apollo.ts new file mode 100644 index 0000000000000000000000000000000000000000..785f0e7f0630f949b0a20c2f43793efe38d6c7eb --- /dev/null +++ b/webui/src/apollo.ts @@ -0,0 +1,18 @@ +import ApolloClient from 'apollo-boost'; +import { + IntrospectionFragmentMatcher, + InMemoryCache, +} from 'apollo-cache-inmemory'; + +import introspectionQueryResultData from './fragmentTypes'; + +const client = new ApolloClient({ + uri: '/graphql', + cache: new InMemoryCache({ + fragmentMatcher: new IntrospectionFragmentMatcher({ + introspectionQueryResultData, + }), + }), +}); + +export default client; diff --git a/webui/src/Author.tsx b/webui/src/components/Author.tsx similarity index 92% rename from webui/src/Author.tsx rename to webui/src/components/Author.tsx index 852cd2b706162b2e37fd1df06214111771d2e5c7..9ac1da527d67ec6c32aa12ce11db8bd901d42299 100644 --- a/webui/src/Author.tsx +++ b/webui/src/components/Author.tsx @@ -1,8 +1,9 @@ +import React from 'react'; + import MAvatar from '@material-ui/core/Avatar'; import Tooltip from '@material-ui/core/Tooltip/Tooltip'; -import React from 'react'; -import { AuthoredFragment } from './Author.generated'; +import { AuthoredFragment } from './fragments.generated'; type Props = AuthoredFragment & { className?: string; diff --git a/webui/src/tag/ImageTag.tsx b/webui/src/components/Content/ImageTag.tsx similarity index 99% rename from webui/src/tag/ImageTag.tsx rename to webui/src/components/Content/ImageTag.tsx index bdb36873875708dae45f9f2bbbb385554a0127c1..70ee1bc03eca2182b87e9fdd186f7f80a7b418bf 100644 --- a/webui/src/tag/ImageTag.tsx +++ b/webui/src/components/Content/ImageTag.tsx @@ -1,6 +1,7 @@ -import { makeStyles } from '@material-ui/styles'; import React from 'react'; +import { makeStyles } from '@material-ui/styles'; + const useStyles = makeStyles({ tag: { maxWidth: '100%', diff --git a/webui/src/tag/PreTag.tsx b/webui/src/components/Content/PreTag.tsx similarity index 99% rename from webui/src/tag/PreTag.tsx rename to webui/src/components/Content/PreTag.tsx index d3b4c27339aa4dc0f38bb44b7fb3a499cc7aa600..5256ab12ec8abacd56dded3153569d5136f6dac0 100644 --- a/webui/src/tag/PreTag.tsx +++ b/webui/src/components/Content/PreTag.tsx @@ -1,6 +1,7 @@ -import { makeStyles } from '@material-ui/styles'; import React from 'react'; +import { makeStyles } from '@material-ui/styles'; + const useStyles = makeStyles({ tag: { maxWidth: '100%', diff --git a/webui/src/Content.tsx b/webui/src/components/Content/index.tsx similarity index 88% rename from webui/src/Content.tsx rename to webui/src/components/Content/index.tsx index 3a7af2f8689e911f7a4784b30929ca24a8f4b7c4..56e52e1efcfc530815e6cf80987ca3ddb47b82d2 100644 --- a/webui/src/Content.tsx +++ b/webui/src/components/Content/index.tsx @@ -4,8 +4,8 @@ import parse from 'remark-parse'; import remark2react from 'remark-react'; import unified from 'unified'; -import ImageTag from './tag/ImageTag'; -import PreTag from './tag/PreTag'; +import ImageTag from './ImageTag'; +import PreTag from './PreTag'; type Props = { markdown: string }; const Content: React.FC = ({ markdown }: Props) => { diff --git a/webui/src/components/Date.tsx b/webui/src/components/Date.tsx new file mode 100644 index 0000000000000000000000000000000000000000..146a349670c3dca884409c804dc49a1adb8b5cde --- /dev/null +++ b/webui/src/components/Date.tsx @@ -0,0 +1,20 @@ +import moment from 'moment'; +import React from 'react'; +import Moment from 'react-moment'; + +import Tooltip from '@material-ui/core/Tooltip/Tooltip'; + +const HOUR = 1000 * 3600; +const DAY = 24 * HOUR; +const WEEK = 7 * DAY; + +type Props = { date: string }; +const Date = ({ date }: Props) => ( + + + on + + +); + +export default Date; diff --git a/webui/src/Label.tsx b/webui/src/components/Label.tsx similarity index 93% rename from webui/src/Label.tsx rename to webui/src/components/Label.tsx index a33b4c2c38710e46963d3958c950f1bd49af14af..1fb8caeaf19584877ed8e5993fd5b69e2a466134 100644 --- a/webui/src/Label.tsx +++ b/webui/src/components/Label.tsx @@ -1,13 +1,15 @@ +import React from 'react'; + import { common } from '@material-ui/core/colors'; import { makeStyles } from '@material-ui/core/styles'; import { getContrastRatio, darken, } from '@material-ui/core/styles/colorManipulator'; -import React from 'react'; -import { LabelFragment } from './Label.generated'; -import { Color } from './gqlTypes'; +import { Color } from 'src/gqlTypes'; + +import { LabelFragment } from './fragments.generated'; // Minimum contrast between the background and the text color const contrastThreshold = 2.5; diff --git a/webui/src/Author.graphql b/webui/src/components/fragments.graphql similarity index 51% rename from webui/src/Author.graphql rename to webui/src/components/fragments.graphql index 76d66b91368e8c59d6c59f060f16e6ca326510f0..03a235f9b144ac1db78570fd6e5e30b820427046 100644 --- a/webui/src/Author.graphql +++ b/webui/src/components/fragments.graphql @@ -1,3 +1,14 @@ +# Label.tsx +fragment Label on Label { + name + color { + R + G + B + } +} + +# Author.tsx fragment authored on Authored { author { name diff --git a/webui/src/index.tsx b/webui/src/index.tsx index c64daf0c755b576ac7d43e93e93a64afaa42a364..9bdaddcaeceec8d9e8720881907f6d19f1c8fa4a 100644 --- a/webui/src/index.tsx +++ b/webui/src/index.tsx @@ -1,36 +1,19 @@ -import { createMuiTheme } from '@material-ui/core/styles'; -import ThemeProvider from '@material-ui/styles/ThemeProvider'; -import ApolloClient from 'apollo-boost'; -import { - IntrospectionFragmentMatcher, - InMemoryCache, -} from 'apollo-cache-inmemory'; import React from 'react'; import { ApolloProvider } from 'react-apollo'; import ReactDOM from 'react-dom'; import { BrowserRouter } from 'react-router-dom'; -import App from './App'; -import introspectionQueryResultData from './fragmentTypes'; - -const theme = createMuiTheme(); +import ThemeProvider from '@material-ui/styles/ThemeProvider'; -const client = new ApolloClient({ - uri: '/graphql', - cache: new InMemoryCache({ - fragmentMatcher: new IntrospectionFragmentMatcher({ - introspectionQueryResultData, - }), - }), -}); +import App from './App'; +import apolloClient from './apollo'; +import theme from './theme'; ReactDOM.render( - + - - - + , diff --git a/webui/src/CurrentIdentity.graphql b/webui/src/layout/CurrentIdentity.graphql similarity index 100% rename from webui/src/CurrentIdentity.graphql rename to webui/src/layout/CurrentIdentity.graphql diff --git a/webui/src/CurrentIdentity.tsx b/webui/src/layout/CurrentIdentity.tsx similarity index 99% rename from webui/src/CurrentIdentity.tsx rename to webui/src/layout/CurrentIdentity.tsx index 256f44c476214f120fd2ffc7e80522670119d35d..21f489ef73289010650bac69e1c99bbfce9e2c87 100644 --- a/webui/src/CurrentIdentity.tsx +++ b/webui/src/layout/CurrentIdentity.tsx @@ -1,6 +1,7 @@ +import React from 'react'; + import Avatar from '@material-ui/core/Avatar'; import { makeStyles } from '@material-ui/core/styles'; -import React from 'react'; import { useCurrentIdentityQuery } from './CurrentIdentity.generated'; diff --git a/webui/src/layout/Header.tsx b/webui/src/layout/Header.tsx new file mode 100644 index 0000000000000000000000000000000000000000..317d3e234cf27391fc1066b9572764ffae19c5ab --- /dev/null +++ b/webui/src/layout/Header.tsx @@ -0,0 +1,50 @@ +import React from 'react'; +import { Link } from 'react-router-dom'; + +import AppBar from '@material-ui/core/AppBar'; +import Toolbar from '@material-ui/core/Toolbar'; +import { makeStyles } from '@material-ui/core/styles'; + +import CurrentIdentity from './CurrentIdentity'; + +const useStyles = makeStyles(theme => ({ + offset: { + ...theme.mixins.toolbar, + }, + filler: { + flexGrow: 1, + }, + appTitle: { + ...theme.typography.h6, + color: 'white', + textDecoration: 'none', + display: 'flex', + alignItems: 'center', + }, + logo: { + height: '42px', + marginRight: theme.spacing(2), + }, +})); + +function Header() { + const classes = useStyles(); + + return ( + <> + + + + git-bug + git-bug + +
+ +
+
+
+ + ); +} + +export default Header; diff --git a/webui/src/layout/index.tsx b/webui/src/layout/index.tsx new file mode 100644 index 0000000000000000000000000000000000000000..42a0cfc1bc494d7bc08959cdfe659bc76a1c8423 --- /dev/null +++ b/webui/src/layout/index.tsx @@ -0,0 +1,18 @@ +import React from 'react'; + +import CssBaseline from '@material-ui/core/CssBaseline'; + +import Header from './Header'; + +type Props = { children: React.ReactNode }; +function Layout({ children }: Props) { + return ( + <> + +
+ {children} + + ); +} + +export default Layout; diff --git a/webui/src/bug/Bug.graphql b/webui/src/pages/bug/Bug.graphql similarity index 66% rename from webui/src/bug/Bug.graphql rename to webui/src/pages/bug/Bug.graphql index 112024aa95ab1cc7dabd17220926cd4ead7a9a17..498242c0a149b407b232f1dca43979febcf2bb34 100644 --- a/webui/src/bug/Bug.graphql +++ b/webui/src/pages/bug/Bug.graphql @@ -1,5 +1,4 @@ -#import "../Label.graphql" -#import "../Author.graphql" +#import "../components/fragments.graphql" fragment Bug on Bug { id diff --git a/webui/src/bug/Bug.tsx b/webui/src/pages/bug/Bug.tsx similarity index 76% rename from webui/src/bug/Bug.tsx rename to webui/src/pages/bug/Bug.tsx index f4029a5fd1d8aa09f05340bb2f822ab4484a6873..3c4bb63b3ccd8441cb03b6bc7ce501eabd1b3c08 100644 --- a/webui/src/bug/Bug.tsx +++ b/webui/src/pages/bug/Bug.tsx @@ -1,17 +1,19 @@ +import React from 'react'; + import Typography from '@material-ui/core/Typography/Typography'; import { makeStyles } from '@material-ui/core/styles'; -import React from 'react'; -import Author from '../Author'; -import Date from '../Date'; -import Label from '../Label'; +import Author from 'src/components/Author'; +import Date from 'src/components/Date'; +import Label from 'src/components/Label'; import { BugFragment } from './Bug.generated'; +import CommentForm from './CommentForm'; import TimelineQuery from './TimelineQuery'; const useStyles = makeStyles(theme => ({ main: { - maxWidth: 800, + maxWidth: 1000, margin: 'auto', marginTop: theme.spacing(4), }, @@ -39,6 +41,9 @@ const useStyles = makeStyles(theme => ({ marginTop: theme.spacing(2), flex: '0 0 200px', }, + sidebarTitle: { + fontWeight: 'bold', + }, labelList: { listStyle: 'none', padding: 0, @@ -51,6 +56,12 @@ const useStyles = makeStyles(theme => ({ display: 'block', }, }, + noLabel: { + ...theme.typography.body2, + }, + commentForm: { + marginLeft: 48, + }, })); type Props = { @@ -75,10 +86,16 @@ function Bug({ bug }: Props) {
+
+ +
- Labels + Labels
    + {bug.labels.length === 0 && ( + None yet + )} {bug.labels.map(l => (
- {bug.humanId} opened + {bug.humanId} opened  - by {bug.author.displayName} +  by {bug.author.displayName}
diff --git a/webui/src/list/Filter.tsx b/webui/src/pages/list/Filter.tsx similarity index 98% rename from webui/src/list/Filter.tsx rename to webui/src/pages/list/Filter.tsx index 30b52de83e811b6e95dd19c4992d9c4426e26093..0635e7f053b427dcd618071e600259d4fe440837 100644 --- a/webui/src/list/Filter.tsx +++ b/webui/src/pages/list/Filter.tsx @@ -1,12 +1,13 @@ +import clsx from 'clsx'; +import { LocationDescriptor } from 'history'; +import React, { useState, useRef } from 'react'; +import { Link } from 'react-router-dom'; + import Menu from '@material-ui/core/Menu'; import MenuItem from '@material-ui/core/MenuItem'; import { SvgIconProps } from '@material-ui/core/SvgIcon'; import { makeStyles } from '@material-ui/core/styles'; import ArrowDropDown from '@material-ui/icons/ArrowDropDown'; -import clsx from 'clsx'; -import { LocationDescriptor } from 'history'; -import React, { useState, useRef } from 'react'; -import { Link } from 'react-router-dom'; export type Query = { [key: string]: Array }; @@ -153,7 +154,7 @@ function FilterDropdown({ export type FilterProps = { active: boolean; - to: LocationDescriptor; + to: LocationDescriptor; // the target on click icon?: React.ComponentType; children: React.ReactNode; }; diff --git a/webui/src/list/FilterToolbar.graphql b/webui/src/pages/list/FilterToolbar.graphql similarity index 100% rename from webui/src/list/FilterToolbar.graphql rename to webui/src/pages/list/FilterToolbar.graphql diff --git a/webui/src/list/FilterToolbar.tsx b/webui/src/pages/list/FilterToolbar.tsx similarity index 89% rename from webui/src/list/FilterToolbar.tsx rename to webui/src/pages/list/FilterToolbar.tsx index b95b10bc6e16b1dec8e81dbb073ed70dec70590c..c568a9dd31d7a388c13c06fda2c16b051d727d38 100644 --- a/webui/src/list/FilterToolbar.tsx +++ b/webui/src/pages/list/FilterToolbar.tsx @@ -1,10 +1,11 @@ import { pipe } from '@arrows/composition'; +import { LocationDescriptor } from 'history'; +import React from 'react'; + import Toolbar from '@material-ui/core/Toolbar'; import { makeStyles } from '@material-ui/core/styles'; import CheckCircleOutline from '@material-ui/icons/CheckCircleOutline'; import ErrorOutline from '@material-ui/icons/ErrorOutline'; -import { LocationDescriptor } from 'history'; -import React from 'react'; import { FilterDropdown, @@ -31,7 +32,7 @@ const useStyles = makeStyles(theme => ({ // This prepends the filter text with a count type CountingFilterProps = { - query: string; + query: string; // the query used as a source to count the number of element children: React.ReactNode; } & FilterProps; function CountingFilter({ query, children, ...props }: CountingFilterProps) { @@ -71,6 +72,12 @@ function FilterToolbar({ query, queryLocation }: Props) { ...params, [key]: [value], }); + const toggleParam = (key: string, value: string) => ( + params: Query + ): Query => ({ + ...params, + [key]: params[key] && params[key].includes(value) ? [] : [value], + }); const clearParam = (key: string) => (params: Query): Query => ({ ...params, [key]: [], @@ -86,7 +93,7 @@ function FilterToolbar({ query, queryLocation }: Props) { clearParam('sort'), stringify )(params)} - to={pipe(replaceParam('status', 'open'), loc)(params)} + to={pipe(toggleParam('status', 'open'), loc)(params)} icon={ErrorOutline} > open @@ -98,7 +105,7 @@ function FilterToolbar({ query, queryLocation }: Props) { clearParam('sort'), stringify )(params)} - to={pipe(replaceParam('status', 'closed'), loc)(params)} + to={pipe(toggleParam('status', 'closed'), loc)(params)} icon={CheckCircleOutline} > closed diff --git a/webui/src/list/List.tsx b/webui/src/pages/list/List.tsx similarity index 99% rename from webui/src/list/List.tsx rename to webui/src/pages/list/List.tsx index cebd13f288a7bc619588d249a8f604c8ce0eb454..c1cae1221ac8b5c6722003e626d2900fafe85c98 100644 --- a/webui/src/list/List.tsx +++ b/webui/src/pages/list/List.tsx @@ -1,6 +1,7 @@ +import React from 'react'; + import Table from '@material-ui/core/Table/Table'; import TableBody from '@material-ui/core/TableBody/TableBody'; -import React from 'react'; import BugRow from './BugRow'; import { BugListFragment } from './ListQuery.generated'; diff --git a/webui/src/list/ListQuery.graphql b/webui/src/pages/list/ListQuery.graphql similarity index 100% rename from webui/src/list/ListQuery.graphql rename to webui/src/pages/list/ListQuery.graphql diff --git a/webui/src/list/ListQuery.tsx b/webui/src/pages/list/ListQuery.tsx similarity index 99% rename from webui/src/list/ListQuery.tsx rename to webui/src/pages/list/ListQuery.tsx index 84b724317a66646abc052a55c94be243bc45a7ea..2d8c698a59a9ca34719f6246b371b199761bc707 100644 --- a/webui/src/list/ListQuery.tsx +++ b/webui/src/pages/list/ListQuery.tsx @@ -1,3 +1,7 @@ +import { ApolloError } from 'apollo-boost'; +import React, { useState, useEffect, useRef } from 'react'; +import { useLocation, useHistory, Link } from 'react-router-dom'; + import IconButton from '@material-ui/core/IconButton'; import InputBase from '@material-ui/core/InputBase'; import Paper from '@material-ui/core/Paper'; @@ -6,9 +10,6 @@ import ErrorOutline from '@material-ui/icons/ErrorOutline'; import KeyboardArrowLeft from '@material-ui/icons/KeyboardArrowLeft'; import KeyboardArrowRight from '@material-ui/icons/KeyboardArrowRight'; import Skeleton from '@material-ui/lab/Skeleton'; -import { ApolloError } from 'apollo-boost'; -import React, { useState, useEffect, useRef } from 'react'; -import { useLocation, useHistory, Link } from 'react-router-dom'; import FilterToolbar from './FilterToolbar'; import List from './List'; @@ -163,7 +164,7 @@ function ListQuery() { const location = useLocation(); const history = useHistory(); const params = new URLSearchParams(location.search); - const query = params.get('q') || ''; + const query = params.has('q') ? params.get('q') || '' : 'status:open'; const [input, setInput] = useState(query); diff --git a/webui/src/pages/list/index.ts b/webui/src/pages/list/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..8a91ce70c6fd4c1548dac249e96943ba45b00230 --- /dev/null +++ b/webui/src/pages/list/index.ts @@ -0,0 +1 @@ +export { default } from './ListQuery'; diff --git a/webui/src/theme.ts b/webui/src/theme.ts new file mode 100644 index 0000000000000000000000000000000000000000..d41cd731d7e4de4f89536a335e182bebbe52c70e --- /dev/null +++ b/webui/src/theme.ts @@ -0,0 +1,11 @@ +import { createMuiTheme } from '@material-ui/core/styles'; + +const theme = createMuiTheme({ + palette: { + primary: { + main: '#263238', + }, + }, +}); + +export default theme; diff --git a/webui/tsconfig.json b/webui/tsconfig.json index 30ba544ba3d13853bfa0729b345acfa5b6b09d89..4e83eef30419aa46ec2625d7137a831298b387aa 100644 --- a/webui/tsconfig.json +++ b/webui/tsconfig.json @@ -1,7 +1,11 @@ { "compilerOptions": { "target": "es5", - "lib": ["dom", "dom.iterable", "esnext"], + "lib": [ + "dom", + "dom.iterable", + "esnext" + ], "allowJs": true, "skipLibCheck": true, "esModuleInterop": true, @@ -14,7 +18,13 @@ "isolatedModules": true, "noEmit": true, "jsx": "react", - "typeRoots": ["node_modules/@types/", "types/"] + "typeRoots": [ + "node_modules/@types/", + "types/" + ], + "baseUrl": "." }, - "include": ["src"] + "include": [ + "src" + ] }