@nyaruka/temba-components 0.105.0 → 0.106.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -1
- package/dist/locales/es.js +1 -1
- package/dist/locales/es.js.map +1 -1
- package/dist/locales/fr.js +1 -1
- package/dist/locales/fr.js.map +1 -1
- package/dist/locales/pt.js +1 -1
- package/dist/locales/pt.js.map +1 -1
- package/dist/temba-components.js +15 -12
- package/dist/temba-components.js.map +1 -1
- package/out-tsc/src/contactsearch/ContactSearch.js +31 -13
- package/out-tsc/src/contactsearch/ContactSearch.js.map +1 -1
- package/out-tsc/src/locales/es.js +1 -1
- package/out-tsc/src/locales/es.js.map +1 -1
- package/out-tsc/src/locales/fr.js +1 -1
- package/out-tsc/src/locales/fr.js.map +1 -1
- package/out-tsc/src/locales/pt.js +1 -1
- package/out-tsc/src/locales/pt.js.map +1 -1
- package/out-tsc/src/outboxmonitor/OutboxMonitor.js +1 -3
- package/out-tsc/src/outboxmonitor/OutboxMonitor.js.map +1 -1
- package/package.json +1 -1
- package/src/contactsearch/ContactSearch.ts +36 -15
- package/src/locales/es.ts +1 -1
- package/src/locales/fr.ts +1 -1
- package/src/locales/pt.ts +1 -1
- package/src/outboxmonitor/OutboxMonitor.ts +1 -4
package/CHANGELOG.md
CHANGED
|
@@ -4,9 +4,26 @@ All notable changes to this project will be documented in this file. Dates are d
|
|
|
4
4
|
|
|
5
5
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
6
6
|
|
|
7
|
-
#### [v0.
|
|
7
|
+
#### [v0.106.0](https://github.com/nyaruka/temba-components/compare/v0.105.1...v0.106.0)
|
|
8
|
+
|
|
9
|
+
- Handle empty contact searches more elegantly [`#451`](https://github.com/nyaruka/temba-components/pull/451)
|
|
10
|
+
|
|
11
|
+
#### [v0.105.1](https://github.com/nyaruka/temba-components/compare/v0.105.0...v0.105.1)
|
|
12
|
+
|
|
13
|
+
> 6 September 2024
|
|
14
|
+
|
|
15
|
+
- Remove debug [`2c3cd7f`](https://github.com/nyaruka/temba-components/commit/2c3cd7f61a7ee3418dbf52d1e4cfa1b57bc30a37)
|
|
16
|
+
|
|
17
|
+
#### [v0.105.0](https://github.com/nyaruka/temba-components/compare/v0.104.1...v0.105.0)
|
|
18
|
+
|
|
19
|
+
> 6 September 2024
|
|
8
20
|
|
|
9
21
|
- Add OutboxMonitor [`#450`](https://github.com/nyaruka/temba-components/pull/450)
|
|
22
|
+
|
|
23
|
+
#### [v0.104.1](https://github.com/nyaruka/temba-components/compare/v0.104.0...v0.104.1)
|
|
24
|
+
|
|
25
|
+
> 15 August 2024
|
|
26
|
+
|
|
10
27
|
- Add user_token icon [`c4510b0`](https://github.com/nyaruka/temba-components/commit/c4510b03d9a00cc3f009788f0262e3535d4d25a9)
|
|
11
28
|
|
|
12
29
|
#### [v0.104.0](https://github.com/nyaruka/temba-components/compare/v0.103.0...v0.104.0)
|
package/dist/locales/es.js
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
5
5
|
export const templates = {
|
|
6
6
|
scf1453991c986b25: `Tab para completar, enter para seleccionar`,
|
|
7
|
-
s638236250662c6b3: `Have sent a message in the last`,
|
|
8
7
|
s8f02e3a18ffc083a: `Are not currently in a flow`,
|
|
8
|
+
s638236250662c6b3: `Have sent a message in the last`,
|
|
9
9
|
s4788ee206c4570c7: `Have not started this flow in the last 90 days`
|
|
10
10
|
};
|
|
11
11
|
//# sourceMappingURL=es.js.map
|
package/dist/locales/es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"es.js","sourceRoot":"","sources":["../../../src/locales/es.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,gDAAgD;AAEhD,4CAA4C;AAC5C,uDAAuD;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,iBAAiB,EAAE,4CAA4C;IAC/D,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"es.js","sourceRoot":"","sources":["../../../src/locales/es.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,gDAAgD;AAEhD,4CAA4C;AAC5C,uDAAuD;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,iBAAiB,EAAE,4CAA4C;IAC/D,iBAAiB,EAAE,6BAA6B;IAChD,iBAAiB,EAAE,iCAAiC;IACpD,iBAAiB,EAAE,gDAAgD;CACpE,CAAC","sourcesContent":["// Do not modify this file by hand!\n// Re-generate this file by running lit-localize\n\n/* eslint-disable no-irregular-whitespace */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nexport const templates = {\n scf1453991c986b25: `Tab para completar, enter para seleccionar`,\n s8f02e3a18ffc083a: `Are not currently in a flow`,\n s638236250662c6b3: `Have sent a message in the last`,\n s4788ee206c4570c7: `Have not started this flow in the last 90 days`\n};\n"]}
|
package/dist/locales/fr.js
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
5
5
|
export const templates = {
|
|
6
6
|
scf1453991c986b25: `Tab to complete, enter to select`,
|
|
7
|
-
s638236250662c6b3: `Have sent a message in the last`,
|
|
8
7
|
s8f02e3a18ffc083a: `Are not currently in a flow`,
|
|
8
|
+
s638236250662c6b3: `Have sent a message in the last`,
|
|
9
9
|
s4788ee206c4570c7: `Have not started this flow in the last 90 days`
|
|
10
10
|
};
|
|
11
11
|
//# sourceMappingURL=fr.js.map
|
package/dist/locales/fr.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fr.js","sourceRoot":"","sources":["../../../src/locales/fr.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,gDAAgD;AAEhD,4CAA4C;AAC5C,uDAAuD;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,iBAAiB,EAAE,kCAAkC;IACrD,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"fr.js","sourceRoot":"","sources":["../../../src/locales/fr.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,gDAAgD;AAEhD,4CAA4C;AAC5C,uDAAuD;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,iBAAiB,EAAE,kCAAkC;IACrD,iBAAiB,EAAE,6BAA6B;IAChD,iBAAiB,EAAE,iCAAiC;IACpD,iBAAiB,EAAE,gDAAgD;CACpE,CAAC","sourcesContent":["// Do not modify this file by hand!\n// Re-generate this file by running lit-localize\n\n/* eslint-disable no-irregular-whitespace */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nexport const templates = {\n scf1453991c986b25: `Tab to complete, enter to select`,\n s8f02e3a18ffc083a: `Are not currently in a flow`,\n s638236250662c6b3: `Have sent a message in the last`,\n s4788ee206c4570c7: `Have not started this flow in the last 90 days`\n};\n"]}
|
package/dist/locales/pt.js
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
5
5
|
export const templates = {
|
|
6
6
|
scf1453991c986b25: `Tab to complete, enter to select`,
|
|
7
|
-
s638236250662c6b3: `Have sent a message in the last`,
|
|
8
7
|
s8f02e3a18ffc083a: `Are not currently in a flow`,
|
|
8
|
+
s638236250662c6b3: `Have sent a message in the last`,
|
|
9
9
|
s4788ee206c4570c7: `Have not started this flow in the last 90 days`
|
|
10
10
|
};
|
|
11
11
|
//# sourceMappingURL=pt.js.map
|
package/dist/locales/pt.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pt.js","sourceRoot":"","sources":["../../../src/locales/pt.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,gDAAgD;AAEhD,4CAA4C;AAC5C,uDAAuD;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,iBAAiB,EAAE,kCAAkC;IACrD,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"pt.js","sourceRoot":"","sources":["../../../src/locales/pt.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,gDAAgD;AAEhD,4CAA4C;AAC5C,uDAAuD;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,iBAAiB,EAAE,kCAAkC;IACrD,iBAAiB,EAAE,6BAA6B;IAChD,iBAAiB,EAAE,iCAAiC;IACpD,iBAAiB,EAAE,gDAAgD;CACpE,CAAC","sourcesContent":["// Do not modify this file by hand!\n// Re-generate this file by running lit-localize\n\n/* eslint-disable no-irregular-whitespace */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nexport const templates = {\n scf1453991c986b25: `Tab to complete, enter to select`,\n s8f02e3a18ffc083a: `Are not currently in a flow`,\n s638236250662c6b3: `Have sent a message in the last`,\n s4788ee206c4570c7: `Have not started this flow in the last 90 days`\n};\n"]}
|
package/dist/temba-components.js
CHANGED
|
@@ -2760,6 +2760,7 @@ let ir=Ps,or=!1;const nr=["es","fr","pt"],{setLocale:sr}=(t=>(function(t){if(or)
|
|
|
2760
2760
|
--temba-select-selected-line-height: 1em;
|
|
2761
2761
|
--temba-select-selected-font-size: 1em;
|
|
2762
2762
|
--search-input-height: 0px !important;
|
|
2763
|
+
--temba-select-min-height: 1.8em;
|
|
2763
2764
|
min-width: 100px;
|
|
2764
2765
|
}
|
|
2765
2766
|
|
|
@@ -2768,7 +2769,7 @@ let ir=Ps,or=!1;const nr=["es","fr","pt"],{setLocale:sr}=(t=>(function(t){if(or)
|
|
|
2768
2769
|
border: 1px solid var(--color-borders);
|
|
2769
2770
|
border-radius: var(--curvature);
|
|
2770
2771
|
}
|
|
2771
|
-
`}refresh(){this.refreshKey="requested_"+(new Date).getTime()}updated(t){super.updated(t),t.has("recipients")&&this.handleRecipientsChanged(),t.has("in_a_flow")&&!this.in_a_flow&&(delete this.exclusions.in_a_flow,this.requestUpdate("exclusions")),(t.has("query")&&this.advanced||t.has("refreshKey")&&"0"!==this.refreshKey)&&(this.summary=null,this.fireCustomEvent(Me.ContentChanged,{reset:!0}),this.lastQuery&&(window.clearTimeout(this.lastQuery),this.fetching=!1),(this.query.trim().length>0||this.recipients.length>0)&&(this.fetching=!0,this.lastQuery=window.setTimeout((()=>{this.fetchSummary()}),2e3)))}fetchSummary(){if(this.endpoint){const t=this.recipients.filter((t=>"group"===t.type)).map((t=>t.id)),e=this.recipients.filter((t=>"contact"===t.type)).map((t=>t.id));Kt(this.endpoint,{include:this.advanced?{query:this.query}:{contact_uuids:e,group_uuids:t},exclude:this.exclusions}).then((t=>{this.fetching=!1,this.initialized=!0,200===t.status?(this.summary=t.json,this.advanced||(this.query=this.summary.query),this.setValue({advanced:this.advanced,query:this.query,exclusions:this.exclusions,recipients:this.recipients}),this.summary.error?this.errors=[this.summary.error]:this.errors=[],this.requestUpdate("errors"),this.fireCustomEvent(Me.ContentChanged,this.summary)):(this.summary=t.json,this.summary.error&&(this.errors=[this.summary.error]),this.requestUpdate("errors"),this.fireCustomEvent(Me.ContentChanged,this.summary))}))}}handleAdvancedToggle(t){re(t),this.recipients=[],this.exclusions={},this.advanced&&(this.query="",this.value=null),this.advanced=!this.advanced,this.setValue({advanced:this.advanced,query:this.query,exclusions:this.exclusions,recipients:this.recipients})}handleQueryChange(t){const e=t.target;this.query=e.inputElement.value}handleRecipientsChanged(){this.endpoint&&(this.recipients&&("0"!==this.refreshKey||this.initialized)?this.refresh():this.initialized=!0)}handleActivityLevelChanged(t){const e=t.target.values[0];e&&this.exclusions.not_seen_since_days&&(this.exclusions.not_seen_since_days=parseInt(e.value),this.refresh())}handleActivityLabelClicked(t){if(t.target&&"TEMBA-CHECKBOX"!==t.target.tagName&&"TEMBA-SELECT"!==t.target.tagName&&!t.target.disabled){const e=t.currentTarget.querySelector("temba-checkbox");e.checked=!e.checked}}handleExclusionChanged(t){if("TEMBA-CHECKBOX"===t.target.tagName){const e=JSON.stringify(this.exclusions),i=t.target;let o=i.checked;if("not_seen_since_days"===i.name&&o){const t=i.parentElement.querySelector("temba-select");o=t.values[0]?parseInt(t.values[0].value):this.exclusions[i.name]}o?this.exclusions[i.name]=o:delete this.exclusions[i.name],e!==JSON.stringify(this.exclusions)&&this.refresh()}}render(){let t;if(this.summary&&!this.summary.error){const e=this.summary.total||0;t=Z`
|
|
2772
|
+
`}refresh(){this.advanced||this.recipients.length>0?this.refreshKey="requested_"+(new Date).getTime():(this.summary=null,this.fetching=!1,this.requestUpdate(),this.fireCustomEvent(Me.ContentChanged,{reset:!0}))}firstUpdated(t){super.firstUpdated(t)}updated(t){super.updated(t),t.has("recipients")&&this.handleRecipientsChanged(),t.has("in_a_flow")&&!this.in_a_flow&&(delete this.exclusions.in_a_flow,this.requestUpdate("exclusions")),(t.has("query")&&this.advanced||t.has("refreshKey")&&"0"!==this.refreshKey)&&(this.summary=null,this.fireCustomEvent(Me.ContentChanged,{reset:!0}),this.lastQuery&&(window.clearTimeout(this.lastQuery),this.fetching=!1),(this.query.trim().length>0||this.recipients.length>0)&&(this.fetching=!0,this.lastQuery=window.setTimeout((()=>{this.fetchSummary()}),2e3)))}fetchSummary(){if(this.endpoint){const t=this.recipients.filter((t=>"group"===t.type)).map((t=>t.id)),e=this.recipients.filter((t=>"contact"===t.type)).map((t=>t.id));Kt(this.endpoint,{include:this.advanced?{query:this.query}:{contact_uuids:e,group_uuids:t},exclude:this.exclusions}).then((t=>{this.fetching=!1,this.initialized=!0,(0!=this.recipients.length||this.advanced)&&(200===t.status?(this.summary=t.json,this.advanced||(this.query=this.summary.query),this.setValue({advanced:this.advanced,query:this.query,exclusions:this.exclusions,recipients:this.recipients}),this.summary.error?this.errors=[this.summary.error]:this.errors=[],this.requestUpdate("errors"),this.fireCustomEvent(Me.ContentChanged,this.summary)):(this.summary=t.json,this.summary.error&&(this.errors=[this.summary.error]),this.requestUpdate("errors"),this.fireCustomEvent(Me.ContentChanged,this.summary)))}))}}handleAdvancedToggle(t){re(t),this.recipients=[],this.exclusions={},this.advanced&&(this.query="",this.value=null),this.advanced=!this.advanced,this.setValue({advanced:this.advanced,query:this.query,exclusions:this.exclusions,recipients:this.recipients})}handleQueryChange(t){const e=t.target;this.query=e.inputElement.value}handleRecipientsChanged(){this.endpoint&&(this.recipients&&("0"!==this.refreshKey||this.initialized)?this.refresh():this.initialized=!0)}handleActivityLevelChanged(t){const e=t.target.values[0];e&&this.exclusions.not_seen_since_days&&(this.exclusions.not_seen_since_days=parseInt(e.value),this.refresh())}handleActivityLabelClicked(t){if(t.target&&"TEMBA-CHECKBOX"!==t.target.tagName&&"TEMBA-SELECT"!==t.target.tagName&&!t.target.disabled){const e=t.currentTarget.querySelector("temba-checkbox");e.checked=!e.checked}}handleExclusionChanged(t){if("TEMBA-CHECKBOX"===t.target.tagName){const e=JSON.stringify(this.exclusions),i=t.target;let o=i.checked;if("not_seen_since_days"===i.name&&o){const t=i.parentElement.querySelector("temba-select");o=t.values[0]?parseInt(t.values[0].value):this.exclusions[i.name]}o?this.exclusions[i.name]=o:delete this.exclusions[i.name],e!==JSON.stringify(this.exclusions)&&this.endpoint&&this.refresh()}}render(){let t;if(this.summary&&!this.summary.error){const e=this.summary.total||0;t=Z`
|
|
2772
2773
|
<div class="result-count">
|
|
2773
2774
|
Found
|
|
2774
2775
|
<a
|
|
@@ -2801,7 +2802,7 @@ let ir=Ps,or=!1;const nr=["es","fr","pt"],{setLocale:sr}=(t=>(function(t){if(or)
|
|
|
2801
2802
|
</div>
|
|
2802
2803
|
</div>
|
|
2803
2804
|
</temba-button>
|
|
2804
|
-
`}const e=this.exclusions.not_seen_since_days;return this.summary&&this.summary.blockers&&this.summary.blockers.length>0
|
|
2805
|
+
`}const e=this.exclusions.not_seen_since_days;let i=null;return this.summary&&this.summary.blockers&&this.summary.blockers.length>0&&(i=Z`${this.summary.blockers.map((t=>Z`<temba-alert level="error">${pr(t)}</temba-alert>`))}`),Z`
|
|
2805
2806
|
${this.advanced?Z`<div class="query">
|
|
2806
2807
|
<temba-textinput
|
|
2807
2808
|
.label=${this.label}
|
|
@@ -2843,7 +2844,12 @@ let ir=Ps,or=!1;const nr=["es","fr","pt"],{setLocale:sr}=(t=>(function(t){if(or)
|
|
|
2843
2844
|
Only include contacts who...
|
|
2844
2845
|
</div>
|
|
2845
2846
|
</div>
|
|
2846
|
-
|
|
2847
|
+
${this.in_a_flow?Z`<temba-checkbox
|
|
2848
|
+
name="in_a_flow"
|
|
2849
|
+
label="${ir("Are not currently in a flow")}"
|
|
2850
|
+
?checked=${this.exclusions.in_a_flow}
|
|
2851
|
+
@change=${this.handleExclusionChanged}
|
|
2852
|
+
></temba-checkbox>`:null}
|
|
2847
2853
|
${this.not_seen_since_days?Z`
|
|
2848
2854
|
<div
|
|
2849
2855
|
class="activity-select"
|
|
@@ -2886,12 +2892,6 @@ let ir=Ps,or=!1;const nr=["es","fr","pt"],{setLocale:sr}=(t=>(function(t){if(or)
|
|
|
2886
2892
|
<div></div>
|
|
2887
2893
|
</div>
|
|
2888
2894
|
`:null}
|
|
2889
|
-
${this.in_a_flow?Z`<temba-checkbox
|
|
2890
|
-
name="in_a_flow"
|
|
2891
|
-
label="${ir("Are not currently in a flow")}"
|
|
2892
|
-
?checked=${this.exclusions.in_a_flow}
|
|
2893
|
-
@change=${this.handleExclusionChanged}
|
|
2894
|
-
></temba-checkbox>`:null}
|
|
2895
2895
|
${this.started_previously?Z`<temba-checkbox
|
|
2896
2896
|
name="started_previously"
|
|
2897
2897
|
label="${ir("Have not started this flow in the last 90 days")}"
|
|
@@ -2907,9 +2907,12 @@ let ir=Ps,or=!1;const nr=["es","fr","pt"],{setLocale:sr}=(t=>(function(t){if(or)
|
|
|
2907
2907
|
<temba-loading units="6" size="8"></temba-loading>
|
|
2908
2908
|
<div class="summary ${this.expanded?"expanded":""}">${t}</div>
|
|
2909
2909
|
</div>
|
|
2910
|
-
${
|
|
2910
|
+
${i}
|
|
2911
|
+
${!i&&this.summary&&this.summary.warnings?this.summary.warnings.map((t=>Z`<temba-alert level="warning"
|
|
2911
2912
|
>${pr(t)}</temba-alert
|
|
2912
2913
|
>`)):""}
|
|
2914
|
+
|
|
2915
|
+
|
|
2913
2916
|
`}}t([ge({type:Boolean})],Yl.prototype,"in_a_flow",void 0),t([ge({type:Boolean})],Yl.prototype,"started_previously",void 0),t([ge({type:Boolean})],Yl.prototype,"not_seen_since_days",void 0),t([ge({type:Boolean})],Yl.prototype,"fetching",void 0),t([ge({type:Boolean})],Yl.prototype,"expanded",void 0),t([ge({type:String})],Yl.prototype,"endpoint",void 0),t([ge({type:String})],Yl.prototype,"placeholder",void 0),t([ge({type:String})],Yl.prototype,"name",void 0),t([ge({type:String})],Yl.prototype,"query",void 0),t([ge({type:Number})],Yl.prototype,"inactiveThreshold",void 0),t([ge({type:Number})],Yl.prototype,"inactiveDays",void 0),t([ge({type:Object,attribute:!1})],Yl.prototype,"summary",void 0),t([ge({type:Object,attribute:!1})],Yl.prototype,"flow",void 0),t([ge({type:Array})],Yl.prototype,"recipients",void 0),t([ge({type:Boolean})],Yl.prototype,"advanced",void 0),t([ge({type:String})],Yl.prototype,"refreshKey",void 0),t([ge({type:Object})],Yl.prototype,"exclusions",void 0);class Kl extends lt{static get styles(){return r`
|
|
2914
2917
|
:host {
|
|
2915
2918
|
align-items: center;
|
|
@@ -7942,7 +7945,7 @@ const{I:Xh}=rt,tc=()=>document.createComment(""),ec=(t,e,i)=>{const o=t._$AA.par
|
|
|
7942
7945
|
.estimate {
|
|
7943
7946
|
font-size: 0.9em;
|
|
7944
7947
|
}
|
|
7945
|
-
`}fetchFolders(){Wt(this.endpoint).then((t=>{t.filter((t=>"outbox"===t.id||"sent"===t.id||"failed"===t.id)).forEach((t=>{this.folders[t.id]?this.folders[t.id].current=t.count:this.folders[t.id]={start:t.count,current:t.count}})),this.firstFetch?this.lastFetch=new Date:this.firstFetch=new Date,this.fetches++,
|
|
7948
|
+
`}fetchFolders(){Wt(this.endpoint).then((t=>{t.filter((t=>"outbox"===t.id||"sent"===t.id||"failed"===t.id)).forEach((t=>{this.folders[t.id]?this.folders[t.id].current=t.count:this.folders[t.id]={start:t.count,current:t.count}})),this.firstFetch?this.lastFetch=new Date:this.firstFetch=new Date,this.fetches++,this.scheduleRefresh(Math.min(5e3*this.fetches,6e4));const e=this.folders.outbox;this.backlogSize=e.current,e.current>1&&this.estimateCompletion()}))}estimateCompletion(){if(this.lastFetch){const t=(this.lastFetch.getTime()-this.firstFetch.getTime())/1e3,e=this.folders.sent,i=this.folders.failed,o=e.current+i.current-(e.start+i.start);this.msgsPerSecond=o/t;const n=this.folders.outbox.current/this.msgsPerSecond;this.estimatedCompletionDate=new Date((new Date).getTime()+1e3*n)}}scheduleRefresh(t){setTimeout((()=>{this.fetchFolders()}),t)}firstUpdated(t){t.has("endpoint")&&this.endpoint&&this.fetchFolders()}hasBacklog(){return this.backlogSize>5e5}render(){const t=Math.round(this.msgsPerSecond);return this.hasBacklog()&&this.estimatedCompletionDate&&!this.isMobile()?Z`<div class="monitor">
|
|
7946
7949
|
<temba-alert
|
|
7947
7950
|
><div class="header">Outbox Notice</div>
|
|
7948
7951
|
<div class="estimate">
|
|
@@ -7950,7 +7953,7 @@ const{I:Xh}=rt,tc=()=>document.createComment(""),ec=(t,e,i)=>{const o=t._$AA.par
|
|
|
7950
7953
|
or broadcasts. Your channels are currently sending at
|
|
7951
7954
|
${t.toLocaleString()}
|
|
7952
7955
|
message${1==t?"":"s"} per second. At that rate, your
|
|
7953
|
-
outbox
|
|
7956
|
+
outbox will clear
|
|
7954
7957
|
<temba-date
|
|
7955
7958
|
value="${this.estimatedCompletionDate.toISOString()}"
|
|
7956
7959
|
display="duration"
|