diff --git a/package.json b/package.json index 202b7027..d1943637 100644 --- a/package.json +++ b/package.json @@ -12,14 +12,15 @@ "@date-io/date-fns": "1.x", "@emotion/react": "^11.4.0", "@emotion/styled": "^11.3.0", + "@hookform/resolvers": "^2.8.1", "@mdi/js": "^5.9.55", "@monaco-editor/react": "^4.1.0", "@mui/icons-material": "^5.0.0", "@mui/lab": "^5.0.0-alpha.47", "@mui/material": "^5.0.0", "@mui/styles": "^5.0.0", - "@rowy/form-builder": "^0.1.2", - "@rowy/multiselect": "^0.1.12", + "@rowy/form-builder": "^0.2.0", + "@rowy/multiselect": "^0.2.0", "@tinymce/tinymce-react": "^3.12.6", "algoliasearch": "^4.8.6", "ansi-to-react": "^6.1.5", @@ -51,7 +52,7 @@ "react-element-scroll-hook": "^1.1.0", "react-firebaseui": "^5.0.2", "react-helmet": "^6.1.0", - "react-hook-form": "^6", + "react-hook-form": "^7.16.1", "react-image": "^4.0.3", "react-joyride": "^2.3.0", "react-json-view": "^1.19.1", diff --git a/src/components/Auth/MarketingBanner.tsx b/src/components/Auth/MarketingBanner.tsx index bc0f91d7..20021334 100644 --- a/src/components/Auth/MarketingBanner.tsx +++ b/src/components/Auth/MarketingBanner.tsx @@ -76,7 +76,7 @@ export default function MarketingBanner() { target="_blank" rel="noopener noreferrer" > - Join our Community + Join our community ); diff --git a/src/components/ConnectServiceSelect/PopupContents.tsx b/src/components/ConnectServiceSelect/PopupContents.tsx index cfd77e59..0b6b71c7 100644 --- a/src/components/ConnectServiceSelect/PopupContents.tsx +++ b/src/components/ConnectServiceSelect/PopupContents.tsx @@ -194,7 +194,7 @@ export default function PopupContents({ color="primary" className={classes.selectAllButton} > - Clear Selection + Clear selection diff --git a/src/components/EmptyState.tsx b/src/components/EmptyState.tsx index 6ac2a78d..11e28d99 100644 --- a/src/components/EmptyState.tsx +++ b/src/components/EmptyState.tsx @@ -29,7 +29,7 @@ export interface IEmptyStateProps extends Partial { * Override with props that are passed to the root MUI `Grid` component. */ export default function EmptyState({ - message = "Nothing Here", + message = "Nothing here", description, Icon = ErrorIcon, fullScreen = false, diff --git a/src/components/ErrorBoundary.tsx b/src/components/ErrorBoundary.tsx index aa9f78ae..5c20b96d 100644 --- a/src/components/ErrorBoundary.tsx +++ b/src/components/ErrorBoundary.tsx @@ -27,7 +27,7 @@ class ErrorBoundary extends React.Component< return ( {this.state.errorMessage} @@ -50,7 +50,7 @@ class ErrorBoundary extends React.Component< rel="noopener noreferrer" endIcon={} > - Report Issue + Report issue )} diff --git a/src/components/Home/AccessDenied.tsx b/src/components/Home/AccessDenied.tsx index e2ac2f48..5c103085 100644 --- a/src/components/Home/AccessDenied.tsx +++ b/src/components/Home/AccessDenied.tsx @@ -15,7 +15,7 @@ export default function AccessDenied() { @@ -38,7 +38,7 @@ export default function AccessDenied() { } diff --git a/src/components/Navigation/Breadcrumbs.tsx b/src/components/Navigation/Breadcrumbs.tsx index c44cee6e..b12898f8 100644 --- a/src/components/Navigation/Breadcrumbs.tsx +++ b/src/components/Navigation/Breadcrumbs.tsx @@ -34,7 +34,7 @@ export default function Breadcrumbs(props: BreadcrumbsProps) { return ( } - aria-label="sub-table breadcrumbs" + aria-label="Sub-table breadcrumbs" sx={{ "& ol": { pl: 2, diff --git a/src/components/Navigation/Notifications/index.tsx b/src/components/Navigation/Notifications/index.tsx index ee160e68..162e2a3e 100644 --- a/src/components/Navigation/Notifications/index.tsx +++ b/src/components/Navigation/Notifications/index.tsx @@ -98,7 +98,7 @@ const Notification = () => { secondary={notification.subtitle} /> - + diff --git a/src/components/Settings/ProjectSettings/About.tsx b/src/components/Settings/ProjectSettings/About.tsx index 84827fc8..de51d51a 100644 --- a/src/components/Settings/ProjectSettings/About.tsx +++ b/src/components/Settings/ProjectSettings/About.tsx @@ -161,7 +161,7 @@ export default function About() { onClick={checkForUpdate} loading={checkState === "LOADING"} > - Check for Updates + Check for updates ) : ( )} @@ -189,7 +189,7 @@ export default function About() { justifyContent="space-between" > - Firebase Project: {projectId} + Firebase project: {projectId} diff --git a/src/components/Settings/ProjectSettings/Authentication.tsx b/src/components/Settings/ProjectSettings/Authentication.tsx index 5980a7bf..f4a7af5c 100644 --- a/src/components/Settings/ProjectSettings/Authentication.tsx +++ b/src/components/Settings/ProjectSettings/Authentication.tsx @@ -21,7 +21,7 @@ export default function Authentication({ return ( <> ({ value: option, diff --git a/src/components/Settings/ProjectSettings/RowyRun.tsx b/src/components/Settings/ProjectSettings/RowyRun.tsx index cf89505e..5d51d20d 100644 --- a/src/components/Settings/ProjectSettings/RowyRun.tsx +++ b/src/components/Settings/ProjectSettings/RowyRun.tsx @@ -157,7 +157,7 @@ export default function RowyRun({ target="_blank" rel="noopener noreferrer" > - Deploy Instructions + Deploy instructions ); @@ -212,7 +212,7 @@ export default function RowyRun({ onClick={checkForUpdate} loading={checkState === "LOADING"} > - Check for Updates + Check for updates ) : ( deployButton @@ -248,7 +248,7 @@ export default function RowyRun({ setInputRowyRunUrl(e.target.value)} diff --git a/src/components/Settings/ThemeColorPicker.tsx b/src/components/Settings/ThemeColorPicker.tsx index cf43c479..c22900d9 100644 --- a/src/components/Settings/ThemeColorPicker.tsx +++ b/src/components/Settings/ThemeColorPicker.tsx @@ -51,7 +51,7 @@ export default function ThemeColorPicker({ > - Light Theme + Light theme - Dark Theme + Dark theme {open && ( setOpen(false)} maxWidth="xs" body={ @@ -80,7 +80,7 @@ export default function InviteUser() { setEmail(e.target.value)} diff --git a/src/components/Settings/UserManagement/UserItem.tsx b/src/components/Settings/UserManagement/UserItem.tsx index 5d42967f..3fdc086c 100644 --- a/src/components/Settings/UserManagement/UserItem.tsx +++ b/src/components/Settings/UserManagement/UserItem.tsx @@ -126,24 +126,24 @@ export default function UserItem({ id, user, roles: rolesProp }: User) { sx: { mr: 0.5, - "& .MuiInputLabel-root": { + "&& .MuiInputLabel-root": { opacity: 0, mt: -3, }, - "& .MuiFilledInput-root": { + "&& .MuiFilledInput-root": { bgcolor: "transparent", boxShadow: 0, "&::before": { content: "none" }, "&:hover, &.Mui-focused": { bgcolor: "action.hover" }, }, - "& .MuiSelect-select.MuiFilledInput-input": { + "&& .MuiSelect-select.MuiFilledInput-input": { typography: "button", pl: 1, pr: 3.25, }, - "& .MuiSelect-icon": { + "&& .MuiSelect-icon": { right: 2, }, }, @@ -163,9 +163,9 @@ export default function UserItem({ id, user, roles: rolesProp }: User) { - + diff --git a/src/components/Settings/UserSettings/Account.tsx b/src/components/Settings/UserSettings/Account.tsx index 90ef50a3..96e6958b 100644 --- a/src/components/Settings/UserSettings/Account.tsx +++ b/src/components/Settings/UserSettings/Account.tsx @@ -27,7 +27,7 @@ export default function Account({ settings }: IUserSettingsChildProps) { diff --git a/src/components/Setup/Step1RowyRun.tsx b/src/components/Setup/Step1RowyRun.tsx index f4d89755..ee55026e 100644 --- a/src/components/Setup/Step1RowyRun.tsx +++ b/src/components/Setup/Step1RowyRun.tsx @@ -85,7 +85,7 @@ export default function Step1RowyRun({ rel="noopener noreferrer" endIcon={} > - Deploy Instructions + Deploy instructions ); @@ -122,7 +122,7 @@ export default function Step1RowyRun({ > setRowyRunUrl(e.target.value)} diff --git a/src/components/Setup/Step2ServiceAccount.tsx b/src/components/Setup/Step2ServiceAccount.tsx index 08af0388..264cdf7d 100644 --- a/src/components/Setup/Step2ServiceAccount.tsx +++ b/src/components/Setup/Step2ServiceAccount.tsx @@ -104,7 +104,7 @@ export default function Step2ServiceAccount({ rel="noopener noreferrer" endIcon={} > - Set Up Service Account + Set up service account - Setup Guide + Setup guide diff --git a/src/components/Setup/Step3ProjectOwner.tsx b/src/components/Setup/Step3ProjectOwner.tsx index 6228e3b8..73fe92ad 100644 --- a/src/components/Setup/Step3ProjectOwner.tsx +++ b/src/components/Setup/Step3ProjectOwner.tsx @@ -101,7 +101,7 @@ export default function Step3ProjectOwner({ rel="noopener noreferrer" endIcon={} > - Set Up in Firebase Console + Set up in Firebase Console )} @@ -168,7 +168,7 @@ export default function Step4Rules({ > setNewRules(e.target.value)} multiline @@ -189,7 +189,7 @@ export default function Step4Rules({ onClick={setRules} loading={rulesStatus === "LOADING"} > - Set Firestore Rules + Set Firestore rules {rulesStatus !== "LOADING" && typeof rulesStatus === "string" && ( diff --git a/src/components/SideDrawer/Form/Autosave.tsx b/src/components/SideDrawer/Form/Autosave.tsx index de996ad7..7dc6854f 100644 --- a/src/components/SideDrawer/Form/Autosave.tsx +++ b/src/components/SideDrawer/Form/Autosave.tsx @@ -4,7 +4,7 @@ import _isEqual from "lodash/isEqual"; import _pick from "lodash/pick"; import _pickBy from "lodash/pickBy"; -import { Control, UseFormMethods, useWatch } from "react-hook-form"; +import { Control, UseFormReturn, useWatch } from "react-hook-form"; import { Values } from "./utils"; import { useProjectContext } from "contexts/ProjectContext"; @@ -14,8 +14,8 @@ export interface IAutosaveProps { control: Control; docRef: firebase.default.firestore.DocumentReference; row: any; - reset: UseFormMethods["reset"]; - dirtyFields: UseFormMethods["formState"]["dirtyFields"]; + reset: UseFormReturn["reset"]; + dirtyFields: UseFormReturn["formState"]["dirtyFields"]; } const getEditables = (values: Values, tableState?: TableState) => diff --git a/src/components/SideDrawer/Form/Reset.tsx b/src/components/SideDrawer/Form/Reset.tsx index eef61568..fd75d038 100644 --- a/src/components/SideDrawer/Form/Reset.tsx +++ b/src/components/SideDrawer/Form/Reset.tsx @@ -1,5 +1,5 @@ import { useEffect } from "react"; -import { UseFormMethods } from "react-hook-form"; +import { UseFormReturn } from "react-hook-form"; import _pickBy from "lodash/pickBy"; import _isEqual from "lodash/isEqual"; @@ -7,9 +7,9 @@ import { Values } from "./utils"; export interface IResetProps { defaultValues: Values; - dirtyFields: UseFormMethods["formState"]["dirtyFields"]; - reset: UseFormMethods["reset"]; - getValues: UseFormMethods["getValues"]; + dirtyFields: UseFormReturn["formState"]["dirtyFields"]; + reset: UseFormReturn["reset"]; + getValues: UseFormReturn["getValues"]; } /** @@ -38,7 +38,7 @@ export default function Reset({ const diff = _pickBy(getValues(), (v, k) => !_isEqual(v, resetValues[k])); // Reset if needed & keep the current dirty fields if (Object.keys(diff).length > 0) { - reset(resetValues, { isDirty: true, dirtyFields: true }); + reset(resetValues, { keepDirty: true }); } }, // `defaultValues` is the `initialValue` of each field type + diff --git a/src/components/SideDrawer/Form/index.tsx b/src/components/SideDrawer/Form/index.tsx index 13b8d54e..729342d2 100644 --- a/src/components/SideDrawer/Form/index.tsx +++ b/src/components/SideDrawer/Form/index.tsx @@ -38,10 +38,8 @@ export default function Form({ values }: IFormProps) { const { ref: docRef, ...rowValues } = values; const defaultValues = { ...initialValues, ...rowValues }; - const { control, reset, formState, getValues } = useForm({ - mode: "onBlur", - defaultValues, - }); + const methods = useForm({ mode: "onBlur", defaultValues }); + const { control, reset, formState, getValues } = methods; const { dirtyFields } = formState; // const { sideDrawerRef } = useProjectContext(); @@ -105,6 +103,7 @@ export default function Form({ values }: IFormProps) { control, docRef, disabled: field.editable === false, + useFormMethods: methods, })} ); @@ -113,7 +112,7 @@ export default function Form({ values }: IFormProps) { diff --git a/src/components/Table/BulkActions/index.tsx b/src/components/Table/BulkActions/index.tsx index bd015d06..f9b8f955 100644 --- a/src/components/Table/BulkActions/index.tsx +++ b/src/components/Table/BulkActions/index.tsx @@ -262,11 +262,11 @@ export default function BulkActions({ selectedRows, columns, clearSelection }) { color="secondary" onClick={() => { requestConfirmation({ - title: "Duplicate Rows?", + title: "Duplicate rows?", body: `Are you sure you want to duplicate the ${numSelected} selected row${ numSelected !== 1 ? "s" : "" }?`, - confirm: "Duplicate Rows", + confirm: "Duplicate rows", handleConfirm: handleDuplicate, }); }} @@ -283,11 +283,11 @@ export default function BulkActions({ selectedRows, columns, clearSelection }) { color="secondary" onClick={() => { requestConfirmation({ - title: "Delete Rows?", + title: "Delete rows?", body: `Are you sure you want to delete the ${numSelected} select row${ numSelected !== 1 ? "s" : "" }?`, - confirm: "Delete Rows", + confirm: "Delete rows", handleConfirm: handleDelete, }); }} diff --git a/src/components/Table/CellValidation.tsx b/src/components/Table/CellValidation.tsx index 02fb78db..16d9bf04 100644 --- a/src/components/Table/CellValidation.tsx +++ b/src/components/Table/CellValidation.tsx @@ -67,7 +67,7 @@ export default function CellValidation({ <> } - title="Invalid Data" + title="Invalid data" message="This row will not be saved until all the required fields contain valid data" placement="right" render={({ openTooltip }) => } @@ -82,7 +82,7 @@ export default function CellValidation({ <> } - title="Required Field" + title="Required field" message="This row will not be saved until all the required fields contain valid data" placement="right" render={({ openTooltip }) => } diff --git a/src/components/Table/ColumnHeader.tsx b/src/components/Table/ColumnHeader.tsx index fb33e31c..c5e720b1 100644 --- a/src/components/Table/ColumnHeader.tsx +++ b/src/components/Table/ColumnHeader.tsx @@ -263,7 +263,7 @@ export default function DraggableHeaderRenderer({ title={ isAsc ? "Unsort" - : `Sort by ${isDesc ? "Ascending" : "Descending"}` + : `Sort by ${isDesc ? "ascending" : "descending"}` } > ({ aria-label={ isAsc ? "Unsort" - : `Sort by ${isDesc ? "Ascending" : "Descending"}` + : `Sort by ${isDesc ? "ascending" : "descending"}` } className={clsx(classes.sortIcon, isAsc && classes.sortIconAsc)} > @@ -290,7 +290,7 @@ export default function DraggableHeaderRenderer({ (column as any).type ))) && ( - + handleChange("defaultValue.type")(e.target.value)} fullWidth diff --git a/src/components/Table/ColumnMenu/FieldSettings/index.tsx b/src/components/Table/ColumnMenu/FieldSettings/index.tsx index 917351e0..ce388fe7 100644 --- a/src/components/Table/ColumnMenu/FieldSettings/index.tsx +++ b/src/components/Table/ColumnMenu/FieldSettings/index.tsx @@ -91,7 +91,7 @@ export default function FieldSettings(props: IMenuModalProps) { sx={{ borderTop: 1, borderColor: "divider", pt: 3 }} > - Rendered Field Config + Rendered field config {createElement(rendedFieldSettings, { config: newConfig, @@ -114,7 +114,7 @@ export default function FieldSettings(props: IMenuModalProps) { onClick: () => { if (showRebuildPrompt) { requestConfirmation({ - title: "Deploy Changes", + title: "Deploy changes", body: "You have made changes that affect the behavior of the cloud function of this table, Would you like to redeploy it now?", confirm: "Deploy", cancel: "Later", diff --git a/src/components/Table/ColumnMenu/FieldsDropdown.tsx b/src/components/Table/ColumnMenu/FieldsDropdown.tsx index 766ae672..43fc7702 100644 --- a/src/components/Table/ColumnMenu/FieldsDropdown.tsx +++ b/src/components/Table/ColumnMenu/FieldsDropdown.tsx @@ -49,8 +49,8 @@ export default function FieldsDropdown({ {option.label} )} - label={label || "Field Type"} - labelPlural="Field Types" + label={label || "Field type"} + labelPlural="field types" TextFieldProps={{ hiddenLabel: hideLabel, helperText: value && getFieldProp("description", value), diff --git a/src/components/Table/ColumnMenu/NameChange.tsx b/src/components/Table/ColumnMenu/NameChange.tsx index 04dbbf73..a2320672 100644 --- a/src/components/Table/ColumnMenu/NameChange.tsx +++ b/src/components/Table/ColumnMenu/NameChange.tsx @@ -19,7 +19,7 @@ export default function NameChange({ return ( { diff --git a/src/components/Table/ColumnMenu/NewColumn.tsx b/src/components/Table/ColumnMenu/NewColumn.tsx index 6f00e1a6..78ea9b7c 100644 --- a/src/components/Table/ColumnMenu/NewColumn.tsx +++ b/src/components/Table/ColumnMenu/NewColumn.tsx @@ -43,7 +43,7 @@ export default function NewColumn({ return ( setColumnLabel(e.target.value)} @@ -67,7 +67,7 @@ export default function NewColumn({ value={fieldKey} variant="filled" id="fieldKey" - label="Field Key" + label="Field key" type="text" fullWidth onChange={(e) => setFieldKey(e.target.value)} diff --git a/src/components/Table/ColumnMenu/TypeChange.tsx b/src/components/Table/ColumnMenu/TypeChange.tsx index 6e9a227b..93a2fafb 100644 --- a/src/components/Table/ColumnMenu/TypeChange.tsx +++ b/src/components/Table/ColumnMenu/TypeChange.tsx @@ -18,7 +18,7 @@ export default function FormDialog({ return ( } actions={{ primary: { diff --git a/src/components/Table/EmptyTable.tsx b/src/components/Table/EmptyTable.tsx index 7c82e1fd..0fb9944d 100644 --- a/src/components/Table/EmptyTable.tsx +++ b/src/components/Table/EmptyTable.tsx @@ -19,7 +19,7 @@ export default function EmptyTable() { <>
- Get Started + Get started There is existing data in the Firestore collection: @@ -51,7 +51,7 @@ export default function EmptyTable() { <>
- Get Started + Get started There is no data in the Firestore collection: @@ -113,7 +113,7 @@ export default function EmptyTable() { } disabled={!columnMenuRef?.current} > - Add Column + Add column diff --git a/src/components/Table/Filters/index.tsx b/src/components/Table/Filters/index.tsx index f1a6ca06..c8aac8ee 100644 --- a/src/components/Table/Filters/index.tsx +++ b/src/components/Table/Filters/index.tsx @@ -455,7 +455,7 @@ const Filters = () => { SelectProps={{ displayEmpty: true }} > - Select Column + Select column {filterColumns.map((c) => ( @@ -483,7 +483,7 @@ const Filters = () => { SelectProps={{ displayEmpty: true }} > - Select Condition + Select condition {operators.map((operator) => ( diff --git a/src/components/Table/FinalColumnHeader.tsx b/src/components/Table/FinalColumnHeader.tsx index 98b90175..75eb32a9 100644 --- a/src/components/Table/FinalColumnHeader.tsx +++ b/src/components/Table/FinalColumnHeader.tsx @@ -69,7 +69,7 @@ const FinalColumnHeader: Column["headerRenderer"] = ({ column }) => { className={classes.button} startIcon={} > - Add Column + Add column ); diff --git a/src/components/Table/HiddenFields.tsx b/src/components/Table/HiddenFields.tsx index 04881fa2..c8455aa3 100644 --- a/src/components/Table/HiddenFields.tsx +++ b/src/components/Table/HiddenFields.tsx @@ -140,7 +140,7 @@ export default function HiddenFields() { }, } as any)} label="Hidden fields" - labelPlural="Fields" + labelPlural="fields" options={tableColumns} value={hiddenFields ?? []} onChange={setHiddenFields} diff --git a/src/components/Table/Settings/Menu.tsx b/src/components/Table/Settings/Menu.tsx index 532c8997..010a03d8 100644 --- a/src/components/Table/Settings/Menu.tsx +++ b/src/components/Table/Settings/Menu.tsx @@ -24,7 +24,7 @@ export default function SettingsMenu({ modal, setModal }) { return (
- Webhook Type + Webhook type