Skip to content

Commit e72fcc1

Browse files
committed
fix comments from review - adding null checks.
1 parent 23b13fd commit e72fcc1

4 files changed

Lines changed: 10 additions & 16 deletions

File tree

demo/code-demo/scripts/session_utils.js

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,13 @@ function UpdateSessions() {
3838

3939
function SetAccessTokenFromSession() {
4040
var sessionAccessToken = GetSession("accessToken");
41-
if (sessionAccessToken)
42-
{
43-
$("#txtAccessToken").val(sessionAccessToken);
44-
}
41+
$("#txtAccessToken").val(sessionAccessToken);
4542
}
4643

4744
function SetEmbedUrlFromSession() {
4845
var sessionEmbedUrl = GetSession("embedUrl");
49-
if (sessionEmbedUrl)
50-
{
51-
$("#txtReportEmbed").val(sessionEmbedUrl);
52-
}
46+
$("#txtReportEmbed").val(sessionEmbedUrl);
5347

5448
var sessionEmbedId = GetSession("embedId");
55-
if (sessionEmbedId)
56-
{
57-
$("#txtEmbedReportId").val(sessionEmbedId);
58-
}
49+
$("#txtEmbedReportId").val(sessionEmbedId);
5950
}

demo/code-demo/scripts/step_authorize.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var embedWithSpecificReportDivExpanded = false;
22

3-
function ExpandEmbedWithSpecificReportDiv() {
3+
function ToggleEmbedWithSpecificReportDiv() {
44
if (embedWithSpecificReportDivExpanded == true)
55
{
66
embedWithSpecificReportDivExpanded = false;

demo/code-demo/scripts/utils.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
if (parts && parts.length > 0)
1212
{
1313
var guidParts = parts[parts.length -1].split("&");
14-
id = guidParts[0];
14+
if (guidParts && guidParts.length > 0)
15+
{
16+
id = guidParts[0];
17+
}
1518
}
1619

1720
if (!id)

demo/code-demo/step_authorize.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<h4>Sample Report</h4>
44
To Embed using a sample report, you can just move to next step.<br/>
55
<button id="nextStepWithSample" class="btn btn-primary" onclick="OpenEmbedStepWithSample()">Embed Sample Report</button><br/><br/><br/>
6-
<a href="#" onclick="ExpandEmbedWithSpecificReportDiv()">Embed Your Own Report</a><br/>
6+
<a href="#" onclick="ToggleEmbedWithSpecificReportDiv()">Embed Your Own Report</a><br/>
77
</div>
88
<div id="EmbedWithSpecificReportDiv" style="display: none;">
99
<div class="line">
@@ -16,7 +16,7 @@ <h4>Prerequisites</h4>
1616
<br/>
1717
<div class="line">
1818
<h4>Flow</h4>
19-
Once you have a report imported to PowerBI Workspace, you are ready to Embed it.<br/>
19+
Once you have a report imported to PowerBI Workspace, you are ready to embed it.<br/>
2020
To Embed a report you need to get an Embed-Token. You can create this token in multiple ways:<br/>
2121
<ul>
2222
<li>Using <a href="https://github.com/Microsoft/PowerBI-cli">PowerBI-Cli</a> tool.<br/></li>

0 commit comments

Comments
 (0)