Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/showing-closed-reports' into sho…
Browse files Browse the repository at this point in the history
…wing-closed-reports
  • Loading branch information
cservakt committed May 15, 2024
2 parents 73982bf + 837fdf2 commit 0423656
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 41 deletions.
Binary file modified web/api/py/codechecker_api/dist/codechecker_api.tar.gz
Binary file not shown.
Binary file not shown.
40 changes: 19 additions & 21 deletions web/server/codechecker_server/api/report_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,24 +302,26 @@ def process_report_filter(
AND.append(or_(*OR))

if report_filter.reportStatus:
print("itt")
# DetectionStatus.NEW DetectionStatus.RESOLVED DetectionStatus.UNRESOLVED DetectionStatus.REOPENED DetectionStatus.OFF DetectionStatus.UNAVAILABLE:
# ReviewStatus.UNREVIEWED ReviewStatus.CONFIRMED ReviewStatus.FALSE_POSITIVE ReviewStatus.INTENTIONAL:
dst = list(map(detection_status_str,
(DetectionStatus.NEW,
DetectionStatus.UNRESOLVED,
DetectionStatus.REOPENED)))
rst = list(map(review_status_str,
(ReviewStatus.UNREVIEWED,
ReviewStatus.CONFIRMED)))

(API_ReviewStatus.UNREVIEWED,
API_ReviewStatus.CONFIRMED)))

OR = []
filter_query = and_(
Report.review_status.in_(rst),
Report.detection_status.in_(dst)
)
if ReportStatus.OUTSTANDING in report_filter.reportStatus:
AND.append(and_(Report.review_status.in_(rst), Report.detection_status.in_(dst)))
OR.append(filter_query)

if ReportStatus.CLOSED in report_filter.reportStatus:
AND.append(not_(and_(Report.review_status.in_(rst), Report.detection_status.in_(dst))))
print("teszt")
print(*AND)
OR.append(not_(filter_query))

AND.append(or_(*OR))

if report_filter.detectionStatus and not report_filter.reportStatus:
dst = list(map(detection_status_str,
Expand Down Expand Up @@ -1887,9 +1889,6 @@ def getDiffResultsHash(self, run_ids, report_hashes, diff_type,
@timeit
def getRunResults(self, run_ids, limit, offset, sort_types,
report_filter, cmp_data, get_details):
if report_filter.detectionStatus:
print("report_filter")
print(report_filter.detectionStatus)
self.__require_view()

limit = verify_limit_range(limit)
Expand Down Expand Up @@ -3308,19 +3307,19 @@ def getReportStatusCounts(self, run_ids, report_filter, cmp_data):

extended_table = extended_table.subquery()

is_opened_case = get_is_opened_case(extended_table)

is_outstanding_case = get_is_opened_case(extended_table)
case_label = "isOutstanding"

if report_filter.isUnique:
q = session.query(
is_opened_case.label("isOpened"),
is_outstanding_case.label(case_label),
func.count(extended_table.c.bug_id.distinct())) \
.group_by(is_opened_case)
.group_by(is_outstanding_case)
else:
q = session.query(
is_opened_case.label("isOpened"),
is_outstanding_case.label(case_label),
func.count(extended_table.c.bug_id)) \
.group_by(is_opened_case)
.group_by(is_outstanding_case)

# return {ReportStatus.OUTSTANDING if isOutstanding
# else ReportStatus.CLOSED: count
Expand All @@ -3329,8 +3328,7 @@ def getReportStatusCounts(self, run_ids, report_filter, cmp_data):
report_status_enum("outstanding" if isOutstanding
else "closed"): count
for isOutstanding, count in q}
print("results")
print(results)

return results


Expand Down
4 changes: 2 additions & 2 deletions web/server/vue-cli/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ export default {
this.loading = true;
const reportFilter = new ReportFilter(this.reportFilter);
reportFilter.reportStatus = null;
return new Promise(resolve => {
ccService.getClient().getReportStatusCounts(this.runIds, reportFilter,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,18 @@
</template>

<template #item.closed="{ item }">
<span>
<span v-if="item.closed">
<router-link
:to="{ name: 'reports', query: {
...$router.currentRoute.query,
...getBaseQueryParams(item),
'report-status': reportStatusFromCodeToString(ReportStatus.CLOSED)
}}"
>
{{ item.closed }}
</router-link>
</span>
<span v-else>
{{ item.closed }}
</span>
</template>
Expand All @@ -307,15 +318,18 @@
:to="{ name: 'reports', query: {
...$router.currentRoute.query,
...getBaseQueryParams(item),
'review-status': [
reviewStatusFromCodeToString(ReviewStatus.UNREVIEWED),
reviewStatusFromCodeToString(ReviewStatus.CONFIRMED)
],
'detection-status': [
detectionStatusFromCodeToString(DetectionStatus.NEW),
detectionStatusFromCodeToString(DetectionStatus.REOPENED),
detectionStatusFromCodeToString(DetectionStatus.UNRESOLVED)
]
// 'review-status': [
// reviewStatusFromCodeToString(ReviewStatus.UNREVIEWED),
// reviewStatusFromCodeToString(ReviewStatus.CONFIRMED)
// ],
// 'detection-status': [
// detectionStatusFromCodeToString(DetectionStatus.NEW),
// detectionStatusFromCodeToString(DetectionStatus.REOPENED),
// detectionStatusFromCodeToString(DetectionStatus.UNRESOLVED)
// ]
'report-status': reportStatusFromCodeToString(
ReportStatus.OUTSTANDING
)
}}"
>
{{ item.outstanding }}
Expand Down Expand Up @@ -351,14 +365,19 @@
</template>

<script>
import { DetectionStatus, ReviewStatus } from "@cc/report-server-types";
import {
DetectionStatus,
ReportStatus,
ReviewStatus
} from "@cc/report-server-types";
import {
DetectionStatusIcon,
ReviewStatusIcon,
SeverityIcon
} from "@/components/Icons";
import {
DetectionStatusMixin,
ReportStatusMixin,
ReviewStatusMixin,
SeverityMixin
} from "@/mixins";
Expand All @@ -376,7 +395,12 @@ export default {
SeverityIcon,
SourceComponentTooltip
},
mixins: [ DetectionStatusMixin, ReviewStatusMixin, SeverityMixin ],
mixins: [
DetectionStatusMixin,
ReportStatusMixin,
ReviewStatusMixin,
SeverityMixin
],
props: {
items: { type: Array, required: true },
colspan: { type: Number, default: 2 },
Expand All @@ -389,8 +413,9 @@ export default {
},
data() {
return {
ReviewStatus,
DetectionStatus
DetectionStatus,
ReportStatus,
ReviewStatus
};
},
computed: {
Expand Down
4 changes: 1 addition & 3 deletions web/server/vue-cli/src/views/Reports.vue
Original file line number Diff line number Diff line change
Expand Up @@ -490,9 +490,7 @@ export default {
const offset = limit * (this.pagination.page - 1);
const sortType = this.getSortMode();
const getDetails = false;
this.reportFilter.detectionStatus = [ 1 ];
console.log(this.reportFilter.reportStatus);
console.log(this.reportFilter.detectionStatus);
ccService.getClient().getRunResults(this.runIds, limit, offset, sortType,
this.reportFilter, this.cmpData, getDetails,
handleThriftError(reports => {
Expand Down

0 comments on commit 0423656

Please sign in to comment.