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

Update: 1.3.0-floweditor-1.18.4 #29

Merged
merged 51 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
4fddb11
initial commit with advanced tab
susanm74 Oct 13, 2022
dff30e4
adding dial and call limit to advanced tab in progress
susanm74 Oct 14, 2022
02a9643
unit tests in progress
susanm74 Oct 19, 2022
ad39459
some updates to ui
susanm74 Oct 19, 2022
9fe27cd
saving dialLimit and callLimit values in progress
susanm74 Oct 20, 2022
f6b67c6
dialLimit and callLimit saving and displaying correct, unit tests in …
susanm74 Oct 21, 2022
7962833
Merge branch 'main' into sl-dial-router-form-advanced-tab
Oct 24, 2022
9f364fc
updates based on review, testing in progress
susanm74 Oct 24, 2022
2404035
Merge branch 'sl-dial-router-form-advanced-tab' of https://github.com…
susanm74 Oct 24, 2022
36b8d4c
more updates based on review
susanm74 Oct 24, 2022
055a2dc
added unit tests for dial_limit and call_limit
susanm74 Oct 25, 2022
1154995
removed extra wait type assertions from dial and call tests
susanm74 Oct 25, 2022
759b3bf
fixed rule translations tab bug, unit test in progress
susanm74 Oct 25, 2022
c061181
minor update to test name
susanm74 Oct 25, 2022
cfcf4da
fixed rule translations saving empty strings as translations: [""]
susanm74 Oct 27, 2022
2a3f9dc
minor update to logic to check for undefined before calling filter
susanm74 Oct 27, 2022
8baecda
updated tests and snapshot
susanm74 Oct 27, 2022
3d0a310
added missing properties to baseProps obj
susanm74 Oct 27, 2022
b5a22e7
initial work on adding skip contacts in a flow checkbox to start some…
susanm74 Oct 27, 2022
4787e84
updated snapshot to include skipContactsInFlow and temba-checkbox
susanm74 Oct 27, 2022
ef11414
updates based on using simple boolean for checkbox
susanm74 Oct 28, 2022
92a59bf
Merge branch 'main' into sl-dial-router-form-advanced-tab
Nov 1, 2022
9df9183
updates based on review to match the original spec!
susanm74 Nov 1, 2022
b107699
tweak to the text input label
susanm74 Nov 2, 2022
03858c2
minor update to handle method to match label
susanm74 Nov 2, 2022
3e90e95
Merge branch 'main' into sl-has-number-between-bugfix
Nov 2, 2022
773beff
excluding numeric rule "has number between" from advanced tab rule tr…
susanm74 Nov 2, 2022
8397577
Merge branch 'sl-has-number-between-bugfix' of https://github.com/nya…
susanm74 Nov 2, 2022
d5e2b45
Merge branch 'main' into sl-start-somebody-else-skip-support
susanm74 Nov 2, 2022
b258961
fixed small typo in handle call limit updated
susanm74 Nov 3, 2022
d6162af
working end to end with a simple boolean
susanm74 Nov 3, 2022
035fc50
switched from simple boolean to JSON object containing boolean
susanm74 Nov 7, 2022
028b14b
Merge pull request #1082 from nyaruka/sl-has-number-between-bugfix
ericnewcomer Nov 8, 2022
abed310
Merge pull request #1083 from nyaruka/sl-start-somebody-else-skip-sup…
ericnewcomer Nov 8, 2022
9c57f38
excluding all date, time, and numeric rules from translations
susanm74 Nov 8, 2022
9f213a3
Merge branch 'main' into sl-dial-router-form-advanced-tab
susanm74 Nov 8, 2022
0ea169d
switch to flexbox row layout in progress
susanm74 Nov 8, 2022
62cf6fc
Fix flex class name
ericnewcomer Nov 8, 2022
c18dd88
wrapped dial and call limit as flex items in a flex container
susanm74 Nov 9, 2022
91d414e
removed first child's margin-left and last child's margin-right
susanm74 Nov 9, 2022
b203c72
switched from using width: 100% in favor of using flex-grow: 1
susanm74 Nov 11, 2022
80b7b47
Merge pull request #1080 from nyaruka/sl-dial-router-form-advanced-tab
ericnewcomer Nov 22, 2022
b016068
Merge pull request #1085 from nyaruka/sl-exclude-numerical-rules-from…
ericnewcomer Nov 22, 2022
c4e04c6
Disallow groups on start session action
ericnewcomer Nov 23, 2022
26ce47f
Merge pull request #1089 from nyaruka/start-session-no-group
ericnewcomer Nov 23, 2022
bf9ff0c
v1.18.3
ericnewcomer Nov 23, 2022
64262f5
Fix StartSessionForm bug for definitions without exclusions
ericnewcomer Nov 29, 2022
f7200c8
Merge pull request #1091 from nyaruka/fix-start-session
ericnewcomer Nov 29, 2022
0469111
v1.18.4
ericnewcomer Nov 29, 2022
3c6f63d
Merge tag 'v1.18.4' of https://github.com/nyaruka/floweditor into HEAD
paulobernardoaf May 22, 2024
9103c6c
chore: bump floweditor to version 1.3.0
paulobernardoaf May 22, 2024
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
25 changes: 24 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,47 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [v1.18.4](https://github.com/nyaruka/floweditor/compare/v1.18.3...v1.18.4)

> 29 November 2022

- Fix StartSessionForm bug for definitions without exclusions [`#1091`](https://github.com/nyaruka/floweditor/pull/1091)

#### [v1.18.3](https://github.com/nyaruka/floweditor/compare/v1.18.2...v1.18.3)

> 23 November 2022

- Disallow groups on start session action [`#1089`](https://github.com/nyaruka/floweditor/pull/1089)
- excluding all date, time, and numeric rules from translations [`#1085`](https://github.com/nyaruka/floweditor/pull/1085)
- dial router form - new advanced tab with dial limit and call limit values [`#1080`](https://github.com/nyaruka/floweditor/pull/1080)
- start somebody else in a flow form - add skip contacts in a flow checkbox [`#1083`](https://github.com/nyaruka/floweditor/pull/1083)
- wait for response form - numeric rule - rule translations tab - has number between and empty translations bugfixes [`#1082`](https://github.com/nyaruka/floweditor/pull/1082)
- switched from simple boolean to JSON object containing boolean [`035fc50`](https://github.com/nyaruka/floweditor/commit/035fc500e6e36fefddcf740437d2c1c0da6b5d93)
- updates based on review to match the original spec! [`9df9183`](https://github.com/nyaruka/floweditor/commit/9df9183c718f780e92e503e834419b4da7fe4926)
- switch to flexbox row layout in progress [`0ea169d`](https://github.com/nyaruka/floweditor/commit/0ea169d294d7080e49a017ba5371a2096b09c759)

#### [v1.18.2](https://github.com/nyaruka/floweditor/compare/v1.18.1...v1.18.2)

> 31 October 2022

- Allow wait for digits routers to use `has_text` and `has_pattern` rules [`#1084`](https://github.com/nyaruka/floweditor/pull/1084)
- Allow wait for digits routers to use has_text and has_pattern rules [`714bc0f`](https://github.com/nyaruka/floweditor/commit/714bc0fa6b474a5ab2b004dd7c188c266fa908cc)
- added unit tests for dial_limit and call_limit [`055a2dc`](https://github.com/nyaruka/floweditor/commit/055a2dc8ebf58bfd5d45cd5c55ab525ec90330a0)
- updates based on review, testing in progress [`9f364fc`](https://github.com/nyaruka/floweditor/commit/9f364fcc8e8f836ff4a0e277d175a1c30737a656)
- updated snapshot to include skipContactsInFlow and temba-checkbox [`4787e84`](https://github.com/nyaruka/floweditor/commit/4787e8451a33a0f84c341dc951931f9e14d53fc6)

#### [v1.18.1](https://github.com/nyaruka/floweditor/compare/v1.18.0...v1.18.1)

> 18 October 2022

- Fix attachment selector hiding on its own [`#1078`](https://github.com/nyaruka/floweditor/pull/1078)
- adding dial and call limit to advanced tab in progress [`dff30e4`](https://github.com/nyaruka/floweditor/commit/dff30e473b56d73c6f4da32f17c28169c872485b)

#### [v1.18.0](https://github.com/nyaruka/floweditor/compare/v1.17.5...v1.18.0)

> 13 October 2022

- Add hooks to allow exeternal resets [`#1079`](https://github.com/nyaruka/floweditor/pull/1079)
- initial commit with advanced tab [`4fddb11`](https://github.com/nyaruka/floweditor/commit/4fddb11d2021a6639d436d6b7ceac4c792d68142)
- Update uuid snapshot [`702156c`](https://github.com/nyaruka/floweditor/commit/702156c3ddfa9f810fcb944dfef8100594804bda)
- Fix attachment selector hiding on its own [`0343855`](https://github.com/nyaruka/floweditor/commit/0343855977a1c43d6d2101da5cff085d55bf874c)

Expand Down
4 changes: 4 additions & 0 deletions WENI-CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
1.3.0-floweditor-1.18.4
----------
* Update floweditor with version 1.18.4

1.2.1-floweditor-1.18.2
----------
* Update floweditor with version 1.18.2
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@weni/flow-editor-rp",
"license": "AGPL-3.0",
"repository": "git://github.com/ilhasoft/floweditor.git",
"version": "1.2.1",
"version": "1.3.0",
"description": "Standalone flow editing tool designed for use within the RapidPro suite of messaging tools but can be adopted for use outside of that ecosystem.",
"browser": "umd/flow-editor.min.js",
"unpkg": "umd/flow-editor.min.js",
Expand Down
1 change: 1 addition & 0 deletions src/components/__snapshots__/index.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Array [
"attachments": "/assets/attachments.json",
"channels": "/assets/channels.json",
"classifiers": "/assets/classifiers.json",
"contacts": "/assets/recipients.json",
"editor": "/flow/editor",
"environment": "/assets/environment.json",
"fields": "/assets/fields.json",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@
margin-left: 0.25em;
margin-top: 0.5em;
margin-bottom: 1em;
}

.checkbox {
margin-top: 20px;
}
53 changes: 48 additions & 5 deletions src/components/flow/actions/startsession/StartSessionForm.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { react as bindCallbacks } from 'auto-bind';
import Dialog, { ButtonSet } from 'components/dialog/Dialog';
import Dialog, { ButtonSet, Tab } from 'components/dialog/Dialog';
import { ActionFormProps } from 'components/flow/props';
import AssetSelector from 'components/form/assetselector/AssetSelector';
import TypeList from 'components/nodeeditor/TypeList';
Expand All @@ -11,7 +11,8 @@ import {
mergeForm,
StringEntry,
SelectOptionEntry,
FormEntry
FormEntry,
ExclusionsCheckboxEntry
} from 'store/nodeEditor';
import { shouldRequireIf, validate } from 'store/validators';
import { renderIf } from 'utils';
Expand All @@ -21,6 +22,7 @@ import TextInputElement from 'components/form/textinput/TextInputElement';
import i18n from 'config/i18n';
import { renderIssues } from '../helpers';
import styles from './StartSessionForm.module.scss';
import CheckboxElement from 'components/form/checkbox/CheckboxElement';

export const START_TYPE_ASSETS: SelectOption = {
name: i18n.t('forms.start_type_manual', 'Select recipients manually'),
Expand All @@ -42,6 +44,7 @@ export interface StartSessionFormState extends FormState {
flow: FormEntry;
startType: SelectOptionEntry;
contactQuery: StringEntry;
exclusions: ExclusionsCheckboxEntry;
}

export class StartSessionForm extends React.Component<ActionFormProps, StartSessionFormState> {
Expand Down Expand Up @@ -75,8 +78,19 @@ export class StartSessionForm extends React.Component<ActionFormProps, StartSess
return this.handleUpdate({ contactQuery });
}

public handleExclusions(skipContactsInAFlow: boolean): boolean {
let exclusions = { in_a_flow: skipContactsInAFlow };
return this.handleUpdate({ exclusions });
}

private handleUpdate(
keys: { flow?: Asset; recipients?: Asset[]; startType?: SelectOption; contactQuery?: string },
keys: {
flow?: Asset;
recipients?: Asset[];
startType?: SelectOption;
contactQuery?: string;
exclusions?: ExclusionsCheckboxEntry;
},
submitting = false
): boolean {
const updates: Partial<StartSessionFormState> = {};
Expand Down Expand Up @@ -112,6 +126,10 @@ export class StartSessionForm extends React.Component<ActionFormProps, StartSess
]);
}

if (keys.hasOwnProperty('exclusions')) {
updates.exclusions = keys.exclusions;
}

const updated = mergeForm(this.state, updates);
this.setState(updated);
return updated.valid;
Expand Down Expand Up @@ -149,8 +167,33 @@ export class StartSessionForm extends React.Component<ActionFormProps, StartSess
public render(): JSX.Element {
const typeConfig = this.props.typeConfig;

const advanced: Tab = {
name: i18n.t('forms.advanced', 'Advanced'),
body: (
<CheckboxElement
name={i18n.t('forms.skip_contacts_in_a_flow', 'Skip contacts currently in a flow')}
title={i18n.t('forms.skip_contacts_in_a_flow', 'Skip contacts currently in a flow')}
labelClassName={styles.checkbox}
checked={this.state.exclusions.in_a_flow}
description={i18n.t(
'forms.skip_contacts_in_a_flow_description',
'Avoid interrupting a contact who is already in a flow.'
)}
onChange={this.handleExclusions}
/>
),
checked: this.state.exclusions.in_a_flow
};

const tabs = [advanced];

return (
<Dialog title={typeConfig.name} headerClass={typeConfig.type} buttons={this.getButtons()}>
<Dialog
title={typeConfig.name}
headerClass={typeConfig.type}
buttons={this.getButtons()}
tabs={tabs}
>
<TypeList __className="" initialType={typeConfig} onChange={this.props.onTypeChange} />
<div>
<SelectElement
Expand All @@ -171,7 +214,7 @@ export class StartSessionForm extends React.Component<ActionFormProps, StartSess
'forms.select_who_to_start',
'Select who should be started in the flow'
)}
assets={this.props.assetStore.recipients}
assets={this.props.assetStore.contacts}
entry={this.state.recipients}
searchable={true}
multi={true}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ exports[`StartSessionForm render should render 1`] = `
<div
class="dialog"
>
<div
class="tabs"
>
<div
class="tab "
>
Advanced

</div>
</div>
<div
class="header start_session"
>
Expand Down Expand Up @@ -87,7 +97,6 @@ exports[`StartSessionForm render should render 1`] = `
name="Recipients"
namekey="name"
placeholder="Select who should be started in the flow"
queryparam="search"
searchable="true"
valuekey="uuid"
values="[{\\"id\\":\\"2dc85899-0577-4f1b-a620-f12094e34b5e\\",\\"name\\":\\"Cat Fanciers\\",\\"type\\":\\"group\\"},{\\"id\\":\\"42ebf1d0-a43e-4ba6-9577-c863b20c88c4\\",\\"name\\":\\"Norbert Kwizera\\",\\"type\\":\\"contact\\",\\"missing\\":false},{\\"id\\":\\"70ac6ea6-803a-4c33-81c7-dc26803c313f\\",\\"name\\":\\"Rowan Seymour\\",\\"type\\":\\"contact\\",\\"missing\\":false}]"
Expand Down Expand Up @@ -152,6 +161,9 @@ Object {
"contactQuery": Object {
"value": "",
},
"exclusions": Object {
"in_a_flow": false,
},
"flow": Object {
"value": null,
},
Expand Down Expand Up @@ -183,6 +195,22 @@ exports[`StartSessionForm render should render an empty form with no action 2`]
}
}
headerClass="start_session"
tabs={
Array [
Object {
"body": <CheckboxElement
checked={false}
description="Avoid interrupting a contact who is already in a flow."
labelClassName="checkbox"
name="Skip contacts currently in a flow"
onChange={[Function]}
title="Skip contacts currently in a flow"
/>,
"checked": false,
"name": "Advanced",
},
]
}
title="Start Somebody Else"
>
<TypeList
Expand Down Expand Up @@ -244,12 +272,6 @@ exports[`StartSessionForm render should render an empty form with no action 2`]
data-testid="recipients"
>
<AssetSelector
assets={
Object {
"items": Object {},
"type": "contact",
}
}
entry={
Object {
"value": Array [],
Expand Down Expand Up @@ -291,6 +313,16 @@ exports[`StartSessionForm render should render contact query 1`] = `
<div
class="dialog"
>
<div
class="tabs"
>
<div
class="tab "
>
Advanced

</div>
</div>
<div
class="header start_session"
>
Expand Down Expand Up @@ -434,6 +466,9 @@ Array [
"contact_query": "my_field > 6",
"contacts": Array [],
"create_contact": false,
"exclusions": Object {
"in_a_flow": false,
},
"flow": Object {
"name": "Flow to Start",
"uuid": "flow_uuid",
Expand All @@ -452,6 +487,16 @@ exports[`StartSessionForm render should render create new contacts 1`] = `
<div
class="dialog"
>
<div
class="tabs"
>
<div
class="tab "
>
Advanced

</div>
</div>
<div
class="header start_session"
>
Expand Down Expand Up @@ -581,6 +626,22 @@ exports[`StartSessionForm render should render self, children with base props 1`
}
}
headerClass="start_session"
tabs={
Array [
Object {
"body": <CheckboxElement
checked={false}
description="Avoid interrupting a contact who is already in a flow."
labelClassName="checkbox"
name="Skip contacts currently in a flow"
onChange={[Function]}
title="Skip contacts currently in a flow"
/>,
"checked": false,
"name": "Advanced",
},
]
}
title="Start Somebody Else"
>
<TypeList
Expand Down Expand Up @@ -642,12 +703,6 @@ exports[`StartSessionForm render should render self, children with base props 1`
data-testid="recipients"
>
<AssetSelector
assets={
Object {
"items": Object {},
"type": "contact",
}
}
entry={
Object {
"value": Array [
Expand Down Expand Up @@ -710,6 +765,16 @@ exports[`StartSessionForm render should warn about invalid fields in contact que
<div
class="dialog"
>
<div
class="tabs"
>
<div
class="tab "
>
Advanced

</div>
</div>
<div
class="header start_session"
>
Expand Down Expand Up @@ -852,6 +917,9 @@ Array [
Object {
"contacts": Array [],
"create_contact": false,
"exclusions": Object {
"in_a_flow": false,
},
"flow": Object {
"name": "My Flow",
"uuid": undefined,
Expand All @@ -869,6 +937,9 @@ Object {
"contactQuery": Object {
"value": "",
},
"exclusions": Object {
"in_a_flow": false,
},
"flow": Object {
"validationFailures": Array [],
"value": Object {
Expand Down Expand Up @@ -901,6 +972,9 @@ Array [
Object {
"contacts": Array [],
"create_contact": false,
"exclusions": Object {
"in_a_flow": false,
},
"flow": Object {
"name": "My Flow",
"uuid": undefined,
Expand Down
Loading
Loading