Commit 621e7b07 authored by Fernando's avatar Fernando

Apply maintainer feedback

* Restructure vue templates
* Fix unit test
parent 08f51415
...@@ -131,26 +131,24 @@ export default { ...@@ -131,26 +131,24 @@ export default {
<template v-else>{{ s__('Licenses|Specified policies in this project') }}</template> <template v-else>{{ s__('Licenses|Specified policies in this project') }}</template>
</header> </header>
<template> <gl-tabs v-model="tabIndex" content-class="pt-0">
<gl-tabs v-model="tabIndex" content-class="pt-0"> <gl-tab data-testid="licensesTab">
<gl-tab data-testid="licensesTab"> <template #title>
<template #title> <span data-testid="licensesTabTitle">{{ s__('Licenses|Detected in Project') }}</span>
<span data-testid="licensesTabTitle">{{ s__('Licenses|Detected in Project') }}</span> <gl-badge pill>{{ licenseCount }}</gl-badge>
<gl-badge pill>{{ licenseCount }}</gl-badge> </template>
</template>
<detected-licenses-table /> <detected-licenses-table />
</gl-tab> </gl-tab>
<gl-tab data-testid="policiesTab"> <gl-tab data-testid="policiesTab">
<template #title> <template #title>
<span data-testid="policiesTabTitle">{{ s__('Licenses|Policies') }}</span> <span data-testid="policiesTabTitle">{{ s__('Licenses|Policies') }}</span>
<gl-badge pill>{{ policyCount }}</gl-badge> <gl-badge pill>{{ policyCount }}</gl-badge>
</template> </template>
<license-management /> <license-management />
</gl-tab> </gl-tab>
</gl-tabs> </gl-tabs>
</template>
</div> </div>
</template> </template>
...@@ -106,34 +106,34 @@ export default { ...@@ -106,34 +106,34 @@ export default {
<template v-else> <template v-else>
<div class="table-section gl-d-flex gl-pl-2 section-70" role="rowheader"> <div class="table-section gl-d-flex gl-pl-2 section-70" role="rowheader">
{{ s__('Licenses|Policy') }} {{ s__('Licenses|Policy') }}
<gl-icon <template v-if="isTooltipEnabled">
v-if="isTooltipEnabled" <gl-icon
ref="reportInfo" ref="reportInfo"
name="question" name="question"
class="text-info gl-ml-1 gl-cursor-pointer" class="text-info gl-ml-1 gl-cursor-pointer"
:aria-label="__('help')" :aria-label="__('help')"
:size="14" :size="14"
/> />
<gl-popover <gl-popover
v-if="isTooltipEnabled" :target="() => $refs.reportInfo.$el"
:target="() => $refs.reportInfo.$el" placement="bottom"
placement="bottom" triggers="click blur"
triggers="click blur" :css-classes="['gl-mt-3']"
:css-classes="['gl-mt-3']"
>
<div class="h5">{{ __('Allowed') }}</div>
<span class="text-secondary">
{{ s__('Licenses|Acceptable license to be used in the project') }}</span
> >
<div class="h5">{{ __('Denied') }}</div> <div class="h5">{{ __('Allowed') }}</div>
<span class="text-secondary"> <span class="text-secondary">
{{ {{ s__('Licenses|Acceptable license to be used in the project') }}</span
s__( >
'Licenses|Disallow Merge request if detected and will instruct the developer to remove', <div class="h5">{{ __('Denied') }}</div>
) <span class="text-secondary">
}}</span {{
> s__(
</gl-popover> 'Licenses|Disallow Merge request if detected and will instruct the developer to remove',
)
}}</span
>
</gl-popover>
</template>
</div> </div>
<div class="table-section section-30" role="rowheader"> <div class="table-section section-30" role="rowheader">
......
...@@ -199,11 +199,11 @@ describe('License Management', () => { ...@@ -199,11 +199,11 @@ describe('License Management', () => {
describe.each([true, false])( describe.each([true, false])(
'when licenseComplianceDeniesMr feature flag is %p', 'when licenseComplianceDeniesMr feature flag is %p',
({ licenseComplianceDeniesMr }) => { licenseComplianceDeniesMr => {
it('should not show the developer only tooltip', () => { it('should not show the developer only tooltip', () => {
createComponent({ createComponent({
state: { isLoadingManagedLicenses: false }, state: { isLoadingManagedLicenses: false },
isAdmin: false, isAdmin: true,
provide: { provide: {
glFeatures: { licenseComplianceDeniesMr }, glFeatures: { licenseComplianceDeniesMr },
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment