Skip to content

Commit

Permalink
refactor: reorganise more components (#3838)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamdelion authored Oct 28, 2024
1 parent bdf4873 commit 3fd9058
Show file tree
Hide file tree
Showing 133 changed files with 287 additions and 334 deletions.
9 changes: 3 additions & 6 deletions editor.planx.uk/src/@planx/components/AddressInput/Editor.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import { ComponentType as TYPES } from "@opensystemslab/planx-core/types";
import {
EditorProps,
ICONS,
} from "@planx/components/ui";
import { EditorProps, ICONS } from "@planx/components/ui";
import { useFormik } from "formik";
import React from "react";
import { ModalFooter } from "ui/editor/ModalFooter";
import ModalSection from "ui/editor/ModalSection";
import ModalSectionContent from "ui/editor/ModalSectionContent";
import RichTextInput from "ui/editor/RichTextInput";
import Input from "ui/shared/Input";
import RichTextInput from "ui/editor/RichTextInput/RichTextInput";
import Input from "ui/shared/Input/Input";
import InputRow from "ui/shared/InputRow";

import { AddressInput, parseAddressInput } from "./model";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { PublicProps } from "@planx/components/ui";
import { useFormik } from "formik";
import React from "react";
import InputLabel from "ui/public/InputLabel";
import Input from "ui/shared/Input";
import Input from "ui/shared/Input/Input";
import InputRowItem from "ui/shared/InputRowItem";

import { ERROR_MESSAGE } from "../shared/constants";
Expand Down
2 changes: 1 addition & 1 deletion editor.planx.uk/src/@planx/components/Calculate/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import InputGroup from "ui/editor/InputGroup";
import { ModalFooter } from "ui/editor/ModalFooter";
import ModalSection from "ui/editor/ModalSection";
import ModalSectionContent from "ui/editor/ModalSectionContent";
import Input from "ui/shared/Input";
import Input from "ui/shared/Input/Input";
import InputRow from "ui/shared/InputRow";

import type { Calculate } from "./model";
Expand Down
8 changes: 4 additions & 4 deletions editor.planx.uk/src/@planx/components/Checklist/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ import compose from "ramda/src/compose";
import remove from "ramda/src/remove";
import React, { useEffect, useRef } from "react";
import { FormikHookReturn } from "types";
import ImgInput from "ui/editor/ImgInput";
import ImgInput from "ui/editor/ImgInput/ImgInput";
import InputGroup from "ui/editor/InputGroup";
import ListManager from "ui/editor/ListManager";
import ListManager from "ui/editor/ListManager/ListManager";
import { ModalFooter } from "ui/editor/ModalFooter";
import ModalSection from "ui/editor/ModalSection";
import ModalSectionContent from "ui/editor/ModalSectionContent";
import RichTextInput from "ui/editor/RichTextInput";
import RichTextInput from "ui/editor/RichTextInput/RichTextInput";
import SimpleMenu from "ui/editor/SimpleMenu";
import Input from "ui/shared/Input";
import Input from "ui/shared/Input/Input";
import InputRow from "ui/shared/InputRow";
import InputRowItem from "ui/shared/InputRowItem";

Expand Down
2 changes: 1 addition & 1 deletion editor.planx.uk/src/@planx/components/Checklist/Public.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import React, { useState } from "react";
import { ExpandableList, ExpandableListItem } from "ui/public/ExpandableList";
import FormWrapper from "ui/public/FormWrapper";
import FullWidthWrapper from "ui/public/FullWidthWrapper";
import ChecklistItem from "ui/shared/ChecklistItem";
import ChecklistItem from "ui/shared/ChecklistItem/ChecklistItem";
import ErrorWrapper from "ui/shared/ErrorWrapper";
import { object } from "yup";

Expand Down
6 changes: 3 additions & 3 deletions editor.planx.uk/src/@planx/components/Confirmation/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import { useFormik } from "formik";
import React, { ChangeEvent } from "react";
import ListManager, {
EditorProps as ListManagerEditorProps,
} from "ui/editor/ListManager";
} from "ui/editor/ListManager/ListManager";
import ModalSection from "ui/editor/ModalSection";
import ModalSectionContent from "ui/editor/ModalSectionContent";
import RichTextInput from "ui/editor/RichTextInput";
import Input from "ui/shared/Input";
import RichTextInput from "ui/editor/RichTextInput/RichTextInput";
import Input from "ui/shared/Input/Input";
import InputRow from "ui/shared/InputRow";

