@chat21/chat21-ionic 3.0.85 → 3.0.86-rc.2
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 +121 -4
- package/README.md +2 -2
- package/package.json +4 -3
- package/src/app/app-routing.module.ts +7 -2
- package/src/app/app.component.html +7 -1
- package/src/app/app.component.scss +20 -2
- package/src/app/app.component.ts +131 -20
- package/src/app/app.module.ts +8 -3
- package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.ts +11 -4
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +86 -23
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +188 -88
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +42 -3
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +11 -24
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.scss +6 -10
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.spec.ts +2 -2
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +16 -26
- package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.html +5 -1
- package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.scss +22 -15
- package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.ts +25 -5
- package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.html +2 -1
- package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.scss +14 -15
- package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.ts +24 -5
- package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.html +6 -1
- package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.scss +12 -13
- package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.ts +26 -5
- package/src/app/chatlib/conversation-detail/message/frame/frame.component.html +8 -2
- package/src/app/chatlib/conversation-detail/message/frame/frame.component.scss +36 -0
- package/src/app/chatlib/conversation-detail/message/frame/frame.component.ts +2 -2
- package/src/app/chatlib/conversation-detail/message/html/html.component.ts +0 -1
- package/src/app/chatlib/conversation-detail/message/image/image.component.html +3 -2
- package/src/app/chatlib/conversation-detail/message/image/image.component.scss +17 -5
- package/src/app/chatlib/conversation-detail/message/image/image.component.ts +1 -1
- package/src/app/chatlib/conversation-detail/message/info-message/info-message.component.scss +3 -2
- package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.html +16 -6
- package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.scss +1 -3
- package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.ts +2 -0
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +78 -52
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.scss +63 -20
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +14 -10
- package/src/app/components/canned-response/canned-response.component.html +9 -9
- package/src/app/components/canned-response/canned-response.component.scss +14 -7
- package/src/app/components/canned-response/canned-response.component.ts +5 -4
- package/src/app/components/contacts-directory/contacts-directory.component.html +22 -26
- package/src/app/components/contacts-directory/contacts-directory.component.scss +8 -6
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +64 -47
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +98 -61
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +24 -44
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component_2.html +116 -0
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +39 -42
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +67 -4
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +82 -154
- package/src/app/components/conversation-info/info-content/info-content.component.html +23 -2
- package/src/app/components/conversation-info/info-content/info-content.component.ts +5 -6
- package/src/app/components/conversation-info/info-direct/info-direct.component.html +7 -14
- package/src/app/components/conversation-info/info-direct/info-direct.component.scss +23 -0
- package/src/app/components/conversation-info/info-direct/info-direct.component.ts +1 -6
- package/src/app/components/conversation-info/info-group/info-group.component.html +44 -108
- package/src/app/components/conversation-info/info-group/info-group.component.scss +101 -61
- package/src/app/components/conversation-info/info-group/info-group.component.ts +1 -0
- package/src/app/components/conversation-info/info-support-group/info-support-group.component.html +2 -1
- package/src/app/components/conversation-info/info-support-group/info-support-group.component.ts +0 -1
- package/src/app/components/{ddp-header/ddp-header.component.html → conversations-list/header-conversations-list/header-conversations-list.component.html} +3 -3
- package/src/app/components/{ddp-header/ddp-header.component.scss → conversations-list/header-conversations-list/header-conversations-list.component.scss} +16 -4
- package/src/app/components/{conversation-detail/bubble-my-message/bubble-my-message.component.spec.ts → conversations-list/header-conversations-list/header-conversations-list.component.spec.ts} +6 -6
- package/src/app/components/{ddp-header/ddp-header.component.ts → conversations-list/header-conversations-list/header-conversations-list.component.ts} +7 -16
- package/src/app/components/conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.html +12 -0
- package/src/app/components/conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.scss +14 -0
- package/src/app/components/{conversation-detail/option-header/option-header.component.spec.ts → conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.spec.ts} +5 -5
- package/src/app/components/{conversation-detail/option-header/option-header.component.ts → conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.ts} +5 -4
- package/src/app/components/navbar/navbar.component.html +103 -0
- package/src/app/components/navbar/navbar.component.scss +249 -0
- package/src/app/components/{ddp-header/ddp-header.component.spec.ts → navbar/navbar.component.spec.ts} +6 -6
- package/src/app/components/navbar/navbar.component.ts +195 -0
- package/src/app/components/project-item/project-item.component.html +98 -149
- package/src/app/components/project-item/project-item.component.scss +43 -35
- package/src/app/components/project-item/project-item.component.ts +16 -4
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +5 -5
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +24 -13
- package/src/app/components/utils/user-presence/user-presence.component.html +7 -2
- package/src/app/components/utils/user-presence/user-presence.component.scss +35 -18
- package/src/app/components/utils/user-presence/user-presence.component.ts +6 -10
- package/src/app/{pages → modals}/create-canned-response/create-canned-response-routing.module.ts +0 -0
- package/src/app/{pages → modals}/create-canned-response/create-canned-response.module.ts +0 -0
- package/src/app/{pages → modals}/create-canned-response/create-canned-response.page.html +0 -0
- package/src/app/{pages → modals}/create-canned-response/create-canned-response.page.scss +0 -0
- package/src/app/{pages → modals}/create-canned-response/create-canned-response.page.spec.ts +0 -0
- package/src/app/{pages → modals}/create-canned-response/create-canned-response.page.ts +13 -13
- package/src/app/{pages → modals}/loader-preview/loader-preview-routing.module.ts +0 -0
- package/src/app/{pages → modals}/loader-preview/loader-preview.module.ts +0 -0
- package/src/app/{pages → modals}/loader-preview/loader-preview.page.html +1 -1
- package/src/app/{pages → modals}/loader-preview/loader-preview.page.scss +4 -0
- package/src/app/{pages → modals}/loader-preview/loader-preview.page.spec.ts +0 -0
- package/src/app/{pages → modals}/loader-preview/loader-preview.page.ts +1 -2
- package/src/app/modals/send-email/send-email-routing.module.ts +17 -0
- package/src/app/modals/send-email/send-email.module.ts +31 -0
- package/src/app/modals/send-email/send-email.page.html +46 -0
- package/src/app/modals/send-email/send-email.page.scss +161 -0
- package/src/app/modals/send-email/send-email.page.spec.ts +24 -0
- package/src/app/modals/send-email/send-email.page.ts +89 -0
- package/src/app/pages/contacts-directory/contacts-directory.page.html +1 -1
- package/src/app/pages/contacts-directory/contacts-directory.page.scss +47 -0
- package/src/app/pages/contacts-directory/contacts-directory.page.ts +2 -0
- package/src/app/pages/conversation-detail/conversation-detail.module.ts +0 -8
- package/src/app/pages/conversation-detail/conversation-detail.page.html +48 -27
- package/src/app/pages/conversation-detail/conversation-detail.page.scss +45 -254
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +330 -138
- package/src/app/pages/conversations-list/conversations-list.page.html +11 -8
- package/src/app/pages/conversations-list/conversations-list.page.scss +18 -2
- package/src/app/pages/conversations-list/conversations-list.page.ts +26 -24
- package/src/app/pages/profile-info/profile-info.page.html +2 -4
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.html +1 -1
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.scss +42 -0
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.ts +1 -0
- package/src/app/services/canned-responses/canned-responses.service.ts +26 -0
- package/src/app/services/projects/projects.service.spec.ts +12 -0
- package/src/app/services/projects/projects.service.ts +43 -0
- package/src/app/services/tiledesk/tiledesk.service.ts +33 -17
- package/src/app/shared/shared.module.ts +24 -33
- package/src/app/utils/toast.spec.ts +7 -0
- package/src/app/utils/toast.ts +48 -0
- package/src/assets/i18n/ar.json +288 -265
- package/src/assets/i18n/az.json +24 -1
- package/src/assets/i18n/de.json +25 -2
- package/src/assets/i18n/en.json +25 -2
- package/src/assets/i18n/es.json +26 -3
- package/src/assets/i18n/fr.json +24 -1
- package/src/assets/i18n/it.json +24 -1
- package/src/assets/i18n/kk.json +25 -2
- package/src/assets/i18n/pt.json +25 -2
- package/src/assets/i18n/ru.json +24 -1
- package/src/assets/i18n/sr.json +287 -264
- package/src/assets/i18n/sv.json +25 -2
- package/src/assets/i18n/tr.json +25 -2
- package/src/assets/i18n/uk.json +25 -2
- package/src/assets/i18n/uz.json +24 -1
- package/src/assets/js/chat21client.js +1 -1
- package/src/assets/sounds/interface-start.mp3 +0 -0
- package/src/assets/sounds/wheep-wheep.mp3 +0 -0
- package/src/chat-config-mqtt-localhost.json +2 -2
- package/src/chat-config-native-mqtt.json +3 -0
- package/src/chat21-core/models/conversation.ts +0 -1
- package/src/chat21-core/models/projects.ts +27 -0
- package/src/chat21-core/providers/firebase/firebase-typing.service.ts +7 -9
- package/src/chat21-core/providers/logger/customLogger.ts +1 -1
- package/src/chat21-core/providers/mqtt/mqtt-auth-service.ts +7 -8
- package/src/chat21-core/utils/constants.ts +7 -1
- package/src/chat21-core/utils/convertRequestToConversation.ts +41 -0
- package/src/chat21-core/utils/user-typing/user-typing.component.html +8 -5
- package/src/chat21-core/utils/user-typing/user-typing.component.scss +87 -17
- package/src/chat21-core/utils/user-typing/user-typing.component.ts +12 -94
- package/src/chat21-core/utils/utils.ts +41 -11
- package/src/global.scss +59 -255
- package/src/index.html +0 -9
- package/src/variables.scss +30 -10
- package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.html +0 -3
- package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.scss +0 -21
- package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.spec.ts +0 -24
- package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.ts +0 -14
- package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.html +0 -54
- package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.scss +0 -98
- package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.ts +0 -84
- package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.html +0 -30
- package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.scss +0 -83
- package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.spec.ts +0 -24
- package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.ts +0 -68
- package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.html +0 -3
- package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.scss +0 -10
- package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.spec.ts +0 -24
- package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.ts +0 -14
- package/src/app/components/conversation-detail/option-header/option-header.component.html +0 -13
- package/src/app/components/conversation-detail/option-header/option-header.component.scss +0 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
<ion-navbar class="navbar navbar-absolute">
|
|
2
|
+
<div class="container-fluid">
|
|
3
|
+
<!-- <div class="navbar-left">
|
|
4
|
+
left
|
|
5
|
+
</div> -->
|
|
6
|
+
<div class="navbar-right">
|
|
7
|
+
<!-- test site -->
|
|
8
|
+
<ng-container *ngIf="project">
|
|
9
|
+
<button class="btn simulate-visitor-btn btn-success-no-boxshadow " (click)="testWidgetPage()">
|
|
10
|
+
<i class="material-icons" style="padding-top: 0px;font-size: 24px;">play_arrow</i>
|
|
11
|
+
{{translationsMap.get('NAVBAR.SIMULATE_VISITOR')}}
|
|
12
|
+
</button>
|
|
13
|
+
</ng-container>
|
|
14
|
+
|
|
15
|
+
<!-- ------ PROJECTS DROPDOWN ------ -->
|
|
16
|
+
<ng-container *ngIf="project">
|
|
17
|
+
<li>
|
|
18
|
+
<button class="btn dropdown-toggle project-dropdown" (click)="openDropdownProjects = !openDropdownProjects">
|
|
19
|
+
<i class="material-icons" style="margin-right: 3px;">keyboard_arrow_down</i>
|
|
20
|
+
<span style="text-transform: none"> {{ project?.id_project?.name }} </span>
|
|
21
|
+
</button>
|
|
22
|
+
<div class="ripple-container"></div>
|
|
23
|
+
<div id="navbar_dropdown" class="dropdown-menu" [ngClass]="{'open': openDropdownProjects}">
|
|
24
|
+
|
|
25
|
+
<!-- PROJECT SETTINGS -->
|
|
26
|
+
<!-- <li *ngIf="USER_ROLE !== 'agent'">
|
|
27
|
+
<a (click)="onClickDropdownOption('projectSettings')">
|
|
28
|
+
<i class="material-icons" style="padding-right: 5px; margin-bottom: 2px; font-size: 20px">settings</i>
|
|
29
|
+
{{translationsMap?.get('NAVBAR.PROJECT_SETTINGS')}}
|
|
30
|
+
</a>
|
|
31
|
+
</li> -->
|
|
32
|
+
|
|
33
|
+
<!-- ALL PROJECTS -->
|
|
34
|
+
<li (click)="onClickDropdownOption('allProjects')">
|
|
35
|
+
<a style="cursor: pointer">
|
|
36
|
+
<i class="material-icons" style="padding-right: 5px; margin-bottom: 2px; font-size: 20px">view_list</i>
|
|
37
|
+
{{translationsMap?.get('NAVBAR.VIEW_ALL_PROJECTS')}}
|
|
38
|
+
</a>
|
|
39
|
+
</li>
|
|
40
|
+
|
|
41
|
+
<!-- ADD PROJECT -->
|
|
42
|
+
<li id="navbar_create_prjct" *ngIf="MT === true" (click)="onClickDropdownOption('addProject')">
|
|
43
|
+
<a style="cursor: pointer">
|
|
44
|
+
<i class="material-icons" style="padding-right: 5px; margin-bottom: 2px; font-size: 20px">add_circle_outline </i>
|
|
45
|
+
{{translationsMap?.get('NAVBAR.ADD_PROJECT')}}
|
|
46
|
+
</a>
|
|
47
|
+
</li>
|
|
48
|
+
|
|
49
|
+
<li class="divider"></li>
|
|
50
|
+
|
|
51
|
+
<!-- RECENT PROJECTS -->
|
|
52
|
+
<li>
|
|
53
|
+
<span style="padding-left: 24px;font-size: 12px; color: rgb(118,149,165);font-weight: 400">
|
|
54
|
+
{{translationsMap?.get('NAVBAR.RECENT_PROJECTS')}}
|
|
55
|
+
</span>
|
|
56
|
+
</li>
|
|
57
|
+
<!--
|
|
58
|
+
***** ngFor - reverse order of output using the index *****
|
|
59
|
+
Reverse() works in place. It means, it will change the original array.
|
|
60
|
+
Slice without parameters returns a copy of projects, so original array, in this case, stays unchanged.
|
|
61
|
+
let prjct of projects?.reverse()
|
|
62
|
+
-->
|
|
63
|
+
<!-- *ngFor="let prjct of projects?.slice().reverse() | slice:0:5; let i=index" -->
|
|
64
|
+
<li *ngFor="let prjct of projects?.slice() | slice:0:5; let i=index" style="cursor: pointer">
|
|
65
|
+
<a (click)="goToHome(prjct?.id_project?._id, prjct?.id_project?.name)"
|
|
66
|
+
[ngClass]="{'li-selected' : prjct?.id_project?._id === project?.id_project?.id }">
|
|
67
|
+
|
|
68
|
+
<span> {{ prjct?.id_project?.name }} </span>
|
|
69
|
+
</a>
|
|
70
|
+
</li>
|
|
71
|
+
|
|
72
|
+
<ng-container *ngIf="projects?.length > 5">
|
|
73
|
+
<li class="divider"></li>
|
|
74
|
+
<li>
|
|
75
|
+
<span style="padding-left: 24px;font-size: 12px; color: rgb(118,149,165);font-weight: 400">
|
|
76
|
+
{{translationsMap?.get('NAVBAR.OTHER_PROJECTS')}}
|
|
77
|
+
</span>
|
|
78
|
+
</li>
|
|
79
|
+
|
|
80
|
+
<!-- *ngFor="let prjct of projects?.slice().reverse() | slice:5:10; let i=index" -->
|
|
81
|
+
<li *ngFor="let prjct of projects?.slice() | slice:5:10; let i=index" style="cursor: pointer">
|
|
82
|
+
<a (click)="goToHome(prjct?.id_project?._id, prjct?.id_project?.name)">
|
|
83
|
+
{{ prjct?.id_project?.name }}
|
|
84
|
+
</a>
|
|
85
|
+
</li>
|
|
86
|
+
</ng-container>
|
|
87
|
+
|
|
88
|
+
</div>
|
|
89
|
+
</li>
|
|
90
|
+
</ng-container>
|
|
91
|
+
|
|
92
|
+
<!-- Sound on / off -->
|
|
93
|
+
<ng-container *ngIf="project">
|
|
94
|
+
<button class="btn volume" style="cursor: pointer;" *ngIf="isSoundEnabled" (click)="onClickSound('disabled')">
|
|
95
|
+
<i class="material-icons">volume_up</i>
|
|
96
|
+
</button>
|
|
97
|
+
<button class="btn volume" style="cursor: pointer;" *ngIf="!isSoundEnabled" (click)="onClickSound('enabled')">
|
|
98
|
+
<i class="material-icons">volume_off</i>
|
|
99
|
+
</button>
|
|
100
|
+
</ng-container>
|
|
101
|
+
</div>
|
|
102
|
+
</div>
|
|
103
|
+
</ion-navbar>
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
.navbar-absolute{
|
|
2
|
+
position: absolute;
|
|
3
|
+
width: calc(100% - var(--sidebar-width));
|
|
4
|
+
margin-left: var(--sidebar-width);
|
|
5
|
+
padding-top: 5px;
|
|
6
|
+
z-index: 1;
|
|
7
|
+
padding-bottom: 5px;
|
|
8
|
+
border-bottom: 1px solid #e7e7e7;
|
|
9
|
+
top: 0;
|
|
10
|
+
|
|
11
|
+
-webkit-font-smoothing: auto;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.navbar{
|
|
15
|
+
background-color: #fff;
|
|
16
|
+
color: #555;
|
|
17
|
+
min-height: var(--nav-bar-heigth);
|
|
18
|
+
transition: all 150ms ease 0s;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.container-fluid{
|
|
22
|
+
padding-right: 15px;
|
|
23
|
+
padding-left: 15px;
|
|
24
|
+
margin-right: auto;
|
|
25
|
+
margin-left: auto;
|
|
26
|
+
|
|
27
|
+
width: 100%;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
ion-navbar{
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.navbar-collapse{
|
|
36
|
+
border-top: none;
|
|
37
|
+
box-shadow: none;
|
|
38
|
+
|
|
39
|
+
padding-right: 15px;
|
|
40
|
+
padding-left: 15px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.navbar-right{
|
|
44
|
+
float: right;
|
|
45
|
+
|
|
46
|
+
display: inline-flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.navbar-left{
|
|
51
|
+
float: left;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.simulate-visitor-btn{
|
|
55
|
+
font-size: 12px;
|
|
56
|
+
padding: 0px 11px 0px 4px !important;
|
|
57
|
+
max-height: 24px;
|
|
58
|
+
border-radius: 30px;
|
|
59
|
+
font-family: 'Poppins';
|
|
60
|
+
|
|
61
|
+
box-shadow: unset!important;
|
|
62
|
+
text-transform: none!important;
|
|
63
|
+
background: #3ecf8e!important;
|
|
64
|
+
color: #fff;
|
|
65
|
+
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.btn{
|
|
69
|
+
display: flex;
|
|
70
|
+
position: relative;
|
|
71
|
+
flex-flow: row nowrap;
|
|
72
|
+
align-items: center;
|
|
73
|
+
justify-content: center;
|
|
74
|
+
|
|
75
|
+
border: 1px solid transparent;
|
|
76
|
+
transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
.dropdown-toggle, .volume{
|
|
81
|
+
background-color: transparent;
|
|
82
|
+
color: inherit;
|
|
83
|
+
|
|
84
|
+
padding: 0px 15px;
|
|
85
|
+
font-weight: 400;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.project-dropdown {
|
|
89
|
+
max-width: 180px;
|
|
90
|
+
white-space: nowrap;
|
|
91
|
+
overflow: hidden;
|
|
92
|
+
text-overflow: ellipsis;
|
|
93
|
+
font-size: 12px;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
li{
|
|
97
|
+
position: relative;
|
|
98
|
+
display: block
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.dropdown-menu {
|
|
102
|
+
border-radius: 3px;
|
|
103
|
+
box-shadow: 0 2px 5px 0 rgb(0, 0, 0, 0.26);
|
|
104
|
+
|
|
105
|
+
position: absolute;
|
|
106
|
+
top: 100%;
|
|
107
|
+
right: 0;
|
|
108
|
+
left: auto;
|
|
109
|
+
z-index: 1000;
|
|
110
|
+
display: none;
|
|
111
|
+
float: left;
|
|
112
|
+
min-width: 160px;
|
|
113
|
+
padding: 5px 0;
|
|
114
|
+
margin: 2px 0 0;
|
|
115
|
+
font-size: 14px;
|
|
116
|
+
text-align: left;
|
|
117
|
+
list-style: none;
|
|
118
|
+
background-color: #fff;
|
|
119
|
+
-webkit-background-clip: padding-box;
|
|
120
|
+
background-clip: padding-box;
|
|
121
|
+
}
|
|
122
|
+
.dropdown-menu{
|
|
123
|
+
max-height: 240px;
|
|
124
|
+
overflow-y: auto;
|
|
125
|
+
}
|
|
126
|
+
.dropdown-menu:not(.open){
|
|
127
|
+
margin-top: -20px;
|
|
128
|
+
opacity: 0;
|
|
129
|
+
visibility: hidden;
|
|
130
|
+
display: block;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.dropdown-menu.open{
|
|
134
|
+
margin-top: 12px; //0;
|
|
135
|
+
opacity: 1;
|
|
136
|
+
visibility: visible;
|
|
137
|
+
display: block;
|
|
138
|
+
transition: all 150ms linear;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.dropdown-menu li {
|
|
142
|
+
position: relative;
|
|
143
|
+
|
|
144
|
+
.li-selected{
|
|
145
|
+
color: #4285f4;
|
|
146
|
+
background-color: #eee;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.dropdown-menu .divider{
|
|
151
|
+
background-color: rgba(0,0,0,.12);
|
|
152
|
+
margin: 5px 0;
|
|
153
|
+
|
|
154
|
+
height: 1px;
|
|
155
|
+
overflow: hidden;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.dropdown-menu li>a{
|
|
159
|
+
font-size: 13px;
|
|
160
|
+
padding: 10px 20px;
|
|
161
|
+
margin: 0 5px;
|
|
162
|
+
border-radius: 2px;
|
|
163
|
+
transition: all 150ms linear;
|
|
164
|
+
|
|
165
|
+
display: block;
|
|
166
|
+
clear: both;
|
|
167
|
+
font-weight: 400;
|
|
168
|
+
line-height: 1.42857143;
|
|
169
|
+
color: #333;
|
|
170
|
+
white-space: nowrap;
|
|
171
|
+
text-decoration: none;
|
|
172
|
+
|
|
173
|
+
cursor: pointer;
|
|
174
|
+
|
|
175
|
+
.material-icons {
|
|
176
|
+
vertical-align: middle;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
&:hover{
|
|
180
|
+
background-color: #3ea9f5;
|
|
181
|
+
color: #fff;
|
|
182
|
+
box-shadow: 0 12px 20px -10px rgba(62, 169, 245, 0.28), 0 4px 20px 0 rgba(0, 0, 0, 0.12), 0 7px 8px -5px rgba(62, 169, 245, 0.2);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
.material-icons {
|
|
188
|
+
font-family: "Material Icons";
|
|
189
|
+
font-weight: 400;
|
|
190
|
+
font-style: normal;
|
|
191
|
+
font-size: 24px;
|
|
192
|
+
line-height: 1;
|
|
193
|
+
letter-spacing: normal;
|
|
194
|
+
text-transform: none;
|
|
195
|
+
display: inline-block;
|
|
196
|
+
white-space: nowrap;
|
|
197
|
+
word-wrap: normal;
|
|
198
|
+
direction: ltr;
|
|
199
|
+
-webkit-font-smoothing: antialiased;
|
|
200
|
+
-moz-osx-font-smoothing: grayscale;
|
|
201
|
+
text-rendering: optimizeLegibility;
|
|
202
|
+
font-feature-settings: "liga";
|
|
203
|
+
|
|
204
|
+
top: 0;
|
|
205
|
+
position: relative;
|
|
206
|
+
font-size: 20px;
|
|
207
|
+
vertical-align: middle;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.ripple-container {
|
|
211
|
+
position: absolute;
|
|
212
|
+
top: 0;
|
|
213
|
+
left: 0;
|
|
214
|
+
z-index: 1;
|
|
215
|
+
width: 100%;
|
|
216
|
+
height: 100%;
|
|
217
|
+
overflow: hidden;
|
|
218
|
+
border-radius: inherit;
|
|
219
|
+
pointer-events: none;
|
|
220
|
+
|
|
221
|
+
.disabled &{
|
|
222
|
+
display: none;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
.ripple {
|
|
226
|
+
position: absolute;
|
|
227
|
+
width: 20px;
|
|
228
|
+
height: 20px;
|
|
229
|
+
margin-left: -10px;
|
|
230
|
+
margin-top: -10px;
|
|
231
|
+
border-radius: 100%;
|
|
232
|
+
background-color: #000; // fallback color
|
|
233
|
+
background-color: rgba(0,0,0,0.05);
|
|
234
|
+
transform: scale(1);
|
|
235
|
+
transform-origin: 50%;
|
|
236
|
+
opacity: 0;
|
|
237
|
+
pointer-events: none;
|
|
238
|
+
}
|
|
239
|
+
.ripple.ripple-on {
|
|
240
|
+
transition: opacity 0.15s ease-in 0s, transform 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
|
|
241
|
+
opacity: 0.1;
|
|
242
|
+
}
|
|
243
|
+
.ripple.ripple-out {
|
|
244
|
+
transition: opacity 0.1s linear 0s !important;
|
|
245
|
+
opacity: 0;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
2
|
import { IonicModule } from '@ionic/angular';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { NavbarComponent } from './navbar.component';
|
|
5
5
|
|
|
6
|
-
describe('
|
|
7
|
-
let component:
|
|
8
|
-
let fixture: ComponentFixture<
|
|
6
|
+
describe('NavbarComponent', () => {
|
|
7
|
+
let component: NavbarComponent;
|
|
8
|
+
let fixture: ComponentFixture<NavbarComponent>;
|
|
9
9
|
|
|
10
10
|
beforeEach(async(() => {
|
|
11
11
|
TestBed.configureTestingModule({
|
|
12
|
-
declarations: [
|
|
12
|
+
declarations: [ NavbarComponent ],
|
|
13
13
|
imports: [IonicModule.forRoot()]
|
|
14
14
|
}).compileComponents();
|
|
15
15
|
|
|
16
|
-
fixture = TestBed.createComponent(
|
|
16
|
+
fixture = TestBed.createComponent(NavbarComponent);
|
|
17
17
|
component = fixture.componentInstance;
|
|
18
18
|
fixture.detectChanges();
|
|
19
19
|
}));
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { AppConfigProvider } from 'src/app/services/app-config';
|
|
2
|
+
import { TiledeskAuthService } from 'src/chat21-core/providers/tiledesk/tiledesk-auth.service';
|
|
3
|
+
import { EventsService } from 'src/app/services/events-service';
|
|
4
|
+
import { ProjectsService } from './../../services/projects/projects.service';
|
|
5
|
+
import { ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
|
6
|
+
import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
|
|
7
|
+
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
8
|
+
import { Project } from 'src/chat21-core/models/projects';
|
|
9
|
+
import { CustomTranslateService } from 'src/chat21-core/providers/custom-translate.service';
|
|
10
|
+
|
|
11
|
+
@Component({
|
|
12
|
+
selector: 'app-navbar',
|
|
13
|
+
templateUrl: './navbar.component.html',
|
|
14
|
+
styleUrls: ['./navbar.component.scss'],
|
|
15
|
+
})
|
|
16
|
+
export class NavbarComponent implements OnInit {
|
|
17
|
+
|
|
18
|
+
@Input() isSoundEnabled: boolean;
|
|
19
|
+
@Output() onSoundChange = new EventEmitter<string>();
|
|
20
|
+
|
|
21
|
+
private logger: LoggerService = LoggerInstance.getInstance();
|
|
22
|
+
private tiledeskToken: string;
|
|
23
|
+
|
|
24
|
+
public projects: Project[];
|
|
25
|
+
public project: any = [];
|
|
26
|
+
private USER_ROLE: string;
|
|
27
|
+
|
|
28
|
+
public translationsMap: Map<string, string> = new Map();
|
|
29
|
+
|
|
30
|
+
public openDropdownProjects: boolean = false
|
|
31
|
+
private public_Key: string;
|
|
32
|
+
public isVisible: boolean;
|
|
33
|
+
public MT: boolean;
|
|
34
|
+
|
|
35
|
+
constructor(
|
|
36
|
+
private projectsService: ProjectsService,
|
|
37
|
+
private tiledeskAuthService: TiledeskAuthService,
|
|
38
|
+
private appConfigProvider: AppConfigProvider,
|
|
39
|
+
private translateService: CustomTranslateService,
|
|
40
|
+
private events: EventsService,
|
|
41
|
+
private cdref: ChangeDetectorRef,
|
|
42
|
+
) { }
|
|
43
|
+
|
|
44
|
+
ngOnInit() {
|
|
45
|
+
this.listenToUserGoOnline();
|
|
46
|
+
this.getStoredProjectAndUserRole();
|
|
47
|
+
this.initTranslations();
|
|
48
|
+
this.getOSCODE();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
ngAfterContentChecked() {
|
|
52
|
+
this.cdref.detectChanges();
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
initTranslations(){
|
|
56
|
+
let keys= [
|
|
57
|
+
"NAVBAR.SIMULATE_VISITOR",
|
|
58
|
+
"NAVBAR.PROJECT_SETTINGS",
|
|
59
|
+
"NAVBAR.VIEW_ALL_PROJECTS",
|
|
60
|
+
"NAVBAR.ADD_PROJECT",
|
|
61
|
+
"NAVBAR.RECENT_PROJECTS",
|
|
62
|
+
"NAVBAR.OTHER_PROJECTS"
|
|
63
|
+
]
|
|
64
|
+
|
|
65
|
+
this.translationsMap = this.translateService.translateLanguage(keys)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
listenToUserGoOnline(){
|
|
69
|
+
this.events.subscribe('go:online', (isOnline)=> {
|
|
70
|
+
this.logger.log('[NAVBAR] listen to go:online --> ', isOnline);
|
|
71
|
+
if(isOnline){
|
|
72
|
+
this.tiledeskToken = this.tiledeskAuthService.getTiledeskToken();
|
|
73
|
+
this.getProjects()
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
getProjects() {
|
|
79
|
+
this.logger.log('[NAVBAR] calling getProjects ... ');
|
|
80
|
+
this.projectsService.getProjects(this.tiledeskToken).subscribe((projects: any) => {
|
|
81
|
+
this.logger.log('[NAVBAR] getProjects PROJECTS ', projects);
|
|
82
|
+
if (projects) {
|
|
83
|
+
// this.projects = projects;
|
|
84
|
+
this.projects = projects.filter((project: any) => {
|
|
85
|
+
// this.logger.log('[NAVBAR] getProjects PROJECTS status ', project.id_project.status);
|
|
86
|
+
return project.id_project.status === 100;
|
|
87
|
+
});
|
|
88
|
+
this.logger.log('[NAVBAR] getProjects this.projects ', this.projects);
|
|
89
|
+
}
|
|
90
|
+
}, (error) => {
|
|
91
|
+
this.logger.error('[NAVBAR] getProjects - ERROR ', error)
|
|
92
|
+
}, () => {
|
|
93
|
+
this.logger.log('[NAVBAR] getProjects - COMPLETE')
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
getStoredProjectAndUserRole() {
|
|
98
|
+
this.events.subscribe('storage:last_project',project =>{
|
|
99
|
+
this.logger.log('[NAVBAR] stored_project ', project)
|
|
100
|
+
if (project && project !== 'undefined') {
|
|
101
|
+
this.project = project;
|
|
102
|
+
this.USER_ROLE = project.role;
|
|
103
|
+
}
|
|
104
|
+
})
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
getOSCODE() {
|
|
108
|
+
this.public_Key = this.appConfigProvider.getConfig().t2y12PruGU9wUtEGzBJfolMIgK;
|
|
109
|
+
this.logger.log('[NAVBAR] AppConfigService getAppConfig public_Key', this.public_Key)
|
|
110
|
+
this.logger.log('[NAVBAR] public_Key', this.public_Key)
|
|
111
|
+
|
|
112
|
+
let keys = this.public_Key.split("-");
|
|
113
|
+
// this.logger.log('PUBLIC-KEY (Navbar) - public_Key keys', keys)
|
|
114
|
+
|
|
115
|
+
keys.forEach(key => {
|
|
116
|
+
// this.logger.log('NavbarComponent public_Key key', key)
|
|
117
|
+
if (key.includes("PAY")) {
|
|
118
|
+
// this.logger.log('PUBLIC-KEY (Navbar) - key', key);
|
|
119
|
+
let pay = key.split(":");
|
|
120
|
+
// this.logger.log('PUBLIC-KEY (Navbar) - pay key&value', pay);
|
|
121
|
+
if (pay[1] === "F") {
|
|
122
|
+
this.isVisible = false;
|
|
123
|
+
// this.logger.log('PUBLIC-KEY (Navbar) - pay isVisible', this.isVisible);
|
|
124
|
+
} else {
|
|
125
|
+
this.isVisible = true;
|
|
126
|
+
// this.logger.log('PUBLIC-KEY (Navbar) - pay isVisible', this.isVisible);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (key.includes("MTT")) {
|
|
131
|
+
// this.logger.log('PUBLIC-KEY (Navbar) - key', key);
|
|
132
|
+
let mt = key.split(":");
|
|
133
|
+
// this.logger.log('PUBLIC-KEY (Navbar) - mt key&value', mt);
|
|
134
|
+
if (mt[1] === "F") {
|
|
135
|
+
this.MT = false;
|
|
136
|
+
// this.logger.log('PUBLIC-KEY (Navbar) - mt is', this.MT);
|
|
137
|
+
} else {
|
|
138
|
+
this.MT = true;
|
|
139
|
+
// this.logger.log('PUBLIC-KEY (Navbar) - mt is', this.MT);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
if (!this.public_Key.includes("MTT")) {
|
|
145
|
+
this.MT = false;
|
|
146
|
+
// this.logger.log('PUBLIC-KEY (Navbar) - mt is', this.MT);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
onClickSound(event: string){
|
|
153
|
+
this.onSoundChange.emit(event)
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
testWidgetPage() {
|
|
158
|
+
const simulateVisitorBtnElem = <HTMLElement>document.querySelector('.simulate-visitor-btn');
|
|
159
|
+
simulateVisitorBtnElem.blur();
|
|
160
|
+
// + '&isOpen=true'
|
|
161
|
+
const url = this.appConfigProvider.getConfig().testsiteBaseUrl + '?tiledesk_projectid=' + this.project.id_project.id + '&project_name=' + this.project.id_project.name + '&role=' + this.USER_ROLE
|
|
162
|
+
window.open(url, '_blank');
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
onClickDropdownOption(event: string){
|
|
166
|
+
const baseUrl = this.appConfigProvider.getConfig().dashboardUrl
|
|
167
|
+
let url = baseUrl
|
|
168
|
+
if(event === 'projectSettings'){
|
|
169
|
+
url = baseUrl + '#/project/' + this.project.id_project.id + '/project-settings/general' + '?token=' + this.tiledeskToken
|
|
170
|
+
}else if(event ==='allProjects'){
|
|
171
|
+
url = baseUrl + '#/projects/' + '?token=' + this.tiledeskToken
|
|
172
|
+
}else if('addProject'){
|
|
173
|
+
url = baseUrl + '#/create-new-project/' + '?token=' + this.tiledeskToken
|
|
174
|
+
}
|
|
175
|
+
console.log('onClickDropdownOption-->', url)
|
|
176
|
+
window.open(url, '_blank');
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
goToHome(id_project: string, project_name: string,) {
|
|
180
|
+
// this.logger.log('!NAVBAR goToHome prjct ', prjct)
|
|
181
|
+
this.logger.log('[NAVBAR] goToHome id_project ', id_project, 'project_name', project_name)
|
|
182
|
+
// RUNS ONLY IF THE THE USER CLICK OVER A PROJECT WITH THE ID DIFFERENT FROM THE CURRENT PROJECT ID
|
|
183
|
+
const baseUrl = this.appConfigProvider.getConfig().dashboardUrl
|
|
184
|
+
if (id_project !== this.project.id_project.id) {
|
|
185
|
+
// this.subscription.unsubscribe();
|
|
186
|
+
// this.unsubscribe$.next();
|
|
187
|
+
// this.unsubscribe$.complete();
|
|
188
|
+
|
|
189
|
+
const url = this.appConfigProvider.getConfig().dashboardUrl + `#/project/${id_project}/home`
|
|
190
|
+
window.open(url, '_blank');
|
|
191
|
+
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
}
|