From c26c9c5aedf0aa3a830e69d2d63e46c7785fe6a8 Mon Sep 17 00:00:00 2001 From: Gibson Han <66423127+gibsonliketheguitar@users.noreply.github.com> Date: Wed, 9 Feb 2022 14:58:04 +0700 Subject: [PATCH 01/19] add logEvent with event title "export_json" --- src/components/TableHeader/Export/Export.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/TableHeader/Export/Export.tsx b/src/components/TableHeader/Export/Export.tsx index cf7033a7..6aade1cd 100644 --- a/src/components/TableHeader/Export/Export.tsx +++ b/src/components/TableHeader/Export/Export.tsx @@ -153,6 +153,7 @@ export default function Export({ query, closeModal }) { saveAs(csvBlob, fileName); break; case "json": + analytics.logEvent("export_json") const jsonData = docs.map((doc: any) => columns.reduce(selectedColumnsJsonReducer(doc), { id: doc.id }) ); From 2a54821cdd42cca0d191da89d79a82828385f355 Mon Sep 17 00:00:00 2001 From: Gibson Han <66423127+gibsonliketheguitar@users.noreply.github.com> Date: Wed, 9 Feb 2022 15:11:49 +0700 Subject: [PATCH 02/19] add conditional to logEvent with title "export_csv" or "export_tsv" --- src/components/TableHeader/Export/Export.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/TableHeader/Export/Export.tsx b/src/components/TableHeader/Export/Export.tsx index 6aade1cd..5cf0015e 100644 --- a/src/components/TableHeader/Export/Export.tsx +++ b/src/components/TableHeader/Export/Export.tsx @@ -140,6 +140,9 @@ export default function Export({ query, closeModal }) { switch (exportType) { case "csv": case "tsv": + exportType === "tsv" + ? analytics.logEvent("export_tsv") + : analytics.logEvent("export_csv"); const csvData = docs.map((doc: any) => columns.reduce(selectedColumnsCsvReducer(doc), {}) ); @@ -153,7 +156,7 @@ export default function Export({ query, closeModal }) { saveAs(csvBlob, fileName); break; case "json": - analytics.logEvent("export_json") + analytics.logEvent("export_json"); const jsonData = docs.map((doc: any) => columns.reduce(selectedColumnsJsonReducer(doc), { id: doc.id }) ); From d66a5dbd61a3517db77089e83424f5161a937c88 Mon Sep 17 00:00:00 2001 From: Gibson Han <66423127+gibsonliketheguitar@users.noreply.github.com> Date: Wed, 9 Feb 2022 16:18:28 +0700 Subject: [PATCH 03/19] add feat to track if tsv or csv is uploaded --- src/components/TableHeader/ImportCsv.tsx | 29 +++++++++++++++---- .../Wizards/ImportCsvWizard/index.tsx | 7 ++++- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/src/components/TableHeader/ImportCsv.tsx b/src/components/TableHeader/ImportCsv.tsx index 8a26737a..a3b36d19 100644 --- a/src/components/TableHeader/ImportCsv.tsx +++ b/src/components/TableHeader/ImportCsv.tsx @@ -1,4 +1,4 @@ -import React, { useState, useCallback } from "react"; +import React, { useState, useCallback, useRef } from "react"; import clsx from "clsx"; import parse from "csv-parse"; import { useDropzone } from "react-dropzone"; @@ -79,6 +79,11 @@ const useStyles = makeStyles((theme) => }) ); +export enum ImportType { + CSV = "csv", + TSV = "tsv", +} + export interface IImportCsvProps { render?: ( onClick: (event: React.MouseEvent) => void @@ -91,6 +96,7 @@ export default function ImportCsv({ render, PopoverProps }: IImportCsvProps) { const { userClaims } = useAppContext(); const { table } = useProjectContext(); + const importTypeRef = useRef(ImportType.CSV); const [open, setOpen] = useState(null); const [tab, setTab] = useState("upload"); const [csvData, setCsvData] = @@ -133,11 +139,20 @@ export default function ImportCsv({ render, PopoverProps }: IImportCsvProps) { reader.onload = (event: any) => parseCsv(event.target.result); reader.readAsText(file); }, []); - const { getRootProps, getInputProps, isDragActive } = useDropzone({ - onDrop, - multiple: false, - accept: ["text/csv", "text/tab-separated-values"], - }); + + function handleSetUploadType(dropzonefile) { + if (dropzonefile.length === 0) return; + if (dropzonefile[0].type === "text/tab-separated-values") + importTypeRef.current = ImportType.TSV; + else importTypeRef.current = ImportType.CSV; + } + + const { acceptedFiles, getRootProps, getInputProps, isDragActive } = + useDropzone({ + onDrop, + multiple: false, + accept: ["text/csv", "text/tab-separated-values"], + }); const [handlePaste] = useDebouncedCallback( (value: string) => parseCsv(value), @@ -232,6 +247,7 @@ export default function ImportCsv({ render, PopoverProps }: IImportCsvProps) { + {handleSetUploadType(acceptedFiles)} {validCsv ? "Valid CSV or TSV" : "Click to upload or drop CSV or TSV file here"} @@ -303,6 +319,7 @@ export default function ImportCsv({ render, PopoverProps }: IImportCsvProps) { {openWizard && csvData && ( setOpenWizard(false)} csvData={csvData} /> diff --git a/src/components/Wizards/ImportCsvWizard/index.tsx b/src/components/Wizards/ImportCsvWizard/index.tsx index 940a5459..4011716c 100644 --- a/src/components/Wizards/ImportCsvWizard/index.tsx +++ b/src/components/Wizards/ImportCsvWizard/index.tsx @@ -21,6 +21,7 @@ import { ColumnConfig } from "@src/hooks/useTable/useTableConfig"; import { useProjectContext } from "@src/contexts/ProjectContext"; import { getFieldProp } from "@src/components/fields"; import { analytics } from "@src/analytics"; +import { ImportType } from "@src/components/TableHeader/ImportCsv"; export type CsvConfig = { pairs: { csvKey: string; columnKey: string }[]; @@ -36,6 +37,7 @@ export interface IStepProps { } export interface IImportCsvWizardProps { + importType: ImportType; handleClose: () => void; csvData: { columns: string[]; @@ -44,6 +46,7 @@ export interface IImportCsvWizardProps { } export default function ImportCsvWizard({ + importType, handleClose, csvData, }: IImportCsvWizardProps) { @@ -96,7 +99,9 @@ export default function ImportCsvWizard({ for (const col of config.newColumns) { tableActions.column.add(col.name, col.type, col); } - analytics.logEvent("import_csv"); + importType === ImportType.TSV + ? analytics.logEvent("import_tsv") + : analytics.logEvent("import_csv"); // Close wizard setOpen(false); setTimeout(handleClose, 300); From f95f5c8fb5ba12dc2e48f11bc9bf010accdeb6fc Mon Sep 17 00:00:00 2001 From: Gibson Han <66423127+gibsonliketheguitar@users.noreply.github.com> Date: Wed, 9 Feb 2022 17:51:08 +0700 Subject: [PATCH 04/19] add error handling w/snackbar when user does not upload .tsv or .csv --- src/components/TableHeader/ImportCsv.tsx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/components/TableHeader/ImportCsv.tsx b/src/components/TableHeader/ImportCsv.tsx index a3b36d19..c0e0ad04 100644 --- a/src/components/TableHeader/ImportCsv.tsx +++ b/src/components/TableHeader/ImportCsv.tsx @@ -3,6 +3,7 @@ import clsx from "clsx"; import parse from "csv-parse"; import { useDropzone } from "react-dropzone"; import { useDebouncedCallback } from "use-debounce"; +import { useSnackbar } from "notistack"; import { makeStyles, createStyles } from "@mui/styles"; import { @@ -95,6 +96,7 @@ export default function ImportCsv({ render, PopoverProps }: IImportCsvProps) { const classes = useStyles(); const { userClaims } = useAppContext(); const { table } = useProjectContext(); + const { enqueueSnackbar } = useSnackbar(); const importTypeRef = useRef(ImportType.CSV); const [open, setOpen] = useState(null); @@ -136,8 +138,18 @@ export default function ImportCsv({ render, PopoverProps }: IImportCsvProps) { const onDrop = useCallback(async (acceptedFiles) => { const file = acceptedFiles[0]; const reader = new FileReader(); - reader.onload = (event: any) => parseCsv(event.target.result); - reader.readAsText(file); + try { + reader.onload = (event: any) => parseCsv(event.target.result); + reader.readAsText(file); + } catch (error) { + enqueueSnackbar(`Please import a .tsv or .csv file`, { + variant: "error", + anchorOrigin: { + vertical: "top", + horizontal: "center", + }, + }); + } }, []); function handleSetUploadType(dropzonefile) { From a5ef00b8ac3796f1b15caaf6c8c5bbde26ed9080 Mon Sep 17 00:00:00 2001 From: Gibson Han <66423127+gibsonliketheguitar@users.noreply.github.com> Date: Wed, 9 Feb 2022 22:14:39 +0700 Subject: [PATCH 05/19] refactor, where tab selection set importMethodRef, add helper function to set dataTypeRef when pasting data, and logEvent to track "import_[importType]" with payload { type:[importType]} --- src/components/TableHeader/ImportCsv.tsx | 87 ++++++++++++++----- .../Wizards/ImportCsvWizard/index.tsx | 4 +- 2 files changed, 64 insertions(+), 27 deletions(-) diff --git a/src/components/TableHeader/ImportCsv.tsx b/src/components/TableHeader/ImportCsv.tsx index c0e0ad04..8adc05ba 100644 --- a/src/components/TableHeader/ImportCsv.tsx +++ b/src/components/TableHeader/ImportCsv.tsx @@ -28,6 +28,7 @@ import ImportIcon from "@src/assets/icons/Import"; import FileUploadIcon from "@src/assets/icons/Upload"; import CheckIcon from "@mui/icons-material/CheckCircle"; +import { analytics } from "@src/analytics"; import ImportCsvWizard, { IImportCsvWizardProps, } from "@src/components/Wizards/ImportCsvWizard"; @@ -85,6 +86,13 @@ export enum ImportType { TSV = "tsv", } +export enum ImportMethod { + DEFAULT = "", + PASTE = "paste", + UPLOAD = "upload", + URL = "url", +} + export interface IImportCsvProps { render?: ( onClick: (event: React.MouseEvent) => void @@ -99,6 +107,7 @@ export default function ImportCsv({ render, PopoverProps }: IImportCsvProps) { const { enqueueSnackbar } = useSnackbar(); const importTypeRef = useRef(ImportType.CSV); + const importMethodRef = useRef(ImportMethod.DEFAULT); const [open, setOpen] = useState(null); const [tab, setTab] = useState("upload"); const [csvData, setCsvData] = @@ -136,11 +145,15 @@ export default function ImportCsv({ render, PopoverProps }: IImportCsvProps) { }); const onDrop = useCallback(async (acceptedFiles) => { - const file = acceptedFiles[0]; - const reader = new FileReader(); try { + const file = acceptedFiles[0]; + const reader = new FileReader(); reader.onload = (event: any) => parseCsv(event.target.result); reader.readAsText(file); + importTypeRef.current = + file.type === "text/tab-separated-values" + ? ImportType.TSV + : ImportType.CSV; } catch (error) { enqueueSnackbar(`Please import a .tsv or .csv file`, { variant: "error", @@ -152,24 +165,33 @@ export default function ImportCsv({ render, PopoverProps }: IImportCsvProps) { } }, []); - function handleSetUploadType(dropzonefile) { - if (dropzonefile.length === 0) return; - if (dropzonefile[0].type === "text/tab-separated-values") - importTypeRef.current = ImportType.TSV; - else importTypeRef.current = ImportType.CSV; + const { getRootProps, getInputProps, isDragActive } = useDropzone({ + onDrop, + multiple: false, + accept: ["text/csv", "text/tab-separated-values"], + }); + + function setDataTypeRef(data: string) { + const getFirstLine = data?.match(/^(.*)/)?.[0]; + /** + * Catching edge case with regex + * EG: "hello\tworld"\tFirst + * - find \t between quotes, and replace with '\s' + * - w/ the \t pattern test it against the formatted string + */ + const strInQuotes = /"(.*?)"/; + const tabsWithSpace = (str: string) => str.replace("\t", "s"); + const formatString = + getFirstLine?.replace(strInQuotes, tabsWithSpace) ?? ""; + const tabPattern = /\t/; + return tabPattern.test(formatString) + ? (importTypeRef.current = ImportType.TSV) + : (importTypeRef.current = ImportType.CSV); } - - const { acceptedFiles, getRootProps, getInputProps, isDragActive } = - useDropzone({ - onDrop, - multiple: false, - accept: ["text/csv", "text/tab-separated-values"], - }); - - const [handlePaste] = useDebouncedCallback( - (value: string) => parseCsv(value), - 1000 - ); + const [handlePaste] = useDebouncedCallback((value: string) => { + parseCsv(value); + setDataTypeRef(value); + }, 1000); const [loading, setLoading] = useState(false); const [handleUrl] = useDebouncedCallback((value: string) => { @@ -179,6 +201,7 @@ export default function ImportCsv({ render, PopoverProps }: IImportCsvProps) { .then((res) => res.text()) .then((data) => { parseCsv(data); + setDataTypeRef(data); setLoading(false); }) .catch((e) => { @@ -231,9 +254,21 @@ export default function ImportCsv({ render, PopoverProps }: IImportCsvProps) { } variant="fullWidth" > - - - + (importMethodRef.current = ImportMethod.UPLOAD)} + /> + (importMethodRef.current = ImportMethod.PASTE)} + /> + (importMethodRef.current = ImportMethod.URL)} + /> @@ -259,7 +294,6 @@ export default function ImportCsv({ render, PopoverProps }: IImportCsvProps) { - {handleSetUploadType(acceptedFiles)} {validCsv ? "Valid CSV or TSV" : "Click to upload or drop CSV or TSV file here"} @@ -323,7 +357,12 @@ export default function ImportCsv({ render, PopoverProps }: IImportCsvProps) { color="primary" disabled={!validCsv} className={classes.continueButton} - onClick={() => setOpenWizard(true)} + onClick={() => { + setOpenWizard(true); + analytics.logEvent(`import_${importMethodRef.current}`, { + type: importTypeRef.current, + }); + }} > Continue diff --git a/src/components/Wizards/ImportCsvWizard/index.tsx b/src/components/Wizards/ImportCsvWizard/index.tsx index 4011716c..bf474f83 100644 --- a/src/components/Wizards/ImportCsvWizard/index.tsx +++ b/src/components/Wizards/ImportCsvWizard/index.tsx @@ -99,9 +99,7 @@ export default function ImportCsvWizard({ for (const col of config.newColumns) { tableActions.column.add(col.name, col.type, col); } - importType === ImportType.TSV - ? analytics.logEvent("import_tsv") - : analytics.logEvent("import_csv"); + analytics.logEvent("import_success", { type: importType }); //change this import_success // Close wizard setOpen(false); setTimeout(handleClose, 300); From 89e1fd1d198fb0074fb1107790a1f7e4d86fb7a7 Mon Sep 17 00:00:00 2001 From: Gibson Han <66423127+gibsonliketheguitar@users.noreply.github.com> Date: Wed, 9 Feb 2022 22:51:10 +0700 Subject: [PATCH 06/19] add logEvent for "local_filter" & "table_filter" --- src/components/TableHeader/Filters/index.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/components/TableHeader/Filters/index.tsx b/src/components/TableHeader/Filters/index.tsx index c26f85a7..d1b3ba11 100644 --- a/src/components/TableHeader/Filters/index.tsx +++ b/src/components/TableHeader/Filters/index.tsx @@ -19,6 +19,7 @@ import FiltersPopover from "./FiltersPopover"; import FilterInputs from "./FilterInputs"; import { useFilterInputs, INITIAL_QUERY } from "./useFilterInputs"; +import { analytics } from "@src/analytics"; import type { TableFilter } from "@src/hooks/useTable"; import { useProjectContext } from "@src/contexts/ProjectContext"; import { useAppContext } from "@src/contexts/AppContext"; @@ -30,6 +31,11 @@ const shouldDisableApplyButton = (value: any) => typeof value !== "number" && typeof value !== "object"; +enum FilterType { + YOURFILTER = "local_filter", + TABLEFILTER = "table_filter", +} + export default function Filters() { const { table, tableState, tableActions } = useProjectContext(); const { userDoc, userClaims } = useAppContext(); @@ -109,12 +115,14 @@ export default function Filters() { // Save table filters to table schema document const setTableFilters = (filters: TableFilter[]) => { + analytics.logEvent(FilterType.TABLEFILTER); tableActions?.table.updateConfig("filters", filters); tableActions?.table.updateConfig("filtersOverridable", canOverrideCheckbox); }; // Save user filters to user document // null overrides table filters const setUserFilters = (filters: TableFilter[] | null) => { + analytics.logEvent(FilterType.YOURFILTER); userDoc.dispatch({ action: DocActions.update, data: { From 6f4200c45f3a015edc8db01efe1f4d2d606804ca Mon Sep 17 00:00:00 2001 From: Gibson Han <66423127+gibsonliketheguitar@users.noreply.github.com> Date: Thu, 10 Feb 2022 09:55:39 +0700 Subject: [PATCH 07/19] remove duplicate tracking of tsv, csv, and json --- src/components/TableHeader/Export/Export.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/components/TableHeader/Export/Export.tsx b/src/components/TableHeader/Export/Export.tsx index 5cf0015e..b4e27003 100644 --- a/src/components/TableHeader/Export/Export.tsx +++ b/src/components/TableHeader/Export/Export.tsx @@ -125,7 +125,7 @@ export default function Export({ query, closeModal }) { const handleExport = async () => { handleClose(); - analytics.logEvent("export_table", { + analytics.logEvent("export_type", { type: exportType, }); enqueueSnackbar("Preparing file. Download will start shortly."); @@ -140,9 +140,6 @@ export default function Export({ query, closeModal }) { switch (exportType) { case "csv": case "tsv": - exportType === "tsv" - ? analytics.logEvent("export_tsv") - : analytics.logEvent("export_csv"); const csvData = docs.map((doc: any) => columns.reduce(selectedColumnsCsvReducer(doc), {}) ); @@ -156,7 +153,6 @@ export default function Export({ query, closeModal }) { saveAs(csvBlob, fileName); break; case "json": - analytics.logEvent("export_json"); const jsonData = docs.map((doc: any) => columns.reduce(selectedColumnsJsonReducer(doc), { id: doc.id }) ); From c6541b0ca143c4e84e425722d88d81ae1876099a Mon Sep 17 00:00:00 2001 From: Gibson Han <66423127+gibsonliketheguitar@users.noreply.github.com> Date: Thu, 10 Feb 2022 10:11:25 +0700 Subject: [PATCH 08/19] add logEvent for "export_tableSettings" && import_tableSettings change "export_type" back to "export_table" --- src/components/TableHeader/Export/Export.tsx | 2 +- src/components/TableSettings/ActionsMenu/ExportSettings.tsx | 2 ++ src/components/TableSettings/ActionsMenu/ImportSettings.tsx | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/TableHeader/Export/Export.tsx b/src/components/TableHeader/Export/Export.tsx index b4e27003..cf7033a7 100644 --- a/src/components/TableHeader/Export/Export.tsx +++ b/src/components/TableHeader/Export/Export.tsx @@ -125,7 +125,7 @@ export default function Export({ query, closeModal }) { const handleExport = async () => { handleClose(); - analytics.logEvent("export_type", { + analytics.logEvent("export_table", { type: exportType, }); enqueueSnackbar("Preparing file. Download will start shortly."); diff --git a/src/components/TableSettings/ActionsMenu/ExportSettings.tsx b/src/components/TableSettings/ActionsMenu/ExportSettings.tsx index ebd723b2..4027a0d5 100644 --- a/src/components/TableSettings/ActionsMenu/ExportSettings.tsx +++ b/src/components/TableSettings/ActionsMenu/ExportSettings.tsx @@ -6,6 +6,7 @@ import { useSnackbar } from "notistack"; import { MenuItem, DialogContentText, LinearProgress } from "@mui/material"; +import { analytics } from "@src/analytics"; import Modal from "@src/components/Modal"; import CodeEditor from "@src/components/CodeEditor"; @@ -49,6 +50,7 @@ export default function ExportSettings({ const { enqueueSnackbar } = useSnackbar(); const handleExport = () => { + analytics.logEvent("export_tableSettings"); navigator.clipboard.writeText(formattedJson); enqueueSnackbar("Copied to clipboard"); handleClose(); diff --git a/src/components/TableSettings/ActionsMenu/ImportSettings.tsx b/src/components/TableSettings/ActionsMenu/ImportSettings.tsx index 8d98fed2..11cf513d 100644 --- a/src/components/TableSettings/ActionsMenu/ImportSettings.tsx +++ b/src/components/TableSettings/ActionsMenu/ImportSettings.tsx @@ -8,6 +8,7 @@ import { useSnackbar } from "notistack"; import { MenuItem, DialogContentText, FormHelperText } from "@mui/material"; +import { analytics } from "@src/analytics"; import Modal from "@src/components/Modal"; import DiffEditor from "@src/components/CodeEditor/DiffEditor"; @@ -59,8 +60,8 @@ export default function ImportSettings({ const { enqueueSnackbar } = useSnackbar(); const { setValue } = useFormMethods; const handleImport = () => { + analytics.logEvent("import_tableSettings"); const { id, collection, ...newValues } = JSON.parse(newSettings); - for (const key in newValues) { setValue(key, newValues[key], { shouldDirty: true, From 2d43d195dab49c1bb455f7e9b25186814e9d480b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Feb 2022 00:55:30 +0000 Subject: [PATCH 09/19] Bump vm2 from 3.9.5 to 3.9.7 Bumps [vm2](https://github.com/patriksimek/vm2) from 3.9.5 to 3.9.7. - [Release notes](https://github.com/patriksimek/vm2/releases) - [Changelog](https://github.com/patriksimek/vm2/blob/master/CHANGELOG.md) - [Commits](https://github.com/patriksimek/vm2/compare/3.9.5...3.9.7) --- updated-dependencies: - dependency-name: vm2 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/yarn.lock b/yarn.lock index badf1454..7b08ee97 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3753,25 +3753,25 @@ acorn-walk@^7.1.1: resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc" integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== +acorn-walk@^8.2.0: + version "8.2.0" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" + integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== + acorn@^6.4.1: version "6.4.2" resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.2.tgz#35866fd710528e92de10cf06016498e47e39e1e6" integrity sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ== -acorn@^7.1.0, acorn@^7.4.0: +acorn@^7.1.0, acorn@^7.1.1, acorn@^7.4.0: version "7.4.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.1.1.tgz#e35668de0b402f359de515c5482a1ab9f89a69bf" - integrity sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg== - -acorn@^8.2.4: - version "8.4.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.4.1.tgz#56c36251fc7cabc7096adc18f05afe814321a28c" - integrity sha512-asabaBSkEKosYKMITunzX177CXxQ4Q8BSSzMTKD+FefUhipQC70gfW5SiUDhYQ3vk8G+81HqQk7Fv9OXwwn9KA== +acorn@^8.2.4, acorn@^8.7.0: + version "8.7.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.0.tgz#90951fde0f8f09df93549481e5fc141445b791cf" + integrity sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ== address@1.1.2, address@^1.0.1: version "1.1.2" @@ -17320,9 +17320,12 @@ vm-browserify@^1.0.1: integrity sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ== vm2@^3.9.3: - version "3.9.5" - resolved "https://registry.yarnpkg.com/vm2/-/vm2-3.9.5.tgz#5288044860b4bbace443101fcd3bddb2a0aa2496" - integrity sha512-LuCAHZN75H9tdrAiLFf030oW7nJV5xwNMuk1ymOZwopmuK3d2H4L1Kv4+GFHgarKiLfXXLFU+7LDABHnwOkWng== + version "3.9.7" + resolved "https://registry.yarnpkg.com/vm2/-/vm2-3.9.7.tgz#bb87aa677c97c61e23a6cb6547e44e990517a6f6" + integrity sha512-g/GZ7V0Mlmch3eDVOATvAXr1GsJNg6kQ5PjvYy3HbJMCRn5slNbo/u73Uy7r5yUej1cRa3ZjtoVwcWSQuQ/fow== + dependencies: + acorn "^8.7.0" + acorn-walk "^8.2.0" w3c-hr-time@^1.0.2: version "1.0.2" From b2680f7a57d1a19dbcb6fbfcb190c78eef8fba16 Mon Sep 17 00:00:00 2001 From: Harini Janakiraman Date: Tue, 15 Feb 2022 12:56:19 +1100 Subject: [PATCH 10/19] Create config.yml --- .github/ISSUE_TEMPLATE/config.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/config.yml diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..42fe08b2 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,4 @@ +contact_links: + - name: πŸ€” Support & questions + url: https://discord.com/invite/fjBugmvzZP + about: Chat with us for live support on discord. From 8542bf6717526f577d93dde46d89c9412e3d75e8 Mon Sep 17 00:00:00 2001 From: Gibson Han <66423127+gibsonliketheguitar@users.noreply.github.com> Date: Tue, 15 Feb 2022 09:30:37 +0700 Subject: [PATCH 11/19] change enum's naming to camelCase inorder to match codebase style --- src/components/TableHeader/Filters/index.tsx | 8 +++--- src/components/TableHeader/ImportCsv.tsx | 29 ++++++++++---------- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/src/components/TableHeader/Filters/index.tsx b/src/components/TableHeader/Filters/index.tsx index d1b3ba11..06849a67 100644 --- a/src/components/TableHeader/Filters/index.tsx +++ b/src/components/TableHeader/Filters/index.tsx @@ -32,8 +32,8 @@ const shouldDisableApplyButton = (value: any) => typeof value !== "object"; enum FilterType { - YOURFILTER = "local_filter", - TABLEFILTER = "table_filter", + yourFilter = "local_filter", + tableFilter = "table_filter", } export default function Filters() { @@ -115,14 +115,14 @@ export default function Filters() { // Save table filters to table schema document const setTableFilters = (filters: TableFilter[]) => { - analytics.logEvent(FilterType.TABLEFILTER); + analytics.logEvent(FilterType.tableFilter); tableActions?.table.updateConfig("filters", filters); tableActions?.table.updateConfig("filtersOverridable", canOverrideCheckbox); }; // Save user filters to user document // null overrides table filters const setUserFilters = (filters: TableFilter[] | null) => { - analytics.logEvent(FilterType.YOURFILTER); + analytics.logEvent(FilterType.yourFilter); userDoc.dispatch({ action: DocActions.update, data: { diff --git a/src/components/TableHeader/ImportCsv.tsx b/src/components/TableHeader/ImportCsv.tsx index 8adc05ba..49034dc6 100644 --- a/src/components/TableHeader/ImportCsv.tsx +++ b/src/components/TableHeader/ImportCsv.tsx @@ -82,15 +82,14 @@ const useStyles = makeStyles((theme) => ); export enum ImportType { - CSV = "csv", - TSV = "tsv", + csv = "csv", + tsv = "tsv", } export enum ImportMethod { - DEFAULT = "", - PASTE = "paste", - UPLOAD = "upload", - URL = "url", + paste = "paste", + upload = "upload", + url = "url", } export interface IImportCsvProps { @@ -106,8 +105,8 @@ export default function ImportCsv({ render, PopoverProps }: IImportCsvProps) { const { table } = useProjectContext(); const { enqueueSnackbar } = useSnackbar(); - const importTypeRef = useRef(ImportType.CSV); - const importMethodRef = useRef(ImportMethod.DEFAULT); + const importTypeRef = useRef(ImportType.csv); + const importMethodRef = useRef(ImportMethod.upload); const [open, setOpen] = useState(null); const [tab, setTab] = useState("upload"); const [csvData, setCsvData] = @@ -152,8 +151,8 @@ export default function ImportCsv({ render, PopoverProps }: IImportCsvProps) { reader.readAsText(file); importTypeRef.current = file.type === "text/tab-separated-values" - ? ImportType.TSV - : ImportType.CSV; + ? ImportType.tsv + : ImportType.csv; } catch (error) { enqueueSnackbar(`Please import a .tsv or .csv file`, { variant: "error", @@ -185,8 +184,8 @@ export default function ImportCsv({ render, PopoverProps }: IImportCsvProps) { getFirstLine?.replace(strInQuotes, tabsWithSpace) ?? ""; const tabPattern = /\t/; return tabPattern.test(formatString) - ? (importTypeRef.current = ImportType.TSV) - : (importTypeRef.current = ImportType.CSV); + ? (importTypeRef.current = ImportType.tsv) + : (importTypeRef.current = ImportType.csv); } const [handlePaste] = useDebouncedCallback((value: string) => { parseCsv(value); @@ -257,17 +256,17 @@ export default function ImportCsv({ render, PopoverProps }: IImportCsvProps) { (importMethodRef.current = ImportMethod.UPLOAD)} + onClick={() => (importMethodRef.current = ImportMethod.upload)} /> (importMethodRef.current = ImportMethod.PASTE)} + onClick={() => (importMethodRef.current = ImportMethod.paste)} /> (importMethodRef.current = ImportMethod.URL)} + onClick={() => (importMethodRef.current = ImportMethod.url)} /> From 5d5a04cbb427d2b7c06fcb61a7b66afc40ba361b Mon Sep 17 00:00:00 2001 From: Harini Janakiraman Date: Tue, 15 Feb 2022 13:42:06 +1100 Subject: [PATCH 12/19] Update config.yml --- .github/ISSUE_TEMPLATE/config.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 42fe08b2..35aaf69b 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,4 +1,8 @@ +blank_issues_enabled: false contact_links: - name: πŸ€” Support & questions url: https://discord.com/invite/fjBugmvzZP about: Chat with us for live support on discord. + - name: πŸ™Œ Want to join our team? + url: https://www.rowy.io/jobs + about: Get in touch to contribute & work with Rowy From e162cb46d87ad16cd99616ab8d10a1eea812a3dc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Feb 2022 11:48:30 +0000 Subject: [PATCH 13/19] Bump follow-redirects from 1.14.7 to 1.14.8 Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.7 to 1.14.8. - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) - [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.7...v1.14.8) --- updated-dependencies: - dependency-name: follow-redirects dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index badf1454..f501af35 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8011,9 +8011,9 @@ fn.name@1.x.x: integrity sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw== follow-redirects@^1.0.0: - version "1.14.7" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.7.tgz#2004c02eb9436eee9a21446a6477debf17e81685" - integrity sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ== + version "1.14.8" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.8.tgz#016996fb9a11a100566398b1c6839337d7bfa8fc" + integrity sha512-1x0S9UVJHsQprFcEC/qnNzBLcIxsjAV905f/UkQxbclCsoTWlacCNOpQa/anodLl2uaEKFhfWOvM2Qg77+15zA== for-in@^1.0.2: version "1.0.2" From 50ccabdc028d7a0ffd6fe110913248c87bfa90a1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 19 Feb 2022 11:55:33 +0000 Subject: [PATCH 14/19] Bump url-parse from 1.4.7 to 1.5.7 Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.4.7 to 1.5.7. - [Release notes](https://github.com/unshiftio/url-parse/releases) - [Commits](https://github.com/unshiftio/url-parse/compare/1.4.7...1.5.7) --- updated-dependencies: - dependency-name: url-parse dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/yarn.lock b/yarn.lock index badf1454..ce7e437e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14052,9 +14052,9 @@ querystring@^0.2.0: integrity sha512-wkvS7mL/JMugcup3/rMitHmd9ecIGd2lhFhK9N3UUQ450h66d1r3Y9nvXzQAW1Lq+wyx61k/1pfKS5KuKiyEbg== querystringify@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.1.1.tgz#60e5a5fd64a7f8bfa4d2ab2ed6fdf4c85bad154e" - integrity sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA== + version "2.2.0" + resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" + integrity sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ== queue-microtask@^1.2.2: version "1.2.3" @@ -17108,18 +17108,10 @@ url-parse-lax@^3.0.0: dependencies: prepend-http "^2.0.0" -url-parse@^1.4.3: - version "1.4.7" - resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.4.7.tgz#a8a83535e8c00a316e403a5db4ac1b9b853ae278" - integrity sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg== - dependencies: - querystringify "^2.1.1" - requires-port "^1.0.0" - -url-parse@^1.5.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.1.tgz#d5fa9890af8a5e1f274a2c98376510f6425f6e3b" - integrity sha512-HOfCOUJt7iSYzEx/UqgtwKRMC6EU91NFhsCHMv9oM03VJcVo2Qrp8T8kI9D7amFf1cu+/3CEhgb3rF9zL7k85Q== +url-parse@^1.4.3, url-parse@^1.5.1: + version "1.5.7" + resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.7.tgz#00780f60dbdae90181f51ed85fb24109422c932a" + integrity sha512-HxWkieX+STA38EDk7CE9MEryFeHCKzgagxlGvsdS7WBImq9Mk+PGwiT56w82WI3aicwJA8REp42Cxo98c8FZMA== dependencies: querystringify "^2.1.1" requires-port "^1.0.0" From ef773f27c9b7356181d58f47f3deee2ae4681133 Mon Sep 17 00:00:00 2001 From: Sidney Alcantara Date: Mon, 21 Feb 2022 12:45:48 +1100 Subject: [PATCH 15/19] disable Aggregate column (closes ROWY-332) --- src/components/fields/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/fields/index.tsx b/src/components/fields/index.tsx index 6ac07b56..04ed6d45 100644 --- a/src/components/fields/index.tsx +++ b/src/components/fields/index.tsx @@ -31,7 +31,7 @@ import Json from "./Json"; import Code from "./Code"; import Action from "./Action"; import Derivative from "./Derivative"; -import Aggregate from "./Aggregate"; +// import Aggregate from "./Aggregate"; import CreatedBy from "./CreatedBy"; import UpdatedBy from "./UpdatedBy"; import CreatedAt from "./CreatedAt"; @@ -77,7 +77,7 @@ export const FIELDS: IFieldConfig[] = [ // CLOUD FUNCTION Action, Derivative, - Aggregate, + // Aggregate, Status, // AUDITING CreatedBy, From 86e44a5d27fa557aaba2b33a8f601b09be847d36 Mon Sep 17 00:00:00 2001 From: shamsmosowi Date: Tue, 22 Feb 2022 10:32:21 +0800 Subject: [PATCH 16/19] updated rowy utils defs --- src/components/CodeEditor/rowy.d.ts | 117 +++++++++++++++++++++------- 1 file changed, 90 insertions(+), 27 deletions(-) diff --git a/src/components/CodeEditor/rowy.d.ts b/src/components/CodeEditor/rowy.d.ts index d3282d8a..de9d706e 100644 --- a/src/components/CodeEditor/rowy.d.ts +++ b/src/components/CodeEditor/rowy.d.ts @@ -1,32 +1,95 @@ -/** - * utility functions - */ -declare namespace rowy { +type RowyFile = { + downloadURL: string; + name: string; + type: string; + lastModifiedTS: number; +}; +type RowyUser = { + email: any; + emailVerified: boolean; + displayName: string; + photoURL: string; + uid: string; + timestamp: number; +}; +type uploadOptions = { + bucket?: string; + folderPath?: string; + fileName?: string; +}; +interface Rowy { + metadata: { + /** + * The project ID of the project running this function. + */ + projectId: () => Promise; + /** + * The numeric project ID of the project running this function. + */ + projectNumber: () => Promise; + /** + * The email address of service account running this function. + * This is the service account that is used to call other APIs. + * Ensure that the service account has the correct permissions. + */ + serviceAccountEmail: () => Promise; + /** + * a user object of the service account running this function. + * Compatible with Rowy audit fields + * Can be used to add createdBy or updatedBy fields to a document. + */ + serviceAccountUser: () => Promise; + }; /** - * uploads a file to the cloud storage from a url + * Gives access to the Secret Manager. + * manage your secrets in the Google Cloud Console. */ - function url2storage( - url: string, - storagePath: string, - fileName?: string - ): Promise<{ - downloadURL: string; - name: string; - type: string; - lastModifiedTS: Date; - }>; - + secrets: { + /** + * Get an existing secret from the secret manager. + */ + get: (name: string, version?: string) => Promise; + }; /** - * Gets the secret defined in Google Cloud Secret + * Gives access to the Cloud Storage. */ - async function getSecret(name: string, v?: string): Promise; - - async function getServiceAccountUser(): Promise<{ - email: string; - emailVerified: boolean; - displayName: string; - photoURL: string; - uid: string; - timestamp: number; - }>; + storage: { + upload: { + /** + * uploads a file to storage bucket from an external url. + */ + url: ( + url: string, + options: uploadOptions + ) => Promise; + /** + * uploads a file to storage bucket from a buffer or string + */ + data: ( + data: Buffer | string, + options: uploadOptions + ) => Promise; + }; + }; + /** + * @deprecated will be removed in version 2.0. + * use rowy.secrets.get instead. + * Get an existing secret from the secret manager. + */ + getSecret: (name: string, version?: string) => Promise; + /** + * @deprecated will be removed in version 2.0. + * use rowy.metadata.serviceAccountUser instead. + * Compatible with Rowy audit fields + * Can be used to add createdBy or updatedBy fields to a document. + */ + getServiceAccountUser: () => Promise; + /** + * @deprecated will be removed in version 2.0. + * use rowy.storage.upload.url instead. + * uploads a file to storage bucket from an external url. + */ + url2storage: (url: string) => Promise; } + +declare const rowy: Rowy; From 4a6c6b123c2bcc77777c206aff825ce49a143710 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 27 Feb 2022 22:42:35 +0000 Subject: [PATCH 17/19] Bump url-parse from 1.4.7 to 1.5.10 Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.4.7 to 1.5.10. - [Release notes](https://github.com/unshiftio/url-parse/releases) - [Commits](https://github.com/unshiftio/url-parse/compare/1.4.7...1.5.10) --- updated-dependencies: - dependency-name: url-parse dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/yarn.lock b/yarn.lock index badf1454..47a669b1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14052,9 +14052,9 @@ querystring@^0.2.0: integrity sha512-wkvS7mL/JMugcup3/rMitHmd9ecIGd2lhFhK9N3UUQ450h66d1r3Y9nvXzQAW1Lq+wyx61k/1pfKS5KuKiyEbg== querystringify@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.1.1.tgz#60e5a5fd64a7f8bfa4d2ab2ed6fdf4c85bad154e" - integrity sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA== + version "2.2.0" + resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" + integrity sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ== queue-microtask@^1.2.2: version "1.2.3" @@ -17108,18 +17108,10 @@ url-parse-lax@^3.0.0: dependencies: prepend-http "^2.0.0" -url-parse@^1.4.3: - version "1.4.7" - resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.4.7.tgz#a8a83535e8c00a316e403a5db4ac1b9b853ae278" - integrity sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg== - dependencies: - querystringify "^2.1.1" - requires-port "^1.0.0" - -url-parse@^1.5.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.1.tgz#d5fa9890af8a5e1f274a2c98376510f6425f6e3b" - integrity sha512-HOfCOUJt7iSYzEx/UqgtwKRMC6EU91NFhsCHMv9oM03VJcVo2Qrp8T8kI9D7amFf1cu+/3CEhgb3rF9zL7k85Q== +url-parse@^1.4.3, url-parse@^1.5.1: + version "1.5.10" + resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.10.tgz#9d3c2f736c1d75dd3bd2be507dcc111f1e2ea9c1" + integrity sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ== dependencies: querystringify "^2.1.1" requires-port "^1.0.0" From a842fb37456632d40a349a7f6857f280ba7ab756 Mon Sep 17 00:00:00 2001 From: Nikita Sviridenko Date: Mon, 28 Feb 2022 11:48:37 +0100 Subject: [PATCH 18/19] Fix initial values for nested fields --- src/components/SideDrawer/Form/index.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/components/SideDrawer/Form/index.tsx b/src/components/SideDrawer/Form/index.tsx index 6895fc2b..2236bd7f 100644 --- a/src/components/SideDrawer/Form/index.tsx +++ b/src/components/SideDrawer/Form/index.tsx @@ -2,6 +2,7 @@ import { createElement, useEffect } from "react"; import { useForm } from "react-hook-form"; import _sortBy from "lodash/sortBy"; import _isEmpty from "lodash/isEmpty"; +import _set from "lodash/set"; import createPersistedState from "use-persisted-state"; import { Stack, FormControlLabel, Switch } from "@mui/material"; @@ -44,7 +45,16 @@ export default function Form({ values }: IFormProps) { // Get initial values from fields config. This won’t be written to the db // when the SideDrawer is opened. Only dirty fields will be written const initialValues = fields.reduce( - (a, { key, type }) => ({ ...a, [key]: getFieldProp("initialValue", type) }), + (a, { key, type }) => { + const initialValue = getFieldProp("initialValue", type); + const nextValues = { ...a }; + if (key.indexOf('.') !== -1) { + _set(nextValues, key, initialValue); + } else { + nextValues[key] = initialValue; + } + return nextValues; + }, {} ); const { ref: docRef, ...rowValues } = values; From 72d82549bfd80fc23cea19b2815979039cad1e86 Mon Sep 17 00:00:00 2001 From: Sidney Alcantara Date: Wed, 2 Mar 2022 18:54:30 +1100 Subject: [PATCH 19/19] bump version number --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8dae7833..fb7fd252 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Rowy", - "version": "2.3.2", + "version": "2.4.0-rc.0", "homepage": "https://rowy.io", "repository": { "type": "git",