Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
efc06841
Commit
efc06841
authored
Nov 17, 2021
by
Kev
Committed by
Savas Vedova
Nov 17, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove license compliance feature flag reference
parent
158e643f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
68 additions
and
125 deletions
+68
-125
ee/app/assets/javascripts/vue_shared/license_compliance/components/add_license_form.vue
...shared/license_compliance/components/add_license_form.vue
+2
-5
ee/app/assets/javascripts/vue_shared/license_compliance/license_management.vue
...ipts/vue_shared/license_compliance/license_management.vue
+26
-31
ee/spec/frontend/vue_shared/license_compliance/components/__snapshots__/add_license_form_spec.js.snap
...ce/components/__snapshots__/add_license_form_spec.js.snap
+0
-29
ee/spec/frontend/vue_shared/license_compliance/components/add_license_form_spec.js
...ed/license_compliance/components/add_license_form_spec.js
+19
-18
ee/spec/frontend/vue_shared/license_compliance/license_management_spec.js
.../vue_shared/license_compliance/license_management_spec.js
+18
-39
locale/gitlab.pot
locale/gitlab.pot
+3
-3
No files found.
ee/app/assets/javascripts/vue_shared/license_compliance/components/add_license_form.vue
View file @
efc06841
...
...
@@ -58,9 +58,6 @@ export default {
submitDisabled
()
{
return
this
.
isInvalidLicense
||
this
.
licenseName
.
trim
()
===
''
||
this
.
approvalStatus
===
''
;
},
isDescriptionEnabled
()
{
return
Boolean
(
this
.
glFeatures
.
licenseComplianceDeniesMr
);
},
},
methods
:
{
addLicense
()
{
...
...
@@ -99,10 +96,10 @@ export default {
:value=
"option.value"
:data-qa-selector=
"`$
{option.value}_license_radio`"
:aria-describedby="`js-${option.value}-license-radio`"
:class="{ 'mb-3': isDescriptionEnabled }
"
class="gl-mb-3
"
>
{{
option
.
label
}}
<div
v-if=
"isDescriptionEnabled"
class=
"text-secondary"
>
<div
class=
"text-secondary"
>
{{
option
.
description
}}
</div>
</gl-form-radio>
...
...
ee/app/assets/javascripts/vue_shared/license_compliance/license_management.vue
View file @
efc06841
...
...
@@ -46,9 +46,6 @@ export default {
showLoadingSpinner
()
{
return
this
.
isLoadingManagedLicenses
&&
!
this
.
hasPendingLicenses
;
},
isTooltipEnabled
()
{
return
Boolean
(
this
.
glFeatures
.
licenseComplianceDeniesMr
);
},
},
watch
:
{
isAddingNewLicense
(
isAddingNewLicense
)
{
...
...
@@ -104,36 +101,34 @@ export default {
</div>
<template
v-else
>
<div
class=
"table-section gl-d-flex gl-pl-2 section-70"
role=
"rowheader"
>
<div
class=
"table-section gl-d
isplay
-flex gl-pl-2 section-70"
role=
"rowheader"
>
{{
s__
(
'
Licenses|Policy
'
)
}}
<template
v-if=
"isTooltipEnabled"
>
<gl-icon
ref=
"reportInfo"
name=
"question"
class=
"text-info gl-ml-1 gl-cursor-pointer"
:aria-label=
"__('help')"
:size=
"14"
/>
<gl-popover
:target=
"() => $refs.reportInfo.$el"
placement=
"bottom"
triggers=
"click blur"
:css-classes=
"['gl-mt-3']"
<gl-icon
ref=
"reportInfo"
name=
"question"
class=
"text-info gl-ml-2 gl-cursor-pointer"
:aria-label=
"__('help')"
:size=
"14"
/>
<gl-popover
:target=
"() => $refs.reportInfo.$el"
placement=
"bottom"
triggers=
"click blur"
: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>
<span
class=
"text-secondary"
>
{{
s__
(
"
Licenses|Unacceptable license, if detected it will disallow a merge request until it's removed
"
,
)
}}
</span
>
<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>
<span
class=
"text-secondary"
>
{{
s__
(
'
Licenses|Disallow Merge request if detected and will instruct the developer to remove
'
,
)
}}
</span
>
</gl-popover>
</
template
>
</gl-popover>
</div>
<div
class=
"table-section section-30"
role=
"rowheader"
>
...
...
ee/spec/frontend/vue_shared/license_compliance/components/__snapshots__/add_license_form_spec.js.snap
deleted
100644 → 0
View file @
158e643f
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`AddLicenseForm template does not show radio button descriptions, if licenseComplianceDeniesMr feature flag is disabled 1`] = `
<gl-form-radio-stub
aria-describedby="js-approved-license-radio"
class=""
data-qa-selector="approved_license_radio"
value="approved"
>
Allow
<!---->
</gl-form-radio-stub>
`;
exports[`AddLicenseForm template does not show radio button descriptions, if licenseComplianceDeniesMr feature flag is disabled 2`] = `
<gl-form-radio-stub
aria-describedby="js-blacklisted-license-radio"
class=""
data-qa-selector="blacklisted_license_radio"
value="blacklisted"
>
Deny
<!---->
</gl-form-radio-stub>
`;
ee/spec/frontend/vue_shared/license_compliance/components/add_license_form_spec.js
View file @
efc06841
...
...
@@ -103,12 +103,25 @@ describe('AddLicenseForm', () => {
expect
(
dropdownElement
.
exists
()).
toBe
(
true
);
});
it
(
'
renders the license approval radio buttons dropdown
'
,
()
=>
{
const
approvalOptions
=
findRadioInputs
();
describe
(
'
license approval radio list
'
,
()
=>
{
it
(
'
renders the correct approval options
'
,
()
=>
{
const
approvalOptions
=
findRadioInputs
();
expect
(
approvalOptions
).
toHaveLength
(
2
);
expect
(
approvalOptions
.
at
(
0
).
text
()).
toBe
(
'
Allow
'
);
expect
(
approvalOptions
.
at
(
1
).
text
()).
toBe
(
'
Deny
'
);
expect
(
approvalOptions
).
toHaveLength
(
2
);
expect
(
approvalOptions
.
at
(
0
).
text
()).
toContain
(
'
Allow
'
);
expect
(
approvalOptions
.
at
(
1
).
text
()).
toContain
(
'
Deny
'
);
});
it
(
'
renders the approval option descriptions
'
,
()
=>
{
const
approvalOptions
=
findRadioInputs
();
expect
(
approvalOptions
.
at
(
0
).
text
()).
toContain
(
'
Acceptable license to be used in the project
'
,
);
expect
(
approvalOptions
.
at
(
1
).
text
()).
toContain
(
'
Disallow merge request if detected and will instruct developer to remove
'
,
);
});
});
it
(
'
renders error text, if there is a duplicate license
'
,
async
()
=>
{
...
...
@@ -123,15 +136,12 @@ describe('AddLicenseForm', () => {
expect
(
feedbackElement
.
text
()).
toBe
(
'
This license already exists in this project.
'
);
});
it
(
'
shows radio button descriptions
, if licenseComplianceDeniesMr feature flag is enabled
'
,
async
()
=>
{
it
(
'
shows radio button descriptions
'
,
async
()
=>
{
wrapper
=
shallowMount
(
LicenseIssueBody
,
{
propsData
:
{
managedLicenses
:
[{
name
:
'
FOO
'
}],
knownLicenses
:
KNOWN_LICENSES
,
},
provide
:
{
glFeatures
:
{
licenseComplianceDeniesMr
:
true
},
},
});
await
Vue
.
nextTick
();
...
...
@@ -145,15 +155,6 @@ describe('AddLicenseForm', () => {
);
});
it
(
'
does not show radio button descriptions, if licenseComplianceDeniesMr feature flag is disabled
'
,
()
=>
{
createComponent
({
managedLicenses
:
[{
name
:
'
FOO
'
}]
});
wrapper
.
setData
({
licenseName
:
'
FOO
'
});
return
Vue
.
nextTick
().
then
(()
=>
{
expect
(
findRadioInputs
().
at
(
0
).
element
).
toMatchSnapshot
();
expect
(
findRadioInputs
().
at
(
1
).
element
).
toMatchSnapshot
();
});
});
it
(
'
disables submit, if the form is invalid
'
,
async
()
=>
{
wrapper
.
setData
({
licenseName
:
''
});
await
Vue
.
nextTick
();
...
...
ee/spec/frontend/vue_shared/license_compliance/license_management_spec.js
View file @
efc06841
...
...
@@ -66,7 +66,6 @@ const createComponent = ({ state, getters, props, actionMocks, isAdmin, options,
PaginatedList
,
},
provide
:
{
glFeatures
:
{
licenseComplianceDeniesMr
:
false
},
...
provide
,
},
store
:
fakeStore
,
...
...
@@ -176,23 +175,15 @@ describe('License Management', () => {
});
});
describe
.
each
([
true
,
false
])(
'
when licenseComplianceDeniesMr feature flag is %p
'
,
(
licenseComplianceDeniesMr
)
=>
{
it
(
'
should not show the developer only tooltip
'
,
()
=>
{
createComponent
({
state
:
{
isLoadingManagedLicenses
:
false
},
isAdmin
:
true
,
provide
:
{
glFeatures
:
{
licenseComplianceDeniesMr
},
},
});
expect
(
findIcon
().
exists
()).
toBe
(
false
);
expect
(
findPopover
().
exists
()).
toBe
(
false
);
});
},
);
it
(
'
should not show the developer only tooltip
'
,
()
=>
{
createComponent
({
state
:
{
isLoadingManagedLicenses
:
false
},
isAdmin
:
true
,
});
expect
(
findIcon
().
exists
()).
toBe
(
false
);
expect
(
findPopover
().
exists
()).
toBe
(
false
);
});
});
describe
(
'
when developer
'
,
()
=>
{
...
...
@@ -232,27 +223,15 @@ describe('License Management', () => {
});
});
describe
.
each
`
licenseComplianceDeniesMr | should
${
true
}
|
${
'
should
'
}
${
false
}
|
${
'
should not
'
}
`
(
'
when licenseComplianceDeniesMr feature flag is $licenseComplianceDeniesMr
'
,
({
licenseComplianceDeniesMr
,
should
})
=>
{
it
(
`
${
should
}
show the developer only tooltip`
,
()
=>
{
createComponent
({
state
:
{
isLoadingManagedLicenses
:
false
},
isAdmin
:
false
,
provide
:
{
glFeatures
:
{
licenseComplianceDeniesMr
},
},
});
expect
(
findIcon
().
exists
()).
toBe
(
licenseComplianceDeniesMr
);
expect
(
findPopover
().
exists
()).
toBe
(
licenseComplianceDeniesMr
);
});
},
);
it
(
'
should show the developer only tooltip
'
,
()
=>
{
createComponent
({
state
:
{
isLoadingManagedLicenses
:
false
},
isAdmin
:
false
,
});
expect
(
findIcon
().
exists
()).
toBe
(
true
);
expect
(
findPopover
().
exists
()).
toBe
(
true
);
});
});
});
});
locale/gitlab.pot
View file @
efc06841
...
...
@@ -20748,9 +20748,6 @@ msgstr ""
msgid "Licenses|Detected licenses that are out-of-compliance with the project's assigned policies"
msgstr ""
msgid "Licenses|Disallow Merge request if detected and will instruct the developer to remove"
msgstr ""
msgid "Licenses|Displays licenses detected in the project, based on the %{linkStart}latest successful%{linkEnd} scan"
msgstr ""
...
...
@@ -20778,6 +20775,9 @@ msgstr ""
msgid "Licenses|The license list details information about the licenses used within your project."
msgstr ""
msgid "Licenses|Unacceptable license, if detected it will disallow a merge request until it's removed"
msgstr ""
msgid "Licenses|View license details for your project"
msgstr ""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment