From 5f7e1853b1a7ca4a12918f04bc3b96cf21ba3354 Mon Sep 17 00:00:00 2001 From: Rowan Seymour Date: Thu, 4 Jan 2024 16:01:56 +0000 Subject: [PATCH 1/8] Revert change to remove result name default on open ticket action --- src/components/flow/routers/ticket/helpers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/flow/routers/ticket/helpers.ts b/src/components/flow/routers/ticket/helpers.ts index f5b071fd6..6f3ed9dcf 100644 --- a/src/components/flow/routers/ticket/helpers.ts +++ b/src/components/flow/routers/ticket/helpers.ts @@ -20,7 +20,7 @@ export const getOriginalAction = (settings: NodeEditorSettings): OpenTicket => { export const nodeToState = (settings: NodeEditorSettings): TicketRouterFormState => { let subject = { value: '@run.flow.name' }; let body = { value: '' }; - let resultName = { value: '' }; + let resultName = { value: 'Result' }; let assignee: FormEntry = { value: null }; let topic: FormEntry = { value: null }; From c7b7ddc4cba419927367ee4ce4e5a1af46f4f914 Mon Sep 17 00:00:00 2001 From: Rowan Seymour Date: Thu, 4 Jan 2024 16:03:13 +0000 Subject: [PATCH 2/8] v1.26.3 --- CHANGELOG.md | 6 ++++++ package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c06a3fb4e..a140d3808 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ 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.26.3](https://github.com/nyaruka/floweditor/compare/v1.26.2...v1.26.3) + +> 4 January 2024 + +- Revert change to remove result name default on open ticket action [`5f7e185`](https://github.com/nyaruka/floweditor/commit/5f7e1853b1a7ca4a12918f04bc3b96cf21ba3354) + #### [v1.26.2](https://github.com/nyaruka/floweditor/compare/v1.26.1...v1.26.2) > 4 January 2024 diff --git a/package.json b/package.json index bd26659a2..32d07f070 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@nyaruka/flow-editor", "license": "AGPL-3.0", "repository": "git://github.com/nyaruka/floweditor.git", - "version": "1.26.2", + "version": "1.26.3", "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", From 36b76e4514de1f77fabb587a2710978f26ad331b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Jan 2024 17:34:18 +0000 Subject: [PATCH 3/8] Bump follow-redirects from 1.14.8 to 1.15.4 Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.8 to 1.15.4. - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) - [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.8...v1.15.4) --- updated-dependencies: - dependency-name: follow-redirects dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 20060a795..36443a444 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5868,9 +5868,9 @@ fn-name@~2.0.1: integrity sha1-UhTXU3pNBqSjAcDMJi/rhBiAAuc= follow-redirects@^1.0.0, follow-redirects@^1.14.0: - version "1.14.8" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.8.tgz#016996fb9a11a100566398b1c6839337d7bfa8fc" - integrity sha512-1x0S9UVJHsQprFcEC/qnNzBLcIxsjAV905f/UkQxbclCsoTWlacCNOpQa/anodLl2uaEKFhfWOvM2Qg77+15zA== + version "1.15.4" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.4.tgz#cdc7d308bf6493126b17ea2191ea0ccf3e535adf" + integrity sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw== for-in@^0.1.3: version "0.1.8" From 6b140888726594307a009e4e87dd35a0d552bd93 Mon Sep 17 00:00:00 2001 From: Rowan Seymour Date: Tue, 20 Feb 2024 20:32:55 +0000 Subject: [PATCH 4/8] Add support to the simulator to display warnings --- src/components/simulator/LogEvent.module.scss | 20 +++++++++++++- src/components/simulator/LogEvent.test.tsx | 7 +++++ src/components/simulator/LogEvent.tsx | 26 ++++++++++++++----- .../__snapshots__/LogEvent.test.tsx.snap | 19 ++++++++++++++ 4 files changed, 65 insertions(+), 7 deletions(-) diff --git a/src/components/simulator/LogEvent.module.scss b/src/components/simulator/LogEvent.module.scss index 7c4a10680..16801d968 100644 --- a/src/components/simulator/LogEvent.module.scss +++ b/src/components/simulator/LogEvent.module.scss @@ -5,6 +5,7 @@ transform: scale(0.2); opacity: 0; } + to { transform: scale(1); opacity: 1; @@ -20,6 +21,7 @@ .msg_text { padding: 8px 15px; } + .ivr_msg, .send_msg { border-radius: 10px; @@ -50,6 +52,16 @@ } } +.warning { + float: inherit; + color: $yellow; + font-size: 11px; + border: none; + text-align: center; + padding: 10px 15px; + border-radius: 11px; +} + .error { float: inherit; color: $red; @@ -72,6 +84,7 @@ .email { text-decoration: underline; cursor: pointer; + &:hover { color: #999; } @@ -81,6 +94,7 @@ word-break: break-all; text-decoration: underline; cursor: pointer; + &:hover { color: #999; } @@ -145,12 +159,14 @@ white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word; + ::first-line { font-family: 'Roboto', sans-serif; font-size: 16px; font-weight: 400; line-height: 34px; } + .response { padding-top: 20px; } @@ -182,11 +198,13 @@ width: 100%; font-size: 90%; color: #bbb; + td { padding: 0 5px; } + td:last-child { text-align: right; font-size: 90%; } -} +} \ No newline at end of file diff --git a/src/components/simulator/LogEvent.test.tsx b/src/components/simulator/LogEvent.test.tsx index b77cc288c..72f0f892c 100644 --- a/src/components/simulator/LogEvent.test.tsx +++ b/src/components/simulator/LogEvent.test.tsx @@ -101,6 +101,13 @@ describe(LogEvent.name, () => { ...commonEventProps }); }); + it('should render warning event', () => { + testEventRender({ + type: 'warning', + text: "I'm an warning", + ...commonEventProps + }); + }); it('should render error event', () => { testEventRender({ type: 'error', diff --git a/src/components/simulator/LogEvent.tsx b/src/components/simulator/LogEvent.tsx index fcfa035fe..1c0a524ce 100644 --- a/src/components/simulator/LogEvent.tsx +++ b/src/components/simulator/LogEvent.tsx @@ -101,6 +101,14 @@ const getStyleForDirection = (direction: Direction): string => { return direction === Direction.MO ? styles.msg_received : styles.send_msg; }; +const renderWarning = (warning: string): JSX.Element => { + return ( +
+ Warning: {warning} +
+ ); +}; + const renderError = (error: string): JSX.Element => { return (
@@ -109,6 +117,10 @@ const renderError = (error: string): JSX.Element => { ); }; +const renderInfoStyles = (allStyles: any[]): string => { + return allStyles.join(' '); +}; + const renderInfo = (info: string, extraStyles?: any[]): JSX.Element => { // localized text can have html entities, so this isn't as dangerous as it looks const infoStyle = [styles.info]; @@ -120,9 +132,6 @@ const renderInfo = (info: string, extraStyles?: any[]): JSX.Element => {
); }; -const renderInfoStyles = (allStyles: any[]): string => { - return allStyles.join(' '); -}; const renderAttachment = (attachment: string): JSX.Element => { const idx = attachment.indexOf(':'); @@ -381,6 +390,8 @@ export default class LogEvent extends React.Component return renderMessage(this.props.msg.text, this.props.msg.attachments, Direction.MT); case 'ivr_created': return renderMessage(this.props.msg.text, this.props.msg.attachments, Direction.MT); + case 'warning': + return renderWarning(this.props.text); case 'error': return renderError(this.props.text); case 'failure': @@ -391,7 +402,7 @@ export default class LogEvent extends React.Component return this.renderGroupsChanged(); case 'contact_urns_changed': return renderInfo('Added a URN for the contact'); - case 'contact_field_changed': + case 'contact_field_changed': { const value = this.getValue(this.props.value); if (value !== '') { return renderInfo( @@ -407,6 +418,7 @@ export default class LogEvent extends React.Component }) ); } + } case 'run_result_changed': return renderInfo( i18n.t('simulator.run_result_changed', 'Set result "[[field]]" to "[[value]]"', { @@ -423,9 +435,10 @@ export default class LogEvent extends React.Component case 'email_created': case 'email_sent': return this.renderEmailSent(); - case 'broadcast_created': + case 'broadcast_created': { const translation = this.props.translations[this.props.base_language]; return renderMessage(translation.text, translation.attachments, Direction.MT); + } case 'resthook_called': return renderInfo( i18n.t('simulator.resthook_called', 'Triggered flow event "[[resthook]]"', { @@ -475,7 +488,7 @@ export default class LogEvent extends React.Component topic: this.props.ticket.topic.name }) ); - case 'airtime_transferred': + case 'airtime_transferred': { const event = this.props as AirtimeTransferEvent; return ( <> @@ -494,6 +507,7 @@ export default class LogEvent extends React.Component )} ); + } } // should only get here if we are get an unexpected event diff --git a/src/components/simulator/__snapshots__/LogEvent.test.tsx.snap b/src/components/simulator/__snapshots__/LogEvent.test.tsx.snap index ef200e2e1..338ff0407 100644 --- a/src/components/simulator/__snapshots__/LogEvent.test.tsx.snap +++ b/src/components/simulator/__snapshots__/LogEvent.test.tsx.snap @@ -406,3 +406,22 @@ exports[`LogEvent should render ticket_opened event 1`] = ` `; + +exports[`LogEvent should render warning event 1`] = ` + +
+
+
+ + Warning: + I'm an warning + +
+
+
+ +`; From 6a8d95a0e0a315d114d2fd9cbd1be6d8fc515744 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 Feb 2024 10:54:03 +0000 Subject: [PATCH 5/8] Bump ip from 1.1.5 to 1.1.9 Bumps [ip](https://github.com/indutny/node-ip) from 1.1.5 to 1.1.9. - [Commits](https://github.com/indutny/node-ip/compare/v1.1.5...v1.1.9) --- updated-dependencies: - dependency-name: ip dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 20060a795..eff908282 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6922,9 +6922,9 @@ ip-regex@^2.1.0: integrity sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk= ip@^1.1.0, ip@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a" - integrity sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo= + version "1.1.9" + resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.9.tgz#8dfbcc99a754d07f425310b86a99546b1151e396" + integrity sha512-cyRxvOEpNHNtchU3Ln9KC/auJgup87llfQpQ+t5ghoC/UhL16SWzbueiCsdTnWmqAWl7LadfuwhlqmtOaqMHdQ== ipaddr.js@1.9.1, ipaddr.js@^1.9.0: version "1.9.1" From f726a0925ff4fd6c085ba2bb5c700964bdaaa126 Mon Sep 17 00:00:00 2001 From: Rowan Seymour Date: Wed, 21 Feb 2024 16:22:03 +0000 Subject: [PATCH 6/8] v1.26.4 --- CHANGELOG.md | 8 ++++++++ package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a140d3808..e1adafdff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ 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.26.4](https://github.com/nyaruka/floweditor/compare/v1.26.3...v1.26.4) + +> 21 February 2024 + +- Bump follow-redirects from 1.14.8 to 1.15.4 [`#1215`](https://github.com/nyaruka/floweditor/pull/1215) +- Bump ip from 1.1.5 to 1.1.9 [`#1220`](https://github.com/nyaruka/floweditor/pull/1220) +- Add support to the simulator to display warnings [`#1218`](https://github.com/nyaruka/floweditor/pull/1218) + #### [v1.26.3](https://github.com/nyaruka/floweditor/compare/v1.26.2...v1.26.3) > 4 January 2024 diff --git a/package.json b/package.json index 32d07f070..be8a3bbf8 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@nyaruka/flow-editor", "license": "AGPL-3.0", "repository": "git://github.com/nyaruka/floweditor.git", - "version": "1.26.3", + "version": "1.26.4", "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", From f78035fa67a70722752e14c96766e8fadaffcbee Mon Sep 17 00:00:00 2001 From: Rowan Seymour Date: Mon, 4 Mar 2024 20:04:44 +0000 Subject: [PATCH 7/8] Bump spec version to 13.3 --- src/flowTypes.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/flowTypes.ts b/src/flowTypes.ts index 68b263da8..63533e981 100644 --- a/src/flowTypes.ts +++ b/src/flowTypes.ts @@ -3,7 +3,7 @@ import { FlowTypes, Operators, Types, ContactStatus } from 'config/interfaces'; import { ExclusionsCheckboxEntry } from 'store/nodeEditor'; // we don't concern ourselves with patch versions -export const SPEC_VERSION = '13.2'; +export const SPEC_VERSION = '13.3'; export interface Languages { [iso: string]: string; From 6a56d0660d7cae7af695b6ddace1f18a3c4070f8 Mon Sep 17 00:00:00 2001 From: Rowan Seymour Date: Mon, 4 Mar 2024 20:07:10 +0000 Subject: [PATCH 8/8] v1.26.5 --- CHANGELOG.md | 6 ++++++ package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1adafdff..017263390 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ 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.26.5](https://github.com/nyaruka/floweditor/compare/v1.26.4...v1.26.5) + +> 4 March 2024 + +- Bump spec version to 13.3 [`f78035f`](https://github.com/nyaruka/floweditor/commit/f78035fa67a70722752e14c96766e8fadaffcbee) + #### [v1.26.4](https://github.com/nyaruka/floweditor/compare/v1.26.3...v1.26.4) > 21 February 2024 diff --git a/package.json b/package.json index be8a3bbf8..4d0c7b2e7 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@nyaruka/flow-editor", "license": "AGPL-3.0", "repository": "git://github.com/nyaruka/floweditor.git", - "version": "1.26.4", + "version": "1.26.5", "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",