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
73f324ca
Commit
73f324ca
authored
Jun 28, 2021
by
Alper Akgun
Committed by
David O'Regan
Jun 28, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Suggest a unique name for registration group path[RUN AS-IF-FOSS]
parent
a32eb7a9
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
12 additions
and
23 deletions
+12
-23
app/assets/javascripts/group.js
app/assets/javascripts/group.js
+1
-1
app/assets/javascripts/pages/groups/new/group_path_validator.js
...sets/javascripts/pages/groups/new/group_path_validator.js
+3
-10
app/views/groups/_import_group_from_file_panel.html.haml
app/views/groups/_import_group_from_file_panel.html.haml
+1
-2
app/views/shared/_group_form.html.haml
app/views/shared/_group_form.html.haml
+1
-2
ee/app/views/registrations/groups/new.html.haml
ee/app/views/registrations/groups/new.html.haml
+1
-2
ee/app/views/subscriptions/groups/edit.html.haml
ee/app/views/subscriptions/groups/edit.html.haml
+1
-2
locale/gitlab.pot
locale/gitlab.pot
+1
-1
spec/features/groups/import_export/import_file_spec.rb
spec/features/groups/import_export/import_file_spec.rb
+1
-1
spec/features/groups_spec.rb
spec/features/groups_spec.rb
+2
-2
No files found.
app/assets/javascripts/group.js
View file @
73f324ca
...
...
@@ -16,7 +16,7 @@ export default class Group {
if
(
groupName
.
value
===
''
)
{
groupName
.
addEventListener
(
'
keyup
'
,
this
.
updateHandler
);
groupName
.
addEventListener
(
'
blur
'
,
this
.
updateGroupPathSlugHandler
);
groupName
.
addEventListener
(
'
keyup
'
,
this
.
updateGroupPathSlugHandler
);
}
});
...
...
app/assets/javascripts/pages/groups/new/group_path_validator.js
View file @
73f324ca
...
...
@@ -12,7 +12,6 @@ const parentIdSelector = 'group_parent_id';
const
successMessageSelector
=
'
.validation-success
'
;
const
pendingMessageSelector
=
'
.validation-pending
'
;
const
unavailableMessageSelector
=
'
.validation-error
'
;
const
suggestionsMessageSelector
=
'
.gl-path-suggestions
'
;
const
inputGroupSelector
=
'
.input-group
'
;
export
default
class
GroupPathValidator
extends
InputValidator
{
...
...
@@ -57,7 +56,9 @@ export default class GroupPathValidator extends InputValidator {
);
if
(
data
.
exists
)
{
GroupPathValidator
.
showSuggestions
(
inputDomElement
,
data
.
suggests
);
const
[
suggestedSlug
]
=
data
.
suggests
;
const
targetDomElement
=
document
.
querySelector
(
'
.js-autofill-group-path
'
);
targetDomElement
.
value
=
suggestedSlug
;
}
})
.
catch
(()
=>
...
...
@@ -68,14 +69,6 @@ export default class GroupPathValidator extends InputValidator {
}
}
static
showSuggestions
(
inputDomElement
,
suggestions
)
{
const
messageElement
=
inputDomElement
.
parentElement
.
parentElement
.
querySelector
(
suggestionsMessageSelector
,
);
const
textSuggestions
=
suggestions
&&
suggestions
.
length
>
0
?
suggestions
.
join
(
'
,
'
)
:
'
none
'
;
messageElement
.
textContent
=
textSuggestions
;
}
static
setMessageVisibility
(
inputDomElement
,
messageSelector
,
isVisible
=
true
)
{
const
messageElement
=
inputDomElement
.
closest
(
inputGroupSelector
)
...
...
app/views/groups/_import_group_from_file_panel.html.haml
View file @
73f324ca
...
...
@@ -33,8 +33,7 @@
title:
_
(
'Please choose a group URL with no special characters.'
),
"data-bind-in"
=>
"
#{
'create_chat_team'
if
Gitlab
.
config
.
mattermost
.
enabled
}
"
%p
.validation-error.gl-field-error.field-validation.hide
=
_
(
'Group path is already taken. Suggestions: '
)
%span
.gl-path-suggestions
=
_
(
"Group path is already taken. We've suggested one that is available."
)
%p
.validation-success.gl-field-success.field-validation.hide
=
_
(
'Group path is available.'
)
%p
.validation-pending.gl-field-error-ignore.field-validation.hide
=
_
(
'Checking group path availability...'
)
.form-group
...
...
app/views/shared/_group_form.html.haml
View file @
73f324ca
...
...
@@ -28,8 +28,7 @@
title:
_
(
'Please choose a group URL with no special characters.'
),
"data-bind-in"
=>
"
#{
'create_chat_team'
if
Gitlab
.
config
.
mattermost
.
enabled
}
"
%p
.validation-error.gl-field-error.field-validation.hide
=
_
(
'Group path is already taken. Suggestions: '
)
%span
.gl-path-suggestions
=
_
(
"Group path is already taken. We've suggested one that is available."
)
%p
.validation-success.gl-field-success.field-validation.hide
=
_
(
'Group path is available.'
)
%p
.validation-pending.gl-field-error-ignore.field-validation.hide
=
_
(
'Checking group URL availability...'
)
...
...
ee/app/views/registrations/groups/new.html.haml
View file @
73f324ca
...
...
@@ -35,8 +35,7 @@
pattern:
Gitlab
::
PathRegex
::
NAMESPACE_FORMAT_REGEX_JS
,
title:
_
(
'Please choose a group URL with no special characters.'
)
%p
.validation-error.gl-field-error.field-validation.hide
=
_
(
'Group path is already taken. Suggestions: '
)
%span
.gl-path-suggestions
=
_
(
"Group path is already taken. We've suggested one that is available."
)
%p
.validation-success.gl-field-success.field-validation.hide
=
_
(
'Group path is available.'
)
%p
.validation-pending.gl-field-error-ignore.field-validation.hide
=
_
(
'Checking group path availability...'
)
.row
...
...
ee/app/views/subscriptions/groups/edit.html.haml
View file @
73f324ca
...
...
@@ -36,8 +36,7 @@
pattern:
Gitlab
::
PathRegex
::
NAMESPACE_FORMAT_REGEX_JS
,
title:
_
(
'Please choose a group URL with no special characters.'
)
%p
.validation-error.gl-field-error.field-validation.hide
=
_
(
'Group path is already taken. Suggestions: '
)
%span
.gl-path-suggestions
=
_
(
"Group path is already taken. We've suggested one that is available."
)
%p
.validation-success.gl-field-success.field-validation.hide
=
_
(
'Group path is available.'
)
%p
.validation-pending.gl-field-error-ignore.field-validation.hide
=
_
(
'Checking group path availability...'
)
.row
...
...
locale/gitlab.pot
View file @
73f324ca
...
...
@@ -15346,7 +15346,7 @@ msgstr ""
msgid "Group overview content"
msgstr ""
msgid "Group path is already taken.
Suggestions:
"
msgid "Group path is already taken.
We've suggested one that is available.
"
msgstr ""
msgid "Group path is available."
...
...
spec/features/groups/import_export/import_file_spec.rb
View file @
73f324ca
...
...
@@ -77,7 +77,7 @@ RSpec.describe 'Import/Export - Group Import', :js do
click_link
'Import group'
fill_in
:import_group_path
,
with:
'test-group-import'
expect
(
page
).
to
have_content
'Group path is already taken. Suggestions: test-group-import1'
expect
(
page
).
to
have_content
"Group path is already taken. We've suggested one that is available."
end
end
end
...
...
spec/features/groups_spec.rb
View file @
73f324ca
...
...
@@ -90,7 +90,7 @@ RSpec.describe 'Group' do
fill_in
'group_path'
,
with:
user
.
username
wait_for_requests
expect
(
page
).
to
have_content
(
'Group path is already taken'
)
expect
(
page
).
to
have_content
(
"Group path is already taken. We've suggested one that is available."
)
end
it
'does not break after an invalid form submit'
do
...
...
@@ -257,7 +257,7 @@ RSpec.describe 'Group' do
fill_in
'Group URL'
,
with:
subgroup
.
path
wait_for_requests
expect
(
page
).
to
have_content
(
'Group path is already taken'
)
expect
(
page
).
to
have_content
(
"Group path is already taken. We've suggested one that is available."
)
end
end
end
...
...
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