import { Confirmation, parseNextSteps, Step } from "./model";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import React, { useEffect, useState } from "react";
import Banner from "ui/public/Banner";
import FileDownload from "ui/public/FileDownload";
import NumberedList from "ui/public/NumberedList";
import ReactMarkdownOrHtml from "ui/shared/ReactMarkdownOrHtml";
import ReactMarkdownOrHtml from "ui/shared/ReactMarkdownOrHtml/ReactMarkdownOrHtml";

import type { Confirmation } from "./model";

Expand Down
9 changes: 3 additions & 6 deletions editor.planx.uk/src/@planx/components/ContactInput/Editor.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import { ComponentType as TYPES } from "@opensystemslab/planx-core/types";
import {
EditorProps,
ICONS,
} from "@planx/components/ui";
import { EditorProps, ICONS } from "@planx/components/ui";
import { useFormik } from "formik";
import React from "react";
import { ModalFooter } from "ui/editor/ModalFooter";
import ModalSection from "ui/editor/ModalSection";
import ModalSectionContent from "ui/editor/ModalSectionContent";
import RichTextInput from "ui/editor/RichTextInput";
import Input from "ui/shared/Input";
import RichTextInput from "ui/editor/RichTextInput/RichTextInput";
import Input from "ui/shared/Input/Input";
import InputRow from "ui/shared/InputRow";

import { ContactInput, parseContactInput } from "./model";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { PublicProps } from "@planx/components/ui";
import { useFormik } from "formik";
import React from "react";
import InputLabel from "ui/public/InputLabel";
import Input from "ui/shared/Input";
import Input from "ui/shared/Input/Input";
import InputRowItem from "ui/shared/InputRowItem";

import { ERROR_MESSAGE } from "../shared/constants";
Expand Down
9 changes: 3 additions & 6 deletions editor.planx.uk/src/@planx/components/Content/Editor.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
import { ComponentType as TYPES } from "@opensystemslab/planx-core/types";
import type { Content } from "@planx/components/Content/model";
import { parseContent } from "@planx/components/Content/model";
import {
EditorProps,
ICONS,
} from "@planx/components/ui";
import { EditorProps, ICONS } from "@planx/components/ui";
import { useFormik } from "formik";
import React from "react";
import ColorPicker from "ui/editor/ColorPicker";
import ColorPicker from "ui/editor/ColorPicker/ColorPicker";
import { ModalFooter } from "ui/editor/ModalFooter";
import ModalSection from "ui/editor/ModalSection";
import ModalSectionContent from "ui/editor/ModalSectionContent";
import RichTextInput from "ui/editor/RichTextInput";
import RichTextInput from "ui/editor/RichTextInput/RichTextInput";
import InputRow from "ui/shared/InputRow";

export type Props = EditorProps<TYPES.Content, Content>;
Expand Down
4 changes: 2 additions & 2 deletions editor.planx.uk/src/@planx/components/Content/Public.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { PublicProps } from "@planx/components/ui";
import { useAnalyticsTracking } from "pages/FlowEditor/lib/analytics/provider";
import React from "react";
import { getContrastTextColor } from "styleUtils";
import { emptyContent } from "ui/editor/RichTextInput";
import ReactMarkdownOrHtml from "ui/shared/ReactMarkdownOrHtml";
import { emptyContent } from "ui/editor/RichTextInput/RichTextInput";
import ReactMarkdownOrHtml from "ui/shared/ReactMarkdownOrHtml/ReactMarkdownOrHtml";

import { HelpButton, Image } from "../shared/Preview/CardHeader/styled";
import MoreInfo from "../shared/Preview/MoreInfo";
Expand Down
13 changes: 5 additions & 8 deletions editor.planx.uk/src/@planx/components/DateInput/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,17 @@ import {
DateInput,
editorValidationSchema,
paddedDate,
parseDateInput,
} from "@planx/components/DateInput/model";
import { parseDateInput } from "@planx/components/DateInput/model";
import {
EditorProps,
ICONS,
} from "@planx/components/ui";
import { EditorProps, ICONS } from "@planx/components/ui";
import { useFormik } from "formik";
import React from "react";
import { ModalFooter } from "ui/editor/ModalFooter";
import ModalSection from "ui/editor/ModalSection";
import ModalSectionContent from "ui/editor/ModalSectionContent";
import RichTextInput from "ui/editor/RichTextInput";
import DateInputUi from "ui/shared/DateInput";
import Input from "ui/shared/Input";
import RichTextInput from "ui/editor/RichTextInput/RichTextInput";
import DateInputUi from "ui/shared/DateInput/DateInput";
import Input from "ui/shared/Input/Input";
import InputRow from "ui/shared/InputRow";

