Repository navigation
Expand file tree
/
Copy pathstep_samples.js
More file actions
46 lines (43 loc) · 1.47 KB
/
Copy pathstep_samples.js
File metadata and controls
46 lines (43 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
function OpenCodeStepWithSample(entityType) {
$("html, body").animate({ scrollTop: 0 }, "slow");
// Clear the log
ClearTextArea('#txtResponse');
SetSession(SessionKeys.EntityType, entityType);
SetSession(SessionKeys.TokenType, defaultTokenType);
if (entityType == EntityType.Report)
{
SetSession(SessionKeys.IsSampleReport, true);
OpenCodeStep(EmbedViewMode, EntityType.Report);
}
else if (entityType == EntityType.Visual)
{
SetSession(SessionKeys.IsSampleReport, true);
OpenCodeStep(EmbedViewMode, EntityType.Visual);
}
else if (entityType == EntityType.Dashboard)
{
SetSession(SessionKeys.IsSampleDashboard, true);
OpenCodeStep(EmbedViewMode, EntityType.Dashboard);
}
else if (entityType == EntityType.Tile)
{
SetSession(SessionKeys.IsSampleTile, true);
OpenCodeStep(EmbedViewMode, EntityType.Tile)
}
else if (entityType == EntityType.Qna)
{
SetSession(SessionKeys.IsSampleQna, true);
OpenCodeStep(EmbedViewMode, EntityType.Qna)
}
else if (entityType == EntityType.PaginatedReport)
{
SetSession(SessionKeys.IsSamplePaginatedReport, true);
OpenCodeStep(EmbedViewMode, EntityType.PaginatedReport)
}
else {
assert(false);
trackEvent(TelemetryEventName.CodeStepError, {});
return;
}
trackEvent(TelemetrySectionName.SampleTool, { entityType: entityType, src: TelemetryEventSource.UserClick });
}