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
bc684654
Commit
bc684654
authored
Jan 13, 2021
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab master
parents
97b2ec92
b71733d0
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
32 additions
and
17 deletions
+32
-17
app/assets/javascripts/pipeline_editor/pipeline_editor_app.vue
...ssets/javascripts/pipeline_editor/pipeline_editor_app.vue
+1
-1
app/models/user.rb
app/models/user.rb
+8
-1
app/views/shared/issuable/_sidebar.html.haml
app/views/shared/issuable/_sidebar.html.haml
+2
-2
changelogs/unreleased/215309-improve-the-error-message-username-has-already-been-taken-on-user-.yml
...rror-message-username-has-already-been-taken-on-user-.yml
+5
-0
changelogs/unreleased/yo-move-issue-gl-button.yml
changelogs/unreleased/yo-move-issue-gl-button.yml
+5
-0
config/locales/en.yml
config/locales/en.yml
+1
-0
spec/frontend/pipeline_editor/pipeline_editor_app_spec.js
spec/frontend/pipeline_editor/pipeline_editor_app_spec.js
+8
-11
spec/models/user_spec.rb
spec/models/user_spec.rb
+1
-1
spec/services/users/update_service_spec.rb
spec/services/users/update_service_spec.rb
+1
-1
No files found.
app/assets/javascripts/pipeline_editor/pipeline_editor_app.vue
View file @
bc684654
...
...
@@ -126,7 +126,7 @@ export default {
return
this
.
$apollo
.
queries
.
content
.
loading
;
},
isBlobContentError
()
{
return
this
.
failureType
===
LOAD_FAILURE_NO_FILE
||
this
.
failureType
===
LOAD_FAILURE_UNKNOWN
;
return
this
.
failureType
===
LOAD_FAILURE_NO_FILE
;
},
isCiConfigDataLoading
()
{
return
this
.
$apollo
.
queries
.
ciConfigData
.
loading
;
...
...
app/models/user.rb
View file @
bc684654
...
...
@@ -1378,7 +1378,14 @@ class User < ApplicationRecord
def
set_username_errors
namespace_path_errors
=
self
.
errors
.
delete
(
:"namespace.path"
)
self
.
errors
[
:username
].
concat
(
namespace_path_errors
)
if
namespace_path_errors
return
unless
namespace_path_errors
&
.
any?
if
namespace_path_errors
.
include?
(
'has already been taken'
)
&&
!
User
.
exists?
(
username:
username
)
self
.
errors
.
add
(
:base
,
:username_exists_as_a_different_namespace
)
else
self
.
errors
[
:username
].
concat
(
namespace_path_errors
)
end
end
def
username_changed_hook
...
...
app/views/shared/issuable/_sidebar.html.haml
View file @
bc684654
...
...
@@ -154,7 +154,7 @@
.sidebar-collapsed-icon
{
data:
{
toggle:
'tooltip'
,
placement:
'left'
,
container:
'body'
,
boundary:
'viewport'
},
title:
_
(
'Move issue'
)
}
=
custom_icon
(
'icon_arrow_right'
)
.dropdown.sidebar-move-issue-dropdown.hide-collapsed
%button
.btn.btn-default.btn-block.js-sidebar-dropdown-toggle.js-move-issue
{
type:
'button'
,
%button
.
gl-button.
btn.btn-default.btn-block.js-sidebar-dropdown-toggle.js-move-issue
{
type:
'button'
,
data:
{
toggle:
'dropdown'
,
display:
'static'
,
track_label:
"right_sidebar"
,
track_property:
"move_issue"
,
track_event:
"click_button"
,
track_value:
""
}
}
=
_
(
'Move issue'
)
.dropdown-menu.dropdown-menu-selectable.dropdown-extended-height
...
...
@@ -163,7 +163,7 @@
=
dropdown_content
=
dropdown_loading
=
dropdown_footer
add_content_class:
true
do
%button
.btn.btn-success.sidebar-move-issue-confirmation-button.js-move-issue-confirmation-button
{
type:
'button'
,
disabled:
true
}
%button
.
gl-button.
btn.btn-success.sidebar-move-issue-confirmation-button.js-move-issue-confirmation-button
{
type:
'button'
,
disabled:
true
}
=
_
(
'Move'
)
=
loading_icon
(
css_class:
'gl-vertical-align-text-bottom sidebar-move-issue-confirmation-loading-icon'
)
...
...
changelogs/unreleased/215309-improve-the-error-message-username-has-already-been-taken-on-user-.yml
0 → 100644
View file @
bc684654
---
title
:
Improve error message when username and namespace conflict
merge_request
:
47537
author
:
type
:
changed
changelogs/unreleased/yo-move-issue-gl-button.yml
0 → 100644
View file @
bc684654
---
title
:
Add `gl-button` to move issue button in issue sidebar
merge_request
:
51285
author
:
Yogi (@yo)
type
:
other
config/locales/en.yml
View file @
bc684654
...
...
@@ -169,6 +169,7 @@ en:
format
:
"
%{attribute}
%{message}"
messages
:
label_already_exists_at_group_level
:
"
already
exists
at
group
level
for
%{group}.
Please
choose
another
one."
username_exists_as_a_different_namespace
:
A user, alias, or group already exists with that username.
wrong_size
:
"
is
the
wrong
size
(should
be
%{file_size})"
size_too_small
:
"
is
too
small
(should
be
at
least
%{file_size})"
size_too_big
:
"
is
too
big
(should
be
at
most
%{file_size})"
...
...
spec/frontend/pipeline_editor/pipeline_editor_app_spec.js
View file @
bc684654
...
...
@@ -448,16 +448,7 @@ describe('~/pipeline_editor/pipeline_editor_app.vue', () => {
const
expectedAlertMsg
=
'
There is no .gitlab-ci.yml file in this repository, please add one and visit the Pipeline Editor again.
'
;
it
(
'
does not show editor or commit form
'
,
async
()
=>
{
mockBlobContentData
.
mockRejectedValueOnce
(
new
Error
(
'
My error!
'
));
createComponentWithApollo
();
await
waitForPromises
();
expect
(
findEditorLite
().
exists
()).
toBe
(
false
);
expect
(
findTextEditor
().
exists
()).
toBe
(
false
);
});
it
(
'
shows a 404 error message
'
,
async
()
=>
{
it
(
'
shows a 404 error message and does not show editor or commit form
'
,
async
()
=>
{
mockBlobContentData
.
mockRejectedValueOnce
({
response
:
{
status
:
httpStatusCodes
.
NOT_FOUND
,
...
...
@@ -468,9 +459,11 @@ describe('~/pipeline_editor/pipeline_editor_app.vue', () => {
await
waitForPromises
();
expect
(
findAlert
().
text
()).
toBe
(
expectedAlertMsg
);
expect
(
findEditorLite
().
exists
()).
toBe
(
false
);
expect
(
findTextEditor
().
exists
()).
toBe
(
false
);
});
it
(
'
shows a 400 error message
'
,
async
()
=>
{
it
(
'
shows a 400 error message
and does not show editor or commit form
'
,
async
()
=>
{
mockBlobContentData
.
mockRejectedValueOnce
({
response
:
{
status
:
httpStatusCodes
.
BAD_REQUEST
,
...
...
@@ -481,6 +474,8 @@ describe('~/pipeline_editor/pipeline_editor_app.vue', () => {
await
waitForPromises
();
expect
(
findAlert
().
text
()).
toBe
(
expectedAlertMsg
);
expect
(
findEditorLite
().
exists
()).
toBe
(
false
);
expect
(
findTextEditor
().
exists
()).
toBe
(
false
);
});
it
(
'
shows a unkown error message
'
,
async
()
=>
{
...
...
@@ -489,6 +484,8 @@ describe('~/pipeline_editor/pipeline_editor_app.vue', () => {
await
waitForPromises
();
expect
(
findAlert
().
text
()).
toBe
(
'
The CI configuration was not loaded, please try again.
'
);
expect
(
findEditorLite
().
exists
()).
toBe
(
true
);
expect
(
findTextEditor
().
exists
()).
toBe
(
true
);
});
});
});
...
...
spec/models/user_spec.rb
View file @
bc684654
...
...
@@ -4280,7 +4280,7 @@ RSpec.describe User do
it
'adds the namespace errors to the user'
do
user
.
update
(
username:
new_username
)
expect
(
user
.
errors
.
full_messages
.
first
).
to
eq
(
'
Username has already been taken
'
)
expect
(
user
.
errors
.
full_messages
.
first
).
to
eq
(
'
A user, alias, or group already exists with that username.
'
)
end
end
end
...
...
spec/services/users/update_service_spec.rb
View file @
bc684654
...
...
@@ -31,7 +31,7 @@ RSpec.describe Users::UpdateService do
result
=
update_user
(
user
,
{
username:
'taken'
})
end
.
not_to
change
{
user
.
reload
.
username
}
expect
(
result
[
:status
]).
to
eq
(
:error
)
expect
(
result
[
:message
]).
to
eq
(
'
Username has already been taken
'
)
expect
(
result
[
:message
]).
to
eq
(
'
A user, alias, or group already exists with that username.
'
)
end
it
'updates the status if status params were given'
do
...
...
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