export type Props = EditorProps<TYPES.DateInput, DateInput>;
Expand Down
2 changes: 1 addition & 1 deletion editor.planx.uk/src/@planx/components/DateInput/Public.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { CardHeader } from "@planx/components/shared/Preview/CardHeader/CardHead
import { PublicProps } from "@planx/components/ui";
import { useFormik } from "formik";
import React from "react";
import DateInputComponent from "ui/shared/DateInput";
import DateInputComponent from "ui/shared/DateInput/DateInput";
import InputRow from "ui/shared/InputRow";
import { object } from "yup";

Expand Down
9 changes: 3 additions & 6 deletions editor.planx.uk/src/@planx/components/DrawBoundary/Editor.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import FormControlLabel from "@mui/material/FormControlLabel";
import Switch from "@mui/material/Switch";
import { ComponentType as TYPES } from "@opensystemslab/planx-core/types";
import {
EditorProps,
ICONS,
} from "@planx/components/ui";
import { EditorProps, ICONS } from "@planx/components/ui";
import { useFormik } from "formik";
import React from "react";
import InputGroup from "ui/editor/InputGroup";
import { ModalFooter } from "ui/editor/ModalFooter";
import ModalSection from "ui/editor/ModalSection";
import ModalSectionContent from "ui/editor/ModalSectionContent";
import RichTextInput from "ui/editor/RichTextInput";
import Input from "ui/shared/Input";
import RichTextInput from "ui/editor/RichTextInput/RichTextInput";
import Input from "ui/shared/Input/Input";
import InputRow from "ui/shared/InputRow";

import type { DrawBoundary } from "./model";
Expand Down
4 changes: 2 additions & 2 deletions editor.planx.uk/src/@planx/components/FileUpload/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import React from "react";
import { ModalFooter } from "ui/editor/ModalFooter";
import ModalSection from "ui/editor/ModalSection";
import ModalSectionContent from "ui/editor/ModalSectionContent";
import RichTextInput from "ui/editor/RichTextInput";
import Input from "ui/shared/Input";
import RichTextInput from "ui/editor/RichTextInput/RichTextInput";
import Input from "ui/shared/Input/Input";
import InputRow from "ui/shared/InputRow";

function Component(props: any) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,21 @@ import { styled } from "@mui/material/styles";
import Switch from "@mui/material/Switch";
import Typography from "@mui/material/Typography";
import { ComponentType as TYPES } from "@opensystemslab/planx-core/types";
import {
EditorProps,
ICONS,
} from "@planx/components/ui";
import { EditorProps, ICONS } from "@planx/components/ui";
import { useFormik } from "formik";
import { lowerCase, merge, upperFirst } from "lodash";
import React from "react";
import ImgInput from "ui/editor/ImgInput";
import ImgInput from "ui/editor/ImgInput/ImgInput";
import ListManager, {
EditorProps as ListManagerEditorProps,
} from "ui/editor/ListManager";
} from "ui/editor/ListManager/ListManager";
import { ModalFooter } from "ui/editor/ModalFooter";
import ModalSection from "ui/editor/ModalSection";
import ModalSectionContent from "ui/editor/ModalSectionContent";
import { ModalSubtitle } from "ui/editor/ModalSubtitle";
import RichTextInput from "ui/editor/RichTextInput";
import SelectInput from "ui/editor/SelectInput";
import Input from "ui/shared/Input";
import RichTextInput from "ui/editor/RichTextInput/RichTextInput";
import SelectInput from "ui/editor/SelectInput/SelectInput";
import Input from "ui/shared/Input/Input";
import InputRow from "ui/shared/InputRow";
import InputRowItem from "ui/shared/InputRowItem";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import { HelpClickMetadata } from "pages/FlowEditor/lib/analytics/types";
import { useStore } from "pages/FlowEditor/lib/store";
import React, { useEffect, useState } from "react";
import { usePrevious } from "react-use";
import { emptyContent } from "ui/editor/RichTextInput";
import { emptyContent } from "ui/editor/RichTextInput/RichTextInput";
import FullWidthWrapper from "ui/public/FullWidthWrapper";
import ErrorWrapper from "ui/shared/ErrorWrapper";
import ReactMarkdownOrHtml from "ui/shared/ReactMarkdownOrHtml";
import ReactMarkdownOrHtml from "ui/shared/ReactMarkdownOrHtml/ReactMarkdownOrHtml";

