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
4a995726
Commit
4a995726
authored
Mar 23, 2020
by
Jose Vargas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace underscore/lodash in ee/projects
parent
424778d6
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
10 additions
and
15 deletions
+10
-15
ee/app/assets/javascripts/project_licenses/components/license_component_links.vue
...s/project_licenses/components/license_component_links.vue
+1
-1
ee/app/assets/javascripts/project_licenses/components/pipeline_info.vue
...javascripts/project_licenses/components/pipeline_info.vue
+1
-1
ee/app/assets/javascripts/project_licenses/utils/mappers.js
ee/app/assets/javascripts/project_licenses/utils/mappers.js
+2
-2
ee/app/assets/javascripts/projects/settings/access_dropdown.js
...p/assets/javascripts/projects/settings/access_dropdown.js
+4
-5
ee/spec/frontend/project_licenses/components/paginated_licenses_table_spec.js
...ject_licenses/components/paginated_licenses_table_spec.js
+1
-3
ee/spec/frontend/project_licenses/utils/mappers_spec.js
ee/spec/frontend/project_licenses/utils/mappers_spec.js
+1
-3
No files found.
ee/app/assets/javascripts/project_licenses/components/license_component_links.vue
View file @
4a995726
<
script
>
import
{
uniqueId
}
from
'
underscore
'
;
import
{
uniqueId
}
from
'
lodash
'
;
import
{
GlLink
,
GlIntersperse
,
GlModal
,
GlButton
,
GlModalDirective
}
from
'
@gitlab/ui
'
;
import
{
sprintf
,
s__
}
from
'
~/locale
'
;
...
...
ee/app/assets/javascripts/project_licenses/components/pipeline_info.vue
View file @
4a995726
<
script
>
import
{
escape
}
from
'
underscore
'
;
import
{
escape
}
from
'
lodash
'
;
import
{
s__
,
sprintf
}
from
'
~/locale
'
;
import
TimeAgoTooltip
from
'
~/vue_shared/components/time_ago_tooltip.vue
'
;
...
...
ee/app/assets/javascripts/project_licenses/utils/mappers.js
View file @
4a995726
import
_
from
'
underscore
'
;
import
{
uniqueId
}
from
'
lodash
'
;
export
const
getLicenseKey
=
({
id
})
=>
{
if
(
id
)
{
return
`id_
${
id
}
`
;
}
return
`client_
${
_
.
uniqueId
()}
`
;
return
`client_
${
uniqueId
()}
`
;
};
/**
...
...
ee/app/assets/javascripts/projects/settings/access_dropdown.js
View file @
4a995726
/* eslint-disable no-underscore-dangle, class-methods-use-this */
import
_
from
'
underscore
'
;
import
{
escape
as
esc
,
find
,
countBy
}
from
'
lodash
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
Flash
from
'
~/flash
'
;
import
{
n__
,
s__
,
__
}
from
'
~/locale
'
;
...
...
@@ -269,7 +268,7 @@ export default class AccessDropdown {
}
const
labelPieces
=
[];
const
counts
=
_
.
countBy
(
currentItems
,
item
=>
item
.
type
);
const
counts
=
countBy
(
currentItems
,
item
=>
item
.
type
);
if
(
counts
[
LEVEL_TYPES
.
ROLE
]
>
0
)
{
labelPieces
.
push
(
n__
(
'
1 role
'
,
'
%d roles
'
,
counts
[
LEVEL_TYPES
.
ROLE
]));
...
...
@@ -445,7 +444,7 @@ export default class AccessDropdown {
break
;
}
const
isActive
=
_
.
find
(
this
.
getSelectedItems
(),
criteria
)
?
'
is-active
'
:
''
;
const
isActive
=
find
(
this
.
getSelectedItems
(),
criteria
)
?
'
is-active
'
:
''
;
switch
(
item
.
type
)
{
case
LEVEL_TYPES
.
USER
:
...
...
@@ -472,7 +471,7 @@ export default class AccessDropdown {
<li>
<a href="#" class="
${
isActiveClass
}
">
<img src="
${
user
.
avatar_url
}
" class="avatar avatar-inline" width="30">
<strong class="dropdown-menu-user-full-name">
${
_
.
escape
(
user
.
name
)}
</strong>
<strong class="dropdown-menu-user-full-name">
${
esc
(
user
.
name
)}
</strong>
<span class="dropdown-menu-user-username">
${
user
.
username
}
</span>
</a>
</li>
...
...
ee/spec/frontend/project_licenses/components/paginated_licenses_table_spec.js
View file @
4a995726
...
...
@@ -7,9 +7,7 @@ import PaginatedLicensesTable from 'ee/project_licenses/components/paginated_lic
import
Pagination
from
'
~/vue_shared/components/pagination_links.vue
'
;
import
mockLicensesResponse
from
'
../store/modules/list/data/mock_licenses.json
'
;
jest
.
mock
(
'
underscore
'
,
()
=>
({
uniqueId
:
()
=>
'
fakeUniqueId
'
,
}));
jest
.
mock
(
'
lodash/uniqueId
'
,
()
=>
()
=>
'
fakeUniqueId
'
);
describe
(
'
PaginatedLicensesTable component
'
,
()
=>
{
const
namespace
=
LICENSE_LIST
;
...
...
ee/spec/frontend/project_licenses/utils/mappers_spec.js
View file @
4a995726
import
{
toLicenseObject
}
from
'
ee/project_licenses/utils/mappers
'
;
const
UNIQUE_ID
=
'
fakeUniqueId
'
;
jest
.
mock
(
'
underscore
'
,
()
=>
({
uniqueId
:
()
=>
'
fakeUniqueId
'
,
}));
jest
.
mock
(
'
lodash/uniqueId
'
,
()
=>
()
=>
'
fakeUniqueId
'
);
describe
(
'
ee/project_licenses/utils/mappers
'
,
()
=>
{
describe
(
'
toLicenseObject
'
,
()
=>
{
...
...
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