Skip to content

Commit 786dfa8

Browse files
committed
Merge remote-tracking branch 'powerbi/master'
2 parents 2f44bba + 9a4cd71 commit 786dfa8

File tree

6 files changed

+65
-10
lines changed

6 files changed

+65
-10
lines changed

demo/v2-demo/scripts/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ function elementClicked(element) {
157157
}
158158

159159
function SetAuthoringPageActive(report) {
160-
return new Promise((resolve, reject) => {
160+
return new Promise(function(resolve, reject) {
161161

162162
// Get all report pages
163163
report.getPages().then(function (pages) {

dist/powerbi-client.d.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,17 @@ declare module "visualDescriptor" {
608608
* @returns {(Promise<models.ICloneVisualResponse>)}
609609
*/
610610
clone(request?: models.ICloneVisualRequest): Promise<models.ICloneVisualResponse>;
611+
/**
612+
* Sort a visual by dataField and direction.
613+
*
614+
* @param request: Sort by visual request.
615+
*
616+
* ```javascript
617+
* visual.sortBy(request)
618+
* .then(() => { ... });
619+
* ```
620+
*/
621+
sortBy(request: models.ISortByVisualRequest): Promise<void>;
611622
}
612623
}
613624
declare module "page" {

dist/powerbi.js

Lines changed: 29 additions & 2 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: 5 additions & 5 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
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "powerbi-client",
3-
"version": "2.7.5",
3+
"version": "2.8.0",
44
"description": "JavaScript library for embedding Power BI into your apps. Provides service which makes it easy to embed different types of components and an object model which allows easy interaction with these components such as changing pages, applying filters, and responding to data selection.",
55
"main": "dist/powerbi.js",
66
"typings": "dist/powerbi-client.d.ts",
@@ -75,7 +75,7 @@
7575
},
7676
"dependencies": {
7777
"http-post-message": "^0.2",
78-
"powerbi-models": "^1.2.0",
78+
"powerbi-models": "^1.2.1",
7979
"powerbi-router": "^0.1",
8080
"window-post-message-proxy": "^0.2"
8181
},

src/visualDescriptor.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,4 +188,21 @@ export class VisualDescriptor implements IVisualNode, IFilterable {
188188
throw response.body;
189189
});
190190
}
191+
192+
/**
193+
* Sort a visual by dataField and direction.
194+
*
195+
* @param request: Sort by visual request.
196+
*
197+
* ```javascript
198+
* visual.sortBy(request)
199+
* .then(() => { ... });
200+
* ```
201+
*/
202+
sortBy(request: models.ISortByVisualRequest): Promise<void> {
203+
return this.page.report.service.hpm.put<models.IError[]>(`/report/pages/${this.page.name}/visuals/${this.name}/sortBy`, request, { uid: this.page.report.config.uniqueId }, this.page.report.iframe.contentWindow)
204+
.catch(response => {
205+
throw response.body;
206+
});
207+
}
191208
}

0 commit comments

Comments
 (0)