From adb0bae401d11744651e6e303c1fa3e0e3a8ac30 Mon Sep 17 00:00:00 2001 From: Vu Nguyen Date: Mon, 22 Jun 2020 17:34:12 +0700 Subject: [PATCH 1/4] refactor: #1325 Refactor confirm uninstall app using react-redux hooks --- .../src/components/TextArea/index.tsx | 10 +- .../developer/developer-app-content.tsx | 2 +- .../__snapshots__/confirm-uninstall.tsx.snap | 135 --------- .../__tests__/confirm-uninstall.tsx | 102 ------- .../app-installations/confirm-uninstall.tsx | 191 ------------ .../confirm-uninstall.test.tsx.snap | 286 ++++++++++++++++++ .../__tests__/confirm-uninstall.test.tsx | 83 +++++ .../confirm-uninstall/confirm-uninstall.tsx | 130 ++++++++ .../form-schema/form-fields.ts | 10 + .../form-schema/validation-schema.ts | 16 + .../confirm-uninstall/index.ts | 2 + 11 files changed, 534 insertions(+), 433 deletions(-) delete mode 100644 packages/marketplace/src/components/ui/app-installations/__tests__/__snapshots__/confirm-uninstall.tsx.snap delete mode 100644 packages/marketplace/src/components/ui/app-installations/__tests__/confirm-uninstall.tsx delete mode 100644 packages/marketplace/src/components/ui/app-installations/confirm-uninstall.tsx create mode 100644 packages/marketplace/src/components/ui/app-installations/confirm-uninstall/__tests__/__snapshots__/confirm-uninstall.test.tsx.snap create mode 100644 packages/marketplace/src/components/ui/app-installations/confirm-uninstall/__tests__/confirm-uninstall.test.tsx create mode 100644 packages/marketplace/src/components/ui/app-installations/confirm-uninstall/confirm-uninstall.tsx create mode 100644 packages/marketplace/src/components/ui/app-installations/confirm-uninstall/form-schema/form-fields.ts create mode 100644 packages/marketplace/src/components/ui/app-installations/confirm-uninstall/form-schema/validation-schema.ts create mode 100644 packages/marketplace/src/components/ui/app-installations/confirm-uninstall/index.ts diff --git a/packages/elements/src/components/TextArea/index.tsx b/packages/elements/src/components/TextArea/index.tsx index 22d3fd4927..7b05c1aeee 100644 --- a/packages/elements/src/components/TextArea/index.tsx +++ b/packages/elements/src/components/TextArea/index.tsx @@ -5,7 +5,7 @@ import { checkError } from '../../utils/form' export interface TextAreaProps { placeholder?: string id: string - labelText: string + labelText?: string name: string dataTest?: string validate?: (value: string) => string | null @@ -31,9 +31,11 @@ export const TextArea = ({ return (
- + {labelText && ( + + )}