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

demo/index.html

Lines changed: 1 addition & 1 deletion
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

730 Bytes
Loading
Loading
Loading
747 Bytes
Loading
726 Bytes
Loading
750 Bytes
Loading
822 Bytes
Loading
749 Bytes
Loading
6.2 KB
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
-31 Bytes
Loading
Loading
5.84 KB
Loading
Loading
Loading
Loading
-3.67 KB
Loading
117 Bytes
Loading
3.98 KB
Loading
3.92 KB
Loading
Loading
3.71 KB
Loading
Loading
Loading
5.01 KB
Loading

src/aliaseditor/AliasEditor.ts

Lines changed: 1 addition & 1 deletion
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

src/button/Button.ts

Lines changed: 6 additions & 2 deletions
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 {

src/chat/Chat.ts

Lines changed: 28 additions & 6 deletions
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
}

src/compose/Compose.ts

Lines changed: 11 additions & 6 deletions
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)