Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport: Fix wrong policy violation tab indicator visibility conditions #1175

Merged
merged 1 commit into from
Feb 23, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 33 additions & 23 deletions src/views/portfolio/projects/Project.vue
Original file line number Diff line number Diff line change
Expand Up @@ -313,39 +313,43 @@
v-b-tooltip.hover
:title="$t('policy_violation.total')"
>{{
showSuppressedViolations
policyViolationsTotal
/*showSuppressedViolations
? policyViolationsTotal
: policyViolationsUnaudited
: policyViolationsUnaudited*/
}}</b-badge
>
<b-badge
variant="tab-info"
v-b-tooltip.hover
:title="$t('policy_violation.infos')"
>{{
showSuppressedViolations
policyViolationsInfoTotal
/*showSuppressedViolations
? policyViolationsInfoTotal
: policyViolationsInfoUnaudited
: policyViolationsInfoUnaudited*/
}}</b-badge
>
<b-badge
variant="tab-warn"
v-b-tooltip.hover
:title="$t('policy_violation.warns')"
>{{
showSuppressedViolations
policyViolationsWarnTotal
/*showSuppressedViolations
? policyViolationsWarnTotal
: policyViolationsWarnUnaudited
: policyViolationsWarnUnaudited*/
}}</b-badge
>
<b-badge
variant="tab-fail"
v-b-tooltip.hover
:title="$t('policy_violation.fails')"
>{{
showSuppressedViolations
policyViolationsFailTotal
/*showSuppressedViolations
? policyViolationsFailTotal
: policyViolationsFailUnaudited
: policyViolationsFailUnaudited*/
}}</b-badge
>
</template>
Expand Down Expand Up @@ -451,11 +455,14 @@ export default {
policyViolationsTotal: 0,
policyViolationsUnaudited: 0,
policyViolationsFailTotal: 0,
policyViolationsFailUnaudited: 0,
// TODO: Requires https://github.com/DependencyTrack/dependency-track/pull/3615.
// policyViolationsFailUnaudited: 0,
policyViolationsWarnTotal: 0,
policyViolationsWarnUnaudited: 0,
// TODO: Requires https://github.com/DependencyTrack/dependency-track/pull/3615.
// policyViolationsWarnUnaudited: 0,
policyViolationsInfoTotal: 0,
policyViolationsInfoUnaudited: 0,
// TODO: Requires https://github.com/DependencyTrack/dependency-track/pull/3615.
// policyViolationsInfoUnaudited: 0,
tabIndex: 0,
};
},
Expand Down Expand Up @@ -522,26 +529,29 @@ export default {
this.project.metrics.policyViolationsFail,
0,
);
this.policyViolationsFailUnaudited = common.valueWithDefault(
this.project.metrics.policyViolationsFailUnaudited,
0,
);
// TODO: Requires https://github.com/DependencyTrack/dependency-track/pull/3615.
// this.policyViolationsFailUnaudited = common.valueWithDefault(
// this.project.metrics.policyViolationsFailUnaudited,
// 0,
// );
this.policyViolationsWarnTotal = common.valueWithDefault(
this.project.metrics.policyViolationsWarn,
0,
);
this.policyViolationsWarnUnaudited = common.valueWithDefault(
this.project.metrics.policyViolationsWarnUnaudited,
0,
);
// TODO: Requires https://github.com/DependencyTrack/dependency-track/pull/3615.
// this.policyViolationsWarnUnaudited = common.valueWithDefault(
// this.project.metrics.policyViolationsWarnUnaudited,
// 0,
// );
this.policyViolationsInfoTotal = common.valueWithDefault(
this.project.metrics.policyViolationsInfo,
0,
);
this.policyViolationsInfoUnaudited = common.valueWithDefault(
this.project.metrics.policyViolationsInfoUnaudited,
0,
);
// TODO: Requires https://github.com/DependencyTrack/dependency-track/pull/3615.
// this.policyViolationsInfoUnaudited = common.valueWithDefault(
// this.project.metrics.policyViolationsInfoUnaudited,
// 0,
// );
EventBus.$emit('addCrumb', this.projectLabel);
this.$title = this.projectLabel;
});
Expand Down