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
7fbf5728
Commit
7fbf5728
authored
May 21, 2021
by
Samantha Ming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add validation feedback for visibility level
Issue:
https://gitlab.com/gitlab-org/gitlab/-/issues/327835
parent
eeb453fe
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
3 deletions
+31
-3
app/assets/javascripts/pages/projects/forks/new/components/fork_form.vue
...scripts/pages/projects/forks/new/components/fork_form.vue
+5
-2
locale/gitlab.pot
locale/gitlab.pot
+3
-0
spec/frontend/pages/projects/forks/new/components/fork_form_spec.js
...end/pages/projects/forks/new/components/fork_form_spec.js
+23
-1
No files found.
app/assets/javascripts/pages/projects/forks/new/components/fork_form.vue
View file @
7fbf5728
...
...
@@ -113,7 +113,6 @@ export default {
}),
visibility
:
initFormField
({
value
:
this
.
projectVisibility
,
skipValidation
:
true
,
}),
},
};
...
...
@@ -322,7 +321,11 @@ export default {
/>
</gl-form-group>
<gl-form-group>
<gl-form-group
v-validation:
[
form
.
showValidation
]
:invalid-feedback=
"s__('ForkProject|Please select a visibility level')"
:state=
"form.fields.visibility.state"
>
<label>
{{ s__('ForkProject|Visibility level') }}
<gl-link
:href=
"visibilityHelpPath"
target=
"_blank"
>
...
...
locale/gitlab.pot
View file @
7fbf5728
...
...
@@ -14294,6 +14294,9 @@ msgstr ""
msgid "ForkProject|Please select a namespace"
msgstr ""
msgid "ForkProject|Please select a visibility level"
msgstr ""
msgid "ForkProject|Private"
msgstr ""
...
...
spec/frontend/pages/projects/forks/new/components/fork_form_spec.js
View file @
7fbf5728
...
...
@@ -235,7 +235,7 @@ describe('ForkForm component', () => {
});
describe
(
'
onSubmit
'
,
()
=>
{
beforeEach
((
)
=>
{
const
setupComponent
=
(
fields
=
{}
)
=>
{
jest
.
spyOn
(
urlUtility
,
'
redirectTo
'
).
mockImplementation
();
mockGetRequest
();
...
...
@@ -245,9 +245,14 @@ describe('ForkForm component', () => {
namespaces
:
MOCK_NAMESPACES_RESPONSE
,
form
:
{
state
:
true
,
...
fields
,
},
},
);
};
beforeEach
(()
=>
{
setupComponent
();
});
const
selectedMockNamespaceIndex
=
1
;
...
...
@@ -279,6 +284,23 @@ describe('ForkForm component', () => {
expect
(
urlUtility
.
redirectTo
).
not
.
toHaveBeenCalled
();
});
it
(
'
does not make POST request if no visbility is checked
'
,
async
()
=>
{
jest
.
spyOn
(
axios
,
'
post
'
);
setupComponent
({
fields
:
{
visibility
:
{
value
:
null
,
},
},
});
await
submitForm
();
expect
(
wrapper
.
find
(
'
[name="visibility"]:checked
'
).
exists
()).
toBe
(
false
);
expect
(
axios
.
post
).
not
.
toHaveBeenCalled
();
});
});
describe
(
'
with valid form
'
,
()
=>
{
...
...
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