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
9f4b4de2
Commit
9f4b4de2
authored
Dec 23, 2020
by
Lukas Eipert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run prettier on 32 files - 30 of 73
Part of our prettier migration; changing the arrow-parens style.
parent
0a8f575e
Changes
33
Show whitespace changes
Inline
Side-by-side
Showing
33 changed files
with
87 additions
and
121 deletions
+87
-121
.prettierignore
.prettierignore
+0
-34
app/assets/javascripts/user_lists/store/show/actions.js
app/assets/javascripts/user_lists/store/show/actions.js
+2
-2
app/assets/javascripts/user_lists/store/show/index.js
app/assets/javascripts/user_lists/store/show/index.js
+1
-1
app/assets/javascripts/user_lists/store/show/mutations.js
app/assets/javascripts/user_lists/store/show/mutations.js
+2
-2
app/assets/javascripts/user_popovers.js
app/assets/javascripts/user_popovers.js
+4
-4
app/assets/javascripts/users_select/index.js
app/assets/javascripts/users_select/index.js
+18
-18
app/assets/javascripts/vue_alerts.js
app/assets/javascripts/vue_alerts.js
+1
-1
app/assets/javascripts/vue_merge_request_widget/components/approvals/approvals.vue
...e_merge_request_widget/components/approvals/approvals.vue
+3
-3
app/assets/javascripts/vue_merge_request_widget/components/deployment/deployment_actions.vue
...quest_widget/components/deployment/deployment_actions.vue
+1
-1
app/assets/javascripts/vue_merge_request_widget/components/deployment/deployment_view_button.vue
...t_widget/components/deployment/deployment_view_button.vue
+1
-1
app/assets/javascripts/vue_merge_request_widget/components/deployment/memory_usage.vue
...rge_request_widget/components/deployment/memory_usage.vue
+3
-3
app/assets/javascripts/vue_merge_request_widget/components/extensions/base.vue
...s/vue_merge_request_widget/components/extensions/base.vue
+4
-4
app/assets/javascripts/vue_merge_request_widget/components/extensions/container.js
...e_merge_request_widget/components/extensions/container.js
+1
-1
app/assets/javascripts/vue_merge_request_widget/components/extensions/index.js
...s/vue_merge_request_widget/components/extensions/index.js
+1
-1
app/assets/javascripts/vue_merge_request_widget/components/mr_widget_alert_message.vue
...rge_request_widget/components/mr_widget_alert_message.vue
+1
-1
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_auto_merge_enabled.vue
...widget/components/states/mr_widget_auto_merge_enabled.vue
+4
-4
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_conflicts.vue
..._request_widget/components/states/mr_widget_conflicts.vue
+2
-2
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_merged.vue
...rge_request_widget/components/states/mr_widget_merged.vue
+2
-2
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_missing_branch.vue
...est_widget/components/states/mr_widget_missing_branch.vue
+1
-1
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_rebase.vue
...rge_request_widget/components/states/mr_widget_rebase.vue
+3
-3
app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue
...merge_request_widget/components/states/ready_to_merge.vue
+6
-6
app/assets/javascripts/vue_merge_request_widget/components/states/squash_before_merge.vue
..._request_widget/components/states/squash_before_merge.vue
+1
-1
app/assets/javascripts/vue_merge_request_widget/components/states/work_in_progress.vue
...rge_request_widget/components/states/work_in_progress.vue
+4
-4
app/assets/javascripts/vue_merge_request_widget/components/terraform/mr_widget_terraform_container.vue
...et/components/terraform/mr_widget_terraform_container.vue
+1
-1
app/assets/javascripts/vue_merge_request_widget/extensions/issues.js
...javascripts/vue_merge_request_widget/extensions/issues.js
+1
-1
app/assets/javascripts/vue_merge_request_widget/mixins/approvals.js
.../javascripts/vue_merge_request_widget/mixins/approvals.js
+1
-1
app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue
...avascripts/vue_merge_request_widget/mr_widget_options.vue
+6
-6
app/assets/javascripts/vue_merge_request_widget/services/mr_widget_service.js
...ts/vue_merge_request_widget/services/mr_widget_service.js
+3
-3
app/assets/javascripts/vue_merge_request_widget/stores/artifacts_list/getters.js
...vue_merge_request_widget/stores/artifacts_list/getters.js
+1
-1
app/assets/javascripts/vue_shared/components/actions_button.vue
...sets/javascripts/vue_shared/components/actions_button.vue
+1
-1
app/assets/javascripts/vue_shared/components/awards_list.vue
app/assets/javascripts/vue_shared/components/awards_list.vue
+4
-4
app/assets/javascripts/vue_shared/components/commit.vue
app/assets/javascripts/vue_shared/components/commit.vue
+1
-1
app/assets/javascripts/vue_shared/components/confirm_modal.vue
...ssets/javascripts/vue_shared/components/confirm_modal.vue
+2
-2
No files found.
.prettierignore
View file @
9f4b4de2
...
@@ -848,40 +848,6 @@ app/assets/javascripts/snippets/components/snippet_blob_view.vue
...
@@ -848,40 +848,6 @@ app/assets/javascripts/snippets/components/snippet_blob_view.vue
app/assets/javascripts/snippets/components/snippet_header.vue
app/assets/javascripts/snippets/components/snippet_header.vue
app/assets/javascripts/snippets/mixins/snippets.js
app/assets/javascripts/snippets/mixins/snippets.js
## nostalgic-morse
app/assets/javascripts/user_lists/store/show/actions.js
app/assets/javascripts/user_lists/store/show/index.js
app/assets/javascripts/user_lists/store/show/mutations.js
app/assets/javascripts/user_popovers.js
app/assets/javascripts/users_select/index.js
app/assets/javascripts/vue_alerts.js
app/assets/javascripts/vue_merge_request_widget/components/approvals/approvals.vue
app/assets/javascripts/vue_merge_request_widget/components/deployment/deployment_actions.vue
app/assets/javascripts/vue_merge_request_widget/components/deployment/deployment_view_button.vue
app/assets/javascripts/vue_merge_request_widget/components/deployment/memory_usage.vue
app/assets/javascripts/vue_merge_request_widget/components/extensions/base.vue
app/assets/javascripts/vue_merge_request_widget/components/extensions/container.js
app/assets/javascripts/vue_merge_request_widget/components/extensions/index.js
app/assets/javascripts/vue_merge_request_widget/components/mr_widget_alert_message.vue
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_auto_merge_enabled.vue
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_conflicts.vue
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_merged.vue
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_missing_branch.vue
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_rebase.vue
app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue
app/assets/javascripts/vue_merge_request_widget/components/states/squash_before_merge.vue
app/assets/javascripts/vue_merge_request_widget/components/states/work_in_progress.vue
app/assets/javascripts/vue_merge_request_widget/components/terraform/mr_widget_terraform_container.vue
app/assets/javascripts/vue_merge_request_widget/extensions/issues.js
app/assets/javascripts/vue_merge_request_widget/mixins/approvals.js
app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue
app/assets/javascripts/vue_merge_request_widget/services/mr_widget_service.js
app/assets/javascripts/vue_merge_request_widget/stores/artifacts_list/getters.js
app/assets/javascripts/vue_shared/components/actions_button.vue
app/assets/javascripts/vue_shared/components/awards_list.vue
app/assets/javascripts/vue_shared/components/commit.vue
app/assets/javascripts/vue_shared/components/confirm_modal.vue
## thirsty-mccarthy
## thirsty-mccarthy
app/assets/javascripts/vue_shared/components/date_time_picker/date_time_picker.vue
app/assets/javascripts/vue_shared/components/date_time_picker/date_time_picker.vue
app/assets/javascripts/vue_shared/components/date_time_picker/date_time_picker_input.vue
app/assets/javascripts/vue_shared/components/date_time_picker/date_time_picker_input.vue
...
...
app/assets/javascripts/user_lists/store/show/actions.js
View file @
9f4b4de2
...
@@ -5,7 +5,7 @@ import * as types from './mutation_types';
...
@@ -5,7 +5,7 @@ import * as types from './mutation_types';
export
const
fetchUserList
=
({
commit
,
state
})
=>
{
export
const
fetchUserList
=
({
commit
,
state
})
=>
{
commit
(
types
.
REQUEST_USER_LIST
);
commit
(
types
.
REQUEST_USER_LIST
);
return
Api
.
fetchFeatureFlagUserList
(
state
.
projectId
,
state
.
userListIid
)
return
Api
.
fetchFeatureFlagUserList
(
state
.
projectId
,
state
.
userListIid
)
.
then
(
response
=>
commit
(
types
.
RECEIVE_USER_LIST_SUCCESS
,
response
.
data
))
.
then
(
(
response
)
=>
commit
(
types
.
RECEIVE_USER_LIST_SUCCESS
,
response
.
data
))
.
catch
(()
=>
commit
(
types
.
RECEIVE_USER_LIST_ERROR
));
.
catch
(()
=>
commit
(
types
.
RECEIVE_USER_LIST_ERROR
));
};
};
...
@@ -27,6 +27,6 @@ export const updateUserList = ({ commit, state }) => {
...
@@ -27,6 +27,6 @@ export const updateUserList = ({ commit, state }) => {
...
state
.
userList
,
...
state
.
userList
,
user_xids
:
stringifyUserIds
(
state
.
userIds
),
user_xids
:
stringifyUserIds
(
state
.
userIds
),
})
})
.
then
(
response
=>
commit
(
types
.
RECEIVE_USER_LIST_SUCCESS
,
response
.
data
))
.
then
(
(
response
)
=>
commit
(
types
.
RECEIVE_USER_LIST_SUCCESS
,
response
.
data
))
.
catch
(()
=>
commit
(
types
.
RECEIVE_USER_LIST_ERROR
));
.
catch
(()
=>
commit
(
types
.
RECEIVE_USER_LIST_ERROR
));
};
};
app/assets/javascripts/user_lists/store/show/index.js
View file @
9f4b4de2
...
@@ -3,7 +3,7 @@ import createState from './state';
...
@@ -3,7 +3,7 @@ import createState from './state';
import
*
as
actions
from
'
./actions
'
;
import
*
as
actions
from
'
./actions
'
;
import
mutations
from
'
./mutations
'
;
import
mutations
from
'
./mutations
'
;
export
default
initialState
=>
export
default
(
initialState
)
=>
new
Vuex
.
Store
({
new
Vuex
.
Store
({
actions
,
actions
,
mutations
,
mutations
,
...
...
app/assets/javascripts/user_lists/store/show/mutations.js
View file @
9f4b4de2
...
@@ -20,10 +20,10 @@ export default {
...
@@ -20,10 +20,10 @@ export default {
[
types
.
ADD_USER_IDS
](
state
,
ids
)
{
[
types
.
ADD_USER_IDS
](
state
,
ids
)
{
state
.
userIds
=
[
state
.
userIds
=
[
...
state
.
userIds
,
...
state
.
userIds
,
...
parseUserIds
(
ids
).
filter
(
id
=>
id
&&
!
state
.
userIds
.
includes
(
id
)),
...
parseUserIds
(
ids
).
filter
(
(
id
)
=>
id
&&
!
state
.
userIds
.
includes
(
id
)),
];
];
},
},
[
types
.
REMOVE_USER_ID
](
state
,
id
)
{
[
types
.
REMOVE_USER_ID
](
state
,
id
)
{
state
.
userIds
=
state
.
userIds
.
filter
(
uid
=>
uid
!==
id
);
state
.
userIds
=
state
.
userIds
.
filter
(
(
uid
)
=>
uid
!==
id
);
},
},
};
};
app/assets/javascripts/user_popovers.js
View file @
9f4b4de2
...
@@ -5,14 +5,14 @@ import { sanitize } from '~/lib/dompurify';
...
@@ -5,14 +5,14 @@ import { sanitize } from '~/lib/dompurify';
import
UsersCache
from
'
./lib/utils/users_cache
'
;
import
UsersCache
from
'
./lib/utils/users_cache
'
;
import
UserPopover
from
'
./vue_shared/components/user_popover/user_popover.vue
'
;
import
UserPopover
from
'
./vue_shared/components/user_popover/user_popover.vue
'
;
const
removeTitle
=
el
=>
{
const
removeTitle
=
(
el
)
=>
{
// Removing titles so its not showing tooltips also
// Removing titles so its not showing tooltips also
el
.
dataset
.
originalTitle
=
''
;
el
.
dataset
.
originalTitle
=
''
;
el
.
setAttribute
(
'
title
'
,
''
);
el
.
setAttribute
(
'
title
'
,
''
);
};
};
const
getPreloadedUserInfo
=
dataset
=>
{
const
getPreloadedUserInfo
=
(
dataset
)
=>
{
const
userId
=
dataset
.
user
||
dataset
.
userId
;
const
userId
=
dataset
.
user
||
dataset
.
userId
;
const
{
username
,
name
,
avatarUrl
}
=
dataset
;
const
{
username
,
name
,
avatarUrl
}
=
dataset
;
...
@@ -28,7 +28,7 @@ const getPreloadedUserInfo = dataset => {
...
@@ -28,7 +28,7 @@ const getPreloadedUserInfo = dataset => {
* Adds a UserPopover component to the body, hands over as much data as the target element has in data attributes.
* Adds a UserPopover component to the body, hands over as much data as the target element has in data attributes.
* loads based on data-user-id more data about a user from the API and sets it on the popover
* loads based on data-user-id more data about a user from the API and sets it on the popover
*/
*/
const
populateUserInfo
=
user
=>
{
const
populateUserInfo
=
(
user
)
=>
{
const
{
userId
}
=
user
;
const
{
userId
}
=
user
;
return
Promise
.
all
([
UsersCache
.
retrieveById
(
userId
),
UsersCache
.
retrieveStatusById
(
userId
)]).
then
(
return
Promise
.
all
([
UsersCache
.
retrieveById
(
userId
),
UsersCache
.
retrieveStatusById
(
userId
)]).
then
(
...
@@ -66,7 +66,7 @@ export default (elements = document.querySelectorAll('.js-user-link')) => {
...
@@ -66,7 +66,7 @@ export default (elements = document.querySelectorAll('.js-user-link')) => {
return
userLinks
return
userLinks
.
filter
(({
dataset
})
=>
dataset
.
user
||
dataset
.
userId
)
.
filter
(({
dataset
})
=>
dataset
.
user
||
dataset
.
userId
)
.
map
(
el
=>
{
.
map
(
(
el
)
=>
{
if
(
initializedPopovers
.
has
(
el
))
{
if
(
initializedPopovers
.
has
(
el
))
{
return
initializedPopovers
.
get
(
el
);
return
initializedPopovers
.
get
(
el
);
}
}
...
...
app/assets/javascripts/users_select/index.js
View file @
9f4b4de2
...
@@ -145,14 +145,14 @@ function UsersSelect(currentUser, els, options = {}) {
...
@@ -145,14 +145,14 @@ function UsersSelect(currentUser, els, options = {}) {
};
};
const
getMultiSelectDropdownTitle
=
function
(
selectedUser
,
isSelected
)
{
const
getMultiSelectDropdownTitle
=
function
(
selectedUser
,
isSelected
)
{
const
selectedUsers
=
getSelected
().
filter
(
u
=>
u
!==
0
);
const
selectedUsers
=
getSelected
().
filter
(
(
u
)
=>
u
!==
0
);
const
firstUser
=
getSelectedUserInputs
()
const
firstUser
=
getSelectedUserInputs
()
.
map
((
index
,
input
)
=>
({
.
map
((
index
,
input
)
=>
({
name
:
input
.
dataset
.
meta
,
name
:
input
.
dataset
.
meta
,
value
:
parseInt
(
input
.
value
,
10
),
value
:
parseInt
(
input
.
value
,
10
),
}))
}))
.
filter
(
u
=>
u
.
id
!==
0
)
.
filter
(
(
u
)
=>
u
.
id
!==
0
)
.
get
(
0
);
.
get
(
0
);
if
(
selectedUsers
.
length
===
0
)
{
if
(
selectedUsers
.
length
===
0
)
{
...
@@ -160,7 +160,7 @@ function UsersSelect(currentUser, els, options = {}) {
...
@@ -160,7 +160,7 @@ function UsersSelect(currentUser, els, options = {}) {
}
else
if
(
selectedUsers
.
length
===
1
)
{
}
else
if
(
selectedUsers
.
length
===
1
)
{
return
firstUser
.
name
;
return
firstUser
.
name
;
}
else
if
(
isSelected
)
{
}
else
if
(
isSelected
)
{
const
otherSelected
=
selectedUsers
.
filter
(
s
=>
s
!==
selectedUser
.
id
);
const
otherSelected
=
selectedUsers
.
filter
(
(
s
)
=>
s
!==
selectedUser
.
id
);
return
sprintf
(
s__
(
'
UsersSelect|%{name} + %{length} more
'
),
{
return
sprintf
(
s__
(
'
UsersSelect|%{name} + %{length} more
'
),
{
name
:
selectedUser
.
name
,
name
:
selectedUser
.
name
,
length
:
otherSelected
.
length
,
length
:
otherSelected
.
length
,
...
@@ -172,7 +172,7 @@ function UsersSelect(currentUser, els, options = {}) {
...
@@ -172,7 +172,7 @@ function UsersSelect(currentUser, els, options = {}) {
});
});
};
};
$assignToMeLink
.
on
(
'
click
'
,
e
=>
{
$assignToMeLink
.
on
(
'
click
'
,
(
e
)
=>
{
e
.
preventDefault
();
e
.
preventDefault
();
$
(
e
.
currentTarget
).
hide
();
$
(
e
.
currentTarget
).
hide
();
...
@@ -196,7 +196,7 @@ function UsersSelect(currentUser, els, options = {}) {
...
@@ -196,7 +196,7 @@ function UsersSelect(currentUser, els, options = {}) {
}
}
});
});
$block
.
on
(
'
click
'
,
'
.js-assign-yourself
'
,
e
=>
{
$block
.
on
(
'
click
'
,
'
.js-assign-yourself
'
,
(
e
)
=>
{
e
.
preventDefault
();
e
.
preventDefault
();
return
assignTo
(
userSelect
.
currentUser
.
id
);
return
assignTo
(
userSelect
.
currentUser
.
id
);
});
});
...
@@ -250,7 +250,7 @@ function UsersSelect(currentUser, els, options = {}) {
...
@@ -250,7 +250,7 @@ function UsersSelect(currentUser, els, options = {}) {
return
initDeprecatedJQueryDropdown
(
$dropdown
,
{
return
initDeprecatedJQueryDropdown
(
$dropdown
,
{
showMenuAbove
,
showMenuAbove
,
data
(
term
,
callback
)
{
data
(
term
,
callback
)
{
return
userSelect
.
users
(
term
,
options
,
users
=>
{
return
userSelect
.
users
(
term
,
options
,
(
users
)
=>
{
// GitLabDropdownFilter returns this.instance
// GitLabDropdownFilter returns this.instance
// GitLabDropdownRemote returns this.options.instance
// GitLabDropdownRemote returns this.options.instance
const
deprecatedJQueryDropdown
=
this
.
instance
||
this
.
options
.
instance
;
const
deprecatedJQueryDropdown
=
this
.
instance
||
this
.
options
.
instance
;
...
@@ -266,14 +266,14 @@ function UsersSelect(currentUser, els, options = {}) {
...
@@ -266,14 +266,14 @@ function UsersSelect(currentUser, els, options = {}) {
// Potential duplicate entries when dealing with issue board
// Potential duplicate entries when dealing with issue board
// because issue board is also managed by vue
// because issue board is also managed by vue
const
selectedUsers
=
uniqBy
(
selectedInputs
,
a
=>
a
.
value
)
const
selectedUsers
=
uniqBy
(
selectedInputs
,
(
a
)
=>
a
.
value
)
.
filter
(
input
=>
{
.
filter
(
(
input
)
=>
{
const
userId
=
parseInt
(
input
.
value
,
10
);
const
userId
=
parseInt
(
input
.
value
,
10
);
const
inUsersArray
=
users
.
find
(
u
=>
u
.
id
===
userId
);
const
inUsersArray
=
users
.
find
(
(
u
)
=>
u
.
id
===
userId
);
return
!
inUsersArray
&&
userId
!==
0
;
return
!
inUsersArray
&&
userId
!==
0
;
})
})
.
map
(
input
=>
{
.
map
(
(
input
)
=>
{
const
userId
=
parseInt
(
input
.
value
,
10
);
const
userId
=
parseInt
(
input
.
value
,
10
);
const
{
avatarUrl
,
avatar_url
,
name
,
username
,
canMerge
}
=
input
.
dataset
;
const
{
avatarUrl
,
avatar_url
,
name
,
username
,
canMerge
}
=
input
.
dataset
;
return
{
return
{
...
@@ -334,7 +334,7 @@ function UsersSelect(currentUser, els, options = {}) {
...
@@ -334,7 +334,7 @@ function UsersSelect(currentUser, els, options = {}) {
}
}
if
(
$dropdown
.
hasClass
(
'
js-multiselect
'
))
{
if
(
$dropdown
.
hasClass
(
'
js-multiselect
'
))
{
const
selected
=
getSelected
().
filter
(
i
=>
i
!==
0
);
const
selected
=
getSelected
().
filter
(
(
i
)
=>
i
!==
0
);
if
(
selected
.
length
>
0
)
{
if
(
selected
.
length
>
0
)
{
if
(
$dropdown
.
data
(
'
dropdownHeader
'
))
{
if
(
$dropdown
.
data
(
'
dropdownHeader
'
))
{
...
@@ -346,12 +346,12 @@ function UsersSelect(currentUser, els, options = {}) {
...
@@ -346,12 +346,12 @@ function UsersSelect(currentUser, els, options = {}) {
}
}
const
selectedUsers
=
users
const
selectedUsers
=
users
.
filter
(
u
=>
selected
.
indexOf
(
u
.
id
)
!==
-
1
)
.
filter
(
(
u
)
=>
selected
.
indexOf
(
u
.
id
)
!==
-
1
)
.
sort
((
a
,
b
)
=>
a
.
name
>
b
.
name
);
.
sort
((
a
,
b
)
=>
a
.
name
>
b
.
name
);
users
=
users
.
filter
(
u
=>
selected
.
indexOf
(
u
.
id
)
===
-
1
);
users
=
users
.
filter
(
(
u
)
=>
selected
.
indexOf
(
u
.
id
)
===
-
1
);
selectedUsers
.
forEach
(
selectedUser
=>
{
selectedUsers
.
forEach
(
(
selectedUser
)
=>
{
showDivider
+=
1
;
showDivider
+=
1
;
users
.
splice
(
showDivider
,
0
,
selectedUser
);
users
.
splice
(
showDivider
,
0
,
selectedUser
);
});
});
...
@@ -477,7 +477,7 @@ function UsersSelect(currentUser, els, options = {}) {
...
@@ -477,7 +477,7 @@ function UsersSelect(currentUser, els, options = {}) {
}
}
}
}
if
(
getSelected
().
find
(
u
=>
u
===
gon
.
current_user_id
))
{
if
(
getSelected
().
find
(
(
u
)
=>
u
===
gon
.
current_user_id
))
{
$assignToMeLink
.
hide
();
$assignToMeLink
.
hide
();
}
else
{
}
else
{
$assignToMeLink
.
show
();
$assignToMeLink
.
show
();
...
@@ -544,7 +544,7 @@ function UsersSelect(currentUser, els, options = {}) {
...
@@ -544,7 +544,7 @@ function UsersSelect(currentUser, els, options = {}) {
}
}
if
(
selected
.
length
>
0
)
{
if
(
selected
.
length
>
0
)
{
getSelected
().
forEach
(
selectedId
=>
highlightSelected
(
selectedId
));
getSelected
().
forEach
(
(
selectedId
)
=>
highlightSelected
(
selectedId
));
}
else
if
(
$dropdown
.
hasClass
(
'
js-issue-board-sidebar
'
))
{
}
else
if
(
$dropdown
.
hasClass
(
'
js-issue-board-sidebar
'
))
{
highlightSelected
(
0
);
highlightSelected
(
0
);
}
else
{
}
else
{
...
@@ -559,7 +559,7 @@ function UsersSelect(currentUser, els, options = {}) {
...
@@ -559,7 +559,7 @@ function UsersSelect(currentUser, els, options = {}) {
let
selected
=
false
;
let
selected
=
false
;
if
(
this
.
multiSelect
)
{
if
(
this
.
multiSelect
)
{
selected
=
getSelected
().
find
(
u
=>
user
.
id
===
u
);
selected
=
getSelected
().
find
(
(
u
)
=>
user
.
id
===
u
);
const
{
fieldName
}
=
this
;
const
{
fieldName
}
=
this
;
const
field
=
$dropdown
const
field
=
$dropdown
...
@@ -613,7 +613,7 @@ function UsersSelect(currentUser, els, options = {}) {
...
@@ -613,7 +613,7 @@ function UsersSelect(currentUser, els, options = {}) {
multiple
:
$
(
select
).
hasClass
(
'
multiselect
'
),
multiple
:
$
(
select
).
hasClass
(
'
multiselect
'
),
minimumInputLength
:
0
,
minimumInputLength
:
0
,
query
(
query
)
{
query
(
query
)
{
return
userSelect
.
users
(
query
.
term
,
options
,
users
=>
{
return
userSelect
.
users
(
query
.
term
,
options
,
(
users
)
=>
{
let
name
;
let
name
;
const
data
=
{
const
data
=
{
results
:
users
,
results
:
users
,
...
...
app/assets/javascripts/vue_alerts.js
View file @
9f4b4de2
...
@@ -2,7 +2,7 @@ import Vue from 'vue';
...
@@ -2,7 +2,7 @@ import Vue from 'vue';
import
{
parseBoolean
}
from
'
~/lib/utils/common_utils
'
;
import
{
parseBoolean
}
from
'
~/lib/utils/common_utils
'
;
import
DismissibleAlert
from
'
~/vue_shared/components/dismissible_alert.vue
'
;
import
DismissibleAlert
from
'
~/vue_shared/components/dismissible_alert.vue
'
;
const
mountVueAlert
=
el
=>
{
const
mountVueAlert
=
(
el
)
=>
{
const
props
=
{
const
props
=
{
html
:
el
.
innerHTML
,
html
:
el
.
innerHTML
,
};
};
...
...
app/assets/javascripts/vue_merge_request_widget/components/approvals/approvals.vue
View file @
9f4b4de2
...
@@ -74,7 +74,7 @@ export default {
...
@@ -74,7 +74,7 @@ export default {
return
this
.
mr
.
approvals
||
{};
return
this
.
mr
.
approvals
||
{};
},
},
approvedBy
()
{
approvedBy
()
{
return
this
.
approvals
.
approved_by
?
this
.
approvals
.
approved_by
.
map
(
x
=>
x
.
user
)
:
[];
return
this
.
approvals
.
approved_by
?
this
.
approvals
.
approved_by
.
map
(
(
x
)
=>
x
.
user
)
:
[];
},
},
userHasApproved
()
{
userHasApproved
()
{
return
Boolean
(
this
.
approvals
.
user_has_approved
);
return
Boolean
(
this
.
approvals
.
user_has_approved
);
...
@@ -136,7 +136,7 @@ export default {
...
@@ -136,7 +136,7 @@ export default {
approveWithAuth
(
data
)
{
approveWithAuth
(
data
)
{
this
.
updateApproval
(
this
.
updateApproval
(
()
=>
this
.
service
.
approveMergeRequestWithAuth
(
data
),
()
=>
this
.
service
.
approveMergeRequestWithAuth
(
data
),
error
=>
{
(
error
)
=>
{
if
(
error
&&
error
.
response
&&
error
.
response
.
status
===
401
)
{
if
(
error
&&
error
.
response
&&
error
.
response
.
status
===
401
)
{
this
.
hasApprovalAuthError
=
true
;
this
.
hasApprovalAuthError
=
true
;
return
;
return
;
...
@@ -155,7 +155,7 @@ export default {
...
@@ -155,7 +155,7 @@ export default {
this
.
isApproving
=
true
;
this
.
isApproving
=
true
;
this
.
clearError
();
this
.
clearError
();
return
serviceFn
()
return
serviceFn
()
.
then
(
data
=>
{
.
then
(
(
data
)
=>
{
this
.
mr
.
setApprovals
(
data
);
this
.
mr
.
setApprovals
(
data
);
eventHub
.
$emit
(
'
MRWidgetUpdateRequested
'
);
eventHub
.
$emit
(
'
MRWidgetUpdateRequested
'
);
this
.
$emit
(
'
updated
'
);
this
.
$emit
(
'
updated
'
);
...
...
app/assets/javascripts/vue_merge_request_widget/components/deployment/deployment_actions.vue
View file @
9f4b4de2
...
@@ -121,7 +121,7 @@ export default {
...
@@ -121,7 +121,7 @@ export default {
this
.
actionInProgress
=
actionName
;
this
.
actionInProgress
=
actionName
;
MRWidgetService
.
executeInlineAction
(
endpoint
)
MRWidgetService
.
executeInlineAction
(
endpoint
)
.
then
(
resp
=>
{
.
then
(
(
resp
)
=>
{
const
redirectUrl
=
resp
?.
data
?.
redirect_url
;
const
redirectUrl
=
resp
?.
data
?.
redirect_url
;
if
(
redirectUrl
)
{
if
(
redirectUrl
)
{
visitUrl
(
redirectUrl
);
visitUrl
(
redirectUrl
);
...
...
app/assets/javascripts/vue_merge_request_widget/components/deployment/deployment_view_button.vue
View file @
9f4b4de2
...
@@ -57,7 +57,7 @@ export default {
...
@@ -57,7 +57,7 @@ export default {
return
this
.
deployment
.
changes
&&
this
.
deployment
.
changes
.
length
>
1
;
return
this
.
deployment
.
changes
&&
this
.
deployment
.
changes
.
length
>
1
;
},
},
filteredChanges
()
{
filteredChanges
()
{
return
this
.
deployment
?.
changes
?.
filter
(
change
=>
change
.
path
.
includes
(
this
.
searchTerm
));
return
this
.
deployment
?.
changes
?.
filter
(
(
change
)
=>
change
.
path
.
includes
(
this
.
searchTerm
));
},
},
},
},
};
};
...
...
app/assets/javascripts/vue_merge_request_widget/components/deployment/memory_usage.vue
View file @
9f4b4de2
...
@@ -102,7 +102,7 @@ export default {
...
@@ -102,7 +102,7 @@ export default {
loadMetrics
()
{
loadMetrics
()
{
backOff
((
next
,
stop
)
=>
{
backOff
((
next
,
stop
)
=>
{
MRWidgetService
.
fetchMetrics
(
this
.
metricsUrl
)
MRWidgetService
.
fetchMetrics
(
this
.
metricsUrl
)
.
then
(
res
=>
{
.
then
(
(
res
)
=>
{
if
(
res
.
status
===
statusCodes
.
NO_CONTENT
)
{
if
(
res
.
status
===
statusCodes
.
NO_CONTENT
)
{
this
.
backOffRequestCounter
+=
1
;
this
.
backOffRequestCounter
+=
1
;
/* eslint-disable no-unused-expressions */
/* eslint-disable no-unused-expressions */
...
@@ -113,14 +113,14 @@ export default {
...
@@ -113,14 +113,14 @@ export default {
})
})
.
catch
(
stop
);
.
catch
(
stop
);
})
})
.
then
(
res
=>
{
.
then
(
(
res
)
=>
{
if
(
res
.
status
===
statusCodes
.
NO_CONTENT
)
{
if
(
res
.
status
===
statusCodes
.
NO_CONTENT
)
{
return
res
;
return
res
;
}
}
return
res
.
data
;
return
res
.
data
;
})
})
.
then
(
data
=>
{
.
then
(
(
data
)
=>
{
this
.
computeGraphData
(
data
.
metrics
,
data
.
deployment_time
);
this
.
computeGraphData
(
data
.
metrics
,
data
.
deployment_time
);
return
data
;
return
data
;
})
})
...
...
app/assets/javascripts/vue_merge_request_widget/components/extensions/base.vue
View file @
9f4b4de2
...
@@ -67,11 +67,11 @@ export default {
...
@@ -67,11 +67,11 @@ export default {
},
},
mounted
()
{
mounted
()
{
this
.
fetchCollapsedData
(
this
.
$props
)
this
.
fetchCollapsedData
(
this
.
$props
)
.
then
(
data
=>
{
.
then
(
(
data
)
=>
{
this
.
collapsedData
=
data
;
this
.
collapsedData
=
data
;
this
.
loadingState
=
null
;
this
.
loadingState
=
null
;
})
})
.
catch
(
e
=>
{
.
catch
(
(
e
)
=>
{
this
.
loadingState
=
LOADING_STATES
.
collapsedError
;
this
.
loadingState
=
LOADING_STATES
.
collapsedError
;
throw
e
;
throw
e
;
});
});
...
@@ -86,11 +86,11 @@ export default {
...
@@ -86,11 +86,11 @@ export default {
this
.
loadingState
=
LOADING_STATES
.
expandedLoading
;
this
.
loadingState
=
LOADING_STATES
.
expandedLoading
;
this
.
fetchFullData
(
this
.
$props
)
this
.
fetchFullData
(
this
.
$props
)
.
then
(
data
=>
{
.
then
(
(
data
)
=>
{
this
.
loadingState
=
null
;
this
.
loadingState
=
null
;
this
.
fullData
=
data
;
this
.
fullData
=
data
;
})
})
.
catch
(
e
=>
{
.
catch
(
(
e
)
=>
{
this
.
loadingState
=
null
;
this
.
loadingState
=
null
;
throw
e
;
throw
e
;
});
});
...
...
app/assets/javascripts/vue_merge_request_widget/components/extensions/container.js
View file @
9f4b4de2
...
@@ -11,7 +11,7 @@ export default {
...
@@ -11,7 +11,7 @@ export default {
return
h
(
return
h
(
'
div
'
,
'
div
'
,
{},
{},
extensions
.
map
(
extension
=>
extensions
.
map
(
(
extension
)
=>
h
(
extension
,
{
h
(
extension
,
{
props
:
extensions
[
0
].
props
.
reduce
(
props
:
extensions
[
0
].
props
.
reduce
(
(
acc
,
key
)
=>
({
(
acc
,
key
)
=>
({
...
...
app/assets/javascripts/vue_merge_request_widget/components/extensions/index.js
View file @
9f4b4de2
...
@@ -3,7 +3,7 @@ import ExtensionBase from './base.vue';
...
@@ -3,7 +3,7 @@ import ExtensionBase from './base.vue';
// Holds all the currently registered extensions
// Holds all the currently registered extensions
export
const
extensions
=
[];
export
const
extensions
=
[];
export
const
registerExtension
=
extension
=>
{
export
const
registerExtension
=
(
extension
)
=>
{
// Pushes into the extenions array a dynamically created Vue component
// Pushes into the extenions array a dynamically created Vue component
// that gets exteneded from `base.vue`
// that gets exteneded from `base.vue`
extensions
.
push
({
extensions
.
push
({
...
...
app/assets/javascripts/vue_merge_request_widget/components/mr_widget_alert_message.vue
View file @
9f4b4de2
...
@@ -13,7 +13,7 @@ export default {
...
@@ -13,7 +13,7 @@ export default {
type
:
String
,
type
:
String
,
required
:
false
,
required
:
false
,
default
:
DANGER
,
default
:
DANGER
,
validator
:
value
=>
[
WARNING
,
DANGER
].
includes
(
value
),
validator
:
(
value
)
=>
[
WARNING
,
DANGER
].
includes
(
value
),
},
},
helpPath
:
{
helpPath
:
{
type
:
String
,
type
:
String
,
...
...
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_auto_merge_enabled.vue
View file @
9f4b4de2
...
@@ -51,8 +51,8 @@ export default {
...
@@ -51,8 +51,8 @@ export default {
this
.
isCancellingAutoMerge
=
true
;
this
.
isCancellingAutoMerge
=
true
;
this
.
service
this
.
service
.
cancelAutomaticMerge
()
.
cancelAutomaticMerge
()
.
then
(
res
=>
res
.
data
)
.
then
(
(
res
)
=>
res
.
data
)
.
then
(
data
=>
{
.
then
(
(
data
)
=>
{
eventHub
.
$emit
(
'
UpdateWidgetData
'
,
data
);
eventHub
.
$emit
(
'
UpdateWidgetData
'
,
data
);
})
})
.
catch
(()
=>
{
.
catch
(()
=>
{
...
@@ -70,8 +70,8 @@ export default {
...
@@ -70,8 +70,8 @@ export default {
this
.
isRemovingSourceBranch
=
true
;
this
.
isRemovingSourceBranch
=
true
;
this
.
service
this
.
service
.
merge
(
options
)
.
merge
(
options
)
.
then
(
res
=>
res
.
data
)
.
then
(
(
res
)
=>
res
.
data
)
.
then
(
data
=>
{
.
then
(
(
data
)
=>
{
if
(
AUTO_MERGE_STRATEGIES
.
includes
(
data
.
status
))
{
if
(
AUTO_MERGE_STRATEGIES
.
includes
(
data
.
status
))
{
eventHub
.
$emit
(
'
MRWidgetUpdateRequested
'
);
eventHub
.
$emit
(
'
MRWidgetUpdateRequested
'
);
}
}
...
...
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_conflicts.vue
View file @
9f4b4de2
...
@@ -30,7 +30,7 @@ export default {
...
@@ -30,7 +30,7 @@ export default {
variables
()
{
variables
()
{
return
this
.
mergeRequestQueryVariables
;
return
this
.
mergeRequestQueryVariables
;
},
},
update
:
data
=>
data
.
project
.
mergeRequest
.
userPermissions
,
update
:
(
data
)
=>
data
.
project
.
mergeRequest
.
userPermissions
,
},
},
stateData
:
{
stateData
:
{
query
:
conflictsStateQuery
,
query
:
conflictsStateQuery
,
...
@@ -40,7 +40,7 @@ export default {
...
@@ -40,7 +40,7 @@ export default {
variables
()
{
variables
()
{
return
this
.
mergeRequestQueryVariables
;
return
this
.
mergeRequestQueryVariables
;
},
},
update
:
data
=>
data
.
project
.
mergeRequest
,
update
:
(
data
)
=>
data
.
project
.
mergeRequest
,
},
},
},
},
props
:
{
props
:
{
...
...
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_merged.vue
View file @
9f4b4de2
...
@@ -83,8 +83,8 @@ export default {
...
@@ -83,8 +83,8 @@ export default {
this
.
service
this
.
service
.
removeSourceBranch
()
.
removeSourceBranch
()
.
then
(
res
=>
res
.
data
)
.
then
(
(
res
)
=>
res
.
data
)
.
then
(
data
=>
{
.
then
(
(
data
)
=>
{
// False positive i18n lint: https://gitlab.com/gitlab-org/frontend/eslint-plugin-i18n/issues/26
// False positive i18n lint: https://gitlab.com/gitlab-org/frontend/eslint-plugin-i18n/issues/26
// eslint-disable-next-line @gitlab/require-i18n-strings
// eslint-disable-next-line @gitlab/require-i18n-strings
if
(
data
.
message
===
'
Branch was deleted
'
)
{
if
(
data
.
message
===
'
Branch was deleted
'
)
{
...
...
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_missing_branch.vue
View file @
9f4b4de2
...
@@ -25,7 +25,7 @@ export default {
...
@@ -25,7 +25,7 @@ export default {
variables
()
{
variables
()
{
return
this
.
mergeRequestQueryVariables
;
return
this
.
mergeRequestQueryVariables
;
},
},
update
:
data
=>
data
.
project
.
mergeRequest
,
update
:
(
data
)
=>
data
.
project
.
mergeRequest
,
},
},
},
},
props
:
{
props
:
{
...
...
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_rebase.vue
View file @
9f4b4de2
...
@@ -65,7 +65,7 @@ export default {
...
@@ -65,7 +65,7 @@ export default {
.
then
(()
=>
{
.
then
(()
=>
{
simplePoll
(
this
.
checkRebaseStatus
);
simplePoll
(
this
.
checkRebaseStatus
);
})
})
.
catch
(
error
=>
{
.
catch
(
(
error
)
=>
{
this
.
isMakingRequest
=
false
;
this
.
isMakingRequest
=
false
;
if
(
error
.
response
&&
error
.
response
.
data
&&
error
.
response
.
data
.
merge_error
)
{
if
(
error
.
response
&&
error
.
response
.
data
&&
error
.
response
.
data
.
merge_error
)
{
...
@@ -78,8 +78,8 @@ export default {
...
@@ -78,8 +78,8 @@ export default {
checkRebaseStatus
(
continuePolling
,
stopPolling
)
{
checkRebaseStatus
(
continuePolling
,
stopPolling
)
{
this
.
service
this
.
service
.
poll
()
.
poll
()
.
then
(
res
=>
res
.
data
)
.
then
(
(
res
)
=>
res
.
data
)
.
then
(
res
=>
{
.
then
(
(
res
)
=>
{
if
(
res
.
rebase_in_progress
)
{
if
(
res
.
rebase_in_progress
)
{
continuePolling
();
continuePolling
();
}
else
{
}
else
{
...
...
app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue
View file @
9f4b4de2
...
@@ -188,8 +188,8 @@ export default {
...
@@ -188,8 +188,8 @@ export default {
this
.
isMakingRequest
=
true
;
this
.
isMakingRequest
=
true
;
this
.
service
this
.
service
.
merge
(
options
)
.
merge
(
options
)
.
then
(
res
=>
res
.
data
)
.
then
(
(
res
)
=>
res
.
data
)
.
then
(
data
=>
{
.
then
(
(
data
)
=>
{
const
hasError
=
const
hasError
=
data
.
status
===
MERGE_FAILED_STATUS
||
data
.
status
===
MERGE_FAILED_STATUS
||
data
.
status
===
MERGE_HOOK_VALIDATION_ERROR_STATUS
;
data
.
status
===
MERGE_HOOK_VALIDATION_ERROR_STATUS
;
...
@@ -228,8 +228,8 @@ export default {
...
@@ -228,8 +228,8 @@ export default {
handleMergePolling
(
continuePolling
,
stopPolling
)
{
handleMergePolling
(
continuePolling
,
stopPolling
)
{
this
.
service
this
.
service
.
poll
()
.
poll
()
.
then
(
res
=>
res
.
data
)
.
then
(
(
res
)
=>
res
.
data
)
.
then
(
data
=>
{
.
then
(
(
data
)
=>
{
if
(
data
.
state
===
'
merged
'
)
{
if
(
data
.
state
===
'
merged
'
)
{
// If state is merged we should update the widget and stop the polling
// If state is merged we should update the widget and stop the polling
eventHub
.
$emit
(
'
MRWidgetUpdateRequested
'
);
eventHub
.
$emit
(
'
MRWidgetUpdateRequested
'
);
...
@@ -270,8 +270,8 @@ export default {
...
@@ -270,8 +270,8 @@ export default {
handleRemoveBranchPolling
(
continuePolling
,
stopPolling
)
{
handleRemoveBranchPolling
(
continuePolling
,
stopPolling
)
{
this
.
service
this
.
service
.
poll
()
.
poll
()
.
then
(
res
=>
res
.
data
)
.
then
(
(
res
)
=>
res
.
data
)
.
then
(
data
=>
{
.
then
(
(
data
)
=>
{
// If source branch exists then we should continue polling
// If source branch exists then we should continue polling
// because removing a source branch is a background task and takes time
// because removing a source branch is a background task and takes time
if
(
data
.
source_branch_exists
)
{
if
(
data
.
source_branch_exists
)
{
...
...
app/assets/javascripts/vue_merge_request_widget/components/states/squash_before_merge.vue
View file @
9f4b4de2
...
@@ -46,7 +46,7 @@ export default {
...
@@ -46,7 +46,7 @@ export default {
name=
"squash"
name=
"squash"
class=
"qa-squash-checkbox js-squash-checkbox gl-mb-0 gl-mr-2"
class=
"qa-squash-checkbox js-squash-checkbox gl-mb-0 gl-mr-2"
:title=
"tooltipTitle"
:title=
"tooltipTitle"
@
change=
"
checked
=> $emit('input', checked)"
@
change=
"
(checked)
=> $emit('input', checked)"
>
>
{{
$options
.
i18n
.
checkboxLabel
}}
{{
$options
.
i18n
.
checkboxLabel
}}
</gl-form-checkbox>
</gl-form-checkbox>
...
...
app/assets/javascripts/vue_merge_request_widget/components/states/work_in_progress.vue
View file @
9f4b4de2
...
@@ -29,7 +29,7 @@ export default {
...
@@ -29,7 +29,7 @@ export default {
variables
()
{
variables
()
{
return
this
.
mergeRequestQueryVariables
;
return
this
.
mergeRequestQueryVariables
;
},
},
update
:
data
=>
data
.
project
.
mergeRequest
.
userPermissions
,
update
:
(
data
)
=>
data
.
project
.
mergeRequest
.
userPermissions
,
},
},
},
},
props
:
{
props
:
{
...
@@ -86,7 +86,7 @@ export default {
...
@@ -86,7 +86,7 @@ export default {
variables
:
mergeRequestQueryVariables
,
variables
:
mergeRequestQueryVariables
,
});
});
const
data
=
produce
(
sourceData
,
draftState
=>
{
const
data
=
produce
(
sourceData
,
(
draftState
)
=>
{
// eslint-disable-next-line no-param-reassign
// eslint-disable-next-line no-param-reassign
draftState
.
project
.
mergeRequest
.
workInProgress
=
workInProgress
;
draftState
.
project
.
mergeRequest
.
workInProgress
=
workInProgress
;
// eslint-disable-next-line no-param-reassign
// eslint-disable-next-line no-param-reassign
...
@@ -137,8 +137,8 @@ export default {
...
@@ -137,8 +137,8 @@ export default {
this
.
isMakingRequest
=
true
;
this
.
isMakingRequest
=
true
;
this
.
service
this
.
service
.
removeWIP
()
.
removeWIP
()
.
then
(
res
=>
res
.
data
)
.
then
(
(
res
)
=>
res
.
data
)
.
then
(
data
=>
{
.
then
(
(
data
)
=>
{
eventHub
.
$emit
(
'
UpdateWidgetData
'
,
data
);
eventHub
.
$emit
(
'
UpdateWidgetData
'
,
data
);
MergeRequest
.
toggleDraftStatus
(
this
.
mr
.
title
,
true
);
MergeRequest
.
toggleDraftStatus
(
this
.
mr
.
title
,
true
);
})
})
...
...
app/assets/javascripts/vue_merge_request_widget/components/terraform/mr_widget_terraform_container.vue
View file @
9f4b4de2
...
@@ -40,7 +40,7 @@ export default {
...
@@ -40,7 +40,7 @@ export default {
);
);
},
},
numberOfInvalidPlans
()
{
numberOfInvalidPlans
()
{
return
Object
.
values
(
this
.
plansObject
).
filter
(
plan
=>
plan
.
tf_report_error
).
length
;
return
Object
.
values
(
this
.
plansObject
).
filter
(
(
plan
)
=>
plan
.
tf_report_error
).
length
;
},
},
numberOfPlans
()
{
numberOfPlans
()
{
return
Object
.
keys
(
this
.
plansObject
).
length
;
return
Object
.
keys
(
this
.
plansObject
).
length
;
...
...
app/assets/javascripts/vue_merge_request_widget/extensions/issues.js
View file @
9f4b4de2
...
@@ -38,7 +38,7 @@ export default {
...
@@ -38,7 +38,7 @@ export default {
.
query
({
query
:
issuesQuery
,
variables
:
{
projectPath
:
targetProjectFullPath
}
})
.
query
({
query
:
issuesQuery
,
variables
:
{
projectPath
:
targetProjectFullPath
}
})
.
then
(({
data
})
=>
{
.
then
(({
data
})
=>
{
// Return some transformed data to be rendered in the expanded state
// Return some transformed data to be rendered in the expanded state
return
data
.
project
.
issues
.
nodes
.
map
(
issue
=>
({
return
data
.
project
.
issues
.
nodes
.
map
(
(
issue
)
=>
({
id
:
issue
.
id
,
// Required: The ID of the object
id
:
issue
.
id
,
// Required: The ID of the object
text
:
issue
.
title
,
// Required: The text to get used on each row
text
:
issue
.
title
,
// Required: The text to get used on each row
// Icon to get rendered on the side of each row
// Icon to get rendered on the side of each row
...
...
app/assets/javascripts/vue_merge_request_widget/mixins/approvals.js
View file @
9f4b4de2
...
@@ -11,7 +11,7 @@ export default {
...
@@ -11,7 +11,7 @@ export default {
}
}
},
},
refreshApprovals
()
{
refreshApprovals
()
{
return
this
.
service
.
fetchApprovals
().
then
(
data
=>
{
return
this
.
service
.
fetchApprovals
().
then
(
(
data
)
=>
{
this
.
mr
.
setApprovals
(
data
);
this
.
mr
.
setApprovals
(
data
);
});
});
},
},
...
...
app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue
View file @
9f4b4de2
...
@@ -358,7 +358,7 @@ export default {
...
@@ -358,7 +358,7 @@ export default {
fetchActionsContent
()
{
fetchActionsContent
()
{
this
.
service
this
.
service
.
fetchMergeActionsContent
()
.
fetchMergeActionsContent
()
.
then
(
res
=>
{
.
then
(
(
res
)
=>
{
if
(
res
.
data
)
{
if
(
res
.
data
)
{
const
el
=
document
.
createElement
(
'
div
'
);
const
el
=
document
.
createElement
(
'
div
'
);
el
.
innerHTML
=
res
.
data
;
el
.
innerHTML
=
res
.
data
;
...
@@ -388,26 +388,26 @@ export default {
...
@@ -388,26 +388,26 @@ export default {
this
.
pollingInterval
.
stopTimer
();
this
.
pollingInterval
.
stopTimer
();
},
},
bindEventHubListeners
()
{
bindEventHubListeners
()
{
eventHub
.
$on
(
'
MRWidgetUpdateRequested
'
,
cb
=>
{
eventHub
.
$on
(
'
MRWidgetUpdateRequested
'
,
(
cb
)
=>
{
this
.
checkStatus
(
cb
);
this
.
checkStatus
(
cb
);
});
});
eventHub
.
$on
(
'
MRWidgetRebaseSuccess
'
,
cb
=>
{
eventHub
.
$on
(
'
MRWidgetRebaseSuccess
'
,
(
cb
)
=>
{
this
.
checkStatus
(
cb
,
true
);
this
.
checkStatus
(
cb
,
true
);
});
});
// `params` should be an Array contains a Boolean, like `[true]`
// `params` should be an Array contains a Boolean, like `[true]`
// Passing parameter as Boolean didn't work.
// Passing parameter as Boolean didn't work.
eventHub
.
$on
(
'
SetBranchRemoveFlag
'
,
params
=>
{
eventHub
.
$on
(
'
SetBranchRemoveFlag
'
,
(
params
)
=>
{
[
this
.
mr
.
isRemovingSourceBranch
]
=
params
;
[
this
.
mr
.
isRemovingSourceBranch
]
=
params
;
});
});
eventHub
.
$on
(
'
FailedToMerge
'
,
mergeError
=>
{
eventHub
.
$on
(
'
FailedToMerge
'
,
(
mergeError
)
=>
{
this
.
mr
.
state
=
'
failedToMerge
'
;
this
.
mr
.
state
=
'
failedToMerge
'
;
this
.
mr
.
mergeError
=
mergeError
;
this
.
mr
.
mergeError
=
mergeError
;
});
});
eventHub
.
$on
(
'
UpdateWidgetData
'
,
data
=>
{
eventHub
.
$on
(
'
UpdateWidgetData
'
,
(
data
)
=>
{
this
.
mr
.
setData
(
data
);
this
.
mr
.
setData
(
data
);
});
});
...
...
app/assets/javascripts/vue_merge_request_widget/services/mr_widget_service.js
View file @
9f4b4de2
...
@@ -60,15 +60,15 @@ export default class MRWidgetService {
...
@@ -60,15 +60,15 @@ export default class MRWidgetService {
}
}
fetchApprovals
()
{
fetchApprovals
()
{
return
axios
.
get
(
this
.
apiApprovalsPath
).
then
(
res
=>
res
.
data
);
return
axios
.
get
(
this
.
apiApprovalsPath
).
then
(
(
res
)
=>
res
.
data
);
}
}
approveMergeRequest
()
{
approveMergeRequest
()
{
return
axios
.
post
(
this
.
apiApprovePath
).
then
(
res
=>
res
.
data
);
return
axios
.
post
(
this
.
apiApprovePath
).
then
(
(
res
)
=>
res
.
data
);
}
}
unapproveMergeRequest
()
{
unapproveMergeRequest
()
{
return
axios
.
post
(
this
.
apiUnapprovePath
).
then
(
res
=>
res
.
data
);
return
axios
.
post
(
this
.
apiUnapprovePath
).
then
(
(
res
)
=>
res
.
data
);
}
}
static
executeInlineAction
(
url
)
{
static
executeInlineAction
(
url
)
{
...
...
app/assets/javascripts/vue_merge_request_widget/stores/artifacts_list/getters.js
View file @
9f4b4de2
import
{
s__
,
n__
}
from
'
~/locale
'
;
import
{
s__
,
n__
}
from
'
~/locale
'
;
export
const
title
=
state
=>
{
export
const
title
=
(
state
)
=>
{
if
(
state
.
isLoading
)
{
if
(
state
.
isLoading
)
{
return
s__
(
'
BuildArtifacts|Loading artifacts
'
);
return
s__
(
'
BuildArtifacts|Loading artifacts
'
);
}
}
...
...
app/assets/javascripts/vue_shared/components/actions_button.vue
View file @
9f4b4de2
...
@@ -43,7 +43,7 @@ export default {
...
@@ -43,7 +43,7 @@ export default {
return
this
.
actions
.
length
>
1
;
return
this
.
actions
.
length
>
1
;
},
},
selectedAction
()
{
selectedAction
()
{
return
this
.
actions
.
find
(
x
=>
x
.
key
===
this
.
selectedKey
)
||
this
.
actions
[
0
];
return
this
.
actions
.
find
(
(
x
)
=>
x
.
key
===
this
.
selectedKey
)
||
this
.
actions
[
0
];
},
},
},
},
methods
:
{
methods
:
{
...
...
app/assets/javascripts/vue_shared/components/awards_list.vue
View file @
9f4b4de2
...
@@ -48,7 +48,7 @@ export default {
...
@@ -48,7 +48,7 @@ export default {
groupedAwards
()
{
groupedAwards
()
{
const
{
thumbsup
,
thumbsdown
,
...
rest
}
=
{
const
{
thumbsup
,
thumbsdown
,
...
rest
}
=
{
...
this
.
groupedDefaultAwards
,
...
this
.
groupedDefaultAwards
,
...
groupBy
(
this
.
awards
,
x
=>
x
.
name
),
...
groupBy
(
this
.
awards
,
(
x
)
=>
x
.
name
),
};
};
return
[
return
[
...
@@ -73,7 +73,7 @@ export default {
...
@@ -73,7 +73,7 @@ export default {
return
false
;
return
false
;
}
}
return
awardList
.
some
(
award
=>
award
.
user
.
id
===
this
.
currentUserId
);
return
awardList
.
some
(
(
award
)
=>
award
.
user
.
id
===
this
.
currentUserId
);
},
},
createAwardList
(
name
,
list
)
{
createAwardList
(
name
,
list
)
{
return
{
return
{
...
@@ -95,11 +95,11 @@ export default {
...
@@ -95,11 +95,11 @@ export default {
// Filter myself from list if I am awarded.
// Filter myself from list if I am awarded.
if
(
hasReactionByCurrentUser
)
{
if
(
hasReactionByCurrentUser
)
{
awardList
=
awardList
.
filter
(
award
=>
award
.
user
.
id
!==
this
.
currentUserId
);
awardList
=
awardList
.
filter
(
(
award
)
=>
award
.
user
.
id
!==
this
.
currentUserId
);
}
}
// Get only 9-10 usernames to show in tooltip text.
// Get only 9-10 usernames to show in tooltip text.
const
namesToShow
=
awardList
.
slice
(
0
,
TOOLTIP_NAME_COUNT
).
map
(
award
=>
award
.
user
.
name
);
const
namesToShow
=
awardList
.
slice
(
0
,
TOOLTIP_NAME_COUNT
).
map
(
(
award
)
=>
award
.
user
.
name
);
// Get the remaining list to use in `and x more` text.
// Get the remaining list to use in `and x more` text.
const
remainingAwardList
=
awardList
.
slice
(
TOOLTIP_NAME_COUNT
,
awardList
.
length
);
const
remainingAwardList
=
awardList
.
slice
(
TOOLTIP_NAME_COUNT
,
awardList
.
length
);
...
...
app/assets/javascripts/vue_shared/components/commit.vue
View file @
9f4b4de2
...
@@ -54,7 +54,7 @@ export default {
...
@@ -54,7 +54,7 @@ export default {
type
:
Object
,
type
:
Object
,
required
:
false
,
required
:
false
,
default
:
undefined
,
default
:
undefined
,
validator
:
ref
=>
validator
:
(
ref
)
=>
ref
===
undefined
||
(
Number
.
isFinite
(
ref
.
iid
)
&&
isString
(
ref
.
path
)
&&
!
isEmpty
(
ref
.
path
)),
ref
===
undefined
||
(
Number
.
isFinite
(
ref
.
iid
)
&&
isString
(
ref
.
path
)
&&
!
isEmpty
(
ref
.
path
)),
},
},
...
...
app/assets/javascripts/vue_shared/components/confirm_modal.vue
View file @
9f4b4de2
...
@@ -30,8 +30,8 @@ export default {
...
@@ -30,8 +30,8 @@ export default {
};
};
},
},
mounted
()
{
mounted
()
{
document
.
querySelectorAll
(
this
.
selector
).
forEach
(
button
=>
{
document
.
querySelectorAll
(
this
.
selector
).
forEach
(
(
button
)
=>
{
button
.
addEventListener
(
'
click
'
,
e
=>
{
button
.
addEventListener
(
'
click
'
,
(
e
)
=>
{
e
.
preventDefault
();
e
.
preventDefault
();
this
.
path
=
button
.
dataset
.
path
;
this
.
path
=
button
.
dataset
.
path
;
...
...
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