mirror of
https://github.com/pds-nest/nest.git
synced 2024-11-22 04:54:18 +00:00
📔 Document a lot of stuff
This commit is contained in:
parent
850adb5ba5
commit
ac1a218677
27 changed files with 234 additions and 39 deletions
|
@ -4,7 +4,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
|
||||||
import { faClock } from "@fortawesome/free-solid-svg-icons"
|
import { faClock } from "@fortawesome/free-solid-svg-icons"
|
||||||
import useRepositoryEditor from "../../hooks/useRepositoryEditor"
|
import useRepositoryEditor from "../../hooks/useRepositoryEditor"
|
||||||
import ContextLanguage from "../../contexts/ContextLanguage"
|
import ContextLanguage from "../../contexts/ContextLanguage"
|
||||||
import FormInlineBADatetime from "./FormInlineBADatetime"
|
import FormInlineTimeRay from "./FormInlineTimeRay"
|
||||||
import { ConditionTime } from "../../objects/Condition"
|
import { ConditionTime } from "../../objects/Condition"
|
||||||
|
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ export default function BoxConditionDatetime({ ...props }) {
|
||||||
}
|
}
|
||||||
{...props}
|
{...props}
|
||||||
>
|
>
|
||||||
<FormInlineBADatetime
|
<FormInlineTimeRay
|
||||||
submit={submit}
|
submit={submit}
|
||||||
/>
|
/>
|
||||||
</BoxFull>
|
</BoxFull>
|
||||||
|
|
|
@ -2,18 +2,26 @@ import React from "react"
|
||||||
import BoxFull from "../base/BoxFull"
|
import BoxFull from "../base/BoxFull"
|
||||||
import useRepositoryViewer from "../../hooks/useRepositoryViewer"
|
import useRepositoryViewer from "../../hooks/useRepositoryViewer"
|
||||||
import useStrings from "../../hooks/useStrings"
|
import useStrings from "../../hooks/useStrings"
|
||||||
import { FilterContains } from "../../utils/Filter"
|
import { FilterContains } from "../../objects/Filter"
|
||||||
import FormInlineText from "./FormInlineText"
|
import FormInlineText from "./FormInlineText"
|
||||||
import { faFont } from "@fortawesome/free-solid-svg-icons"
|
import { faFont } from "@fortawesome/free-solid-svg-icons"
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A {@link BoxFull} that allows the user to select a word to search for, and then to add it as a
|
||||||
|
* {@link FilterContains} of a RepositoryViewer.
|
||||||
|
*
|
||||||
|
* @param props - Additional props to pass to the box.
|
||||||
|
* @returns {JSX.Element}
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
export default function BoxFilterContains({ ...props }) {
|
export default function BoxFilterContains({ ...props }) {
|
||||||
const strings = useStrings()
|
const strings = useStrings()
|
||||||
const { appendFilter } = useRepositoryViewer()
|
const { appendFilter } = useRepositoryViewer()
|
||||||
|
|
||||||
const submit = value => {
|
const submit = value => {
|
||||||
appendFilter(new FilterContains(false, value))
|
appendFilter(new FilterContains(value))
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: add this string
|
// TODO: add this string
|
||||||
|
|
|
@ -1,19 +1,27 @@
|
||||||
import React from "react"
|
import React from "react"
|
||||||
import BoxFull from "../base/BoxFull"
|
import BoxFull from "../base/BoxFull"
|
||||||
import { faClock, faHashtag } from "@fortawesome/free-solid-svg-icons"
|
import { faClock } from "@fortawesome/free-solid-svg-icons"
|
||||||
import useRepositoryViewer from "../../hooks/useRepositoryViewer"
|
import useRepositoryViewer from "../../hooks/useRepositoryViewer"
|
||||||
import useStrings from "../../hooks/useStrings"
|
import useStrings from "../../hooks/useStrings"
|
||||||
import { FilterInsideTimeRay } from "../../utils/Filter"
|
import { FilterInsideTimeRay } from "../../objects/Filter"
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
|
||||||
import FormInlineBADatetime from "./FormInlineBADatetime"
|
import FormInlineTimeRay from "./FormInlineTimeRay"
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A {@link BoxFull} that allows the user to select a {@link TimeRay}, and then to add it as a
|
||||||
|
* {@link FilterInsideTimeRay} of a RepositoryViewer.
|
||||||
|
*
|
||||||
|
* @param props - Additional props to pass to the box.
|
||||||
|
* @returns {JSX.Element}
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
export default function BoxFilterDatetime({ ...props }) {
|
export default function BoxFilterDatetime({ ...props }) {
|
||||||
const strings = useStrings()
|
const strings = useStrings()
|
||||||
const { appendFilter } = useRepositoryViewer()
|
const { appendFilter } = useRepositoryViewer()
|
||||||
|
|
||||||
const submit = ({ date, isBefore }) => {
|
const submit = ({ timeRay }) => {
|
||||||
appendFilter(new FilterInsideTimeRay(isBefore, date))
|
appendFilter(new FilterInsideTimeRay(timeRay))
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -29,7 +37,7 @@ export default function BoxFilterDatetime({ ...props }) {
|
||||||
}
|
}
|
||||||
{...props}
|
{...props}
|
||||||
>
|
>
|
||||||
<FormInlineBADatetime submit={submit}/>
|
<FormInlineTimeRay submit={submit}/>
|
||||||
</BoxFull>
|
</BoxFull>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,17 +5,24 @@ import useRepositoryViewer from "../../hooks/useRepositoryViewer"
|
||||||
import useStrings from "../../hooks/useStrings"
|
import useStrings from "../../hooks/useStrings"
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
|
||||||
import { faLocationArrow, faPlus } from "@fortawesome/free-solid-svg-icons"
|
import { faLocationArrow, faPlus } from "@fortawesome/free-solid-svg-icons"
|
||||||
import { FilterWithPlace } from "../../utils/Filter"
|
import { FilterWithPlace } from "../../objects/Filter"
|
||||||
import ButtonIconOnly from "../base/ButtonIconOnly"
|
import ButtonIconOnly from "../base/ButtonIconOnly"
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A {@link BoxFull} that allows the user to add a {@link FilterWithPlace} to a RepositoryViewer.
|
||||||
|
*
|
||||||
|
* @param props - Additional props to pass to the box.
|
||||||
|
* @returns {JSX.Element}
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
export default function BoxFilterHasPlace({ ...props }) {
|
export default function BoxFilterHasPlace({ ...props }) {
|
||||||
const strings = useStrings()
|
const strings = useStrings()
|
||||||
|
|
||||||
const { appendFilter } = useRepositoryViewer()
|
const { appendFilter } = useRepositoryViewer()
|
||||||
|
|
||||||
const submit = () => {
|
const submit = () => {
|
||||||
appendFilter(new FilterWithPlace(false))
|
appendFilter(new FilterWithPlace())
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: translate this
|
// TODO: translate this
|
||||||
|
|
|
@ -3,17 +3,25 @@ import BoxFull from "../base/BoxFull"
|
||||||
import { faClock } from "@fortawesome/free-solid-svg-icons"
|
import { faClock } from "@fortawesome/free-solid-svg-icons"
|
||||||
import useRepositoryViewer from "../../hooks/useRepositoryViewer"
|
import useRepositoryViewer from "../../hooks/useRepositoryViewer"
|
||||||
import useStrings from "../../hooks/useStrings"
|
import useStrings from "../../hooks/useStrings"
|
||||||
import { FilterHashtag } from "../../utils/Filter"
|
import { FilterHashtag } from "../../objects/Filter"
|
||||||
import FormInlineHashtag from "./FormInlineHashtag"
|
import FormInlineHashtag from "./FormInlineHashtag"
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A {@link BoxFull} that allows the user to select a Twitter hashtag to search for, and then to add it as a
|
||||||
|
* {@link FilterContains} of a RepositoryViewer.
|
||||||
|
*
|
||||||
|
* @param props - Additional props to pass to the box.
|
||||||
|
* @returns {JSX.Element}
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
export default function BoxFilterHashtag({ ...props }) {
|
export default function BoxFilterHashtag({ ...props }) {
|
||||||
const strings = useStrings()
|
const strings = useStrings()
|
||||||
const { appendFilter } = useRepositoryViewer()
|
const { appendFilter } = useRepositoryViewer()
|
||||||
|
|
||||||
const submit = value => {
|
const submit = value => {
|
||||||
appendFilter(new FilterHashtag(false, value))
|
appendFilter(new FilterHashtag(value))
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -1,14 +1,22 @@
|
||||||
import React from "react"
|
import React from "react"
|
||||||
import BoxFull from "../base/BoxFull"
|
import BoxFull from "../base/BoxFull"
|
||||||
import FormInline from "../base/FormInline"
|
|
||||||
import useRepositoryViewer from "../../hooks/useRepositoryViewer"
|
import useRepositoryViewer from "../../hooks/useRepositoryViewer"
|
||||||
import useStrings from "../../hooks/useStrings"
|
import useStrings from "../../hooks/useStrings"
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
|
||||||
import { faMapPin } from "@fortawesome/free-solid-svg-icons"
|
import { faMapPin } from "@fortawesome/free-solid-svg-icons"
|
||||||
import FormInlineLocation from "./FormInlineLocation"
|
import FormInlineLocation from "./FormInlineLocation"
|
||||||
import { FilterInsideMapArea } from "../../utils/Filter"
|
import { FilterInsideMapArea } from "../../objects/Filter"
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A {@link BoxFull} that allows the user to add a {@link FilterInsideMapArea} to a RepositoryViewer.
|
||||||
|
*
|
||||||
|
* It connects to the `mapViewHook` of the RepositoryViewer.
|
||||||
|
*
|
||||||
|
* @param props - Additional props to pass to the box.
|
||||||
|
* @returns {JSX.Element}
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
export default function BoxFilterLocation({ ...props }) {
|
export default function BoxFilterLocation({ ...props }) {
|
||||||
const strings = useStrings()
|
const strings = useStrings()
|
||||||
|
|
||||||
|
|
|
@ -3,20 +3,26 @@ import BoxFull from "../base/BoxFull"
|
||||||
import { faAt } from "@fortawesome/free-solid-svg-icons"
|
import { faAt } from "@fortawesome/free-solid-svg-icons"
|
||||||
import useRepositoryViewer from "../../hooks/useRepositoryViewer"
|
import useRepositoryViewer from "../../hooks/useRepositoryViewer"
|
||||||
import useStrings from "../../hooks/useStrings"
|
import useStrings from "../../hooks/useStrings"
|
||||||
import { FilterPoster } from "../../utils/Filter"
|
import { FilterPoster } from "../../objects/Filter"
|
||||||
import FormInlineUser from "./FormInlineUser"
|
import FormInlineUser from "./FormInlineUser"
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A {@link BoxFull} that allows the user to select a Twitter user to search for, and then to add it as a
|
||||||
|
* {@link FilterPoster} of a RepositoryViewer.
|
||||||
|
*
|
||||||
|
* @param props - Additional props to pass to the box.
|
||||||
|
* @returns {JSX.Element}
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
export default function BoxFilterUser({ ...props }) {
|
export default function BoxFilterUser({ ...props }) {
|
||||||
// TODO: Translate this
|
|
||||||
// TODO: and also use a better string maybe
|
|
||||||
const strings = useStrings()
|
const strings = useStrings()
|
||||||
|
|
||||||
const { appendFilter } = useRepositoryViewer()
|
const { appendFilter } = useRepositoryViewer()
|
||||||
|
|
||||||
const submit = value => {
|
const submit = value => {
|
||||||
appendFilter(new FilterPoster(false, value))
|
appendFilter(new FilterPoster(value))
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -19,6 +19,7 @@ export default function BoxFilters({ ...props }) {
|
||||||
const badges = filters.map((filter, pos) => <BadgeFilter key={pos} filter={filter}/>)
|
const badges = filters.map((filter, pos) => <BadgeFilter key={pos} filter={filter}/>)
|
||||||
|
|
||||||
// TODO: localize this
|
// TODO: localize this
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<BoxFull header={"Filters"} {...props}>
|
<BoxFull header={"Filters"} {...props}>
|
||||||
{badges}
|
{badges}
|
||||||
|
|
|
@ -13,7 +13,7 @@ import ContextLanguage from "../../contexts/ContextLanguage"
|
||||||
/**
|
/**
|
||||||
* A {@link BoxFull} displaying the user's current login status, and allowing them to logout.
|
* A {@link BoxFull} displaying the user's current login status, and allowing them to logout.
|
||||||
*
|
*
|
||||||
* @param props
|
* @param props - Additional props to pass to the box.
|
||||||
* @returns {JSX.Element}
|
* @returns {JSX.Element}
|
||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
.BoxRepositoryCreate {
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,14 +1,22 @@
|
||||||
import React, { useContext } from "react"
|
import React from "react"
|
||||||
import BoxFullScrollable from "../base/BoxFullScrollable"
|
import BoxFullScrollable from "../base/BoxFullScrollable"
|
||||||
import SummaryTweet from "./SummaryTweet"
|
import SummaryTweet from "./SummaryTweet"
|
||||||
import ContextLanguage from "../../contexts/ContextLanguage"
|
|
||||||
import Empty from "./Empty"
|
import Empty from "./Empty"
|
||||||
import ContextRepositoryViewer from "../../contexts/ContextRepositoryViewer"
|
import useRepositoryViewer from "../../hooks/useRepositoryViewer"
|
||||||
|
import useStrings from "../../hooks/useStrings"
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A {@link BoxFullScrollable} rendering all the tweets currently displayed in a RepositoryViewer as
|
||||||
|
* {@link SummaryTweet}s.
|
||||||
|
*
|
||||||
|
* @param props - Additional props to pass to the box.
|
||||||
|
* @returns {JSX.Element}
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
export default function BoxRepositoryTweets({ ...props }) {
|
export default function BoxRepositoryTweets({ ...props }) {
|
||||||
const { strings } = useContext(ContextLanguage)
|
const strings = useStrings()
|
||||||
const { tweets } = useContext(ContextRepositoryViewer)
|
const { tweets } = useRepositoryViewer()
|
||||||
|
|
||||||
let content
|
let content
|
||||||
if(tweets.length === 0) {
|
if(tweets.length === 0) {
|
||||||
|
|
|
@ -9,6 +9,15 @@ import FormAlert from "../base/formparts/FormAlert"
|
||||||
import ContextLanguage from "../../contexts/ContextLanguage"
|
import ContextLanguage from "../../contexts/ContextLanguage"
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A {@link BoxFull} allowing an administrator user to create a new user.
|
||||||
|
*
|
||||||
|
* @param createUser - Async function to call to create an user.
|
||||||
|
* @param running - Whether another request is currently running.
|
||||||
|
* @param props - Additional props to pass to the box.
|
||||||
|
* @returns {JSX.Element}
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
export default function BoxUserCreate({ createUser, running, ...props }) {
|
export default function BoxUserCreate({ createUser, running, ...props }) {
|
||||||
const [username, setUsername] = useState("")
|
const [username, setUsername] = useState("")
|
||||||
const [email, setEmail] = useState("")
|
const [email, setEmail] = useState("")
|
||||||
|
|
|
@ -5,6 +5,16 @@ import SummaryUser from "./SummaryUser"
|
||||||
import ContextLanguage from "../../contexts/ContextLanguage"
|
import ContextLanguage from "../../contexts/ContextLanguage"
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A {@link BoxFullScrollable} rendering an array of users as {@link SummaryUser}s.
|
||||||
|
*
|
||||||
|
* @param users - Array of users to render.
|
||||||
|
* @param destroyUser - Async function to destroy an user, to be passed to {@link SummaryUser}.
|
||||||
|
* @param running - Whether another request is currently running.
|
||||||
|
* @param props - Additional props to pass to the box.
|
||||||
|
* @returns {JSX.Element}
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
export default function BoxUserList({ users, destroyUser, running, ...props }) {
|
export default function BoxUserList({ users, destroyUser, running, ...props }) {
|
||||||
const { strings } = useContext(ContextLanguage)
|
const { strings } = useContext(ContextLanguage)
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,17 @@ import React, { useContext, useMemo } from "react"
|
||||||
import BoxMap from "../base/BoxMap"
|
import BoxMap from "../base/BoxMap"
|
||||||
import ContextLanguage from "../../contexts/ContextLanguage"
|
import ContextLanguage from "../../contexts/ContextLanguage"
|
||||||
import { Marker, Popup } from "react-leaflet"
|
import { Marker, Popup } from "react-leaflet"
|
||||||
import { Location } from "../../utils/location"
|
import { Location } from "../../objects/location"
|
||||||
import ContextRepositoryViewer from "../../contexts/ContextRepositoryViewer"
|
import ContextRepositoryViewer from "../../contexts/ContextRepositoryViewer"
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A {@link BoxMap} displaying the displayed tweets of a RepositoryViewer as {@link Marker}s.
|
||||||
|
*
|
||||||
|
* @param props - Additional props to pass to the box.
|
||||||
|
* @returns {JSX.Element}
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
export default function BoxVisualizationMap({ ...props }) {
|
export default function BoxVisualizationMap({ ...props }) {
|
||||||
const { strings } = useContext(ContextLanguage)
|
const { strings } = useContext(ContextLanguage)
|
||||||
const { tweets, mapViewHook } = useContext(ContextRepositoryViewer)
|
const { tweets, mapViewHook } = useContext(ContextRepositoryViewer)
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import React, { useContext } from "react"
|
import React, { useCallback, useContext } from "react"
|
||||||
import BoxWordcloud from "../base/BoxWordcloud"
|
import BoxWordcloud from "../base/BoxWordcloud"
|
||||||
import ContextLanguage from "../../contexts/ContextLanguage"
|
import ContextLanguage from "../../contexts/ContextLanguage"
|
||||||
import BoxFull from "../base/BoxFull"
|
import BoxFull from "../base/BoxFull"
|
||||||
import Empty from "./Empty"
|
import Empty from "./Empty"
|
||||||
import ContextRepositoryViewer from "../../contexts/ContextRepositoryViewer"
|
import ContextRepositoryViewer from "../../contexts/ContextRepositoryViewer"
|
||||||
import { FilterContains } from "../../utils/Filter"
|
import { FilterContains } from "../../objects/Filter"
|
||||||
|
|
||||||
|
|
||||||
export default function BoxVisualizationWordcloud({ ...props }) {
|
export default function BoxVisualizationWordcloud({ ...props }) {
|
||||||
|
@ -19,9 +19,12 @@ export default function BoxVisualizationWordcloud({ ...props }) {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const onWordClick = word => {
|
const onWordClick = useCallback(
|
||||||
appendFilter(new FilterContains(false, word.text))
|
word => {
|
||||||
}
|
appendFilter(new FilterContains(word.text))
|
||||||
|
},
|
||||||
|
[appendFilter]
|
||||||
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<BoxWordcloud
|
<BoxWordcloud
|
||||||
|
|
|
@ -2,6 +2,16 @@ import React from "react"
|
||||||
import ButtonIconOnly from "../base/ButtonIconOnly"
|
import ButtonIconOnly from "../base/ButtonIconOnly"
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A {@link ButtonIconOnly} to be used to switch between RepositoryViewer tabs.
|
||||||
|
*
|
||||||
|
* @param setTab - Function to change tab.
|
||||||
|
* @param currentTab - Name of the current tab, as a string.
|
||||||
|
* @param name - Name of the tab this button should switch to, as a string.
|
||||||
|
* @param props - Additional props to pass to the button.
|
||||||
|
* @returns {JSX.Element}
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
export default function ButtonPicker({ setTab, currentTab, name, ...props }) {
|
export default function ButtonPicker({ setTab, currentTab, name, ...props }) {
|
||||||
return (
|
return (
|
||||||
<ButtonIconOnly
|
<ButtonIconOnly
|
||||||
|
|
|
@ -5,6 +5,16 @@ import Button from "../base/Button"
|
||||||
import ContextLanguage from "../../contexts/ContextLanguage"
|
import ContextLanguage from "../../contexts/ContextLanguage"
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A {@link Button} allowing the user to select between **Before** and **After**.
|
||||||
|
*
|
||||||
|
* @param isBefore - The current value of the button.
|
||||||
|
* @param setBefore - Function to set the current value of the button.
|
||||||
|
* @param className - Additional class(es) to append to the button.
|
||||||
|
* @param props - Additional props to pass to the button.
|
||||||
|
* @returns {JSX.Element}
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
export default function ButtonToggleBeforeAfter({ isBefore, setBefore, className, ...props }) {
|
export default function ButtonToggleBeforeAfter({ isBefore, setBefore, className, ...props }) {
|
||||||
const { strings } = useContext(ContextLanguage)
|
const { strings } = useContext(ContextLanguage)
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,15 @@ import classNames from "classnames"
|
||||||
import ContextLanguage from "../../contexts/ContextLanguage"
|
import ContextLanguage from "../../contexts/ContextLanguage"
|
||||||
|
|
||||||
|
|
||||||
export default function Empty({ children, className, ...props }) {
|
/**
|
||||||
|
* A simple inline `<i>` element to be used when there is nothing to be displayed inside a box.
|
||||||
|
*
|
||||||
|
* @param className - Additional class(es) to append to the element.
|
||||||
|
* @param props - Additional props to pass to the element.
|
||||||
|
* @returns {JSX.Element}
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
|
export default function Empty({ className, ...props }) {
|
||||||
const { strings } = useContext(ContextLanguage)
|
const { strings } = useContext(ContextLanguage)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -8,6 +8,14 @@ import { faHashtag } from "@fortawesome/free-solid-svg-icons"
|
||||||
const INVALID_CHARACTERS = /([^a-z0-9_\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u00ff\u0100-\u024f\u0253-\u0254\u0256-\u0257\u0300-\u036f\u1e00-\u1eff\u0400-\u04ff\u0500-\u0527\u2de0-\u2dff\ua640-\ua69f\u0591-\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05d0-\u05ea\u05f0-\u05f4\ufb12-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufb4f\u0610-\u061a\u0620-\u065f\u066e-\u06d3\u06d5-\u06dc\u06de-\u06e8\u06ea-\u06ef\u06fa-\u06fc\u0750-\u077f\u08a2-\u08ac\u08e4-\u08fe\ufb50-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\u200c\u0e01-\u0e3a\u0e40-\u0e4e\u1100-\u11ff\u3130-\u3185\ua960-\ua97f\uac00-\ud7af\ud7b0-\ud7ff\uffa1-\uffdc\u30a1-\u30fa\u30fc-\u30fe\uff66-\uff9f\uff10-\uff19\uff21-\uff3a\uff41-\uff5a\u3041-\u3096\u3099-\u309e\u3400-\u4dbf\u4e00-\u9fff\u20000-\u2a6df\u2a700-\u2b73\u2b740-\u2b81\u2f800-\u2fa1])/g
|
const INVALID_CHARACTERS = /([^a-z0-9_\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u00ff\u0100-\u024f\u0253-\u0254\u0256-\u0257\u0300-\u036f\u1e00-\u1eff\u0400-\u04ff\u0500-\u0527\u2de0-\u2dff\ua640-\ua69f\u0591-\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05d0-\u05ea\u05f0-\u05f4\ufb12-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufb4f\u0610-\u061a\u0620-\u065f\u066e-\u06d3\u06d5-\u06dc\u06de-\u06e8\u06ea-\u06ef\u06fa-\u06fc\u0750-\u077f\u08a2-\u08ac\u08e4-\u08fe\ufb50-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\u200c\u0e01-\u0e3a\u0e40-\u0e4e\u1100-\u11ff\u3130-\u3185\ua960-\ua97f\uac00-\ud7af\ud7b0-\ud7ff\uffa1-\uffdc\u30a1-\u30fa\u30fc-\u30fe\uff66-\uff9f\uff10-\uff19\uff21-\uff3a\uff41-\uff5a\u3041-\u3096\u3099-\u309e\u3400-\u4dbf\u4e00-\u9fff\u20000-\u2a6df\u2a700-\u2b73\u2b740-\u2b81\u2f800-\u2fa1])/g
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A {@link FormInline} allowing the user to select a Twitter hashtag.
|
||||||
|
*
|
||||||
|
* @param submit - Function <string> called when the submit button is pressed.
|
||||||
|
* @param props - Additional props to pass to the form.
|
||||||
|
* @returns {JSX.Element}
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
export default function FormInlineHashtag({ submit, ...props }) {
|
export default function FormInlineHashtag({ submit, ...props }) {
|
||||||
|
|
||||||
const validate = value => {
|
const validate = value => {
|
||||||
|
|
|
@ -6,6 +6,21 @@ import ButtonIconOnly from "../base/ButtonIconOnly"
|
||||||
import Style from "./FormInlineLocation.module.css"
|
import Style from "./FormInlineLocation.module.css"
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated to be refactored
|
||||||
|
* @param mapViewHook
|
||||||
|
* @param radIcon
|
||||||
|
* @param latIcon
|
||||||
|
* @param lngIcon
|
||||||
|
* @param buttonIcon
|
||||||
|
* @param buttonColor
|
||||||
|
* @param placeholder
|
||||||
|
* @param validate
|
||||||
|
* @param submit
|
||||||
|
* @param props
|
||||||
|
* @returns {JSX.Element}
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
export default function FormInlineLocation(
|
export default function FormInlineLocation(
|
||||||
{
|
{
|
||||||
mapViewHook,
|
mapViewHook,
|
||||||
|
|
|
@ -6,6 +6,19 @@ import ButtonIconOnly from "../base/ButtonIconOnly"
|
||||||
import Style from "./FormInlineText.module.css"
|
import Style from "./FormInlineText.module.css"
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A {@link FormInline} allowing the user to enter a string.
|
||||||
|
*
|
||||||
|
* @param textIcon - The icon to display in the text field.
|
||||||
|
* @param buttonIcon - The icon to display on the submit button.
|
||||||
|
* @param buttonColor - The color of the submit button.
|
||||||
|
* @param placeholder - The placeholder of the text field.
|
||||||
|
* @param validate - Function <string -> string> called to set the value of the text field.
|
||||||
|
* @param submit - Function <string> called when the submit button is pressed.
|
||||||
|
* @param props - Additional props to pass to the form.
|
||||||
|
* @returns {JSX.Element}
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
export default function FormInlineText(
|
export default function FormInlineText(
|
||||||
{
|
{
|
||||||
textIcon = faFont,
|
textIcon = faFont,
|
||||||
|
|
|
@ -11,7 +11,20 @@ import TimeRay from "../../objects/TimeRay"
|
||||||
const INVALID_CHARACTERS = /[^0-9TZ:+-]/g
|
const INVALID_CHARACTERS = /[^0-9TZ:+-]/g
|
||||||
|
|
||||||
|
|
||||||
export default function FormInlineBADatetime(
|
/**
|
||||||
|
* A {@link FormInline} allowing the user to select a {@link TimeRay}.
|
||||||
|
*
|
||||||
|
* @param textIcon - The icon to display in the text field.
|
||||||
|
* @param buttonIcon - The icon to display on the submit button.
|
||||||
|
* @param buttonColor - The color of the submit button.
|
||||||
|
* @param placeholder - The placeholder of the text field.
|
||||||
|
* @param validate - Function <string -> string> called to set the value of the text field.
|
||||||
|
* @param submit - Function <{@link TimeRay}> called when the submit button is pressed.
|
||||||
|
* @param props - Additional props to pass to the form.
|
||||||
|
* @returns {JSX.Element}
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
|
export default function FormInlineTimeRay(
|
||||||
{
|
{
|
||||||
textIcon = faClock,
|
textIcon = faClock,
|
||||||
buttonIcon = faPlus,
|
buttonIcon = faPlus,
|
|
@ -3,11 +3,17 @@ import FormInlineText from "./FormInlineText"
|
||||||
import { faAt } from "@fortawesome/free-solid-svg-icons"
|
import { faAt } from "@fortawesome/free-solid-svg-icons"
|
||||||
|
|
||||||
|
|
||||||
// Official hashtag regex from https://stackoverflow.com/a/22490853/4334568
|
|
||||||
// noinspection RegExpAnonymousGroup,LongLine
|
|
||||||
const INVALID_CHARACTERS = /[^a-zA-Z0-9]/g
|
const INVALID_CHARACTERS = /[^a-zA-Z0-9]/g
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A {@link FormInline} allowing the user to select a Twitter user.
|
||||||
|
*
|
||||||
|
* @param submit - Function <string> called when the submit button is pressed.
|
||||||
|
* @param props - Additional props to pass to the form.
|
||||||
|
* @returns {JSX.Element}
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
export default function FormInlineUser({ submit, ...props }) {
|
export default function FormInlineUser({ submit, ...props }) {
|
||||||
|
|
||||||
const validate = value => {
|
const validate = value => {
|
||||||
|
|
|
@ -5,6 +5,13 @@ import ButtonPicker from "./ButtonPicker"
|
||||||
import ContextRepositoryViewer from "../../contexts/ContextRepositoryViewer"
|
import ContextRepositoryViewer from "../../contexts/ContextRepositoryViewer"
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tab selector for the Add Filter box of a RepositoryViewer.
|
||||||
|
*
|
||||||
|
* @param props - Additional props to pass to the div.
|
||||||
|
* @returns {JSX.Element}
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
export default function PickerFilter({ ...props }) {
|
export default function PickerFilter({ ...props }) {
|
||||||
const { filterTab, setFilterTab, setVisualizationTab } = useContext(ContextRepositoryViewer)
|
const { filterTab, setFilterTab, setVisualizationTab } = useContext(ContextRepositoryViewer)
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,13 @@ import ContextRepositoryViewer from "../../contexts/ContextRepositoryViewer"
|
||||||
import ButtonPicker from "./ButtonPicker"
|
import ButtonPicker from "./ButtonPicker"
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tab selector for the Visualization box of a RepositoryViewer.
|
||||||
|
*
|
||||||
|
* @param props - Additional props to pass to the div.
|
||||||
|
* @returns {JSX.Element}
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
export default function PickerVisualization({ ...props }) {
|
export default function PickerVisualization({ ...props }) {
|
||||||
const { visualizationTab, setVisualizationTab } = useContext(ContextRepositoryViewer)
|
const { visualizationTab, setVisualizationTab } = useContext(ContextRepositoryViewer)
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,14 @@ import SummaryText from "../base/summary/SummaryText"
|
||||||
import SummaryRight from "../base/summary/SummaryRight"
|
import SummaryRight from "../base/summary/SummaryRight"
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A {@link SummaryBase} representing a tweet.
|
||||||
|
*
|
||||||
|
* @param tweet - The tweet to represent.
|
||||||
|
* @param props - Additional props to pass to the summary.
|
||||||
|
* @returns {JSX.Element}
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
export default function SummaryTweet({ tweet, ...props }) {
|
export default function SummaryTweet({ tweet, ...props }) {
|
||||||
let icon
|
let icon
|
||||||
if(tweet["location"]) {
|
if(tweet["location"]) {
|
||||||
|
|
|
@ -8,6 +8,16 @@ import SummaryButton from "../base/summary/SummaryButton"
|
||||||
import SummaryRight from "../base/summary/SummaryRight"
|
import SummaryRight from "../base/summary/SummaryRight"
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A {@link SummaryBase} representing a N.E.S.T. user.
|
||||||
|
*
|
||||||
|
* @param user - The user to represent.
|
||||||
|
* @param destroyUser - Async function <string> to destroy an user from the frontend.
|
||||||
|
* @param running - Whether another request is already running.
|
||||||
|
* @param props - Additional props to pass to the summary.
|
||||||
|
* @returns {JSX.Element}
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
export default function SummaryUser({ user, destroyUser, running, ...props }) {
|
export default function SummaryUser({ user, destroyUser, running, ...props }) {
|
||||||
const { strings } = useContext(ContextLanguage)
|
const { strings } = useContext(ContextLanguage)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue