@nyaruka/temba-components 0.138.0 → 0.138.6
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/.devcontainer/Dockerfile +0 -9
- package/.devcontainer/devcontainer.json +8 -3
- package/.github/workflows/build.yml +6 -1
- package/.github/workflows/cla.yml +1 -1
- package/.github/workflows/publish.yml +6 -1
- package/CHANGELOG.md +39 -0
- package/dist/locales/es.js +5 -5
- package/dist/locales/es.js.map +1 -1
- package/dist/locales/fr.js +5 -5
- package/dist/locales/fr.js.map +1 -1
- package/dist/locales/locale-codes.js +11 -2
- package/dist/locales/locale-codes.js.map +1 -1
- package/dist/locales/pt.js +5 -5
- package/dist/locales/pt.js.map +1 -1
- package/dist/temba-components.js +131 -98
- package/dist/temba-components.js.map +1 -1
- package/out-tsc/src/display/FloatingTab.js +16 -8
- package/out-tsc/src/display/FloatingTab.js.map +1 -1
- package/out-tsc/src/flow/CanvasMenu.js +33 -15
- package/out-tsc/src/flow/CanvasMenu.js.map +1 -1
- package/out-tsc/src/flow/CanvasNode.js +4 -0
- package/out-tsc/src/flow/CanvasNode.js.map +1 -1
- package/out-tsc/src/flow/Editor.js +279 -55
- package/out-tsc/src/flow/Editor.js.map +1 -1
- package/out-tsc/src/flow/NodeTypeSelector.js +13 -11
- package/out-tsc/src/flow/NodeTypeSelector.js.map +1 -1
- package/out-tsc/src/flow/Plumber.js +1 -1
- package/out-tsc/src/flow/Plumber.js.map +1 -1
- package/out-tsc/src/flow/actions/set_contact_field.js +5 -1
- package/out-tsc/src/flow/actions/set_contact_field.js.map +1 -1
- package/out-tsc/src/list/RunList.js +2 -1
- package/out-tsc/src/list/RunList.js.map +1 -1
- package/out-tsc/src/list/TicketList.js +2 -1
- package/out-tsc/src/list/TicketList.js.map +1 -1
- package/out-tsc/src/live/ContactChat.js +18 -1
- package/out-tsc/src/live/ContactChat.js.map +1 -1
- package/out-tsc/src/locales/es.js +5 -5
- package/out-tsc/src/locales/es.js.map +1 -1
- package/out-tsc/src/locales/fr.js +5 -5
- package/out-tsc/src/locales/fr.js.map +1 -1
- package/out-tsc/src/locales/locale-codes.js +11 -2
- package/out-tsc/src/locales/locale-codes.js.map +1 -1
- package/out-tsc/src/locales/pt.js +5 -5
- package/out-tsc/src/locales/pt.js.map +1 -1
- package/out-tsc/src/store/AppState.js +5 -0
- package/out-tsc/src/store/AppState.js.map +1 -1
- package/out-tsc/test/temba-contact-fields.test.js +3 -3
- package/out-tsc/test/temba-contact-fields.test.js.map +1 -1
- package/out-tsc/test/temba-flow-editor-node.test.js +2 -1
- package/out-tsc/test/temba-flow-editor-node.test.js.map +1 -1
- package/out-tsc/test/temba-select.test.js +1 -0
- package/out-tsc/test/temba-select.test.js.map +1 -1
- package/package.json +1 -1
- package/screenshots/truth/floating-tab/gray.png +0 -0
- package/screenshots/truth/floating-tab/green.png +0 -0
- package/screenshots/truth/floating-tab/purple.png +0 -0
- package/screenshots/truth/node-type-selector/action-mode.png +0 -0
- package/screenshots/truth/node-type-selector/split-mode.png +0 -0
- package/src/display/FloatingTab.ts +18 -8
- package/src/flow/CanvasMenu.ts +38 -16
- package/src/flow/CanvasNode.ts +8 -0
- package/src/flow/Editor.ts +343 -58
- package/src/flow/NodeTypeSelector.ts +13 -11
- package/src/flow/Plumber.ts +1 -1
- package/src/flow/actions/set_contact_field.ts +5 -1
- package/src/list/RunList.ts +2 -1
- package/src/list/TicketList.ts +2 -1
- package/src/live/ContactChat.ts +19 -1
- package/src/locales/es.ts +18 -13
- package/src/locales/fr.ts +18 -13
- package/src/locales/locale-codes.ts +11 -2
- package/src/locales/pt.ts +18 -13
- package/src/store/AppState.ts +5 -0
- package/test/temba-contact-fields.test.ts +8 -3
- package/test/temba-flow-editor-node.test.ts +2 -1
- package/test/temba-select.test.ts +1 -0
package/src/live/ContactChat.ts
CHANGED
|
@@ -271,6 +271,12 @@ export class ContactChat extends ContactStoreElement {
|
|
|
271
271
|
@property({ type: Boolean })
|
|
272
272
|
showInterrupt = false;
|
|
273
273
|
|
|
274
|
+
@property({ type: Boolean })
|
|
275
|
+
disableAssign = false;
|
|
276
|
+
|
|
277
|
+
@property({ type: Boolean })
|
|
278
|
+
disableReply = false;
|
|
279
|
+
|
|
274
280
|
@property({ type: String })
|
|
275
281
|
avatar = DEFAULT_AVATAR;
|
|
276
282
|
|
|
@@ -607,6 +613,14 @@ export class ContactChat extends ContactStoreElement {
|
|
|
607
613
|
return null;
|
|
608
614
|
} else {
|
|
609
615
|
if (!this.currentTicket.closed_on) {
|
|
616
|
+
// hide compose if agent can't reply to unassigned tickets
|
|
617
|
+
if (
|
|
618
|
+
this.disableReply &&
|
|
619
|
+
(!this.currentTicket.assignee ||
|
|
620
|
+
this.currentTicket.assignee.email !== this.agent)
|
|
621
|
+
) {
|
|
622
|
+
return null;
|
|
623
|
+
}
|
|
610
624
|
//chatbox for active contacts with an open ticket
|
|
611
625
|
return this.getCompose();
|
|
612
626
|
} else {
|
|
@@ -676,6 +690,10 @@ export class ContactChat extends ContactStoreElement {
|
|
|
676
690
|
}
|
|
677
691
|
|
|
678
692
|
public assignTicket(email: string) {
|
|
693
|
+
if (this.disableAssign) {
|
|
694
|
+
return;
|
|
695
|
+
}
|
|
696
|
+
|
|
679
697
|
// if its already assigned to use, it's a noop
|
|
680
698
|
if (
|
|
681
699
|
(this.currentTicket.assignee &&
|
|
@@ -803,7 +821,7 @@ export class ContactChat extends ContactStoreElement {
|
|
|
803
821
|
? [this.currentTicket.assignee]
|
|
804
822
|
: []}
|
|
805
823
|
@change=${this.handleAssignmentChanged}
|
|
806
|
-
?disabled=${ticketClosed}
|
|
824
|
+
?disabled=${ticketClosed || this.disableAssign}
|
|
807
825
|
></temba-user-select>
|
|
808
826
|
|
|
809
827
|
<temba-select
|
package/src/locales/es.ts
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
//
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
|
|
2
|
+
// Do not modify this file by hand!
|
|
3
|
+
// Re-generate this file by running lit-localize
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
/* eslint-disable no-irregular-whitespace */
|
|
9
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
10
|
+
|
|
11
|
+
export const templates = {
|
|
12
|
+
'scf1453991c986b25': `Tab para completar, enter para seleccionar`,
|
|
13
|
+
's73b4d70c02f4b4e0': `No options`,
|
|
14
|
+
's8f02e3a18ffc083a': `Are not currently in a flow`,
|
|
15
|
+
's638236250662c6b3': `Have sent a message in the last`,
|
|
16
|
+
's4788ee206c4570c7': `Have not started this flow in the last 90 days`,
|
|
17
|
+
};
|
|
18
|
+
|
package/src/locales/fr.ts
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
//
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
|
|
2
|
+
// Do not modify this file by hand!
|
|
3
|
+
// Re-generate this file by running lit-localize
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
/* eslint-disable no-irregular-whitespace */
|
|
9
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
10
|
+
|
|
11
|
+
export const templates = {
|
|
12
|
+
's73b4d70c02f4b4e0': `No options`,
|
|
13
|
+
'scf1453991c986b25': `Tab to complete, enter to select`,
|
|
14
|
+
's8f02e3a18ffc083a': `Are not currently in a flow`,
|
|
15
|
+
's638236250662c6b3': `Have sent a message in the last`,
|
|
16
|
+
's4788ee206c4570c7': `Have not started this flow in the last 90 days`,
|
|
17
|
+
};
|
|
18
|
+
|
|
@@ -10,9 +10,18 @@ export const sourceLocale = `en`;
|
|
|
10
10
|
* The other locale codes that this application is localized into. Sorted
|
|
11
11
|
* lexicographically.
|
|
12
12
|
*/
|
|
13
|
-
export const targetLocales = [
|
|
13
|
+
export const targetLocales = [
|
|
14
|
+
`es`,
|
|
15
|
+
`fr`,
|
|
16
|
+
`pt`,
|
|
17
|
+
] as const;
|
|
14
18
|
|
|
15
19
|
/**
|
|
16
20
|
* All valid project locale codes. Sorted lexicographically.
|
|
17
21
|
*/
|
|
18
|
-
export const allLocales = [
|
|
22
|
+
export const allLocales = [
|
|
23
|
+
`en`,
|
|
24
|
+
`es`,
|
|
25
|
+
`fr`,
|
|
26
|
+
`pt`,
|
|
27
|
+
] as const;
|
package/src/locales/pt.ts
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
//
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
|
|
2
|
+
// Do not modify this file by hand!
|
|
3
|
+
// Re-generate this file by running lit-localize
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
/* eslint-disable no-irregular-whitespace */
|
|
9
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
10
|
+
|
|
11
|
+
export const templates = {
|
|
12
|
+
's73b4d70c02f4b4e0': `No options`,
|
|
13
|
+
'scf1453991c986b25': `Tab to complete, enter to select`,
|
|
14
|
+
's8f02e3a18ffc083a': `Are not currently in a flow`,
|
|
15
|
+
's638236250662c6b3': `Have sent a message in the last`,
|
|
16
|
+
's4788ee206c4570c7': `Have not started this flow in the last 90 days`,
|
|
17
|
+
};
|
|
18
|
+
|
package/src/store/AppState.ts
CHANGED
|
@@ -484,6 +484,11 @@ export const zustand = createStore<AppState>()(
|
|
|
484
484
|
exitUuid: string,
|
|
485
485
|
destinationNodeUuid: string
|
|
486
486
|
) => {
|
|
487
|
+
/* console.log('Upating connection:', {
|
|
488
|
+
nodeUuid,
|
|
489
|
+
exitUuid,
|
|
490
|
+
destinationNodeUuid
|
|
491
|
+
});*/
|
|
487
492
|
set((state: AppState) => {
|
|
488
493
|
// Find the exit with this UUID
|
|
489
494
|
const node = state.flowDefinition.nodes.find(
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import { assert, expect } from '@open-wc/testing';
|
|
2
2
|
import { ContactFields } from '../src/live/ContactFields';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
getComponent,
|
|
5
|
+
loadStore,
|
|
6
|
+
mockPOST,
|
|
7
|
+
waitForCondition
|
|
8
|
+
} from './utils.test';
|
|
4
9
|
|
|
5
10
|
const TAG = 'temba-contact-fields';
|
|
6
11
|
const getFields = async (attrs: any = {}) => {
|
|
7
12
|
attrs['endpoint'] = '/test-assets/contacts/';
|
|
8
13
|
const fields = (await getComponent(TAG, attrs, '', 600)) as ContactFields;
|
|
9
14
|
|
|
10
|
-
// wait for our contact to load
|
|
11
|
-
await
|
|
15
|
+
// wait for our contact data to load
|
|
16
|
+
await waitForCondition(() => fields.data !== undefined);
|
|
12
17
|
|
|
13
18
|
return fields;
|
|
14
19
|
};
|