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
Show 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
>
<
script
>
import
{
uniqueId
}
from
'
underscore
'
;
import
{
uniqueId
}
from
'
lodash
'
;
import
{
GlLink
,
GlIntersperse
,
GlModal
,
GlButton
,
GlModalDirective
}
from
'
@gitlab/ui
'
;
import
{
GlLink
,
GlIntersperse
,
GlModal
,
GlButton
,
GlModalDirective
}
from
'
@gitlab/ui
'
;
import
{
sprintf
,
s__
}
from
'
~/locale
'
;
import
{
sprintf
,
s__
}
from
'
~/locale
'
;
...
...
ee/app/assets/javascripts/project_licenses/components/pipeline_info.vue
View file @
4a995726
<
script
>
<
script
>
import
{
escape
}
from
'
underscore
'
;
import
{
escape
}
from
'
lodash
'
;
import
{
s__
,
sprintf
}
from
'
~/locale
'
;
import
{
s__
,
sprintf
}
from
'
~/locale
'
;
import
TimeAgoTooltip
from
'
~/vue_shared/components/time_ago_tooltip.vue
'
;
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
})
=>
{
export
const
getLicenseKey
=
({
id
})
=>
{
if
(
id
)
{
if
(
id
)
{
return
`id_
${
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 */
/* eslint-disable no-underscore-dangle, class-methods-use-this */
import
{
escape
as
esc
,
find
,
countBy
}
from
'
lodash
'
;
import
_
from
'
underscore
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
Flash
from
'
~/flash
'
;
import
Flash
from
'
~/flash
'
;
import
{
n__
,
s__
,
__
}
from
'
~/locale
'
;
import
{
n__
,
s__
,
__
}
from
'
~/locale
'
;
...
@@ -269,7 +268,7 @@ export default class AccessDropdown {
...
@@ -269,7 +268,7 @@ export default class AccessDropdown {
}
}
const
labelPieces
=
[];
const
labelPieces
=
[];
const
counts
=
_
.
countBy
(
currentItems
,
item
=>
item
.
type
);
const
counts
=
countBy
(
currentItems
,
item
=>
item
.
type
);
if
(
counts
[
LEVEL_TYPES
.
ROLE
]
>
0
)
{
if
(
counts
[
LEVEL_TYPES
.
ROLE
]
>
0
)
{
labelPieces
.
push
(
n__
(
'
1 role
'
,
'
%d roles
'
,
counts
[
LEVEL_TYPES
.
ROLE
]));
labelPieces
.
push
(
n__
(
'
1 role
'
,
'
%d roles
'
,
counts
[
LEVEL_TYPES
.
ROLE
]));
...
@@ -445,7 +444,7 @@ export default class AccessDropdown {
...
@@ -445,7 +444,7 @@ export default class AccessDropdown {
break
;
break
;
}
}
const
isActive
=
_
.
find
(
this
.
getSelectedItems
(),
criteria
)
?
'
is-active
'
:
''
;
const
isActive
=
find
(
this
.
getSelectedItems
(),
criteria
)
?
'
is-active
'
:
''
;
switch
(
item
.
type
)
{
switch
(
item
.
type
)
{
case
LEVEL_TYPES
.
USER
:
case
LEVEL_TYPES
.
USER
:
...
@@ -472,7 +471,7 @@ export default class AccessDropdown {
...
@@ -472,7 +471,7 @@ export default class AccessDropdown {
<li>
<li>
<a href="#" class="
${
isActiveClass
}
">
<a href="#" class="
${
isActiveClass
}
">
<img src="
${
user
.
avatar_url
}
" class="avatar avatar-inline" width="30">
<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>
<span class="dropdown-menu-user-username">
${
user
.
username
}
</span>
</a>
</a>
</li>
</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
...
@@ -7,9 +7,7 @@ import PaginatedLicensesTable from 'ee/project_licenses/components/paginated_lic
import
Pagination
from
'
~/vue_shared/components/pagination_links.vue
'
;
import
Pagination
from
'
~/vue_shared/components/pagination_links.vue
'
;
import
mockLicensesResponse
from
'
../store/modules/list/data/mock_licenses.json
'
;
import
mockLicensesResponse
from
'
../store/modules/list/data/mock_licenses.json
'
;
jest
.
mock
(
'
underscore
'
,
()
=>
({
jest
.
mock
(
'
lodash/uniqueId
'
,
()
=>
()
=>
'
fakeUniqueId
'
);
uniqueId
:
()
=>
'
fakeUniqueId
'
,
}));
describe
(
'
PaginatedLicensesTable component
'
,
()
=>
{
describe
(
'
PaginatedLicensesTable component
'
,
()
=>
{
const
namespace
=
LICENSE_LIST
;
const
namespace
=
LICENSE_LIST
;
...
...
ee/spec/frontend/project_licenses/utils/mappers_spec.js
View file @
4a995726
import
{
toLicenseObject
}
from
'
ee/project_licenses/utils/mappers
'
;
import
{
toLicenseObject
}
from
'
ee/project_licenses/utils/mappers
'
;
const
UNIQUE_ID
=
'
fakeUniqueId
'
;
const
UNIQUE_ID
=
'
fakeUniqueId
'
;
jest
.
mock
(
'
underscore
'
,
()
=>
({
jest
.
mock
(
'
lodash/uniqueId
'
,
()
=>
()
=>
'
fakeUniqueId
'
);
uniqueId
:
()
=>
'
fakeUniqueId
'
,
}));
describe
(
'
ee/project_licenses/utils/mappers
'
,
()
=>
{
describe
(
'
ee/project_licenses/utils/mappers
'
,
()
=>
{
describe
(
'
toLicenseObject
'
,
()
=>
{
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