Skip to content

Commit 0aebf3d

Browse files
authored
Merge pull request #470 from nyaruka/assignment-bar
Assignment bar
2 parents 17ee4c3 + 60e546f commit 0aebf3d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1424
-1340
lines changed

Diff for: demo/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
</head>
128128

129129
<body>
130-
<temba-webchat channel="f2f0c0fc-c287-4826-96f5-84ed4ce0717a"></temba-webchat>
130+
<temba-webchat channel="68ba3ed0-8f37-4ff4-883f-5547900586bb"></temba-webchat>
131131
<temba-store completion="/static/api/completion.json" functions="/static/api/functions.json"
132132
fields="/static/api/fields.json" globals="/static/api/globals.json" groups="/static/api/groups.json"></temba-store>
133133

Diff for: screenshots/truth/compose/attachments-tab.png

730 Bytes
Loading
221 Bytes
Loading

Diff for: screenshots/truth/compose/attachments-with-files.png

727 Bytes
Loading

Diff for: screenshots/truth/compose/intial-text.png

747 Bytes
Loading

Diff for: screenshots/truth/compose/no-counter.png

726 Bytes
Loading

Diff for: screenshots/truth/compose/wraps-text-and-spaces.png

750 Bytes
Loading

Diff for: screenshots/truth/compose/wraps-text-and-url.png

822 Bytes
Loading

Diff for: screenshots/truth/compose/wraps-text-no-spaces.png

749 Bytes
Loading

Diff for: screenshots/truth/contacts/chat-failure.png

6.2 KB
Loading
9.14 KB
Loading
-1.43 KB
Loading
-1.44 KB
Loading
2.59 KB
Loading
9.14 KB
Loading
9.14 KB
Loading

Diff for: screenshots/truth/contacts/chat-sends-text-only.png

9.14 KB
Loading

Diff for: screenshots/truth/content-menu/item-no-buttons.png

-31 Bytes
Loading

Diff for: screenshots/truth/content-menu/items-and-buttons.png

-59 Bytes
Loading

Diff for: screenshots/truth/omnibox/selected.png

5.84 KB
Loading

Diff for: screenshots/truth/select/enabled-multi-selection.png

4.7 KB
Loading
6.51 KB
Loading

Diff for: screenshots/truth/select/endpoint-initial-value.png

5.01 KB
Loading

Diff for: screenshots/truth/select/expressions.png

-3.67 KB
Loading

Diff for: screenshots/truth/select/functions.png

117 Bytes
Loading

Diff for: screenshots/truth/select/initial-value.png

3.98 KB
Loading

Diff for: screenshots/truth/select/multi-with-endpoint.png

3.92 KB
Loading

Diff for: screenshots/truth/select/multiple-initial-values.png

4.56 KB
Loading

Diff for: screenshots/truth/select/selected-multi-test.png

3.71 KB
Loading

Diff for: screenshots/truth/select/static-initial-value.png

3.19 KB
Loading
3.19 KB
Loading

Diff for: screenshots/truth/select/value-initial.png

5.01 KB
Loading

