Skip to content

Commit

Permalink
Bump formik from 2.4.5 to 2.4.6 (#8358)
Browse files Browse the repository at this point in the history
* Bump formik from 2.4.5 to 2.4.6

Bumps [formik](https://github.com/jaredpalmer/formik) from 2.4.5 to 2.4.6.
- [Release notes](https://github.com/jaredpalmer/formik/releases)
- [Commits](https://github.com/jaredpalmer/formik/compare/formik@2.4.5...formik@2.4.6)

---
updated-dependencies:
- dependency-name: formik
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* mock async icon

* use isEqual because formik no longer maintains reference equality on the initialValues object

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ben Loe <ben@pixiebrix.com>
  • Loading branch information
dependabot[bot] and Ben Loe committed Apr 30, 2024
1 parent 92fae7a commit 06960f0
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 12 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -79,7 +79,7 @@
"filenamify": "^6.0.0",
"filter-altered-clicks": "^2.0.1",
"fit-textarea": "^3.0.0",
"formik": "^2.4.5",
"formik": "^2.4.6",
"fuse.js": "^7.0.0",
"generate-schema": "^2.6.0",
"handlebars": "^4.7.8",
Expand Down
28 changes: 28 additions & 0 deletions src/__mocks__/@/components/asyncIcon.ts
@@ -0,0 +1,28 @@
/*
* Copyright (C) 2024 PixieBrix, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import type { Nullishable } from "@/utils/nullishUtils";
import type { IconStringDefinition } from "@/types/contract";
import type { IconProp } from "@fortawesome/fontawesome-svg-core";

export function useAsyncIcon(
icon: Nullishable<IconStringDefinition>,
defaultIcon: IconProp,
placeholder: IconProp = defaultIcon,
): IconProp {
return defaultIcon;
}
12 changes: 5 additions & 7 deletions src/components/form/useFieldAnnotations.ts
Expand Up @@ -30,7 +30,7 @@ import {
import { type ModComponentFormState } from "@/pageEditor/starterBricks/formStateTypes";
import { type FormikContextType } from "formik";
import { produce } from "immer";
import { get, isEmpty, set } from "lodash";
import { get, isEmpty, isEqual, set } from "lodash";
import { AnnotationType } from "@/types/annotationTypes";
import { isNullOrBlank } from "@/utils/stringUtils";
import { type Expression } from "@/types/runtimeTypes";
Expand Down Expand Up @@ -98,14 +98,12 @@ function useFieldAnnotations(fieldPath: string): FieldAnnotation[] {
return true;
}

if (
const detailValue =
typeof annotation.detail === "object" &&
"expression" in annotation.detail
) {
return annotation.detail.expression === value;
}

return annotation.detail === value;
? annotation.detail.expression
: annotation.detail;
return isEqual(detailValue, value);
})
.map(({ message, type, actions }) => {
const fieldAnnotation: FieldAnnotation = {
Expand Down

0 comments on commit 06960f0

Please sign in to comment.