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`] = `
+
+
+
+
+ Warning:
+ I'm an warning
+
+
+
+
+