Diff for: src/aliaseditor/AliasEditor.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ export class AliasEditor extends LitElement {
194194
private handleSearchSelection(evt: CustomEvent) {
195195
const selection = evt.detail.selected as FeatureProperties;
196196
this.showAliasDialog(selection);
197-
const select = this.shadowRoot.querySelector('temba-select') as Select;
197+
const select = this.shadowRoot.querySelector('temba-select') as Select<any>;
198198
select.clear();
199199
}
200200

Diff for: src/button/Button.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ export class Button extends LitElement {
77
static get styles() {
88
return css`
99
:host {
10-
display: inline-block;
10+
display: flex;
11+
align-self: stretch;
1112
font-family: var(--font-family);
1213
font-weight: 400;
1314
}
@@ -29,13 +30,15 @@ export class Button extends LitElement {
2930
.button-container {
3031
color: #fff;
3132
cursor: pointer;
32-
display: block;
33+
display: flex;
34+
flex-grow: 1;
3335
border-radius: var(--curvature);
3436
outline: none;
3537
transition: background ease-in var(--transition-speed);
3638
user-select: none;
3739
-webkit-user-select: none;
3840
text-align: center;
41+
border: var(--button-border, none);
3942
}
4043
4144
.button-name {
@@ -70,6 +73,7 @@ export class Button extends LitElement {
7073
transition: var(--transition-speed);
7174
background: var(--button-mask);
7275
display: flex;
76+
align-items: center;
7377
}
7478
7579
.button-container.disabled-button {

Diff for: src/chat/Chat.ts

+28-6
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,22 @@ export class Chat extends RapidElement {
6060
z-index: 1;
6161
}
6262
63+
slot[name='header'] {
64+
position: absolute;
65+
top: 0;
66+
left: 0;
67+
right: 0;
68+
display: block;
69+
}
70+
71+
slot[name='footer'] {
72+
position: absolute;
73+
bottom: 0;
74+
left: 0;
75+
right: 0;
76+
display: block;
77+
}
78+
6379
.block {
6480
margin-bottom: 1em;
6581
display: flex;
@@ -160,6 +176,7 @@ export class Chat extends RapidElement {
160176
padding-bottom: 0.25em;
161177
background: var(--color-chat-in, #f1f1f1);
162178
border-radius: var(--curvature);
179+
border: var(--chat-border-in, none);
163180
}
164181
165182
.bubble .name {
@@ -179,6 +196,7 @@ export class Chat extends RapidElement {
179196
180197
.incoming .bubble {
181198
background: var(--color-chat-out, #3c92dd);
199+
border: var(--chat-border-out, none);
182200
color: white;
183201
}
184202
@@ -228,7 +246,6 @@ export class Chat extends RapidElement {
228246
}
229247
230248
.messages {
231-
background: #fff;
232249
position: relative;
233250
flex-grow: 1;
234251
overflow: hidden;
@@ -245,6 +262,7 @@ export class Chat extends RapidElement {
245262
-webkit-overflow-scrolling: touch;
246263
overflow-scrolling: touch;
247264
padding: 1em 1em 1em 1em;
265+
padding-bottom: 2.5em;
248266
display: flex;
249267
flex-direction: column-reverse;
250268
}
@@ -722,11 +740,13 @@ export class Chat extends RapidElement {
722740
</div>
723741
${showAvatar
724742
? html`<div class="avatar" style="align-self:flex-end">
725-
${email
726-
? html`<temba-user email=${email}></temba-user>`
727-
: name
728-
? html`<temba-user fullname=${name}></temba-user>`
729-
: html`<temba-user system></temba-user>`}
743+
<temba-user
744+
email=${email}
745+
name=${name}
746+
avatar=${currentMsg.user?.avatar}
747+
?system=${!email && !name}
748+
>
749+
</temba-user>
730750
</div>`
731751
: null}
732752
</div>
@@ -810,6 +830,8 @@ export class Chat extends RapidElement {
810830
class="${!this.fetching ? 'hidden' : ''}"
811831
></temba-loading>
812832
</div>
833+
<slot class="header" name="header"></slot>
834+
<slot class="footer" name="footer"></slot>
813835
</div>`;
814836
}
815837
}

Diff for: src/compose/Compose.ts

+11-6
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,14 @@ export class Compose extends FormElement {
113113
}
114114
115115
temba-tabs {
116-
--focused-tab-color: #f4f4f4;
117-
min-height: var(--compose-min-height, 13.5em);
116+
--temba-tabs-border-bottom: none;
117+
--temba-tabs-border-left: none;
118+
--temba-tabs-border-right: none;
119+
--temba-tabs-options-padding: 0.25em 0 0 0.25em;
120+
}
121+
122+
temba-completion {
123+
--textarea-min-height: 8em;
118124
}
119125
120126
.quick-replies {
@@ -483,7 +489,7 @@ export class Compose extends FormElement {
483489
num > 0 &&
484490
evt.ctrlKey &&
485491
evt.metaKey &&
486-
num <= tabs.tabs.length
492+
num <= tabs.options.length
487493
) {
488494
tabs.index = num - 1;
489495
}
@@ -526,7 +532,7 @@ export class Compose extends FormElement {
526532
}
527533

528534
private handleLanguageChange(evt: Event) {
529-
const select = evt.target as Select;
535+
const select = evt.target as Select<any>;
530536
this.currentLanguage = select.values[0].iso;
531537
}
532538

@@ -618,15 +624,14 @@ export class Compose extends FormElement {
618624
}
619625

620626
const tabs = this.shadowRoot.querySelector('temba-tabs') as TabPane;
621-
tabs.index = tabs.tabs.findIndex((tab) => tab.name === 'Reply');
627+
tabs.index = tabs.options.findIndex((tab) => tab.name === 'Reply');
622628
}
623629

624630
private getActions(): TemplateResult {
625631
const showOptins = this.optIns && this.isBaseLanguage();
626632
const showTemplates = this.templates && this.isBaseLanguage();
627633
return html`
628634
<temba-tabs
629-
embedded
630635
focusedname
631636
@temba-context-changed=${this.handleTabChanged}
632637
refresh="${(this.currentAttachments || []).length}|${this.index}|${this

0 commit comments

Comments
 (0)