From 2b87e9afc1e7bb43a8849cf98816f374e4796133 Mon Sep 17 00:00:00 2001 From: Eric Newcomer Date: Tue, 2 Jul 2024 20:46:16 +0000 Subject: [PATCH 1/3] Don't allow localization of wa templates --- src/components/flow/actions/action/Action.module.scss | 4 ++++ .../flow/actions/localization/MsgLocalizationForm.tsx | 3 ++- src/components/flow/actions/saymsg/SayMsgForm.tsx | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/flow/actions/action/Action.module.scss b/src/components/flow/actions/action/Action.module.scss index 46316cb9e..000d31f00 100644 --- a/src/components/flow/actions/action/Action.module.scss +++ b/src/components/flow/actions/action/Action.module.scss @@ -130,4 +130,8 @@ background: rgba(255, 255, 255, 0.9); $color_1: rgba(0, 0, 0, 0.12); $color_2: rgba(0, 0, 0, 0.1); +} + +.message { + --textarea-height: 8em; } \ No newline at end of file diff --git a/src/components/flow/actions/localization/MsgLocalizationForm.tsx b/src/components/flow/actions/localization/MsgLocalizationForm.tsx index 03d8be2db..b4283f203 100644 --- a/src/components/flow/actions/localization/MsgLocalizationForm.tsx +++ b/src/components/flow/actions/localization/MsgLocalizationForm.tsx @@ -293,7 +293,7 @@ export default class MsgLocalizationForm extends React.Component< ); } - if (this.state.template) { + if (this.state.template && this.state.templateVariables.length > 0) { tabs.push({ name: 'WhatsApp', body: ( @@ -339,6 +339,7 @@ export default class MsgLocalizationForm extends React.Component< Date: Tue, 2 Jul 2024 21:07:16 +0000 Subject: [PATCH 2/3] Update snapshots --- .../localization/__snapshots__/MsgLocalizationForm.test.ts.snap | 2 ++ .../flow/actions/saymsg/__snapshots__/SayMsgForm.test.ts.snap | 1 + 2 files changed, 3 insertions(+) diff --git a/src/components/flow/actions/localization/__snapshots__/MsgLocalizationForm.test.ts.snap b/src/components/flow/actions/localization/__snapshots__/MsgLocalizationForm.test.ts.snap index 238f6ae0b..943a0979d 100644 --- a/src/components/flow/actions/localization/__snapshots__/MsgLocalizationForm.test.ts.snap +++ b/src/components/flow/actions/localization/__snapshots__/MsgLocalizationForm.test.ts.snap @@ -120,6 +120,7 @@ exports[`MsgLocalizationForm inits inits with initial values 1`] = ` Date: Tue, 2 Jul 2024 21:07:54 +0000 Subject: [PATCH 3/3] Update hucky precommit --- package.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 0aac6167e..0595adf82 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,6 @@ "lambda": "yarn run lambda:build && yarn run lambda:serve", "prettify": "prettier --write 'src/**/*.{ts,tsx,json,js,css,md}'", "netlify": "yarn run build && yarn run lambda:build", - "precommit": "lint-staged", "preversion": "yarn test --watchAll=false", "postversion": "git push --tags && git push origin main", "version": "yarn run build && auto-changelog -p && git add CHANGELOG.md", @@ -158,5 +157,10 @@ "typescript": "3.4.5", "uniqid": "5.0.3", "uuid": "3.3.2" + }, + "husky": { + "hooks": { + "pre-commit": "lint-staged" + } } }