[HTML Report] Fix display issues in Windows OS (#1010)

* add code
* update ChangeLog.md
This commit is contained in:
Zhenhua Hu 2023-10-21 06:05:41 +08:00 коммит произвёл GitHub
Родитель 795eda540a
Коммит a37dd2b750
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 14 добавлений и 20 удалений

Просмотреть файл

@ -1,6 +1,10 @@
# Change Log - oav
## 09-29-2023 3.2.13
## 10/19/2023 3.2.14
- #1010 Fix an issue with details of `Failed Operations` not displayed in Windows-generated HTML report.
## 09/29/2023 3.2.13
- #1004 fixes an issue with the injected property refWithReadOnly causing additionalProperty error in schema validator.

Просмотреть файл

@ -156,10 +156,7 @@ export class CoverageView {
? `${this.specLinkPrefix}/${element.specFilePath?.substring(
element.specFilePath?.indexOf("specification")
)}#L${error.source.position.line}`
: path.relative(
__dirname,
`../../${element.specFilePath}#L${error.source.position.line}`
),
: `${element.specFilePath}#L${error.source.position.line}`,
pathsInPayload: error.pathsInPayload,
jsonPathsInPayload: error.jsonPathsInPayload,
severity: error.severity,
@ -170,10 +167,7 @@ export class CoverageView {
: element.payloadFilePath,
payloadFilePathWithPosition: this.overrideLinkInReport
? `${this.payloadLinkPrefix}/${payloadFile}#L${element.payloadFilePathPosition?.line}`
: path.relative(
__dirname,
`../../${element.payloadFilePath}#L${element.payloadFilePathPosition?.line}`
),
: `${element.payloadFilePath}#L${element.payloadFilePathPosition?.line}`,
payloadFileLinkLabel: payloadFile,
});
});
@ -184,10 +178,7 @@ export class CoverageView {
payloadFileLinkLabel: payloadFile,
payloadFilePathWithPosition: this.overrideLinkInReport
? `${this.payloadLinkPrefix}/${payloadFile}#L${element.payloadFilePathPosition?.line}`
: path.relative(
__dirname,
`../../${element.payloadFilePath}#L${element.payloadFilePathPosition?.line}`
),
: `${element.payloadFilePath}#L${element.payloadFilePathPosition?.line}`,
errors: element.errors,
specFilePath: this.overrideLinkInReport
? `${this.specLinkPrefix}/${element.specFilePath?.substring(
@ -205,7 +196,7 @@ export class CoverageView {
? `${this.specLinkPrefix}/${element.spec?.substring(
element.spec?.indexOf("specification")
)}`
: path.relative(__dirname, `../../${element.spec}`);
: `${element.spec}`;
this.coverageResultsForRendering.push({
spec: specLink,
specLinkLabel: element.spec?.substring(element.spec?.lastIndexOf("/") + 1),
@ -224,7 +215,9 @@ export class CoverageView {
this.resultsForRendering = this.coverageResultsForRendering.map((item) => {
const data = this.validationResultsForRendering.find(
(i) => i.specFilePath && item.spec.includes(i.specFilePath)
(i) =>
i.specFilePath &&
item.spec.split(path.win32.sep).join(path.posix.sep).includes(i.specFilePath)
);
return {
...item,
@ -272,10 +265,7 @@ export class CoverageView {
? `${this.specLinkPrefix}/${element[0].specFilePath?.substring(
element[0].specFilePath?.indexOf("specification")
)}#L${element[0]!.operationInfo!.position!.line}`
: path.relative(
__dirname,
`../../${element[0].specFilePath}#L${element[0]!.operationInfo!.position!.line}`
),
: `${element[0].specFilePath}#L${element[0]!.operationInfo!.position!.line}`,
});
});

Просмотреть файл

@ -1,6 +1,6 @@
{
"name": "oav",
"version": "3.2.13",
"version": "3.2.14",
"author": {
"name": "Microsoft Corporation",
"email": "azsdkteam@microsoft.com",