@chat21/chat21-web-widget 5.0.83-rc.2 → 5.0.83-rc.3
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 +4 -0
- package/deploy_amazon_beta.sh +11 -4
- package/deploy_amazon_prod.sh +11 -4
- package/package.json +1 -1
- package/src/app/app.module.ts +2 -1
- package/src/app/component/conversation-detail/conversation/conversation.component.html +7 -0
- package/src/app/component/conversation-detail/conversation/conversation.component.ts +15 -5
- package/src/app/modals/confirm-close/confirm-close.component.html +6 -0
- package/src/app/modals/confirm-close/confirm-close.component.scss +0 -0
- package/src/app/modals/confirm-close/confirm-close.component.spec.ts +23 -0
- package/src/app/modals/confirm-close/confirm-close.component.ts +24 -0
- package/src/app/utils/BrandResources.ts +8 -0
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,10 @@
|
|
|
6
6
|
### **Copyrigth**:
|
|
7
7
|
*Tiledesk SRL*
|
|
8
8
|
|
|
9
|
+
# 5.0.83-rc.3
|
|
10
|
+
- **added**: send '/start' info message on restart header menu option
|
|
11
|
+
- **bug-fixed**: close header menu option not send the last conversation id to close
|
|
12
|
+
|
|
9
13
|
# 5.0.83-rc.2
|
|
10
14
|
- **changed**: ui improvements on audio elements
|
|
11
15
|
|
package/deploy_amazon_beta.sh
CHANGED
|
@@ -2,7 +2,12 @@
|
|
|
2
2
|
version=`node -e 'console.log(require("./package.json").version)'`
|
|
3
3
|
echo "version $version"
|
|
4
4
|
|
|
5
|
-
ng build --configuration="pre" --aot=true --base-href --
|
|
5
|
+
ng build --configuration="pre" --aot=true --base-href --build-optimizer=true
|
|
6
|
+
|
|
7
|
+
### SET HASHING : START ###
|
|
8
|
+
cp ./src/launch_template.js ./dist/launch.js
|
|
9
|
+
node ./src/build_launch.js
|
|
10
|
+
### SET HASHING : END ###
|
|
6
11
|
|
|
7
12
|
# ########## --->>>> NATIVE-MQTT folder START <<<<<------ ########## #
|
|
8
13
|
|
|
@@ -23,11 +28,13 @@ ng build --configuration="pre" --aot=true --base-href --output-hashing none --bu
|
|
|
23
28
|
|
|
24
29
|
# ########## --->>>> FIREBASE folder START <<<<<------ ########## #
|
|
25
30
|
cd dist
|
|
26
|
-
aws s3 sync . s3://tiledesk-widget-pre/v5/$version/ --cache-control max-age=300
|
|
27
|
-
aws s3 sync . s3://tiledesk-widget-pre/v5/ --cache-control
|
|
31
|
+
aws s3 sync . s3://tiledesk-widget-pre/v5/$version/ --cache-control max-age=300 --exclude='launch.js' #7days
|
|
32
|
+
aws s3 sync . s3://tiledesk-widget-pre/v5/$version/ --cache-control "no-store,no-cache,private" --exclude='*' --include='launch.js'
|
|
33
|
+
aws s3 sync . s3://tiledesk-widget-pre/v5/ --cache-control max-age=300 --exclude='launch.js' #7days
|
|
34
|
+
aws s3 sync . s3://tiledesk-widget-pre/v5/ --cache-control "no-store,no-cache,private" --exclude='*' --include='launch.js'
|
|
28
35
|
cd ..
|
|
29
36
|
|
|
30
|
-
|
|
37
|
+
aws cloudfront create-invalidation --distribution-id E2V5O0YPR61V8P --paths "/*"
|
|
31
38
|
# echo new version deployed $NEW_VER/$NEW_BUILD/ on s3://tiledesk-widget-pre/v2
|
|
32
39
|
echo new version deployed $version/ on s3://tiledesk-widget-pre/v5 and s3://tiledesk-widget-pre/v5/$version/
|
|
33
40
|
echo available on https://s3.eu-west-1.amazonaws.com/tiledesk-widget-pre/v5/index.html
|
package/deploy_amazon_prod.sh
CHANGED
|
@@ -3,7 +3,13 @@ version=`node -e 'console.log(require("./package.json").version)'`
|
|
|
3
3
|
echo "version $version"
|
|
4
4
|
|
|
5
5
|
# --build-optimizer=false if localstorage is disabled (webview) appears https://github.com/firebase/angularfire/issues/970
|
|
6
|
-
ng build --configuration="prod" --aot=true
|
|
6
|
+
ng build --configuration="prod" --aot=true --build-optimizer=true --vendor-chunk=true
|
|
7
|
+
##--base-href='./v5/' --output-hashing none
|
|
8
|
+
|
|
9
|
+
### SET HASHING : START ###
|
|
10
|
+
cp ./src/launch_template.js ./dist/launch.js
|
|
11
|
+
node ./src/build_launch.js
|
|
12
|
+
### SET HASHING : END ###
|
|
7
13
|
|
|
8
14
|
#### FIREBASE #####
|
|
9
15
|
# cd dist
|
|
@@ -12,12 +18,13 @@ ng build --configuration="prod" --aot=true --base-href --output-hashing none --b
|
|
|
12
18
|
# aws s3 sync . s3://tiledesk-widget/v5/ --cache-control max-age=300
|
|
13
19
|
# cd ..
|
|
14
20
|
|
|
15
|
-
|
|
16
21
|
# #### MQTT #####
|
|
17
22
|
cd dist
|
|
18
23
|
# aws s3 sync . s3://tiledesk-widget/v5/latest/
|
|
19
|
-
aws s3 sync . s3://tiledesk-widget/v6/$version/ --cache-control max-age=
|
|
20
|
-
aws s3 sync . s3://tiledesk-widget/v6/ --cache-control
|
|
24
|
+
aws s3 sync . s3://tiledesk-widget/v6/$version/ --cache-control max-age=86400 --exclude='launch.js' #8days
|
|
25
|
+
aws s3 sync . s3://tiledesk-widget/v6/$version/ --cache-control "no-store,no-cache,private" --exclude='*' --include='launch.js'
|
|
26
|
+
aws s3 sync . s3://tiledesk-widget/v6/ --cache-control max-age=86400 --exclude='launch.js' #8days
|
|
27
|
+
aws s3 sync . s3://tiledesk-widget/v6/ --cache-control "no-store,no-cache,private" --exclude='*' --include='launch.js'
|
|
21
28
|
cd ..
|
|
22
29
|
|
|
23
30
|
aws cloudfront create-invalidation --distribution-id E3EJDWEHY08CZZ --paths "/*"
|
package/package.json
CHANGED
package/src/app/app.module.ts
CHANGED
|
@@ -135,6 +135,7 @@ import { ScriptService } from 'src/chat21-core/providers/scripts/script.service'
|
|
|
135
135
|
import { CarouselComponent } from './component/message/carousel/carousel.component';
|
|
136
136
|
import { BrandService } from './providers/brand.service';
|
|
137
137
|
import { NetworkOfflineComponent } from './component/network-offline/network-offline.component';
|
|
138
|
+
import { ConfirmCloseComponent } from './modals/confirm-close/confirm-close.component';
|
|
138
139
|
|
|
139
140
|
|
|
140
141
|
|
|
@@ -300,7 +301,7 @@ export function uploadFactory(http: HttpClient, appConfig: AppConfigService, app
|
|
|
300
301
|
TooltipDirective,
|
|
301
302
|
CarouselComponent,
|
|
302
303
|
NetworkOfflineComponent,
|
|
303
|
-
|
|
304
|
+
ConfirmCloseComponent
|
|
304
305
|
],
|
|
305
306
|
imports: [
|
|
306
307
|
BrowserModule,
|
|
@@ -90,6 +90,13 @@
|
|
|
90
90
|
(onCloseModalPreview)="onCloseModalPreview()">
|
|
91
91
|
</chat-conversation-attachment-preview>
|
|
92
92
|
|
|
93
|
+
|
|
94
|
+
<dialog #mydialog>
|
|
95
|
+
<chat-confirm-close>
|
|
96
|
+
|
|
97
|
+
</chat-confirm-close>
|
|
98
|
+
</dialog>
|
|
99
|
+
|
|
93
100
|
<!-- FOOTER -->
|
|
94
101
|
<!-- [class.maximize-width]="(g?.singleConversation && hideTextAreaContent) || (isConversationArchived && !g?.allowReopen)" -->
|
|
95
102
|
<div id="chat21-footer">
|
|
@@ -50,6 +50,8 @@ import { ConversationContentComponent } from '../conversation-content/conversati
|
|
|
50
50
|
})
|
|
51
51
|
export class ConversationComponent implements OnInit, AfterViewInit, OnChanges {
|
|
52
52
|
@ViewChild('afConversationComponent') private afConversationComponent: ElementRef; // l'ID del div da scrollare
|
|
53
|
+
@ViewChild('mydialog') mydialog: ElementRef;
|
|
54
|
+
|
|
53
55
|
// @HostListener('window:resize', ['$event'])
|
|
54
56
|
// ========= begin:: Input/Output values
|
|
55
57
|
// @Input() elRoot: ElementRef;
|
|
@@ -978,19 +980,27 @@ export class ConversationComponent implements OnInit, AfterViewInit, OnChanges {
|
|
|
978
980
|
}
|
|
979
981
|
/** CALLED BY: conv-header component */
|
|
980
982
|
onCloseChat(){
|
|
981
|
-
this.
|
|
982
|
-
this.
|
|
983
|
+
// this.mydialog.nativeElement.showModal()
|
|
984
|
+
this.logger.debug('[CONV-COMP] close chat with uid ', this.conversation.uid, this.conversationId)
|
|
985
|
+
this.tiledeskRequestService.closeSupportGroup(this.conversationId).then(data => {
|
|
983
986
|
if(data === 'closed'){
|
|
984
987
|
this.isMenuShow = false
|
|
985
|
-
this.logger.debug('[CONV-COMP] chat closed successfully with uid ', this.
|
|
988
|
+
this.logger.debug('[CONV-COMP] chat closed successfully with uid ', this.conversationId)
|
|
986
989
|
}
|
|
987
990
|
}).catch(error => {
|
|
988
|
-
this.logger.error('[CONV-COMP] ERROR while closing chat with id: ', this.
|
|
991
|
+
this.logger.error('[CONV-COMP] ERROR while closing chat with id: ', this.conversationId, error)
|
|
989
992
|
})
|
|
990
993
|
}
|
|
991
994
|
/** CALLED BY: conv-header component */
|
|
992
995
|
onRestartChat(){
|
|
993
|
-
|
|
996
|
+
//restart SAME conversation calling /start againg
|
|
997
|
+
let attributes = {
|
|
998
|
+
subtype: 'info',
|
|
999
|
+
... this.g.attributes
|
|
1000
|
+
}
|
|
1001
|
+
this.conversationFooter.sendMessage('/start', TYPE_MSG_TEXT, null, attributes)
|
|
1002
|
+
|
|
1003
|
+
// this.hideTextAreaContent = true
|
|
994
1004
|
}
|
|
995
1005
|
/** CALLED BY: conv-header component */
|
|
996
1006
|
onWidgetHeightChange(mode){
|
|
File without changes
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { ConfirmCloseComponent } from './confirm-close.component';
|
|
4
|
+
|
|
5
|
+
describe('ConfirmCloseComponent', () => {
|
|
6
|
+
let component: ConfirmCloseComponent;
|
|
7
|
+
let fixture: ComponentFixture<ConfirmCloseComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ ConfirmCloseComponent ]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(ConfirmCloseComponent);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
selector: 'chat-confirm-close',
|
|
5
|
+
templateUrl: './confirm-close.component.html',
|
|
6
|
+
styleUrls: ['./confirm-close.component.scss']
|
|
7
|
+
})
|
|
8
|
+
export class ConfirmCloseComponent implements OnInit{
|
|
9
|
+
|
|
10
|
+
@ViewChild('mydialog') mydialog: ElementRef;
|
|
11
|
+
|
|
12
|
+
constructor() { }
|
|
13
|
+
|
|
14
|
+
ngOnInit(): void {
|
|
15
|
+
// console.log('[CONFIRM CLOSE MODAL] onInit-->', this.dialog);
|
|
16
|
+
// this.dialog.showModal();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
ngAfterViewInit(){
|
|
20
|
+
// console.log('[CONFIRM CLOSE MODAL] ngAfterViewInit-->', this.mydialog);
|
|
21
|
+
// this.mydialog.nativeElement.showModal()
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
}
|
|
@@ -25,6 +25,14 @@ export class BrandResources {
|
|
|
25
25
|
// var icon = document.querySelector("link[rel~='icon']") as HTMLElement;
|
|
26
26
|
// icon.setAttribute('href', this.brand['FAVICON_URL'])
|
|
27
27
|
|
|
28
|
+
/** META sharing ELEMENTS */
|
|
29
|
+
if(this.brand['META_SHARE_INFO'] && this.brand['META_SHARE_INFO'].length > 0){
|
|
30
|
+
Object.keys(this.brand['META_SHARE_INFO']).forEach(key => {
|
|
31
|
+
var meta = document.querySelector("meta[property^='og:"+key.toLowerCase()+"']") as HTMLElement;
|
|
32
|
+
meta.setAttribute('content', this.brand['META_SHARE_INFO'][key])
|
|
33
|
+
})
|
|
34
|
+
}
|
|
35
|
+
|
|
28
36
|
/** CSS */
|
|
29
37
|
document.documentElement.style.setProperty('--base-brand-color', this.brand['BRAND_PRIMARY_COLOR']);
|
|
30
38
|
|