forked from Ericsson/codechecker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feat] Showing closed reports on Checker Coverage tab
It is an additional PR for Checker Coverage tab to list closed reports not just outstandings. The number of closed report can be clickable for the user if it is not zero. Achieving this, it is necessary to add a report status filter to the report filter section that has two options: OUTSTANDING and CLOSED. A report is outstanding when its review status is unreviewed/confirmed and its detaction status is new/unresolved/reopened. When the new filter is set, the review and the detection status filters are not taken into account.
- Loading branch information
Showing
11 changed files
with
184 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
119 changes: 119 additions & 0 deletions
119
web/server/vue-cli/src/components/Report/ReportFilter/Filters/ReportStatusFilter.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
<template> | ||
<select-option | ||
:id="id" | ||
title="Report Status" | ||
:bus="bus" | ||
:fetch-items="fetchItems" | ||
:loading="loading" | ||
:selected-items="selectedItems" | ||
:panel="panel" | ||
@clear="clear(true)" | ||
@input="setSelectedItems" | ||
> | ||
<template v-slot:icon="{ item }"> | ||
<review-status-icon :status="item.id" /> | ||
</template> | ||
|
||
<template v-slot:append-toolbar-title> | ||
<tooltip-help-icon> | ||
Filter reports by the <b>latest</b> review status.<br><br> | ||
|
||
Reports can be assigned a review status of the following values: | ||
<ul> | ||
<li> | ||
<b>Unreviewed</b>: Nobody has seen this report. | ||
</li> | ||
<li> | ||
<b>Confirmed:</b> This is really a bug. | ||
</li> | ||
<li> | ||
<b>False positive:</b> This is not a bug. | ||
</li> | ||
<li> | ||
<b>Intentional:</b> This report is a bug but we don't want to fix | ||
it. | ||
</li> | ||
</ul> | ||
</tooltip-help-icon> | ||
|
||
<selected-toolbar-title-items | ||
v-if="selectedItems" | ||
:value="selectedItems" | ||
/> | ||
</template> | ||
</select-option> | ||
</template> | ||
|
||
<script> | ||
import { ccService, handleThriftError } from "@cc-api"; | ||
import { ReportFilter, ReviewStatus } from "@cc/report-server-types"; | ||
import TooltipHelpIcon from "@/components/TooltipHelpIcon"; | ||
import { ReviewStatusIcon } from "@/components/Icons"; | ||
import { ReviewStatusMixin } from "@/mixins"; | ||
import { SelectOption, SelectedToolbarTitleItems } from "./SelectOption"; | ||
import BaseSelectOptionFilterMixin from "./BaseSelectOptionFilter.mixin"; | ||
export default { | ||
name: "ReportStatusFilter", | ||
components: { | ||
SelectOption, | ||
ReviewStatusIcon, | ||
SelectedToolbarTitleItems, | ||
TooltipHelpIcon | ||
}, | ||
mixins: [ BaseSelectOptionFilterMixin, ReviewStatusMixin ], | ||
data() { | ||
return { | ||
id: "report-status" | ||
}; | ||
}, | ||
methods: { | ||
encodeValue(reviewStatusId) { | ||
return this.reviewStatusFromCodeToString(reviewStatusId); | ||
}, | ||
decodeValue(reviewStatusName) { | ||
return this.reviewStatusFromStringToCode(reviewStatusName); | ||
}, | ||
updateReportFilter() { | ||
this.setReportFilter({ | ||
reportStatus: this.selectedItems.map(item => item.id) | ||
}); | ||
}, | ||
onReportFilterChange(key) { | ||
if (key === "reportStatus") return; | ||
this.update(); | ||
}, | ||
fetchItems() { | ||
this.loading = true; | ||
console.log(this.reportFilter); | ||
const reportFilter = new ReportFilter(this.reportFilter); | ||
reportFilter.reviewStatus = null; | ||
return new Promise(resolve => { | ||
ccService.getClient().getReviewStatusCounts(this.runIds, reportFilter, | ||
this.cmpData, handleThriftError(res => { | ||
resolve(Object.keys(ReviewStatus).map(status => { | ||
const id = ReviewStatus[status]; | ||
return { | ||
id: id, | ||
title: this.encodeValue(id), | ||
count: res[id] !== undefined ? res[id].toNumber() : 0 | ||
}; | ||
})); | ||
this.loading = false; | ||
})); | ||
}); | ||
} | ||
} | ||
}; | ||
</script> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters