Skip to content

Commit

Permalink
Merge pull request #12 from glific/feature/single-attachment
Browse files Browse the repository at this point in the history
Each node can only have a single attachment
  • Loading branch information
pankaj-ag authored Jan 5, 2021
2 parents e77e2c9 + 641789f commit 901b5b6
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
8 changes: 4 additions & 4 deletions build/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"files": {
"main.css": "./static/css/main.5d76d5d5.chunk.css",
"main.js": "./static/js/main.2311ea85.chunk.js",
"main.js.map": "./static/js/main.2311ea85.chunk.js.map",
"main.js": "./static/js/main.971262ab.chunk.js",
"main.js.map": "./static/js/main.971262ab.chunk.js.map",
"runtime-main.js": "./static/js/runtime-main.52f400d1.js",
"runtime-main.js.map": "./static/js/runtime-main.52f400d1.js.map",
"static/js/2.94fb7297.chunk.js": "./static/js/2.94fb7297.chunk.js",
"static/js/2.94fb7297.chunk.js.map": "./static/js/2.94fb7297.chunk.js.map",
"static/js/3.30227eeb.chunk.js": "./static/js/3.30227eeb.chunk.js",
"static/js/3.30227eeb.chunk.js.map": "./static/js/3.30227eeb.chunk.js.map",
"index.html": "./index.html",
"precache-manifest.3023c96a597d050e738b2abac08b7dfe.js": "./precache-manifest.3023c96a597d050e738b2abac08b7dfe.js",
"precache-manifest.2d78dd9211b1f8228adcf8d495f59dd0.js": "./precache-manifest.2d78dd9211b1f8228adcf8d495f59dd0.js",
"service-worker.js": "./service-worker.js",
"static/css/main.5d76d5d5.chunk.css.map": "./static/css/main.5d76d5d5.chunk.css.map",
"static/js/2.94fb7297.chunk.js.LICENSE.txt": "./static/js/2.94fb7297.chunk.js.LICENSE.txt",
Expand All @@ -21,6 +21,6 @@
"static/js/runtime-main.52f400d1.js",
"static/js/2.94fb7297.chunk.js",
"static/css/main.5d76d5d5.chunk.css",
"static/js/main.2311ea85.chunk.js"
"static/js/main.971262ab.chunk.js"
]
}
2 changes: 1 addition & 1 deletion build/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" href="./favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><link rel="manifest" href="./manifest.json"/><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto+Mono:300|Roboto:200,300,400,500"/><title>Nyaruka Flow Editor</title><style>html{--font-family:'Roboto',sans-serif;font-family:var(--font-family);font-size:13px;font-weight:300;--curvature:4px;--curvature-widget:4px;--primary-rgb:52,152,219;--secondary-rgb:0,77,129;--focus-rgb:82,168,236;--error-rgb:255,99,71;--color-info:#c0d9eb;--color-warning:#fff6c0;--color-error:rgb(var(--error-rgb));--color-text:#555;--color-widget-text:#555;--color-borders:rgba(0, 0, 0, 0.07);--widget-box-shadow-focused:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 8px rgba(var(--focus-rgb), 0.6);--widget-box-shadow-focused-error:inset 0 1px 1px rgba(var(--error-rgb), 0.075),0 0 8px rgba(var(--error-rgb), 0.6);--color-focus:rgba(var(--focus-rgb), 0.8);--color-widget-bg:#fff;--color-widget-bg-focused:#fff;--color-widget-border:rgb(204, 204, 204);--color-placeholder:var(--color-text-help);--color-primary-light:#eee;--color-secondary-light:#ccc;--color-primary-dark:rgb(var(--primary-rgb));--color-secondary-dark:rgb(var(--secondary-rgb));--color-text-light:rgba(255, 255, 255, 0.92);--color-text-dark:rgba(0, 0, 0, 0.5);--color-text-dark-secondary:rgba(0, 0, 0, 0.25);--color-text-help:rgba(0, 0, 0, 0.45);--color-selection:#f0f6ff;--color-overlay-dark:rgba(0, 0, 0, 0.2);--color-overlay-dark-text:rgba(255, 255, 255, 0.9);--color-overlay-light:rgba(0, 0, 0, 0.05);--color-overlay-light-text:rgba(0, 0, 0, 0.6);--color-link-primary:rgba(var(--primary-rgb), 0.8);--color-link-primary-hover:rgba(var(--primary-rgb), 0.9);--color-link-secondary:rgba(var(--secondary-rgb), 0.8);--color-link-secondary-hover:rgba(var(--secondary-rgb), 0.9);--color-button-primary:var(--color-primary-dark);--color-button-primary-text:var(--color-text-light);--color-button-secondary:var(--color-secondary-light);--color-button-secondary-text:var(--color-text-dark);--color-button-disabled:rgba(0, 0, 0, 0.03);--color-label-primary:var(--color-primary-dark);--color-label-primary-text:var(--color-text-light);--color-label-secondary:rgba(0, 0, 0, 0.2);--color-label-secondary-text:rgba(255, 255, 255, 0.9)}</style><link href="./static/css/main.5d76d5d5.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="floweditor"></div><script>!function(e){function r(r){for(var n,a,i=r[0],c=r[1],l=r[2],s=0,p=[];s<i.length;s++)a=i[s],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&p.push(o[a][0]),o[a]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(f&&f(r);p.length;)p.shift()();return u.push.apply(u,l||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,i=1;i<t.length;i++){var c=t[i];0!==o[c]&&(n=!1)}n&&(u.splice(r--,1),e=a(a.s=t[0]))}return e}var n={},o={1:0},u=[];function a(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,a),t.l=!0,t.exports}a.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise((function(r,n){t=o[e]=[r,n]}));r.push(t[2]=n);var u,i=document.createElement("script");i.charset="utf-8",i.timeout=120,a.nc&&i.setAttribute("nonce",a.nc),i.src=function(e){return a.p+"static/js/"+({}[e]||e)+"."+{3:"30227eeb"}[e]+".chunk.js"}(e);var c=new Error;u=function(r){i.onerror=i.onload=null,clearTimeout(l);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,t[1](c)}o[e]=void 0}};var l=setTimeout((function(){u({type:"timeout",target:i})}),12e4);i.onerror=i.onload=u,document.head.appendChild(i)}return Promise.all(r)},a.m=e,a.c=n,a.d=function(e,r,t){a.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,r){if(1&r&&(e=a(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(a.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)a.d(t,n,function(r){return e[r]}.bind(null,n));return t},a.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(r,"a",r),r},a.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},a.p="./",a.oe=function(e){throw console.error(e),e};var i=this["webpackJsonp@nyaruka/flow-editor"]=this["webpackJsonp@nyaruka/flow-editor"]||[],c=i.push.bind(i);i.push=r,i=i.slice();for(var l=0;l<i.length;l++)r(i[l]);var f=c;t()}([])</script><script src="./static/js/2.94fb7297.chunk.js"></script><script src="./static/js/main.2311ea85.chunk.js"></script></body><script>var base="http://api.glific.test:4000/flow-editor/",uuid="3fa22108-f464-41e5-81d9-d8a298854429",config={flow:uuid,flowType:"message",localStorage:!0,mutable:!0,filters:["facebook","whatsapp","airtime","resthook","classifier","ticketer"],excludeTypes:["send_broadcast","add_contact_urn","remove_contact_groups","send_email","set_run_result","call_resthook","start_session","open_ticket","split_by_expression","transfer_airtime","split_by_intent","split_by_contact_field","split_by_run_result","split_by_random","split_by_groups","split_by_scheme"],excludeOperators:["has_beginning","has_text","has_number_lt","has_number_lte","has_number_gte","has_number_gt","has_date","has_date_category","has_date_lt","has_number_lte","has_number_gte","has_number_gt","has_date","has_date_category","has_date_lt","has_date_eq","has_date_gt","has_time","has_group","has_category","has_phone","has_phone_category","has_email","has_email_category","has_state","has_state_category","has_district","has_ward","has_error","has_value","has_pattern"],help:{legacy_extra:"help.html",missing_dependency:"help.html",invalid_regex:"help.html"},endpoints:{globals:base+"globals",groups:base+"groups",fields:base+"fields",labels:base+"labels",channels:base+"channels",classifiers:base+"classifiers",ticketers:base+"ticketers",resthooks:base+"resthooks",templates:base+"templates",flows:base+"flows",revisions:base+"revisions/"+uuid,recents:base+"recents",languages:base+"languages",environment:base+"environment",recipients:base+"recipients",functions:base+"functions",completion:base+"completion",attachments:base+"attachments",activity:base+"activity",editor:"/",simulateStart:null,simulateResume:null}};showFlowEditor(document.getElementById("floweditor"),config)</script></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" href="./favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><link rel="manifest" href="./manifest.json"/><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto+Mono:300|Roboto:200,300,400,500"/><title>Nyaruka Flow Editor</title><style>html{--font-family:'Roboto',sans-serif;font-family:var(--font-family);font-size:13px;font-weight:300;--curvature:4px;--curvature-widget:4px;--primary-rgb:52,152,219;--secondary-rgb:0,77,129;--focus-rgb:82,168,236;--error-rgb:255,99,71;--color-info:#c0d9eb;--color-warning:#fff6c0;--color-error:rgb(var(--error-rgb));--color-text:#555;--color-widget-text:#555;--color-borders:rgba(0, 0, 0, 0.07);--widget-box-shadow-focused:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 8px rgba(var(--focus-rgb), 0.6);--widget-box-shadow-focused-error:inset 0 1px 1px rgba(var(--error-rgb), 0.075),0 0 8px rgba(var(--error-rgb), 0.6);--color-focus:rgba(var(--focus-rgb), 0.8);--color-widget-bg:#fff;--color-widget-bg-focused:#fff;--color-widget-border:rgb(204, 204, 204);--color-placeholder:var(--color-text-help);--color-primary-light:#eee;--color-secondary-light:#ccc;--color-primary-dark:rgb(var(--primary-rgb));--color-secondary-dark:rgb(var(--secondary-rgb));--color-text-light:rgba(255, 255, 255, 0.92);--color-text-dark:rgba(0, 0, 0, 0.5);--color-text-dark-secondary:rgba(0, 0, 0, 0.25);--color-text-help:rgba(0, 0, 0, 0.45);--color-selection:#f0f6ff;--color-overlay-dark:rgba(0, 0, 0, 0.2);--color-overlay-dark-text:rgba(255, 255, 255, 0.9);--color-overlay-light:rgba(0, 0, 0, 0.05);--color-overlay-light-text:rgba(0, 0, 0, 0.6);--color-link-primary:rgba(var(--primary-rgb), 0.8);--color-link-primary-hover:rgba(var(--primary-rgb), 0.9);--color-link-secondary:rgba(var(--secondary-rgb), 0.8);--color-link-secondary-hover:rgba(var(--secondary-rgb), 0.9);--color-button-primary:var(--color-primary-dark);--color-button-primary-text:var(--color-text-light);--color-button-secondary:var(--color-secondary-light);--color-button-secondary-text:var(--color-text-dark);--color-button-disabled:rgba(0, 0, 0, 0.03);--color-label-primary:var(--color-primary-dark);--color-label-primary-text:var(--color-text-light);--color-label-secondary:rgba(0, 0, 0, 0.2);--color-label-secondary-text:rgba(255, 255, 255, 0.9)}</style><link href="./static/css/main.5d76d5d5.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="floweditor"></div><script>!function(e){function r(r){for(var n,a,i=r[0],c=r[1],l=r[2],s=0,p=[];s<i.length;s++)a=i[s],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&p.push(o[a][0]),o[a]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(f&&f(r);p.length;)p.shift()();return u.push.apply(u,l||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,i=1;i<t.length;i++){var c=t[i];0!==o[c]&&(n=!1)}n&&(u.splice(r--,1),e=a(a.s=t[0]))}return e}var n={},o={1:0},u=[];function a(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,a),t.l=!0,t.exports}a.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise((function(r,n){t=o[e]=[r,n]}));r.push(t[2]=n);var u,i=document.createElement("script");i.charset="utf-8",i.timeout=120,a.nc&&i.setAttribute("nonce",a.nc),i.src=function(e){return a.p+"static/js/"+({}[e]||e)+"."+{3:"30227eeb"}[e]+".chunk.js"}(e);var c=new Error;u=function(r){i.onerror=i.onload=null,clearTimeout(l);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,t[1](c)}o[e]=void 0}};var l=setTimeout((function(){u({type:"timeout",target:i})}),12e4);i.onerror=i.onload=u,document.head.appendChild(i)}return Promise.all(r)},a.m=e,a.c=n,a.d=function(e,r,t){a.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,r){if(1&r&&(e=a(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(a.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)a.d(t,n,function(r){return e[r]}.bind(null,n));return t},a.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(r,"a",r),r},a.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},a.p="./",a.oe=function(e){throw console.error(e),e};var i=this["webpackJsonp@nyaruka/flow-editor"]=this["webpackJsonp@nyaruka/flow-editor"]||[],c=i.push.bind(i);i.push=r,i=i.slice();for(var l=0;l<i.length;l++)r(i[l]);var f=c;t()}([])</script><script src="./static/js/2.94fb7297.chunk.js"></script><script src="./static/js/main.971262ab.chunk.js"></script></body><script>var base="http://api.glific.test:4000/flow-editor/",uuid="3fa22108-f464-41e5-81d9-d8a298854429",config={flow:uuid,flowType:"message",localStorage:!0,mutable:!0,filters:["facebook","whatsapp","airtime","resthook","classifier","ticketer"],excludeTypes:["send_broadcast","add_contact_urn","remove_contact_groups","send_email","set_run_result","call_resthook","start_session","open_ticket","split_by_expression","transfer_airtime","split_by_intent","split_by_contact_field","split_by_run_result","split_by_random","split_by_groups","split_by_scheme"],excludeOperators:["has_beginning","has_text","has_number_lt","has_number_lte","has_number_gte","has_number_gt","has_date","has_date_category","has_date_lt","has_number_lte","has_number_gte","has_number_gt","has_date","has_date_category","has_date_lt","has_date_eq","has_date_gt","has_time","has_group","has_category","has_phone","has_phone_category","has_email","has_email_category","has_state","has_state_category","has_district","has_ward","has_error","has_value","has_pattern"],help:{legacy_extra:"help.html",missing_dependency:"help.html",invalid_regex:"help.html"},endpoints:{globals:base+"globals",groups:base+"groups",fields:base+"fields",labels:base+"labels",channels:base+"channels",classifiers:base+"classifiers",ticketers:base+"ticketers",resthooks:base+"resthooks",templates:base+"templates",flows:base+"flows",revisions:base+"revisions/"+uuid,recents:base+"recents",languages:base+"languages",environment:base+"environment",recipients:base+"recipients",functions:base+"functions",completion:base+"completion",attachments:base+"attachments",activity:base+"activity",editor:"/",simulateStart:null,simulateResume:null}};showFlowEditor(document.getElementById("floweditor"),config)</script></html>
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
self.__precacheManifest = (self.__precacheManifest || []).concat([
{
revision: 'bc227627d8194711bf3df4c4f0e507b3',
revision: 'b32c4d4c6201563eb99ea294a58283e6',
url: './index.html'
},
{
revision: '0e5b5200a1facb66e216',
revision: '56ecd028d3e5cb8599d1',
url: './static/css/main.5d76d5d5.chunk.css'
},
{
Expand All @@ -20,8 +20,8 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([
url: './static/js/3.30227eeb.chunk.js'
},
{
revision: '0e5b5200a1facb66e216',
url: './static/js/main.2311ea85.chunk.js'
revision: '56ecd028d3e5cb8599d1',
url: './static/js/main.971262ab.chunk.js'
},
{
revision: '8aa6eb740f6f2d11c7f6',
Expand Down
2 changes: 1 addition & 1 deletion build/service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

importScripts('https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js');

importScripts('./precache-manifest.3023c96a597d050e738b2abac08b7dfe.js');
importScripts('./precache-manifest.2d78dd9211b1f8228adcf8d495f59dd0.js');

self.addEventListener('message', event => {
if (event.data && event.data.type === 'SKIP_WAITING') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4881,7 +4881,7 @@
return e.renderAttachment(a, t);
}),
a =
this.state.attachments.length < 3
this.state.attachments.length < 1
? this.renderAttachment(-1, { url: '', type: '' })
: null;
return k.createElement(
Expand Down Expand Up @@ -6270,7 +6270,7 @@
return t.uploaded ? e.renderUpload(a, t) : e.renderAttachment(a, t);
}),
a =
this.state.attachments.length < 3
this.state.attachments.length < 1
? this.renderAttachment(-1, { url: '', type: '' })
: null;
return k.createElement(
Expand All @@ -6282,7 +6282,7 @@
Ft.t(
'forms.send_msg_summary',
'Add an attachment to each message. The attachment can be a file you upload or a dynamic URL using expressions and variables from your Flow.',
{ count: 3 }
{ count: 1 }
)
),
t,
Expand Down Expand Up @@ -20952,4 +20952,4 @@
],
[[161, 1, 2]]
]);
//# sourceMappingURL=main.2311ea85.chunk.js.map
//# sourceMappingURL=main.971262ab.chunk.js.map

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { Trans } from 'react-i18next';
import { createUUID, range } from 'utils';
import { renderIssues } from '../helpers';

const MAX_ATTACHMENTS = 3;
const MAX_ATTACHMENTS = 1;

const TYPE_OPTIONS: SelectOption[] = [
{ value: 'image', name: i18n.t('forms.image_url', 'Image URL') },
Expand Down
2 changes: 1 addition & 1 deletion src/components/flow/actions/sendmsg/SendMsgForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import i18n from 'config/i18n';
import { Trans } from 'react-i18next';
import { TembaSelectStyle } from 'temba/TembaSelect';

const MAX_ATTACHMENTS = 3;
const MAX_ATTACHMENTS = 1;

const TYPE_OPTIONS: SelectOption[] = [
{ value: 'image', name: i18n.t('forms.image_url', 'Image URL') },
Expand Down

0 comments on commit 901b5b6

Please sign in to comment.