From ac1a218677d8f8376a2cc5f2271f69c119b6b9cf Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 23 May 2021 05:03:41 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=94=20Document=20a=20lot=20of=20stuff?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../interactive/BoxConditionDatetime.js | 4 ++-- .../interactive/BoxFilterContains.js | 12 +++++++++-- .../interactive/BoxFilterDatetime.js | 20 +++++++++++++------ .../interactive/BoxFilterHasPlace.js | 11 ++++++++-- .../interactive/BoxFilterHashtag.js | 12 +++++++++-- .../interactive/BoxFilterLocation.js | 12 +++++++++-- .../components/interactive/BoxFilterUser.js | 14 +++++++++---- .../components/interactive/BoxFilters.js | 1 + .../components/interactive/BoxLoggedIn.js | 2 +- .../BoxRepositoryCreate.module.css | 3 --- .../interactive/BoxRepositoryTweets.js | 18 ++++++++++++----- .../components/interactive/BoxUserCreate.js | 9 +++++++++ .../components/interactive/BoxUserList.js | 10 ++++++++++ .../interactive/BoxVisualizationMap.js | 9 ++++++++- .../interactive/BoxVisualizationWordcloud.js | 13 +++++++----- .../components/interactive/ButtonPicker.js | 10 ++++++++++ .../interactive/ButtonToggleBeforeAfter.js | 10 ++++++++++ nest_frontend/components/interactive/Empty.js | 10 +++++++++- .../interactive/FormInlineHashtag.js | 8 ++++++++ .../interactive/FormInlineLocation.js | 15 ++++++++++++++ .../components/interactive/FormInlineText.js | 13 ++++++++++++ ...lineBADatetime.js => FormInlineTimeRay.js} | 15 +++++++++++++- .../components/interactive/FormInlineUser.js | 10 ++++++++-- .../components/interactive/PickerFilter.js | 7 +++++++ .../interactive/PickerVisualization.js | 7 +++++++ .../components/interactive/SummaryTweet.js | 8 ++++++++ .../components/interactive/SummaryUser.js | 10 ++++++++++ 27 files changed, 234 insertions(+), 39 deletions(-) delete mode 100644 nest_frontend/components/interactive/BoxRepositoryCreate.module.css rename nest_frontend/components/interactive/{FormInlineBADatetime.js => FormInlineTimeRay.js} (72%) diff --git a/nest_frontend/components/interactive/BoxConditionDatetime.js b/nest_frontend/components/interactive/BoxConditionDatetime.js index 1145576..2b11fe9 100644 --- a/nest_frontend/components/interactive/BoxConditionDatetime.js +++ b/nest_frontend/components/interactive/BoxConditionDatetime.js @@ -4,7 +4,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" import { faClock } from "@fortawesome/free-solid-svg-icons" import useRepositoryEditor from "../../hooks/useRepositoryEditor" import ContextLanguage from "../../contexts/ContextLanguage" -import FormInlineBADatetime from "./FormInlineBADatetime" +import FormInlineTimeRay from "./FormInlineTimeRay" import { ConditionTime } from "../../objects/Condition" @@ -38,7 +38,7 @@ export default function BoxConditionDatetime({ ...props }) { } {...props} > - diff --git a/nest_frontend/components/interactive/BoxFilterContains.js b/nest_frontend/components/interactive/BoxFilterContains.js index 545d263..b76ea85 100644 --- a/nest_frontend/components/interactive/BoxFilterContains.js +++ b/nest_frontend/components/interactive/BoxFilterContains.js @@ -2,18 +2,26 @@ import React from "react" import BoxFull from "../base/BoxFull" import useRepositoryViewer from "../../hooks/useRepositoryViewer" import useStrings from "../../hooks/useStrings" -import { FilterContains } from "../../utils/Filter" +import { FilterContains } from "../../objects/Filter" import FormInlineText from "./FormInlineText" import { faFont } from "@fortawesome/free-solid-svg-icons" 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 }) { const strings = useStrings() const { appendFilter } = useRepositoryViewer() const submit = value => { - appendFilter(new FilterContains(false, value)) + appendFilter(new FilterContains(value)) } // TODO: add this string diff --git a/nest_frontend/components/interactive/BoxFilterDatetime.js b/nest_frontend/components/interactive/BoxFilterDatetime.js index ab0c1ff..47743da 100644 --- a/nest_frontend/components/interactive/BoxFilterDatetime.js +++ b/nest_frontend/components/interactive/BoxFilterDatetime.js @@ -1,19 +1,27 @@ import React from "react" 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 useStrings from "../../hooks/useStrings" -import { FilterInsideTimeRay } from "../../utils/Filter" +import { FilterInsideTimeRay } from "../../objects/Filter" 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 }) { const strings = useStrings() const { appendFilter } = useRepositoryViewer() - const submit = ({ date, isBefore }) => { - appendFilter(new FilterInsideTimeRay(isBefore, date)) + const submit = ({ timeRay }) => { + appendFilter(new FilterInsideTimeRay(timeRay)) } return ( @@ -29,7 +37,7 @@ export default function BoxFilterDatetime({ ...props }) { } {...props} > - + ) } diff --git a/nest_frontend/components/interactive/BoxFilterHasPlace.js b/nest_frontend/components/interactive/BoxFilterHasPlace.js index ffaa711..49c4d7a 100644 --- a/nest_frontend/components/interactive/BoxFilterHasPlace.js +++ b/nest_frontend/components/interactive/BoxFilterHasPlace.js @@ -5,17 +5,24 @@ import useRepositoryViewer from "../../hooks/useRepositoryViewer" import useStrings from "../../hooks/useStrings" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" import { faLocationArrow, faPlus } from "@fortawesome/free-solid-svg-icons" -import { FilterWithPlace } from "../../utils/Filter" +import { FilterWithPlace } from "../../objects/Filter" 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 }) { const strings = useStrings() const { appendFilter } = useRepositoryViewer() const submit = () => { - appendFilter(new FilterWithPlace(false)) + appendFilter(new FilterWithPlace()) } // TODO: translate this diff --git a/nest_frontend/components/interactive/BoxFilterHashtag.js b/nest_frontend/components/interactive/BoxFilterHashtag.js index 211d461..b1f5145 100644 --- a/nest_frontend/components/interactive/BoxFilterHashtag.js +++ b/nest_frontend/components/interactive/BoxFilterHashtag.js @@ -3,17 +3,25 @@ import BoxFull from "../base/BoxFull" import { faClock } from "@fortawesome/free-solid-svg-icons" import useRepositoryViewer from "../../hooks/useRepositoryViewer" import useStrings from "../../hooks/useStrings" -import { FilterHashtag } from "../../utils/Filter" +import { FilterHashtag } from "../../objects/Filter" import FormInlineHashtag from "./FormInlineHashtag" 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 }) { const strings = useStrings() const { appendFilter } = useRepositoryViewer() const submit = value => { - appendFilter(new FilterHashtag(false, value)) + appendFilter(new FilterHashtag(value)) } return ( diff --git a/nest_frontend/components/interactive/BoxFilterLocation.js b/nest_frontend/components/interactive/BoxFilterLocation.js index 5c036f7..c7d7114 100644 --- a/nest_frontend/components/interactive/BoxFilterLocation.js +++ b/nest_frontend/components/interactive/BoxFilterLocation.js @@ -1,14 +1,22 @@ import React from "react" import BoxFull from "../base/BoxFull" -import FormInline from "../base/FormInline" import useRepositoryViewer from "../../hooks/useRepositoryViewer" import useStrings from "../../hooks/useStrings" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" import { faMapPin } from "@fortawesome/free-solid-svg-icons" 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 }) { const strings = useStrings() diff --git a/nest_frontend/components/interactive/BoxFilterUser.js b/nest_frontend/components/interactive/BoxFilterUser.js index edcb702..2c7340d 100644 --- a/nest_frontend/components/interactive/BoxFilterUser.js +++ b/nest_frontend/components/interactive/BoxFilterUser.js @@ -3,20 +3,26 @@ import BoxFull from "../base/BoxFull" import { faAt } from "@fortawesome/free-solid-svg-icons" import useRepositoryViewer from "../../hooks/useRepositoryViewer" import useStrings from "../../hooks/useStrings" -import { FilterPoster } from "../../utils/Filter" +import { FilterPoster } from "../../objects/Filter" import FormInlineUser from "./FormInlineUser" 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 }) { - // TODO: Translate this - // TODO: and also use a better string maybe const strings = useStrings() const { appendFilter } = useRepositoryViewer() const submit = value => { - appendFilter(new FilterPoster(false, value)) + appendFilter(new FilterPoster(value)) } return ( diff --git a/nest_frontend/components/interactive/BoxFilters.js b/nest_frontend/components/interactive/BoxFilters.js index 0745124..382a727 100644 --- a/nest_frontend/components/interactive/BoxFilters.js +++ b/nest_frontend/components/interactive/BoxFilters.js @@ -19,6 +19,7 @@ export default function BoxFilters({ ...props }) { const badges = filters.map((filter, pos) => ) // TODO: localize this + return ( {badges} diff --git a/nest_frontend/components/interactive/BoxLoggedIn.js b/nest_frontend/components/interactive/BoxLoggedIn.js index ad3488c..dba6e51 100644 --- a/nest_frontend/components/interactive/BoxLoggedIn.js +++ b/nest_frontend/components/interactive/BoxLoggedIn.js @@ -13,7 +13,7 @@ import ContextLanguage from "../../contexts/ContextLanguage" /** * 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} * @constructor */ diff --git a/nest_frontend/components/interactive/BoxRepositoryCreate.module.css b/nest_frontend/components/interactive/BoxRepositoryCreate.module.css deleted file mode 100644 index 3ba2249..0000000 --- a/nest_frontend/components/interactive/BoxRepositoryCreate.module.css +++ /dev/null @@ -1,3 +0,0 @@ -.BoxRepositoryCreate { - -} diff --git a/nest_frontend/components/interactive/BoxRepositoryTweets.js b/nest_frontend/components/interactive/BoxRepositoryTweets.js index b03a774..822cba7 100644 --- a/nest_frontend/components/interactive/BoxRepositoryTweets.js +++ b/nest_frontend/components/interactive/BoxRepositoryTweets.js @@ -1,14 +1,22 @@ -import React, { useContext } from "react" +import React from "react" import BoxFullScrollable from "../base/BoxFullScrollable" import SummaryTweet from "./SummaryTweet" -import ContextLanguage from "../../contexts/ContextLanguage" 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 }) { - const { strings } = useContext(ContextLanguage) - const { tweets } = useContext(ContextRepositoryViewer) + const strings = useStrings() + const { tweets } = useRepositoryViewer() let content if(tweets.length === 0) { diff --git a/nest_frontend/components/interactive/BoxUserCreate.js b/nest_frontend/components/interactive/BoxUserCreate.js index 5996a03..8280460 100644 --- a/nest_frontend/components/interactive/BoxUserCreate.js +++ b/nest_frontend/components/interactive/BoxUserCreate.js @@ -9,6 +9,15 @@ import FormAlert from "../base/formparts/FormAlert" 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 }) { const [username, setUsername] = useState("") const [email, setEmail] = useState("") diff --git a/nest_frontend/components/interactive/BoxUserList.js b/nest_frontend/components/interactive/BoxUserList.js index db0f6a4..4f18b1b 100644 --- a/nest_frontend/components/interactive/BoxUserList.js +++ b/nest_frontend/components/interactive/BoxUserList.js @@ -5,6 +5,16 @@ import SummaryUser from "./SummaryUser" 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 }) { const { strings } = useContext(ContextLanguage) diff --git a/nest_frontend/components/interactive/BoxVisualizationMap.js b/nest_frontend/components/interactive/BoxVisualizationMap.js index 9e4f82e..910ff21 100644 --- a/nest_frontend/components/interactive/BoxVisualizationMap.js +++ b/nest_frontend/components/interactive/BoxVisualizationMap.js @@ -2,10 +2,17 @@ import React, { useContext, useMemo } from "react" import BoxMap from "../base/BoxMap" import ContextLanguage from "../../contexts/ContextLanguage" import { Marker, Popup } from "react-leaflet" -import { Location } from "../../utils/location" +import { Location } from "../../objects/location" 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 }) { const { strings } = useContext(ContextLanguage) const { tweets, mapViewHook } = useContext(ContextRepositoryViewer) diff --git a/nest_frontend/components/interactive/BoxVisualizationWordcloud.js b/nest_frontend/components/interactive/BoxVisualizationWordcloud.js index be53923..2cfe97b 100644 --- a/nest_frontend/components/interactive/BoxVisualizationWordcloud.js +++ b/nest_frontend/components/interactive/BoxVisualizationWordcloud.js @@ -1,10 +1,10 @@ -import React, { useContext } from "react" +import React, { useCallback, useContext } from "react" import BoxWordcloud from "../base/BoxWordcloud" import ContextLanguage from "../../contexts/ContextLanguage" import BoxFull from "../base/BoxFull" import Empty from "./Empty" import ContextRepositoryViewer from "../../contexts/ContextRepositoryViewer" -import { FilterContains } from "../../utils/Filter" +import { FilterContains } from "../../objects/Filter" export default function BoxVisualizationWordcloud({ ...props }) { @@ -19,9 +19,12 @@ export default function BoxVisualizationWordcloud({ ...props }) { ) } - const onWordClick = word => { - appendFilter(new FilterContains(false, word.text)) - } + const onWordClick = useCallback( + word => { + appendFilter(new FilterContains(word.text)) + }, + [appendFilter] + ) return ( ` 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) return ( diff --git a/nest_frontend/components/interactive/FormInlineHashtag.js b/nest_frontend/components/interactive/FormInlineHashtag.js index a1a156f..e6753b6 100644 --- a/nest_frontend/components/interactive/FormInlineHashtag.js +++ b/nest_frontend/components/interactive/FormInlineHashtag.js @@ -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 +/** + * A {@link FormInline} allowing the user to select a Twitter hashtag. + * + * @param submit - Function 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 }) { const validate = value => { diff --git a/nest_frontend/components/interactive/FormInlineLocation.js b/nest_frontend/components/interactive/FormInlineLocation.js index eab623b..f55a6ca 100644 --- a/nest_frontend/components/interactive/FormInlineLocation.js +++ b/nest_frontend/components/interactive/FormInlineLocation.js @@ -6,6 +6,21 @@ import ButtonIconOnly from "../base/ButtonIconOnly" 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( { mapViewHook, diff --git a/nest_frontend/components/interactive/FormInlineText.js b/nest_frontend/components/interactive/FormInlineText.js index 00217f6..80c625d 100644 --- a/nest_frontend/components/interactive/FormInlineText.js +++ b/nest_frontend/components/interactive/FormInlineText.js @@ -6,6 +6,19 @@ import ButtonIconOnly from "../base/ButtonIconOnly" 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> called to set the value of the text field. + * @param submit - Function called when the submit button is pressed. + * @param props - Additional props to pass to the form. + * @returns {JSX.Element} + * @constructor + */ export default function FormInlineText( { textIcon = faFont, diff --git a/nest_frontend/components/interactive/FormInlineBADatetime.js b/nest_frontend/components/interactive/FormInlineTimeRay.js similarity index 72% rename from nest_frontend/components/interactive/FormInlineBADatetime.js rename to nest_frontend/components/interactive/FormInlineTimeRay.js index ccf88dc..90b5815 100644 --- a/nest_frontend/components/interactive/FormInlineBADatetime.js +++ b/nest_frontend/components/interactive/FormInlineTimeRay.js @@ -11,7 +11,20 @@ import TimeRay from "../../objects/TimeRay" 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> 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, buttonIcon = faPlus, diff --git a/nest_frontend/components/interactive/FormInlineUser.js b/nest_frontend/components/interactive/FormInlineUser.js index 836acfa..275e655 100644 --- a/nest_frontend/components/interactive/FormInlineUser.js +++ b/nest_frontend/components/interactive/FormInlineUser.js @@ -3,11 +3,17 @@ import FormInlineText from "./FormInlineText" 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 +/** + * A {@link FormInline} allowing the user to select a Twitter user. + * + * @param submit - Function 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 }) { const validate = value => { diff --git a/nest_frontend/components/interactive/PickerFilter.js b/nest_frontend/components/interactive/PickerFilter.js index c44f6b4..478fe43 100644 --- a/nest_frontend/components/interactive/PickerFilter.js +++ b/nest_frontend/components/interactive/PickerFilter.js @@ -5,6 +5,13 @@ import ButtonPicker from "./ButtonPicker" 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 }) { const { filterTab, setFilterTab, setVisualizationTab } = useContext(ContextRepositoryViewer) diff --git a/nest_frontend/components/interactive/PickerVisualization.js b/nest_frontend/components/interactive/PickerVisualization.js index 37f85e0..2bee8e7 100644 --- a/nest_frontend/components/interactive/PickerVisualization.js +++ b/nest_frontend/components/interactive/PickerVisualization.js @@ -4,6 +4,13 @@ import ContextRepositoryViewer from "../../contexts/ContextRepositoryViewer" 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 }) { const { visualizationTab, setVisualizationTab } = useContext(ContextRepositoryViewer) diff --git a/nest_frontend/components/interactive/SummaryTweet.js b/nest_frontend/components/interactive/SummaryTweet.js index b3d2809..2033d77 100644 --- a/nest_frontend/components/interactive/SummaryTweet.js +++ b/nest_frontend/components/interactive/SummaryTweet.js @@ -6,6 +6,14 @@ import SummaryText from "../base/summary/SummaryText" 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 }) { let icon if(tweet["location"]) { diff --git a/nest_frontend/components/interactive/SummaryUser.js b/nest_frontend/components/interactive/SummaryUser.js index 395763b..0124205 100644 --- a/nest_frontend/components/interactive/SummaryUser.js +++ b/nest_frontend/components/interactive/SummaryUser.js @@ -8,6 +8,16 @@ import SummaryButton from "../base/summary/SummaryButton" 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 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 }) { const { strings } = useContext(ContextLanguage)