@@ -104,12 +104,12 @@ export class Report extends embed.Embed implements IReportNode, IFilterable {
104104 */
105105 render ( config ?: IReportLoadConfiguration ) : Promise < void > {
106106 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+ } ) ;
113113 }
114114
115115 /**
@@ -128,12 +128,12 @@ export class Report extends embed.Embed implements IReportNode, IFilterable {
128128 } ;
129129
130130 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+ } ) ;
137137 }
138138
139139 /**
@@ -147,13 +147,13 @@ export class Report extends embed.Embed implements IReportNode, IFilterable {
147147 * @returns {Promise<void> }
148148 */
149149 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+ } ) ;
157157 }
158158
159159 /**
@@ -176,9 +176,9 @@ export class Report extends embed.Embed implements IReportNode, IFilterable {
176176
177177 return this . service . hpm . get < models . IFilter [ ] > ( `/report/filters` , { uid : this . config . uniqueId } , this . iframe . contentWindow )
178178 . then ( response => response . body ,
179- response => {
180- throw response . body ;
181- } ) ;
179+ response => {
180+ throw response . body ;
181+ } ) ;
182182 }
183183
184184 /**
@@ -451,7 +451,7 @@ export class Report extends embed.Embed implements IReportNode, IFilterable {
451451 } )
452452 . catch ( response => {
453453 throw response . body ;
454- } ) ;
454+ } ) ;
455455 }
456456
457457 /**
@@ -501,6 +501,52 @@ export class Report extends embed.Embed implements IReportNode, IFilterable {
501501 return this . applyThemeInternal ( < models . IReportTheme > { } ) ;
502502 }
503503
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+
504550 /**
505551 * @hidden
506552 */
@@ -530,7 +576,7 @@ export class Report extends embed.Embed implements IReportNode, IFilterable {
530576
531577 return mode ;
532578 }
533-
579+
534580 /**
535581 * @hidden
536582 */
0 commit comments