Skip to content

Commit

Permalink
fix(inbound): fix upgrade to chat from inbound
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Amadori committed May 21, 2020
1 parent a0ed2aa commit c95020d
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 3 deletions.
1 change: 1 addition & 0 deletions interaction/app/default/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
<vvc-inbound id="vvc-inbound"
*ngIf="appState.inboundMode"
(close)="closeInbound()"
(upgrade)="upgradeInboundToChat()"
[context]="appState"></vvc-inbound>
</div>
</div>
Expand Down
3 changes: 3 additions & 0 deletions interaction/app/default/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,9 @@ export class AppComponent implements OnInit {
upgradeCbnToChat() {
this.interactionService.upgradeCbnToChat();
}
upgradeInboundToChat() {
this.interactionService.upgradeInboundToChat();
}
videoToggle(show) {
this.interactionService.toggleVideo(show);
}
Expand Down
4 changes: 4 additions & 0 deletions interaction/app/default/src/scss/theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1179,6 +1179,10 @@ $icon-survey-smile-off: './assets/static/icons/smile-off.png';
font-size: 20px;
line-height: 1.3;
padding: 40px 30px 0 30px;

.media-bottom {
@include media-bottom();
}
}
.number-to-call {
font-size: 18px;
Expand Down
2 changes: 1 addition & 1 deletion interaction/app/default/src/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -1690,7 +1690,7 @@
"state": "new"
},
"it": {
"value": "Visualizza il numero da chimare col prefisso internazionale",
"value": "Visualizza il numero da chiamare col prefisso internazionale",
"state": "new"
}
}
Expand Down
3 changes: 3 additions & 0 deletions interaction/lib/core/src/lib/services/contact-wrap.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1394,4 +1394,7 @@ export class VvcContactWrap {
upgradeCbnToChat() {
this.uiService.upgradeCbnToChat();
}
upgradeInboundToChat() {
this.uiService.upgradeInboundToChat();
}
}
3 changes: 3 additions & 0 deletions interaction/lib/core/src/lib/services/interaction.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,4 +319,7 @@ export class VvcInteractionService {
upgradeCbnToChat() {
this.contactService.upgradeCbnToChat();
}
upgradeInboundToChat() {
this.contactService.upgradeInboundToChat();
}
}
5 changes: 4 additions & 1 deletion interaction/lib/core/src/lib/services/ui.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import {
WidgetSetInboundState,
WidgetUpgradeCbnToChat,
WidgetUpdateRemoteCaps,
WidgetUpdateLocalCaps
WidgetUpdateLocalCaps, WidgetUpgradeInboundToChat
} from '../store/actions/widget.actions';
import {DataCollectionSelected} from '../store/actions/dataCollection.actions';
import {NewEvent} from '../store/actions/events.actions';
Expand Down Expand Up @@ -255,4 +255,7 @@ export class VvcUiService {
upgradeCbnToChat() {
this.store.dispatch(new WidgetUpgradeCbnToChat());
}
upgradeInboundToChat() {
this.store.dispatch(new WidgetUpgradeInboundToChat());
}
}
5 changes: 5 additions & 0 deletions interaction/lib/core/src/lib/store/actions/widget.actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export const WIDGET_UPDATE_REMOTE_CAPS = '[Widget] Update Remote Capabilities
export const WIDGET_UPDATE_LOCAL_CAPS = '[Widget] Update Local Capabilities';
export const WIDGET_UPLOAD_COMPLETED = '[Widget] Upload Completed';
export const WIDGET_UPGRADE_CBN_TO_CHAT = '[Widget] Upgrade Cbn to Chat';
export const WIDGET_UPGRADE_INBOUND_TO_CHAT = '[Widget] Upgrade Inbound to Chat';
export const WIDGET_WEBLEAD_SENT = '[Widget] Weblead Sent';


Expand Down Expand Up @@ -203,6 +204,9 @@ export class WidgetUpdateLocalCaps implements Action {
export class WidgetUpgradeCbnToChat implements Action {
readonly type = WIDGET_UPGRADE_CBN_TO_CHAT;
}
export class WidgetUpgradeInboundToChat implements Action {
readonly type = WIDGET_UPGRADE_INBOUND_TO_CHAT;
}
export class WidgetWebleadSent implements Action {
readonly type = WIDGET_WEBLEAD_SENT;
}
Expand Down Expand Up @@ -251,5 +255,6 @@ export type WidgetActions
| WidgetUploadCompleted
| WidgetUiReady
| WidgetUpgradeCbnToChat
| WidgetUpgradeInboundToChat
| WidgetWebleadSent
;
4 changes: 4 additions & 0 deletions interaction/lib/core/src/lib/store/reducers/widget.reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@ export function reducer(state: WidgetState = initialState, action: fromWidget.Wi
const context = Object.assign({}, state.context, {cbnMode: false});
return Object.assign({}, state, { context: context });
}
case fromWidget.WIDGET_UPGRADE_INBOUND_TO_CHAT: {
const context = Object.assign({}, state.context, {inboundMode: false});
return Object.assign({}, state, { context: context });
}
case fromWidget.WIDGET_WEBLEAD_SENT: {
const context = Object.assign({}, state.context, {hasError: true, showQueuePanel: true, webleadSent: true});
return Object.assign({}, state, {context: context});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
<vvc-inbound-topbar [context]="context"
(close)="close.emit()"></vvc-inbound-topbar>

<vvc-inbound-fullscreen-messages [context]="context"></vvc-inbound-fullscreen-messages>
<vvc-inbound-fullscreen-messages [context]="context"
(upgrade)="upgrade.emit()"></vvc-inbound-fullscreen-messages>

<div class="sep"></div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ export class InboundComponent {

@Input() context;
@Output() close = new EventEmitter();
@Output() upgrade = new EventEmitter();

}

0 comments on commit c95020d

Please sign in to comment.