@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 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
 
@@ -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 --output-hashing none --build-optimizer=true
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 max-age=300
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
- #aws cloudfront create-invalidation --distribution-id E3EJDWEHY08CZZ --paths "/*"
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
@@ -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 --base-href --output-hashing none --build-optimizer=true --vendor-chunk=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=300
20
- aws s3 sync . s3://tiledesk-widget/v6/ --cache-control max-age=300
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@chat21/chat21-web-widget",
3
3
  "author": "Tiledesk SRL",
4
- "version": "5.0.83-rc.2",
4
+ "version": "5.0.83-rc.3",
5
5
  "license": "MIT",
6
6
  "homepage": "https://www.tiledesk.com",
7
7
  "repository": {
@@ -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.logger.debug('[CONV-COMP] close chat with uid ', this.conversation.uid)
982
- this.tiledeskRequestService.closeSupportGroup(this.conversation.uid).then(data => {
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.conversation.uid)
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.conversation.uid, error)
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
- this.hideTextAreaContent = true
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){
@@ -0,0 +1,6 @@
1
+ <div class="modal-container">
2
+ CLOSE CONVERSATION MODAL
3
+ </div>
4
+
5
+
6
+
@@ -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