Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't allow localization of wa templates #1242

Merged
merged 3 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -158,5 +157,10 @@
"typescript": "3.4.5",
"uniqid": "5.0.3",
"uuid": "3.3.2"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
}
}
4 changes: 4 additions & 0 deletions src/components/flow/actions/action/Action.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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: (
Expand Down Expand Up @@ -339,6 +339,7 @@ export default class MsgLocalizationForm extends React.Component<

<TextInputElement
name={i18n.t('forms.message', 'Message')}
__className={styles.message}
showLabel={false}
onChange={this.handleMessageUpdate}
entry={this.state.message}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ exports[`MsgLocalizationForm inits inits with initial values 1`] = `
</div>
</div>
<TextInputElement
__className="message"
autocomplete={true}
entry={
Object {
Expand Down Expand Up @@ -256,6 +257,7 @@ exports[`MsgLocalizationForm render should render 1`] = `
</div>
</div>
<TextInputElement
__className="message"
autocomplete={true}
entry={
Object {
Expand Down
2 changes: 2 additions & 0 deletions src/components/flow/actions/saymsg/SayMsgForm.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { react as bindCallbacks } from 'auto-bind';
import styles from 'components/flow/actions/action/Action.module.scss';
import Dialog, { ButtonSet } from 'components/dialog/Dialog';
import { ActionFormProps } from 'components/flow/props';
import TextInputElement from 'components/form/textinput/TextInputElement';
Expand Down Expand Up @@ -82,6 +83,7 @@ export default class SayMsgForm extends React.Component<ActionFormProps, SayMsgF
<Dialog title={typeConfig.name} headerClass={typeConfig.type} buttons={this.getButtons()}>
<TypeList __className="" initialType={typeConfig} onChange={this.props.onTypeChange} />
<TextInputElement
__className={styles.message}
name={i18n.t('forms.message', 'Message')}
showLabel={false}
onChange={this.handleMessageUpdate}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ exports[`SayMsgForm render should render 1`] = `
onChange={[MockFunction]}
/>
<TextInputElement
__className="message"
autocomplete={true}
entry={
Object {
Expand Down
Loading