simulate hash click by jQuery (#864)
Co-authored-by: v-tianxi@microsoft.com <v-tian@microsoft.com>
This commit is contained in:
Родитель
85fb41394f
Коммит
72800adf47
|
@ -61,7 +61,9 @@ export interface OperationCoverageInfoForRendering extends OperationCoverageInfo
|
|||
|
||||
export interface resultForRendering
|
||||
extends OperationCoverageInfoForRendering,
|
||||
TrafficValidationIssueForRendering {}
|
||||
TrafficValidationIssueForRendering {
|
||||
index?: number;
|
||||
}
|
||||
|
||||
// used to pass data to the template rendering engine
|
||||
export class CoverageView {
|
||||
|
@ -266,7 +268,8 @@ export class CoverageView {
|
|||
});
|
||||
});
|
||||
|
||||
for (const e of this.resultsForRendering) {
|
||||
for (const [index, e] of this.resultsForRendering.entries()) {
|
||||
e.index = index;
|
||||
for (const i of generalErrorsInnerList) {
|
||||
if (e.specFilePath === i.specFilePath && i) {
|
||||
e.generalErrorsInnerList.push(i);
|
||||
|
|
|
@ -135,6 +135,7 @@
|
|||
color: var(--link-color);
|
||||
font-size: 16px;
|
||||
margin-right: 5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.details .btnMore span {
|
||||
|
@ -392,6 +393,7 @@
|
|||
color: var(--link-color);
|
||||
font-size: 16px;
|
||||
margin-right: 5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.content-label .btnMore h2 {
|
||||
|
@ -498,6 +500,11 @@
|
|||
border: none;
|
||||
border-top: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
/* simulate hash link by jQuery */
|
||||
.hashLinkClass {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
|
@ -540,12 +547,13 @@
|
|||
<tr>
|
||||
<th>Total ( {{totalOperations}} )</th>
|
||||
<th style="background-color: var(--report-bg-yellow)">
|
||||
Untested<a href="#MissingTest"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2048 2048" class="svg_dd790ee3 x-hidden-focus" focusable="false" width="25" height="15" style="vertical-align: middle;"><path d="M1707 715q76 27 139 75t108 111 69 138 25 156q0 106-40 199t-110 162-163 110-199 41h-512q-106 0-199-40t-162-110-110-163-41-199q0-106 40-199t110-162 163-110 199-41h171q0 35-13 66t-37 54-55 36-66 14q-71 0-133 27t-108 73-73 109-27 133q0 71 27 133t73 108 108 73 133 27h512q70 0 132-27t109-73 73-108 27-133q0-92-46-168t-124-123V715zM171 683q0 91 46 167t124 124v189q-76-27-139-75T94 977 25 839 0 683q0-106 40-199t110-162 163-110 199-41h512q106 0 199 40t162 110 110 163 41 199q0 106-40 199t-110 162-163 110-199 41H853q0-35 13-66t37-54 54-37 67-14q70 0 132-27t109-73 73-108 27-133q0-70-26-132t-73-109-109-74-133-27H512q-71 0-133 27t-108 73-73 109-27 133z" class="x-hidden-focus"></path></svg>
|
||||
Untested<span class="hashLinkClass" data-hash-link="MissingTest_{{index}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2048 2048" class="svg_dd790ee3 x-hidden-focus" focusable="false" width="25" height="15" style="vertical-align: middle;"><path d="M1707 715q76 27 139 75t108 111 69 138 25 156q0 106-40 199t-110 162-163 110-199 41h-512q-106 0-199-40t-162-110-110-163-41-199q0-106 40-199t110-162 163-110 199-41h171q0 35-13 66t-37 54-55 36-66 14q-71 0-133 27t-108 73-73 109-27 133q0 71 27 133t73 108 108 73 133 27h512q70 0 132-27t109-73 73-108 27-133q0-92-46-168t-124-123V715zM171 683q0 91 46 167t124 124v189q-76-27-139-75T94 977 25 839 0 683q0-106 40-199t110-162 163-110 199-41h512q106 0 199 40t162 110 110 163 41 199q0 106-40 199t-110 162-163 110-199 41H853q0-35 13-66t37-54 54-37 67-14q70 0 132-27t109-73 73-108 27-133q0-70-26-132t-73-109-109-74-133-27H512q-71 0-133 27t-108 73-73 109-27 133z" class="x-hidden-focus"></path></svg>
|
||||
( {{unCoveredOperations}} )
|
||||
</a>
|
||||
</span>
|
||||
</th>
|
||||
<th style="background-color: var(--report-bg-red);">
|
||||
Fail<a href="#testFailed"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2048 2048" class="svg_dd790ee3 x-hidden-focus" focusable="false" width="25" height="15" style="vertical-align: middle;"><path d="M1707 715q76 27 139 75t108 111 69 138 25 156q0 106-40 199t-110 162-163 110-199 41h-512q-106 0-199-40t-162-110-110-163-41-199q0-106 40-199t110-162 163-110 199-41h171q0 35-13 66t-37 54-55 36-66 14q-71 0-133 27t-108 73-73 109-27 133q0 71 27 133t73 108 108 73 133 27h512q70 0 132-27t109-73 73-108 27-133q0-92-46-168t-124-123V715zM171 683q0 91 46 167t124 124v189q-76-27-139-75T94 977 25 839 0 683q0-106 40-199t110-162 163-110 199-41h512q106 0 199 40t162 110 110 163 41 199q0 106-40 199t-110 162-163 110-199 41H853q0-35 13-66t37-54 54-37 67-14q70 0 132-27t109-73 73-108 27-133q0-70-26-132t-73-109-109-74-133-27H512q-71 0-133 27t-108 73-73 109-27 133z" class="x-hidden-focus"></path></svg></a>
|
||||
Fail<span class="hashLinkClass" data-hash-link="testFailed_{{index}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2048 2048" class="svg_dd790ee3 x-hidden-focus" focusable="false" width="25" height="15" style="vertical-align: middle;"><path d="M1707 715q76 27 139 75t108 111 69 138 25 156q0 106-40 199t-110 162-163 110-199 41h-512q-106 0-199-40t-162-110-110-163-41-199q0-106 40-199t110-162 163-110 199-41h171q0 35-13 66t-37 54-55 36-66 14q-71 0-133 27t-108 73-73 109-27 133q0 71 27 133t73 108 108 73 133 27h512q70 0 132-27t109-73 73-108 27-133q0-92-46-168t-124-123V715zM171 683q0 91 46 167t124 124v189q-76-27-139-75T94 977 25 839 0 683q0-106 40-199t110-162 163-110 199-41h512q106 0 199 40t162 110 110 163 41 199q0 106-40 199t-110 162-163 110-199 41H853q0-35 13-66t37-54 54-37 67-14q70 0 132-27t109-73 73-108 27-133q0-70-26-132t-73-109-109-74-133-27H512q-71 0-133 27t-108 73-73 109-27 133z" class="x-hidden-focus"></path></svg>
|
||||
</span>
|
||||
( {{validationFailOperations}} )
|
||||
</th>
|
||||
<th style="background-color: var(--report-bg-green);">Pass ( {{validationPassOperations}} )</th>
|
||||
|
@ -564,7 +572,7 @@
|
|||
<div style="padding: 0px 15px 20px; display:none;" class="content-collapse">
|
||||
|
||||
<section class="testFailed">
|
||||
<h2 class="title" id="testFailed">Failed Operations ( {{validationFailOperations}} )</h2>
|
||||
<h2 class="title" id="testFailed_{{index}}">Failed Operations ( {{validationFailOperations}} )</h2>
|
||||
<article>
|
||||
<div class="table-body">
|
||||
<table summary="Operations Test Failed" cellspacing="0" cellpadding="0">
|
||||
|
@ -633,7 +641,7 @@
|
|||
</section>
|
||||
|
||||
<section class="notTested">
|
||||
<h2 class="title" id="MissingTest">Untested Operations ( {{unCoveredOperations}} )</h2>
|
||||
<h2 class="title" id="MissingTest_{{index}}">Untested Operations ( {{unCoveredOperations}} )</h2>
|
||||
<article>
|
||||
<div class="table-body">
|
||||
<table summary="Operations Not Tested" cellspacing="0" cellpadding="0">
|
||||
|
@ -716,6 +724,7 @@
|
|||
console.log('Hello AZSDK. Document.Ready available here.');
|
||||
addFailedEachClick();
|
||||
addContentClick();
|
||||
hashLinkClick();
|
||||
document.getElementById('markdownCont').innerHTML = marked.parse(`<div>${document.getElementById('markdownTmp').innerText}`);
|
||||
switchClick();
|
||||
});
|
||||
|
@ -741,6 +750,25 @@
|
|||
});
|
||||
});
|
||||
}
|
||||
|
||||
function hashLinkClick() {
|
||||
$('span.hashLinkClass').each(function (index) {
|
||||
$(this).click(function(event){
|
||||
var disableCon = $(this).parent().parent().parent().parent().parent().parent().parent().parent().next()
|
||||
var hashLinkId = $(this).data('hashLink')
|
||||
if($(disableCon).is(":hidden")) {
|
||||
disableCon.toggle();
|
||||
var arrow = $(this).parent().parent().parent().parent().parent().parent().parent().parent().prev().find(".arrow")[0]
|
||||
$(arrow).toggleClass("collapse");
|
||||
var target_top = $(`#${hashLinkId}`).offset().top;
|
||||
$("html,body").scrollTop(target_top);
|
||||
} else {
|
||||
var target_top = $(`#${hashLinkId}`).offset().top;
|
||||
$("html,body").scrollTop(target_top);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function switchClick(){
|
||||
$('input[type=checkbox][name=reportRenderMethod]').change(function() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче