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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
269c0fe0
Commit
269c0fe0
authored
May 10, 2017
by
Filipa Lacerda
Committed by
Phil Hughes
May 10, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace old isObject for underscore methods
parent
1daa133c
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
18 additions
and
47 deletions
+18
-47
app/assets/javascripts/environments/components/environment_item.vue
.../javascripts/environments/components/environment_item.vue
+9
-23
app/assets/javascripts/gl_dropdown.js
app/assets/javascripts/gl_dropdown.js
+3
-2
app/assets/javascripts/lib/utils/type_utility.js
app/assets/javascripts/lib/utils/type_utility.js
+2
-15
app/assets/javascripts/main.js
app/assets/javascripts/main.js
+0
-1
changelogs/unreleased/remove-old-isobject.yml
changelogs/unreleased/remove-old-isobject.yml
+4
-0
spec/javascripts/blob/create_branch_dropdown_spec.js
spec/javascripts/blob/create_branch_dropdown_spec.js
+0
-1
spec/javascripts/blob/target_branch_dropdown_spec.js
spec/javascripts/blob/target_branch_dropdown_spec.js
+0
-1
spec/javascripts/gl_dropdown_spec.js
spec/javascripts/gl_dropdown_spec.js
+0
-1
spec/javascripts/labels_issue_sidebar_spec.js
spec/javascripts/labels_issue_sidebar_spec.js
+0
-1
spec/javascripts/project_title_spec.js
spec/javascripts/project_title_spec.js
+0
-1
spec/javascripts/search_autocomplete_spec.js
spec/javascripts/search_autocomplete_spec.js
+0
-1
No files found.
app/assets/javascripts/environments/components/environment_item.vue
View file @
269c0fe0
<
script
>
<
script
>
import
Timeago
from
'
timeago.js
'
;
import
Timeago
from
'
timeago.js
'
;
import
_
from
'
underscore
'
;
import
'
../../lib/utils/text_utility
'
;
import
'
../../lib/utils/text_utility
'
;
import
ActionsComponent
from
'
./environment_actions.vue
'
;
import
ActionsComponent
from
'
./environment_actions.vue
'
;
import
ExternalUrlComponent
from
'
./environment_external_url.vue
'
;
import
ExternalUrlComponent
from
'
./environment_external_url.vue
'
;
...
@@ -59,7 +60,7 @@ export default {
...
@@ -59,7 +60,7 @@ export default {
hasLastDeploymentKey
()
{
hasLastDeploymentKey
()
{
if
(
this
.
model
&&
if
(
this
.
model
&&
this
.
model
.
last_deployment
&&
this
.
model
.
last_deployment
&&
!
this
.
$options
.
isObject
Empty
(
this
.
model
.
last_deployment
))
{
!
_
.
is
Empty
(
this
.
model
.
last_deployment
))
{
return
true
;
return
true
;
}
}
return
false
;
return
false
;
...
@@ -310,8 +311,8 @@ export default {
...
@@ -310,8 +311,8 @@ export default {
*/
*/
deploymentHasUser
()
{
deploymentHasUser
()
{
return
this
.
model
&&
return
this
.
model
&&
!
this
.
$options
.
isObject
Empty
(
this
.
model
.
last_deployment
)
&&
!
_
.
is
Empty
(
this
.
model
.
last_deployment
)
&&
!
this
.
$options
.
isObject
Empty
(
this
.
model
.
last_deployment
.
user
);
!
_
.
is
Empty
(
this
.
model
.
last_deployment
.
user
);
},
},
/**
/**
...
@@ -322,8 +323,8 @@ export default {
...
@@ -322,8 +323,8 @@ export default {
*/
*/
deploymentUser
()
{
deploymentUser
()
{
if
(
this
.
model
&&
if
(
this
.
model
&&
!
this
.
$options
.
isObject
Empty
(
this
.
model
.
last_deployment
)
&&
!
_
.
is
Empty
(
this
.
model
.
last_deployment
)
&&
!
this
.
$options
.
isObject
Empty
(
this
.
model
.
last_deployment
.
user
))
{
!
_
.
is
Empty
(
this
.
model
.
last_deployment
.
user
))
{
return
this
.
model
.
last_deployment
.
user
;
return
this
.
model
.
last_deployment
.
user
;
}
}
return
{};
return
{};
...
@@ -338,8 +339,8 @@ export default {
...
@@ -338,8 +339,8 @@ export default {
*/
*/
shouldRenderBuildName
()
{
shouldRenderBuildName
()
{
return
!
this
.
model
.
isFolder
&&
return
!
this
.
model
.
isFolder
&&
!
this
.
$options
.
isObject
Empty
(
this
.
model
.
last_deployment
)
&&
!
_
.
is
Empty
(
this
.
model
.
last_deployment
)
&&
!
this
.
$options
.
isObject
Empty
(
this
.
model
.
last_deployment
.
deployable
);
!
_
.
is
Empty
(
this
.
model
.
last_deployment
.
deployable
);
},
},
/**
/**
...
@@ -380,7 +381,7 @@ export default {
...
@@ -380,7 +381,7 @@ export default {
*/
*/
shouldRenderDeploymentID
()
{
shouldRenderDeploymentID
()
{
return
!
this
.
model
.
isFolder
&&
return
!
this
.
model
.
isFolder
&&
!
this
.
$options
.
isObject
Empty
(
this
.
model
.
last_deployment
)
&&
!
_
.
is
Empty
(
this
.
model
.
last_deployment
)
&&
this
.
model
.
last_deployment
.
iid
!==
undefined
;
this
.
model
.
last_deployment
.
iid
!==
undefined
;
},
},
...
@@ -410,21 +411,6 @@ export default {
...
@@ -410,21 +411,6 @@ export default {
},
},
},
},
/**
* Helper to verify if certain given object are empty.
* Should be replaced by lodash _.isEmpty - https://lodash.com/docs/4.17.2#isEmpty
* @param {Object} object
* @returns {Bollean}
*/
isObjectEmpty
(
object
)
{
for
(
const
key
in
object
)
{
// eslint-disable-line
if
(
hasOwnProperty
.
call
(
object
,
key
))
{
return
false
;
}
}
return
true
;
},
methods
:
{
methods
:
{
onClickFolder
()
{
onClickFolder
()
{
eventHub
.
$emit
(
'
toggleFolder
'
,
this
.
model
,
this
.
folderUrl
);
eventHub
.
$emit
(
'
toggleFolder
'
,
this
.
model
,
this
.
folderUrl
);
...
...
app/assets/javascripts/gl_dropdown.js
View file @
269c0fe0
/* eslint-disable func-names, space-before-function-paren, no-var, one-var, one-var-declaration-per-line, prefer-rest-params, max-len, vars-on-top, wrap-iife, no-unused-vars, quotes, no-shadow, no-cond-assign, prefer-arrow-callback, no-return-assign, no-else-return, camelcase, comma-dangle, no-lonely-if, guard-for-in, no-restricted-syntax, consistent-return, prefer-template, no-param-reassign, no-loop-func, no-mixed-operators */
/* eslint-disable func-names, space-before-function-paren, no-var, one-var, one-var-declaration-per-line, prefer-rest-params, max-len, vars-on-top, wrap-iife, no-unused-vars, quotes, no-shadow, no-cond-assign, prefer-arrow-callback, no-return-assign, no-else-return, camelcase, comma-dangle, no-lonely-if, guard-for-in, no-restricted-syntax, consistent-return, prefer-template, no-param-reassign, no-loop-func, no-mixed-operators */
/* global fuzzaldrinPlus */
/* global fuzzaldrinPlus */
import
{
isObject
}
from
'
./lib/utils/type_utility
'
;
var
GitLabDropdown
,
GitLabDropdownFilter
,
GitLabDropdownRemote
;
var
GitLabDropdown
,
GitLabDropdownFilter
,
GitLabDropdownRemote
;
...
@@ -93,7 +94,7 @@ GitLabDropdownFilter = (function() {
...
@@ -93,7 +94,7 @@ GitLabDropdownFilter = (function() {
// { prop: 'def' }
// { prop: 'def' }
// ]
// ]
// }
// }
if
(
gl
.
utils
.
isObject
(
data
))
{
if
(
isObject
(
data
))
{
results
=
{};
results
=
{};
for
(
key
in
data
)
{
for
(
key
in
data
)
{
group
=
data
[
key
];
group
=
data
[
key
];
...
@@ -396,7 +397,7 @@ GitLabDropdown = (function() {
...
@@ -396,7 +397,7 @@ GitLabDropdown = (function() {
html
=
[
this
.
noResults
()];
html
=
[
this
.
noResults
()];
}
else
{
}
else
{
// Handle array groups
// Handle array groups
if
(
gl
.
utils
.
isObject
(
data
))
{
if
(
isObject
(
data
))
{
html
=
[];
html
=
[];
for
(
name
in
data
)
{
for
(
name
in
data
)
{
groupData
=
data
[
name
];
groupData
=
data
[
name
];
...
...
app/assets/javascripts/lib/utils/type_utility.js
View file @
269c0fe0
/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-var, no-param-reassign, no-cond-assign, no-return-assign, max-len */
// eslint-disable-next-line import/prefer-default-export
(
function
()
{
export
const
isObject
=
obj
=>
obj
&&
obj
.
constructor
===
Object
;
(
function
(
w
)
{
var
base
;
if
(
w
.
gl
==
null
)
{
w
.
gl
=
{};
}
if
((
base
=
w
.
gl
).
utils
==
null
)
{
base
.
utils
=
{};
}
return
w
.
gl
.
utils
.
isObject
=
function
(
obj
)
{
return
(
obj
!=
null
)
&&
(
obj
.
constructor
===
Object
);
};
})(
window
);
}).
call
(
window
);
app/assets/javascripts/main.js
View file @
269c0fe0
...
@@ -59,7 +59,6 @@ import './lib/utils/datetime_utility';
...
@@ -59,7 +59,6 @@ import './lib/utils/datetime_utility';
import
'
./lib/utils/notify
'
;
import
'
./lib/utils/notify
'
;
import
'
./lib/utils/pretty_time
'
;
import
'
./lib/utils/pretty_time
'
;
import
'
./lib/utils/text_utility
'
;
import
'
./lib/utils/text_utility
'
;
import
'
./lib/utils/type_utility
'
;
import
'
./lib/utils/url_utility
'
;
import
'
./lib/utils/url_utility
'
;
// u2f
// u2f
...
...
changelogs/unreleased/remove-old-isobject.yml
0 → 100644
View file @
269c0fe0
---
title
:
Remove unused code and uses underscore
merge_request
:
author
:
spec/javascripts/blob/create_branch_dropdown_spec.js
View file @
269c0fe0
require
(
'
~/gl_dropdown
'
);
require
(
'
~/gl_dropdown
'
);
require
(
'
~/lib/utils/type_utility
'
);
require
(
'
~/blob/create_branch_dropdown
'
);
require
(
'
~/blob/create_branch_dropdown
'
);
require
(
'
~/blob/target_branch_dropdown
'
);
require
(
'
~/blob/target_branch_dropdown
'
);
...
...
spec/javascripts/blob/target_branch_dropdown_spec.js
View file @
269c0fe0
require
(
'
~/gl_dropdown
'
);
require
(
'
~/gl_dropdown
'
);
require
(
'
~/lib/utils/type_utility
'
);
require
(
'
~/blob/create_branch_dropdown
'
);
require
(
'
~/blob/create_branch_dropdown
'
);
require
(
'
~/blob/target_branch_dropdown
'
);
require
(
'
~/blob/target_branch_dropdown
'
);
...
...
spec/javascripts/gl_dropdown_spec.js
View file @
269c0fe0
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
require
(
'
~/gl_dropdown
'
);
require
(
'
~/gl_dropdown
'
);
require
(
'
~/lib/utils/common_utils
'
);
require
(
'
~/lib/utils/common_utils
'
);
require
(
'
~/lib/utils/type_utility
'
);
require
(
'
~/lib/utils/url_utility
'
);
require
(
'
~/lib/utils/url_utility
'
);
(()
=>
{
(()
=>
{
...
...
spec/javascripts/labels_issue_sidebar_spec.js
View file @
269c0fe0
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
/* global IssuableContext */
/* global IssuableContext */
/* global LabelsSelect */
/* global LabelsSelect */
require
(
'
~/lib/utils/type_utility
'
);
require
(
'
~/gl_dropdown
'
);
require
(
'
~/gl_dropdown
'
);
require
(
'
select2
'
);
require
(
'
select2
'
);
require
(
'
vendor/jquery.nicescroll
'
);
require
(
'
vendor/jquery.nicescroll
'
);
...
...
spec/javascripts/project_title_spec.js
View file @
269c0fe0
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
/* global Project */
/* global Project */
require
(
'
select2/select2.js
'
);
require
(
'
select2/select2.js
'
);
require
(
'
~/lib/utils/type_utility
'
);
require
(
'
~/gl_dropdown
'
);
require
(
'
~/gl_dropdown
'
);
require
(
'
~/api
'
);
require
(
'
~/api
'
);
require
(
'
~/project_select
'
);
require
(
'
~/project_select
'
);
...
...
spec/javascripts/search_autocomplete_spec.js
View file @
269c0fe0
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
require
(
'
~/gl_dropdown
'
);
require
(
'
~/gl_dropdown
'
);
require
(
'
~/search_autocomplete
'
);
require
(
'
~/search_autocomplete
'
);
require
(
'
~/lib/utils/common_utils
'
);
require
(
'
~/lib/utils/common_utils
'
);
require
(
'
~/lib/utils/type_utility
'
);
require
(
'
vendor/fuzzaldrin-plus
'
);
require
(
'
vendor/fuzzaldrin-plus
'
);
(
function
()
{
(
function
()
{
...
...
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