@chat21/chat21-web-widget 5.1.0-rc16 → 5.1.0-rc17
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,9 @@
|
|
|
6
6
|
### **Copyrigth**:
|
|
7
7
|
*Tiledesk SRL*
|
|
8
8
|
|
|
9
|
+
# 5.1.0-rc17
|
|
10
|
+
- **added**: allowedOnSpecificUrl and allowedOnSpecificUrlList to manage list of pattern url to allow to load the widget
|
|
11
|
+
|
|
9
12
|
# 5.1.0-rc16
|
|
10
13
|
- **added**: hideOnSpecificUrlList replaced in favour of hideOnSpecificDomainList
|
|
11
14
|
|
package/package.json
CHANGED
|
@@ -516,11 +516,11 @@ export class GlobalSettingsService {
|
|
|
516
516
|
if (variables.hasOwnProperty('showAudioRecorderFooterButton')) {
|
|
517
517
|
globals['showAudioRecorderFooterButton'] = variables['showAudioRecorderFooterButton'];
|
|
518
518
|
}
|
|
519
|
-
if (variables.hasOwnProperty('
|
|
520
|
-
globals['
|
|
519
|
+
if (variables.hasOwnProperty('allowedOnSpecificUrl')) {
|
|
520
|
+
globals['allowedOnSpecificUrl'] = variables['allowedOnSpecificUrl'];
|
|
521
521
|
}
|
|
522
|
-
if (variables.hasOwnProperty('
|
|
523
|
-
globals['
|
|
522
|
+
if (variables.hasOwnProperty('allowedOnSpecificUrlList')) {
|
|
523
|
+
globals['allowedOnSpecificUrlList'] = variables['allowedOnSpecificUrlList'];
|
|
524
524
|
}
|
|
525
525
|
|
|
526
526
|
}
|
|
@@ -1978,8 +1978,8 @@ export class GlobalSettingsService {
|
|
|
1978
1978
|
|
|
1979
1979
|
manageLoadingDomains(): boolean {
|
|
1980
1980
|
|
|
1981
|
-
if(!this.globals.
|
|
1982
|
-
console.log('
|
|
1981
|
+
if(this.globals.allowedOnSpecificUrl && (!this.globals.allowedOnSpecificUrlList || this.globals.allowedOnSpecificUrlList.length === 0) ){
|
|
1982
|
+
console.log('allowedOnSpecificUrl is true and allowedOnSpecificUrlList is empty or not set');
|
|
1983
1983
|
return true
|
|
1984
1984
|
}
|
|
1985
1985
|
|
|
@@ -1992,13 +1992,13 @@ export class GlobalSettingsService {
|
|
|
1992
1992
|
}
|
|
1993
1993
|
|
|
1994
1994
|
const currentUrl = this.globals.windowContext.location.href;
|
|
1995
|
-
const
|
|
1995
|
+
const shouldShow = this.globals.allowedOnSpecificUrlList.some(pattern => {
|
|
1996
1996
|
const regex = wildcardToRegex(pattern);
|
|
1997
1997
|
return regex.test(currentUrl);
|
|
1998
1998
|
});
|
|
1999
1999
|
|
|
2000
2000
|
// let isAllowedToLoad = !isAllowedUrlInText(this.globals.windowContext.location.origin, this.globals.hideOnSpecificDomainList)
|
|
2001
|
-
return
|
|
2001
|
+
return shouldShow
|
|
2002
2002
|
}
|
|
2003
2003
|
|
|
2004
2004
|
}
|
package/src/app/utils/globals.ts
CHANGED
|
@@ -219,8 +219,8 @@ export class Globals {
|
|
|
219
219
|
showAttachmentFooterButton: boolean // ******* new ********
|
|
220
220
|
showAudioRecorderFooterButton: boolean // ******* new ********
|
|
221
221
|
|
|
222
|
-
|
|
223
|
-
|
|
222
|
+
allowedOnSpecificUrl: boolean // ******* new ********
|
|
223
|
+
allowedOnSpecificUrlList: Array<string> // ******* new ********
|
|
224
224
|
constructor(
|
|
225
225
|
) { }
|
|
226
226
|
|
|
@@ -420,10 +420,10 @@ export class Globals {
|
|
|
420
420
|
this.showAttachmentFooterButton = true;
|
|
421
421
|
/** show/hide rec audio option in footer chat-detail page */
|
|
422
422
|
this.showAudioRecorderFooterButton = true;
|
|
423
|
-
/** enabled to set a list of
|
|
424
|
-
this.
|
|
425
|
-
/** set a list of
|
|
426
|
-
this.
|
|
423
|
+
/** enabled to set a list of pattern url able to load the widget **/
|
|
424
|
+
this.allowedOnSpecificUrl = false
|
|
425
|
+
/** set a list of pattern url able to load the widget */
|
|
426
|
+
this.allowedOnSpecificUrlList = [];
|
|
427
427
|
|
|
428
428
|
// ============ END: SET EXTERNAL PARAMETERS ==============//
|
|
429
429
|
|