Merged PR 136967: Add update filters API · dramirezm/PowerBI-JavaScript@ce34d4c · GitHub
Skip to content

Commit ce34d4c

Browse files
committed
Merged PR 136967: Add update filters API
Added new `updateFilters` to `IFilterable` interfaces and to the classes that implements it. API usage examples: ```typescript await report.updateFilters(FiltersOperations.RemoveAll); await page.updateFilters(FiltersOperations.ReplaceAll, filters); await visual.updateFilters(FiltersOperations.Add, filters); await report.updateFilters(FiltersOperations.Replace, filters); ```
1 parent e4b6f1e commit ce34d4c

14 files changed

Lines changed: 1593 additions & 1017 deletions

.eslintrc.js

Lines changed: 252 additions & 251 deletions
Large diffs are not rendered by default.

dist/powerbi-client.d.ts

Lines changed: 210 additions & 147 deletions
Large diffs are not rendered by default.

dist/powerbi.js

Lines changed: 562 additions & 314 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/powerbi.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions

src/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @ignore *//** */
22
const config = {
3-
version: '2.16.5',
3+
version: '2.17.0',
44
type: 'js'
55
};
66

src/ifilterable.ts

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,39 @@
1-
import * as models from 'powerbi-models';
1+
import { FiltersOperations, IFilter } from 'powerbi-models';
22
import { IHttpPostMessageResponse } from 'http-post-message';
33

44
/**
55
* Decorates embed components that support filters
66
* Examples include reports and pages
7-
*
7+
*
88
* @export
99
* @interface IFilterable
1010
*/
1111
export interface IFilterable {
1212
/**
1313
* Gets the filters currently applied to the object.
14-
*
15-
* @returns {(Promise<models.IFilter[]>)}
14+
*
15+
* @returns {(Promise<IFilter[]>)}
1616
*/
17-
getFilters(): Promise<models.IFilter[]>;
17+
getFilters(): Promise<IFilter[]>;
1818
/**
19-
* Replaces all filters on the current object with the specified filter values.
20-
*
21-
* @param {(models.IFilter[])} filters
19+
* Update the filters for the current instance according to the operation: Add, replace all, replace by target or remove.
20+
*
21+
* @param {(FiltersOperations)} operation
22+
* @param {(IFilter[])} filters
2223
* @returns {Promise<IHttpPostMessageResponse<void>>}
2324
*/
24-
setFilters(filters: models.IFilter[]): Promise<IHttpPostMessageResponse<void>>;
25+
updateFilters(operation: FiltersOperations, filters?: IFilter[]): Promise<IHttpPostMessageResponse<void>>;
2526
/**
2627
* Removes all filters from the current object.
27-
*
28+
*
2829
* @returns {Promise<IHttpPostMessageResponse<void>>}
2930
*/
3031
removeFilters(): Promise<IHttpPostMessageResponse<void>>;
31-
}
32+
/**
33+
* Replaces all filters on the current object with the specified filter values.
34+
*
35+
* @param {(IFilter[])} filters
36+
* @returns {Promise<IHttpPostMessageResponse<void>>}
37+
*/
38+
setFilters(filters: IFilter[]): Promise<IHttpPostMessageResponse<void>>;
39+
}

src/page.ts

Lines changed: 87 additions & 52 deletions

0 commit comments

Comments
 (0)