chore: Move to prettier standard double quotes (#1309)
This commit is contained in:
@@ -1,39 +1,39 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import keydown from 'react-keydown';
|
||||
import { Waypoint } from 'react-waypoint';
|
||||
import { withRouter, Link } from 'react-router-dom';
|
||||
import type { Location, RouterHistory } from 'react-router-dom';
|
||||
import { PlusIcon } from 'outline-icons';
|
||||
import { observable, action } from 'mobx';
|
||||
import { observer, inject } from 'mobx-react';
|
||||
import { debounce } from 'lodash';
|
||||
import queryString from 'query-string';
|
||||
import styled from 'styled-components';
|
||||
import ArrowKeyNavigation from 'boundless-arrow-key-navigation';
|
||||
import * as React from "react";
|
||||
import ReactDOM from "react-dom";
|
||||
import keydown from "react-keydown";
|
||||
import { Waypoint } from "react-waypoint";
|
||||
import { withRouter, Link } from "react-router-dom";
|
||||
import type { Location, RouterHistory } from "react-router-dom";
|
||||
import { PlusIcon } from "outline-icons";
|
||||
import { observable, action } from "mobx";
|
||||
import { observer, inject } from "mobx-react";
|
||||
import { debounce } from "lodash";
|
||||
import queryString from "query-string";
|
||||
import styled from "styled-components";
|
||||
import ArrowKeyNavigation from "boundless-arrow-key-navigation";
|
||||
|
||||
import { DEFAULT_PAGINATION_LIMIT } from 'stores/BaseStore';
|
||||
import DocumentsStore from 'stores/DocumentsStore';
|
||||
import UsersStore from 'stores/UsersStore';
|
||||
import { newDocumentUrl, searchUrl } from 'utils/routeHelpers';
|
||||
import { meta } from 'utils/keyboard';
|
||||
import { DEFAULT_PAGINATION_LIMIT } from "stores/BaseStore";
|
||||
import DocumentsStore from "stores/DocumentsStore";
|
||||
import UsersStore from "stores/UsersStore";
|
||||
import { newDocumentUrl, searchUrl } from "utils/routeHelpers";
|
||||
import { meta } from "utils/keyboard";
|
||||
|
||||
import Flex from 'shared/components/Flex';
|
||||
import Button from 'components/Button';
|
||||
import Empty from 'components/Empty';
|
||||
import Fade from 'components/Fade';
|
||||
import HelpText from 'components/HelpText';
|
||||
import CenteredContent from 'components/CenteredContent';
|
||||
import LoadingIndicator from 'components/LoadingIndicator';
|
||||
import DocumentPreview from 'components/DocumentPreview';
|
||||
import NewDocumentMenu from 'menus/NewDocumentMenu';
|
||||
import PageTitle from 'components/PageTitle';
|
||||
import SearchField from './components/SearchField';
|
||||
import StatusFilter from './components/StatusFilter';
|
||||
import CollectionFilter from './components/CollectionFilter';
|
||||
import UserFilter from './components/UserFilter';
|
||||
import DateFilter from './components/DateFilter';
|
||||
import Flex from "shared/components/Flex";
|
||||
import Button from "components/Button";
|
||||
import Empty from "components/Empty";
|
||||
import Fade from "components/Fade";
|
||||
import HelpText from "components/HelpText";
|
||||
import CenteredContent from "components/CenteredContent";
|
||||
import LoadingIndicator from "components/LoadingIndicator";
|
||||
import DocumentPreview from "components/DocumentPreview";
|
||||
import NewDocumentMenu from "menus/NewDocumentMenu";
|
||||
import PageTitle from "components/PageTitle";
|
||||
import SearchField from "./components/SearchField";
|
||||
import StatusFilter from "./components/StatusFilter";
|
||||
import CollectionFilter from "./components/CollectionFilter";
|
||||
import UserFilter from "./components/UserFilter";
|
||||
import DateFilter from "./components/DateFilter";
|
||||
|
||||
type Props = {
|
||||
history: RouterHistory,
|
||||
@@ -49,7 +49,7 @@ class Search extends React.Component<Props> {
|
||||
firstDocument: ?DocumentPreview;
|
||||
|
||||
@observable
|
||||
query: string = decodeURIComponent(this.props.match.params.term || '');
|
||||
query: string = decodeURIComponent(this.props.match.params.term || "");
|
||||
@observable params: URLSearchParams = new URLSearchParams();
|
||||
@observable offset: number = 0;
|
||||
@observable allowLoadMore: boolean = true;
|
||||
@@ -73,7 +73,7 @@ class Search extends React.Component<Props> {
|
||||
}
|
||||
}
|
||||
|
||||
@keydown('esc')
|
||||
@keydown("esc")
|
||||
goBack() {
|
||||
this.props.history.goBack();
|
||||
}
|
||||
@@ -107,8 +107,8 @@ class Search extends React.Component<Props> {
|
||||
};
|
||||
|
||||
handleTermChange = () => {
|
||||
const query = decodeURIComponent(this.props.match.params.term || '');
|
||||
this.query = query ? query : '';
|
||||
const query = decodeURIComponent(this.props.match.params.term || "");
|
||||
this.query = query ? query : "";
|
||||
this.offset = 0;
|
||||
this.allowLoadMore = true;
|
||||
|
||||
@@ -135,21 +135,21 @@ class Search extends React.Component<Props> {
|
||||
};
|
||||
|
||||
get includeArchived() {
|
||||
return this.params.get('includeArchived') === 'true';
|
||||
return this.params.get("includeArchived") === "true";
|
||||
}
|
||||
|
||||
get collectionId() {
|
||||
const id = this.params.get('collectionId');
|
||||
const id = this.params.get("collectionId");
|
||||
return id ? id : undefined;
|
||||
}
|
||||
|
||||
get userId() {
|
||||
const id = this.params.get('userId');
|
||||
const id = this.params.get("userId");
|
||||
return id ? id : undefined;
|
||||
}
|
||||
|
||||
get dateFilter() {
|
||||
const id = this.params.get('dateFilter');
|
||||
const id = this.params.get("dateFilter");
|
||||
return id ? id : undefined;
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ class Search extends React.Component<Props> {
|
||||
|
||||
get title() {
|
||||
const query = this.query;
|
||||
const title = 'Search';
|
||||
const title = "Search";
|
||||
if (query) return `${query} – ${title}`;
|
||||
return title;
|
||||
}
|
||||
@@ -361,14 +361,14 @@ const Container = styled(CenteredContent)`
|
||||
const ResultsWrapper = styled(Flex)`
|
||||
position: absolute;
|
||||
transition: all 300ms cubic-bezier(0.65, 0.05, 0.36, 1);
|
||||
top: ${props => (props.pinToTop ? '0%' : '50%')};
|
||||
margin-top: ${props => (props.pinToTop ? '40px' : '-75px')};
|
||||
top: ${props => (props.pinToTop ? "0%" : "50%")};
|
||||
margin-top: ${props => (props.pinToTop ? "40px" : "-75px")};
|
||||
width: 100%;
|
||||
`;
|
||||
|
||||
const ResultList = styled(Flex)`
|
||||
margin-bottom: 150px;
|
||||
opacity: ${props => (props.visible ? '1' : '0')};
|
||||
opacity: ${props => (props.visible ? "1" : "0")};
|
||||
transition: all 400ms cubic-bezier(0.65, 0.05, 0.36, 1);
|
||||
`;
|
||||
|
||||
@@ -388,4 +388,4 @@ const Filters = styled(Flex)`
|
||||
}
|
||||
`;
|
||||
|
||||
export default withRouter(inject('documents')(Search));
|
||||
export default withRouter(inject("documents")(Search));
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import { observer, inject } from 'mobx-react';
|
||||
import FilterOptions from './FilterOptions';
|
||||
import CollectionsStore from 'stores/CollectionsStore';
|
||||
import * as React from "react";
|
||||
import { observer, inject } from "mobx-react";
|
||||
import FilterOptions from "./FilterOptions";
|
||||
import CollectionsStore from "stores/CollectionsStore";
|
||||
|
||||
const defaultOption = {
|
||||
key: undefined,
|
||||
label: 'Any collection',
|
||||
label: "Any collection",
|
||||
};
|
||||
|
||||
type Props = {
|
||||
@@ -36,4 +36,4 @@ class CollectionFilter extends React.Component<Props> {
|
||||
}
|
||||
}
|
||||
|
||||
export default inject('collections')(CollectionFilter);
|
||||
export default inject("collections")(CollectionFilter);
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import FilterOptions from './FilterOptions';
|
||||
import * as React from "react";
|
||||
import FilterOptions from "./FilterOptions";
|
||||
|
||||
const options = [
|
||||
{ key: undefined, label: 'Any time' },
|
||||
{ key: 'day', label: 'Past day' },
|
||||
{ key: 'week', label: 'Past week' },
|
||||
{ key: 'month', label: 'Past month' },
|
||||
{ key: 'year', label: 'Past year' },
|
||||
{ key: undefined, label: "Any time" },
|
||||
{ key: "day", label: "Past day" },
|
||||
{ key: "week", label: "Past week" },
|
||||
{ key: "month", label: "Past month" },
|
||||
{ key: "year", label: "Past year" },
|
||||
];
|
||||
|
||||
type Props = {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import { CheckmarkIcon } from 'outline-icons';
|
||||
import styled from 'styled-components';
|
||||
import HelpText from 'components/HelpText';
|
||||
import Flex from 'shared/components/Flex';
|
||||
import * as React from "react";
|
||||
import { CheckmarkIcon } from "outline-icons";
|
||||
import styled from "styled-components";
|
||||
import HelpText from "components/HelpText";
|
||||
import Flex from "shared/components/Flex";
|
||||
|
||||
type Props = {
|
||||
label: string,
|
||||
@@ -34,7 +34,7 @@ const Checkmark = styled(CheckmarkIcon)`
|
||||
fill: ${props => props.theme.text};
|
||||
`;
|
||||
|
||||
const Anchor = styled('a')`
|
||||
const Anchor = styled("a")`
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
font-size: 15px;
|
||||
@@ -52,9 +52,9 @@ const Anchor = styled('a')`
|
||||
}
|
||||
`;
|
||||
|
||||
const ListItem = styled('li')`
|
||||
const ListItem = styled("li")`
|
||||
list-style: none;
|
||||
font-weight: ${props => (props.active ? '600' : 'normal')};
|
||||
font-weight: ${props => (props.active ? "600" : "normal")};
|
||||
`;
|
||||
|
||||
export default FilterOption;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import { find } from 'lodash';
|
||||
import styled from 'styled-components';
|
||||
import Button, { Inner } from 'components/Button';
|
||||
import { DropdownMenu } from 'components/DropdownMenu';
|
||||
import FilterOption from './FilterOption';
|
||||
import * as React from "react";
|
||||
import { find } from "lodash";
|
||||
import styled from "styled-components";
|
||||
import Button, { Inner } from "components/Button";
|
||||
import { DropdownMenu } from "components/DropdownMenu";
|
||||
import FilterOption from "./FilterOption";
|
||||
|
||||
type Props = {
|
||||
options: {
|
||||
@@ -22,11 +22,11 @@ const FilterOptions = ({
|
||||
options,
|
||||
activeKey,
|
||||
defaultLabel,
|
||||
selectedPrefix = '',
|
||||
selectedPrefix = "",
|
||||
onSelect,
|
||||
}: Props) => {
|
||||
const selected = find(options, { key: activeKey }) || options[0];
|
||||
const selectedLabel = selected ? `${selectedPrefix} ${selected.label}` : '';
|
||||
const selectedLabel = selected ? `${selectedPrefix} ${selected.label}` : "";
|
||||
|
||||
return (
|
||||
<DropdownButton label={activeKey ? selectedLabel : defaultLabel}>
|
||||
@@ -49,7 +49,7 @@ const FilterOptions = ({
|
||||
);
|
||||
};
|
||||
|
||||
const Content = styled('div')`
|
||||
const Content = styled("div")`
|
||||
padding: 0 8px;
|
||||
width: 250px;
|
||||
|
||||
@@ -95,7 +95,7 @@ const DropdownButton = styled(SearchFilter)`
|
||||
margin-right: 8px;
|
||||
`;
|
||||
|
||||
const List = styled('ol')`
|
||||
const List = styled("ol")`
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import styled, { withTheme } from 'styled-components';
|
||||
import { SearchIcon } from 'outline-icons';
|
||||
import Flex from 'shared/components/Flex';
|
||||
import * as React from "react";
|
||||
import styled, { withTheme } from "styled-components";
|
||||
import { SearchIcon } from "outline-icons";
|
||||
import Flex from "shared/components/Flex";
|
||||
|
||||
type Props = {
|
||||
onChange: string => void,
|
||||
@@ -16,13 +16,13 @@ class SearchField extends React.Component<Props> {
|
||||
componentDidMount() {
|
||||
if (this.props && this.input) {
|
||||
// ensure that focus is placed at end of input
|
||||
const len = (this.props.defaultValue || '').length;
|
||||
const len = (this.props.defaultValue || "").length;
|
||||
this.input.setSelectionRange(len, len);
|
||||
}
|
||||
}
|
||||
|
||||
handleChange = (ev: SyntheticEvent<HTMLInputElement>) => {
|
||||
this.props.onChange(ev.currentTarget.value ? ev.currentTarget.value : '');
|
||||
this.props.onChange(ev.currentTarget.value ? ev.currentTarget.value : "");
|
||||
};
|
||||
|
||||
focusInput = (ev: SyntheticEvent<>) => {
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import FilterOptions from './FilterOptions';
|
||||
import * as React from "react";
|
||||
import FilterOptions from "./FilterOptions";
|
||||
|
||||
const options = [
|
||||
{
|
||||
key: undefined,
|
||||
label: 'Active documents',
|
||||
note: 'Documents in collections you are able to access',
|
||||
label: "Active documents",
|
||||
note: "Documents in collections you are able to access",
|
||||
},
|
||||
{
|
||||
key: 'true',
|
||||
label: 'All documents',
|
||||
note: 'Include documents that are in the archive',
|
||||
key: "true",
|
||||
label: "All documents",
|
||||
note: "Include documents that are in the archive",
|
||||
},
|
||||
];
|
||||
|
||||
@@ -24,7 +24,7 @@ const StatusFilter = ({ includeArchived, onSelect }: Props) => {
|
||||
return (
|
||||
<FilterOptions
|
||||
options={options}
|
||||
activeKey={includeArchived ? 'true' : undefined}
|
||||
activeKey={includeArchived ? "true" : undefined}
|
||||
onSelect={onSelect}
|
||||
defaultLabel="Active documents"
|
||||
/>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import { observer, inject } from 'mobx-react';
|
||||
import FilterOptions from './FilterOptions';
|
||||
import UsersStore from 'stores/UsersStore';
|
||||
import * as React from "react";
|
||||
import { observer, inject } from "mobx-react";
|
||||
import FilterOptions from "./FilterOptions";
|
||||
import UsersStore from "stores/UsersStore";
|
||||
|
||||
const defaultOption = {
|
||||
key: undefined,
|
||||
label: 'Any author',
|
||||
label: "Any author",
|
||||
};
|
||||
|
||||
type Props = {
|
||||
@@ -40,4 +40,4 @@ class UserFilter extends React.Component<Props> {
|
||||
}
|
||||
}
|
||||
|
||||
export default inject('users')(UserFilter);
|
||||
export default inject("users")(UserFilter);
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
// @flow
|
||||
import Search from './Search';
|
||||
import Search from "./Search";
|
||||
export default Search;
|
||||
|
||||
Reference in New Issue
Block a user