Skip to content

Alihamud live code - #93

Merged
ali-hamud merged 6 commits into
devfrom
alihamud-live-code
Nov 14, 2016
Merged

ali-hamud merged 6 commits into
devfrom
alihamud-live-code

Conversation

@ali-hamud

Copy link
Copy Markdown
Contributor

Live Demo with visible code.

<div id="left-pane" class="halfWidth right">
<div id="embedArea">
<h3>Embedded Report Area</h3>
<h5>The following div id is <b>reportContainer</b>. In code, we embed a report to it.</h5>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to go through text scrubbing for the texts here..

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is sure.
I will do it in another increment.

Comment thread demo/code-demo/step_authorize.html Outdated
<br/>
<div class="line">
<h4>Flow</h4>
Once you have a report imported to PowerBI Workspace, you are ready to Embed it.<br/>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*embed.. no caps..

please go through text scrubbing


function _Report_GetId() {
report = powerbi.embeds[0];
$('#result').html(report.getId());

@noanu Noa (noanu) Nov 14, 2016 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is"report" always defined? is there a chance for referencing a null here? (and same comment for the below code thar references the report object without checking if it is defined.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually report can be null if there is no embeds.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But the code will not be that clear.
this is a sample code for developers, they should add the check after copying.


function UpdateSessions() {
var txtAccessToken = $('#txtAccessToken').val();
if (txtAccessToken)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens if these strings are empty strings? do you want to update the session with them anyway?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

}
}

function SetAccessTokenFromSession() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the session should always be updated with correct values and is responsible for checking for nulls when it is updates, so is it neccessary do check it also here?

@@ -0,0 +1,32 @@
var embedWithSpecificReportDivExpanded = false;

function ExpandEmbedWithSpecificReportDiv() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this function name be somethings with "toggle" (that was it does doesn't it?)

Comment thread demo/code-demo/scripts/utils.js Outdated
if (parts && parts.length > 0)
{
var guidParts = parts[parts.length -1].split("&");
id = guidParts[0];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a chance "guidParts" is null?

@ali-hamud
ali-hamud merged commit 744c0b7 into dev Nov 14, 2016
Ethan HO (tenshi13) pushed a commit to tenshi13/PowerBI-JavaScript that referenced this pull request May 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants