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
Boxiang Sun
gitlab-ce
Commits
0bf740fa
Commit
0bf740fa
authored
Nov 21, 2018
by
Winnie Hellmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace `=== true` with `parseBoolean()`
parent
8ef51157
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
36 additions
and
18 deletions
+36
-18
app/assets/javascripts/behaviors/shortcuts/shortcuts.js
app/assets/javascripts/behaviors/shortcuts/shortcuts.js
+2
-1
app/assets/javascripts/boards/index.js
app/assets/javascripts/boards/index.js
+2
-2
app/assets/javascripts/boards/stores/boards_store.js
app/assets/javascripts/boards/stores/boards_store.js
+2
-2
app/assets/javascripts/contextual_sidebar.js
app/assets/javascripts/contextual_sidebar.js
+2
-1
app/assets/javascripts/diffs/store/modules/diff_state.js
app/assets/javascripts/diffs/store/modules/diff_state.js
+2
-1
app/assets/javascripts/groups/index.js
app/assets/javascripts/groups/index.js
+2
-1
app/assets/javascripts/header.js
app/assets/javascripts/header.js
+2
-1
app/assets/javascripts/landing.js
app/assets/javascripts/landing.js
+2
-1
app/assets/javascripts/merge_request_tabs.js
app/assets/javascripts/merge_request_tabs.js
+7
-2
app/assets/javascripts/namespace_select.js
app/assets/javascripts/namespace_select.js
+2
-1
app/assets/javascripts/pages/admin/abuse_reports/abuse_reports.js
...ts/javascripts/pages/admin/abuse_reports/abuse_reports.js
+2
-1
app/assets/javascripts/pages/profiles/two_factor_auths/index.js
...sets/javascripts/pages/profiles/two_factor_auths/index.js
+2
-1
app/assets/javascripts/pages/projects/pipeline_schedules/shared/components/pipeline_schedules_callout.vue
...chedules/shared/components/pipeline_schedules_callout.vue
+2
-1
app/assets/javascripts/performance_bar/services/performance_bar_service.js
...ripts/performance_bar/services/performance_bar_service.js
+3
-1
app/assets/javascripts/profile/profile.js
app/assets/javascripts/profile/profile.js
+2
-1
No files found.
app/assets/javascripts/behaviors/shortcuts/shortcuts.js
View file @
0bf740fa
...
...
@@ -4,6 +4,7 @@ import Mousetrap from 'mousetrap';
import
axios
from
'
../../lib/utils/axios_utils
'
;
import
{
refreshCurrentPage
,
visitUrl
}
from
'
../../lib/utils/url_utility
'
;
import
findAndFollowLink
from
'
../../lib/utils/navigation_utility
'
;
import
{
parseBoolean
}
from
'
~/lib/utils/common_utils
'
;
const
defaultStopCallback
=
Mousetrap
.
stopCallback
;
Mousetrap
.
stopCallback
=
(
e
,
element
,
combo
)
=>
{
...
...
@@ -61,7 +62,7 @@ export default class Shortcuts {
static
onTogglePerfBar
(
e
)
{
e
.
preventDefault
();
const
performanceBarCookieName
=
'
perf_bar_enabled
'
;
if
(
Cookies
.
get
(
performanceBarCookieName
)
===
'
true
'
)
{
if
(
parseBoolean
(
Cookies
.
get
(
performanceBarCookieName
))
)
{
Cookies
.
set
(
performanceBarCookieName
,
'
false
'
,
{
path
:
'
/
'
});
}
else
{
Cookies
.
set
(
performanceBarCookieName
,
'
true
'
,
{
path
:
'
/
'
});
...
...
app/assets/javascripts/boards/index.js
View file @
0bf740fa
...
...
@@ -24,7 +24,7 @@ import BoardSidebar from './components/board_sidebar';
import
initNewListDropdown
from
'
./components/new_list_dropdown
'
;
import
BoardAddIssuesModal
from
'
./components/modal/index.vue
'
;
import
'
~/vue_shared/vue_resource_interceptor
'
;
import
{
NavigationType
}
from
'
~/lib/utils/common_utils
'
;
import
{
NavigationType
,
parseBoolean
}
from
'
~/lib/utils/common_utils
'
;
let
issueBoardsApp
;
...
...
@@ -60,7 +60,7 @@ export default () => {
boardsEndpoint
:
$boardApp
.
dataset
.
boardsEndpoint
,
listsEndpoint
:
$boardApp
.
dataset
.
listsEndpoint
,
boardId
:
$boardApp
.
dataset
.
boardId
,
disabled
:
$boardApp
.
dataset
.
disabled
===
'
true
'
,
disabled
:
parseBoolean
(
$boardApp
.
dataset
.
disabled
)
,
issueLinkBase
:
$boardApp
.
dataset
.
issueLinkBase
,
rootPath
:
$boardApp
.
dataset
.
rootPath
,
bulkUpdatePath
:
$boardApp
.
dataset
.
bulkUpdatePath
,
...
...
app/assets/javascripts/boards/stores/boards_store.js
View file @
0bf740fa
...
...
@@ -5,7 +5,7 @@ import $ from 'jquery';
import
_
from
'
underscore
'
;
import
Vue
from
'
vue
'
;
import
Cookies
from
'
js-cookie
'
;
import
{
getUrlParamsArray
}
from
'
~/lib/utils/common_utils
'
;
import
{
getUrlParamsArray
,
parseBoolean
}
from
'
~/lib/utils/common_utils
'
;
const
boardsStore
=
{
disabled
:
false
,
...
...
@@ -78,7 +78,7 @@ const boardsStore = {
});
},
welcomeIsHidden
()
{
return
Cookies
.
get
(
'
issue_board_welcome_hidden
'
)
===
'
true
'
;
return
parseBoolean
(
Cookies
.
get
(
'
issue_board_welcome_hidden
'
))
;
},
removeList
(
id
,
type
=
'
blank
'
)
{
const
list
=
this
.
findList
(
'
id
'
,
id
,
type
);
...
...
app/assets/javascripts/contextual_sidebar.js
View file @
0bf740fa
...
...
@@ -2,6 +2,7 @@ import $ from 'jquery';
import
Cookies
from
'
js-cookie
'
;
import
_
from
'
underscore
'
;
import
bp
from
'
./breakpoints
'
;
import
{
parseBoolean
}
from
'
~/lib/utils/common_utils
'
;
export
default
class
ContextualSidebar
{
constructor
()
{
...
...
@@ -78,7 +79,7 @@ export default class ContextualSidebar {
if
(
breakpoint
===
'
sm
'
||
breakpoint
===
'
md
'
)
{
this
.
toggleCollapsedSidebar
(
true
);
}
else
if
(
breakpoint
===
'
lg
'
)
{
const
collapse
=
Cookies
.
get
(
'
sidebar_collapsed
'
)
===
'
true
'
;
const
collapse
=
parseBoolean
(
Cookies
.
get
(
'
sidebar_collapsed
'
))
;
this
.
toggleCollapsedSidebar
(
collapse
);
}
}
...
...
app/assets/javascripts/diffs/store/modules/diff_state.js
View file @
0bf740fa
import
Cookies
from
'
js-cookie
'
;
import
{
getParameterValues
}
from
'
~/lib/utils/url_utility
'
;
import
bp
from
'
~/breakpoints
'
;
import
{
parseBoolean
}
from
'
~/lib/utils/common_utils
'
;
import
{
INLINE_DIFF_VIEW_TYPE
,
DIFF_VIEW_COOKIE_NAME
,
MR_TREE_SHOW_KEY
}
from
'
../../constants
'
;
const
viewTypeFromQueryString
=
getParameterValues
(
'
view
'
)[
0
];
...
...
@@ -22,7 +23,7 @@ export default () => ({
tree
:
[],
treeEntries
:
{},
showTreeList
:
storedTreeShow
===
null
?
bp
.
getBreakpointSize
()
!==
'
xs
'
:
storedTreeShow
===
'
true
'
,
storedTreeShow
===
null
?
bp
.
getBreakpointSize
()
!==
'
xs
'
:
parseBoolean
(
storedTreeShow
)
,
currentDiffFileId
:
''
,
projectPath
:
''
,
commentForms
:
[],
...
...
app/assets/javascripts/groups/index.js
View file @
0bf740fa
import
Vue
from
'
vue
'
;
import
{
parseBoolean
}
from
'
~/lib/utils/common_utils
'
;
import
Translate
from
'
../vue_shared/translate
'
;
import
GroupFilterableList
from
'
./groups_filterable_list
'
;
import
GroupsStore
from
'
./store/groups_store
'
;
...
...
@@ -38,7 +39,7 @@ export default (containerId = 'js-groups-tree', endpoint, action = '') => {
},
data
()
{
const
{
dataset
}
=
dataEl
||
this
.
$options
.
el
;
const
hideProjects
=
dataset
.
hideProjects
===
'
true
'
;
const
hideProjects
=
parseBoolean
(
dataset
.
hideProjects
)
;
const
service
=
new
GroupsService
(
endpoint
||
dataset
.
endpoint
);
const
store
=
new
GroupsStore
(
hideProjects
);
...
...
app/assets/javascripts/header.js
View file @
0bf740fa
...
...
@@ -4,6 +4,7 @@ import Translate from '~/vue_shared/translate';
import
{
highCountTrim
}
from
'
~/lib/utils/text_utility
'
;
import
SetStatusModalTrigger
from
'
./set_status_modal/set_status_modal_trigger.vue
'
;
import
SetStatusModalWrapper
from
'
./set_status_modal/set_status_modal_wrapper.vue
'
;
import
{
parseBoolean
}
from
'
~/lib/utils/common_utils
'
;
/**
* Updates todo counter when todos are toggled.
...
...
@@ -36,7 +37,7 @@ document.addEventListener('DOMContentLoaded', () => {
const
{
hasStatus
}
=
this
.
$options
.
el
.
dataset
;
return
{
hasStatus
:
hasStatus
===
'
true
'
,
hasStatus
:
parseBoolean
(
hasStatus
)
,
};
},
render
(
createElement
)
{
...
...
app/assets/javascripts/landing.js
View file @
0bf740fa
import
Cookies
from
'
js-cookie
'
;
import
{
parseBoolean
}
from
'
~/lib/utils/common_utils
'
;
class
Landing
{
constructor
(
landingElement
,
dismissButton
,
cookieName
)
{
...
...
@@ -30,7 +31,7 @@ class Landing {
}
isDismissed
()
{
return
Cookies
.
get
(
this
.
cookieName
)
===
'
true
'
;
return
parseBoolean
(
Cookies
.
get
(
this
.
cookieName
))
;
}
}
...
...
app/assets/javascripts/merge_request_tabs.js
View file @
0bf740fa
...
...
@@ -8,7 +8,12 @@ import flash from './flash';
import
BlobForkSuggestion
from
'
./blob/blob_fork_suggestion
'
;
import
initChangesDropdown
from
'
./init_changes_dropdown
'
;
import
bp
from
'
./breakpoints
'
;
import
{
parseUrlPathname
,
handleLocationHash
,
isMetaClick
}
from
'
./lib/utils/common_utils
'
;
import
{
parseUrlPathname
,
handleLocationHash
,
isMetaClick
,
parseBoolean
,
}
from
'
./lib/utils/common_utils
'
;
import
{
isInVueNoteablePage
}
from
'
./lib/utils/dom_utils
'
;
import
{
getLocationHash
}
from
'
./lib/utils/url_utility
'
;
import
Diff
from
'
./diff
'
;
...
...
@@ -440,7 +445,7 @@ export default class MergeRequestTabs {
// Expand the issuable sidebar unless the user explicitly collapsed it
expandView
()
{
if
(
Cookies
.
get
(
'
collapsed_gutter
'
)
===
'
true
'
)
{
if
(
parseBoolean
(
Cookies
.
get
(
'
collapsed_gutter
'
))
)
{
return
;
}
const
$gutterIcon
=
$
(
'
.js-sidebar-toggle i:visible
'
);
...
...
app/assets/javascripts/namespace_select.js
View file @
0bf740fa
...
...
@@ -3,10 +3,11 @@
import
$
from
'
jquery
'
;
import
Api
from
'
./api
'
;
import
{
mergeUrlParams
}
from
'
./lib/utils/url_utility
'
;
import
{
parseBoolean
}
from
'
~/lib/utils/common_utils
'
;
export
default
class
NamespaceSelect
{
constructor
(
opts
)
{
const
isFilter
=
opts
.
dropdown
.
dataset
.
isFilter
===
'
true
'
;
const
isFilter
=
parseBoolean
(
opts
.
dropdown
.
dataset
.
isFilter
)
;
const
fieldName
=
opts
.
dropdown
.
dataset
.
fieldName
||
'
namespace_id
'
;
$
(
opts
.
dropdown
).
glDropdown
({
...
...
app/assets/javascripts/pages/admin/abuse_reports/abuse_reports.js
View file @
0bf740fa
import
$
from
'
jquery
'
;
import
{
truncate
}
from
'
../../../lib/utils/text_utility
'
;
import
{
parseBoolean
}
from
'
~/lib/utils/common_utils
'
;
const
MAX_MESSAGE_LENGTH
=
500
;
const
MESSAGE_CELL_SELECTOR
=
'
.abuse-reports .message
'
;
...
...
@@ -26,7 +27,7 @@ export default class AbuseReports {
const
$messageCellElement
=
$
(
this
);
const
originalMessage
=
$messageCellElement
.
data
(
'
originalMessage
'
);
if
(
!
originalMessage
)
return
;
if
(
$messageCellElement
.
data
(
'
messageTruncated
'
)
===
'
true
'
)
{
if
(
parseBoolean
(
$messageCellElement
.
data
(
'
messageTruncated
'
))
)
{
$messageCellElement
.
data
(
'
messageTruncated
'
,
'
false
'
);
$messageCellElement
.
text
(
originalMessage
);
}
else
{
...
...
app/assets/javascripts/pages/profiles/two_factor_auths/index.js
View file @
0bf740fa
import
$
from
'
jquery
'
;
import
U2FRegister
from
'
~/u2f/register
'
;
import
{
parseBoolean
}
from
'
~/lib/utils/common_utils
'
;
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
const
twoFactorNode
=
document
.
querySelector
(
'
.js-two-factor-auth
'
);
const
skippable
=
twoFactorNode
.
dataset
.
twoFactorSkippable
===
'
true
'
;
const
skippable
=
parseBoolean
(
twoFactorNode
.
dataset
.
twoFactorSkippable
)
;
if
(
skippable
)
{
const
button
=
`<a class="btn btn-sm btn-warning float-right" data-method="patch" href="
${
twoFactorNode
.
dataset
.
two_factor_skip_url
...
...
app/assets/javascripts/pages/projects/pipeline_schedules/shared/components/pipeline_schedules_callout.vue
View file @
0bf740fa
...
...
@@ -3,6 +3,7 @@ import Vue from 'vue';
import
Cookies
from
'
js-cookie
'
;
import
Translate
from
'
../../../../../vue_shared/translate
'
;
import
illustrationSvg
from
'
../icons/intro_illustration.svg
'
;
import
{
parseBoolean
}
from
'
~/lib/utils/common_utils
'
;
Vue
.
use
(
Translate
);
...
...
@@ -13,7 +14,7 @@ export default {
data
()
{
return
{
docsUrl
:
document
.
getElementById
(
'
pipeline-schedules-callout
'
).
dataset
.
docsUrl
,
calloutDismissed
:
Cookies
.
get
(
cookieKey
)
===
'
true
'
,
calloutDismissed
:
parseBoolean
(
Cookies
.
get
(
cookieKey
))
,
};
},
created
()
{
...
...
app/assets/javascripts/performance_bar/services/performance_bar_service.js
View file @
0bf740fa
import
Vue
from
'
vue
'
;
import
_
from
'
underscore
'
;
import
axios
from
'
../../lib/utils/axios_utils
'
;
import
{
parseBoolean
}
from
'
~/lib/utils/common_utils
'
;
let
vueResourceInterceptor
;
...
...
@@ -41,7 +42,8 @@ export default class PerformanceBarService {
// Vue Resource.
const
requestUrl
=
(
response
.
config
||
response
).
url
;
const
apiRequest
=
requestUrl
&&
requestUrl
.
match
(
/^
\/
api
\/
/
);
const
cachedResponse
=
response
.
headers
&&
response
.
headers
[
'
x-gitlab-from-cache
'
]
===
'
true
'
;
const
cachedResponse
=
response
.
headers
&&
parseBoolean
(
response
.
headers
[
'
x-gitlab-from-cache
'
]);
const
fireCallback
=
requestUrl
!==
peekUrl
&&
requestId
&&
!
apiRequest
&&
!
cachedResponse
;
return
[
fireCallback
,
requestId
,
requestUrl
];
...
...
app/assets/javascripts/profile/profile.js
View file @
0bf740fa
import
$
from
'
jquery
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
flash
from
'
../flash
'
;
import
{
parseBoolean
}
from
'
~/lib/utils/common_utils
'
;
export
default
class
Profile
{
constructor
({
form
}
=
{})
{
...
...
@@ -80,7 +81,7 @@ export default class Profile {
setRepoRadio
()
{
const
multiEditRadios
=
$
(
'
input[name="user[multi_file]"]
'
);
if
(
this
.
newRepoActivated
||
this
.
newRepoActivated
===
'
true
'
)
{
if
(
parseBoolean
(
this
.
newRepoActivated
)
)
{
multiEditRadios
.
filter
(
'
[value=on]
'
).
prop
(
'
checked
'
,
true
);
}
else
{
multiEditRadios
.
filter
(
'
[value=off]
'
).
prop
(
'
checked
'
,
true
);
...
...
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