@@ -104,12 +104,12 @@ export class Report extends embed.Embed implements IReportNode, IFilterable {
104
104
*/
105
105
render ( config ?: IReportLoadConfiguration ) : Promise < void > {
106
106
return this . service . hpm . post < models . IError [ ] > ( `/report/render` , config , { uid : this . config . uniqueId } , this . iframe . contentWindow )
107
- . then ( response => {
108
- return response . body ;
109
- } )
110
- . catch ( response => {
111
- throw response . body ;
112
- } ) ;
107
+ . then ( response => {
108
+ return response . body ;
109
+ } )
110
+ . catch ( response => {
111
+ throw response . body ;
112
+ } ) ;
113
113
}
114
114
115
115
/**
@@ -128,12 +128,12 @@ export class Report extends embed.Embed implements IReportNode, IFilterable {
128
128
} ;
129
129
130
130
return this . service . hpm . post < models . IPage > ( `/report/addPage` , request , { uid : this . config . uniqueId } , this . iframe . contentWindow )
131
- . then ( response => {
132
- var page = response . body ;
133
- return new Page ( this , page . name , page . displayName , page . isActive , page . visibility , page . defaultSize , page . defaultDisplayOption ) ;
134
- } , response => {
135
- throw response . body ;
136
- } ) ;
131
+ . then ( response => {
132
+ var page = response . body ;
133
+ return new Page ( this , page . name , page . displayName , page . isActive , page . visibility , page . defaultSize , page . defaultDisplayOption ) ;
134
+ } , response => {
135
+ throw response . body ;
136
+ } ) ;
137
137
}
138
138
139
139
/**
@@ -147,13 +147,13 @@ export class Report extends embed.Embed implements IReportNode, IFilterable {
147
147
* @returns {Promise<void> }
148
148
*/
149
149
deletePage ( pageName ?: string ) : Promise < void > {
150
- return this . service . hpm . delete < models . IError [ ] > ( `/report/pages/${ pageName } ` , { } , { uid : this . config . uniqueId } , this . iframe . contentWindow )
151
- . then ( response => {
152
- return response . body ;
153
- } )
154
- . catch ( response => {
155
- throw response . body ;
156
- } ) ;
150
+ return this . service . hpm . delete < models . IError [ ] > ( `/report/pages/${ pageName } ` , { } , { uid : this . config . uniqueId } , this . iframe . contentWindow )
151
+ . then ( response => {
152
+ return response . body ;
153
+ } )
154
+ . catch ( response => {
155
+ throw response . body ;
156
+ } ) ;
157
157
}
158
158
159
159
/**
@@ -176,9 +176,9 @@ export class Report extends embed.Embed implements IReportNode, IFilterable {
176
176
177
177
return this . service . hpm . get < models . IFilter [ ] > ( `/report/filters` , { uid : this . config . uniqueId } , this . iframe . contentWindow )
178
178
. then ( response => response . body ,
179
- response => {
180
- throw response . body ;
181
- } ) ;
179
+ response => {
180
+ throw response . body ;
181
+ } ) ;
182
182
}
183
183
184
184
/**
@@ -451,7 +451,7 @@ export class Report extends embed.Embed implements IReportNode, IFilterable {
451
451
} )
452
452
. catch ( response => {
453
453
throw response . body ;
454
- } ) ;
454
+ } ) ;
455
455
}
456
456
457
457
/**
@@ -501,6 +501,52 @@ export class Report extends embed.Embed implements IReportNode, IFilterable {
501
501
return this . applyThemeInternal ( < models . IReportTheme > { } ) ;
502
502
}
503
503
504
+ /**
505
+ * Reset user's filters, slicers, and other data view changes to the default state of the report
506
+ *
507
+ * ```javascript
508
+ * report.resetPersistentFilters();
509
+ * ```
510
+ */
511
+ resetPersistentFilters ( ) : Promise < void > {
512
+ return this . service . hpm . delete < models . IError [ ] > ( `/report/userState` , null , { uid : this . config . uniqueId } , this . iframe . contentWindow )
513
+ . catch ( response => {
514
+ throw response . body ;
515
+ } ) ;
516
+ }
517
+
518
+ /**
519
+ * Save user's filters, slicers, and other data view changes of the report
520
+ *
521
+ * ```javascript
522
+ * report.savePersistentFilters();
523
+ * ```
524
+ */
525
+ savePersistentFilters ( ) : Promise < void > {
526
+ return this . service . hpm . post < models . IError [ ] > ( `/report/userState` , null , { uid : this . config . uniqueId } , this . iframe . contentWindow )
527
+ . catch ( response => {
528
+ throw response . body ;
529
+ } ) ;
530
+ }
531
+
532
+ /**
533
+ * Returns if there are user's filters, slicers, or other data view changes applied on the report.
534
+ * If persistent filters is disable, returns false.
535
+ *
536
+ * ```javascript
537
+ * report.arePersistentFiltersApplied();
538
+ * ```
539
+ *
540
+ * @returns {Promise<boolean> }
541
+ */
542
+ arePersistentFiltersApplied ( ) : Promise < boolean > {
543
+ return this . service . hpm . get < boolean > ( `/report/isUserStateApplied` , { uid : this . config . uniqueId } , this . iframe . contentWindow )
544
+ . then ( response => response . body ,
545
+ response => {
546
+ throw response . body ;
547
+ } ) ;
548
+ }
549
+
504
550
/**
505
551
* @hidden
506
552
*/
@@ -530,7 +576,7 @@ export class Report extends embed.Embed implements IReportNode, IFilterable {
530
576
531
577
return mode ;
532
578
}
533
-
579
+
534
580
/**
535
581
* @hidden
536
582
*/
0 commit comments