import { FileUploadSlot } from "../FileUpload/model";
import { MoreInformation } from "../shared";
Expand Down
9 changes: 3 additions & 6 deletions editor.planx.uk/src/@planx/components/FindProperty/Editor.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import FormControlLabel from "@mui/material/FormControlLabel";
import Switch from "@mui/material/Switch";
import { ComponentType as TYPES } from "@opensystemslab/planx-core/types";
import {
EditorProps,
ICONS,
} from "@planx/components/ui";
import { EditorProps, ICONS } from "@planx/components/ui";
import { useFormik } from "formik";
import React from "react";
import InputGroup from "ui/editor/InputGroup";
import { ModalFooter } from "ui/editor/ModalFooter";
import ModalSection from "ui/editor/ModalSection";
import ModalSectionContent from "ui/editor/ModalSectionContent";
import RichTextInput from "ui/editor/RichTextInput";
import Input from "ui/shared/Input";
import RichTextInput from "ui/editor/RichTextInput/RichTextInput";
import Input from "ui/shared/Input/Input";
import InputRow from "ui/shared/InputRow";
import InputRowItem from "ui/shared/InputRowItem";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import find from "lodash/find";
import { parse, toNormalised } from "postcode";
import React, { useEffect, useState } from "react";
import InputLabel from "ui/public/InputLabel";
import Input from "ui/shared/Input";
import Input from "ui/shared/Input/Input";

import type { SiteAddress } from "../model";
import { FETCH_BLPU_CODES } from "../Public";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import React, { useEffect, useRef, useState } from "react";
import FullWidthWrapper from "ui/public/FullWidthWrapper";
import InputLabel from "ui/public/InputLabel";
import ErrorWrapper from "ui/shared/ErrorWrapper";
import Input from "ui/shared/Input";
import Input from "ui/shared/Input/Input";

import { DEFAULT_NEW_ADDRESS_LABEL, SiteAddress } from "../model";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { CardHeader } from "@planx/components/shared/Preview/CardHeader/CardHead
import { squareMetresToHectares } from "@planx/components/shared/utils";
import { PublicProps } from "@planx/components/ui";
import area from "@turf/area";
import DelayedLoadingIndicator from "components/DelayedLoadingIndicator";
import DelayedLoadingIndicator from "components/DelayedLoadingIndicator/DelayedLoadingIndicator";
import { Feature } from "geojson";
import { Store } from "pages/FlowEditor/lib/store";
import React, { useEffect, useState } from "react";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ComponentType as TYPES } from "@opensystemslab/planx-core/types";
import { useFormik } from "formik";
import React from "react";
import InputField from "ui/editor/InputField";
import InputField from "ui/editor/InputField/InputField";

import { FormError } from "../ui";

Expand Down
6 changes: 3 additions & 3 deletions editor.planx.uk/src/@planx/components/List/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import React from "react";
import { ModalFooter } from "ui/editor/ModalFooter";
import ModalSection from "ui/editor/ModalSection";
import ModalSectionContent from "ui/editor/ModalSectionContent";
import RichTextInput from "ui/editor/RichTextInput";
import SelectInput from "ui/editor/SelectInput";
import RichTextInput from "ui/editor/RichTextInput/RichTextInput";
import SelectInput from "ui/editor/SelectInput/SelectInput";
import ErrorWrapper from "ui/shared/ErrorWrapper";
import Input from "ui/shared/Input";
import Input from "ui/shared/Input/Input";
import InputRow from "ui/shared/InputRow";
import InputRowItem from "ui/shared/InputRowItem";
import InputRowLabel from "ui/shared/InputRowLabel";
Expand Down
8 changes: 4 additions & 4 deletions editor.planx.uk/src/@planx/components/MapAndLabel/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import RadioGroup from "@mui/material/RadioGroup";
import { ComponentType as TYPES } from "@opensystemslab/planx-core/types";
import { useFormik } from "formik";
import React from "react";
import ColorPicker from "ui/editor/ColorPicker";
import ColorPicker from "ui/editor/ColorPicker/ColorPicker";
import InputGroup from "ui/editor/InputGroup";
import { ModalFooter } from "ui/editor/ModalFooter";
import ModalSection from "ui/editor/ModalSection";
import ModalSectionContent from "ui/editor/ModalSectionContent";
import RichTextInput from "ui/editor/RichTextInput";
import SelectInput from "ui/editor/SelectInput";
import RichTextInput from "ui/editor/RichTextInput/RichTextInput";
import SelectInput from "ui/editor/SelectInput/SelectInput";
import InputLabel from "ui/public/InputLabel";
import Input from "ui/shared/Input";
import Input from "ui/shared/Input/Input";
import InputRow from "ui/shared/InputRow";
import InputRowItem from "ui/shared/InputRowItem";

Expand Down
Loading

0 comments on commit 3fd9058

Please sign in to comment.