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
6f6da2f0
Commit
6f6da2f0
authored
Mar 15, 2021
by
Paul Gascou-Vaillancourt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Scroll to top of window on error
parent
4db43ced
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
6 deletions
+17
-6
ee/app/assets/javascripts/security_configuration/api_fuzzing/components/configuration_form.vue
...nfiguration/api_fuzzing/components/configuration_form.vue
+10
-6
ee/changelogs/unreleased/321201-api-fuzzing-form-ux-fine-tuning.yml
...ogs/unreleased/321201-api-fuzzing-form-ux-fine-tuning.yml
+5
-0
ee/spec/frontend/security_configuration/api_fuzzing/components/configuration_form_spec.js
...uration/api_fuzzing/components/configuration_form_spec.js
+2
-0
No files found.
ee/app/assets/javascripts/security_configuration/api_fuzzing/components/configuration_form.vue
View file @
6f6da2f0
...
...
@@ -54,7 +54,7 @@ export default {
data
()
{
return
{
isLoading
:
false
,
showError
:
false
,
isErrorVisible
:
false
,
targetUrl
:
{
field
:
'
targetUrl
'
,
label
:
s__
(
'
APIFuzzing|Target URL
'
),
...
...
@@ -159,7 +159,7 @@ export default {
methods
:
{
async
onSubmit
()
{
this
.
isLoading
=
true
;
this
.
showError
=
false
;
this
.
dismissError
()
;
try
{
const
input
=
{
projectPath
:
this
.
fullPath
,
...
...
@@ -186,21 +186,25 @@ export default {
variables
:
{
input
},
});
if
(
errors
.
length
)
{
this
.
showError
=
true
;
this
.
showError
()
;
}
else
{
this
.
ciYamlEditPath
=
gitlabCiYamlEditPath
;
this
.
configurationYaml
=
configurationYaml
;
this
.
$refs
[
CONFIGURATION_SNIPPET_MODAL_ID
].
show
();
}
}
catch
(
e
)
{
this
.
showError
=
true
;
this
.
showError
()
;
Sentry
.
captureException
(
e
);
}
finally
{
this
.
isLoading
=
false
;
}
},
showError
()
{
this
.
isErrorVisible
=
true
;
window
.
scrollTo
({
top
:
0
});
},
dismissError
()
{
this
.
showError
=
false
;
this
.
isErrorVisible
=
false
;
},
},
SCAN_MODES
,
...
...
@@ -209,7 +213,7 @@ export default {
<
template
>
<form
@
submit.prevent=
"onSubmit"
>
<gl-alert
v-if=
"
showError
"
variant=
"danger"
class=
"gl-mb-5"
@
dismiss=
"dismissError"
>
<gl-alert
v-if=
"
isErrorVisible
"
variant=
"danger"
class=
"gl-mb-5"
@
dismiss=
"dismissError"
>
{{
s__
(
'
APIFuzzing|The configuration could not be saved, please try again later.
'
)
}}
</gl-alert>
...
...
ee/changelogs/unreleased/321201-api-fuzzing-form-ux-fine-tuning.yml
0 → 100644
View file @
6f6da2f0
---
title
:
Scroll to top of window when API Fuzzing configuration fails
merge_request
:
56890
author
:
type
:
changed
ee/spec/frontend/security_configuration/api_fuzzing/components/configuration_form_spec.js
View file @
6f6da2f0
...
...
@@ -263,6 +263,7 @@ describe('EE - ApiFuzzingConfigurationForm', () => {
await
waitForPromises
();
expect
(
findAlert
().
exists
()).
toBe
(
true
);
expect
(
window
.
scrollTo
).
toHaveBeenCalledWith
({
top
:
0
});
});
it
(
'
shows an error on error-as-data
'
,
async
()
=>
{
...
...
@@ -287,6 +288,7 @@ describe('EE - ApiFuzzingConfigurationForm', () => {
await
waitForPromises
();
expect
(
findAlert
().
exists
()).
toBe
(
true
);
expect
(
window
.
scrollTo
).
toHaveBeenCalledWith
({
top
:
0
});
});
});
});
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