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
87ae36b1
Commit
87ae36b1
authored
Mar 30, 2021
by
pburdette
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable trigger button
When making a request disable the trigger button until redirected.
parent
95bc54ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
app/assets/javascripts/jobs/components/manual_variables_form.vue
...ets/javascripts/jobs/components/manual_variables_form.vue
+9
-1
spec/frontend/jobs/components/manual_variables_form_spec.js
spec/frontend/jobs/components/manual_variables_form_spec.js
+6
-0
No files found.
app/assets/javascripts/jobs/components/manual_variables_form.vue
View file @
87ae36b1
...
@@ -43,6 +43,7 @@ export default {
...
@@ -43,6 +43,7 @@ export default {
variables
:
[],
variables
:
[],
key
:
''
,
key
:
''
,
secretValue
:
''
,
secretValue
:
''
,
triggerBtnDisabled
:
false
,
};
};
},
},
computed
:
{
computed
:
{
...
@@ -98,6 +99,11 @@ export default {
...
@@ -98,6 +99,11 @@ export default {
1
,
1
,
);
);
},
},
trigger
()
{
this
.
triggerBtnDisabled
=
true
;
this
.
triggerManualJob
(
this
.
variables
);
},
},
},
};
};
</
script
>
</
script
>
...
@@ -182,7 +188,9 @@ export default {
...
@@ -182,7 +188,9 @@ export default {
variant=
"info"
variant=
"info"
category=
"primary"
category=
"primary"
:aria-label=
"__('Trigger manual job')"
:aria-label=
"__('Trigger manual job')"
@
click=
"triggerManualJob(variables)"
:disabled=
"triggerBtnDisabled"
data-testid=
"trigger-manual-job-btn"
@
click=
"trigger"
>
>
{{
action
.
button_title
}}
{{
action
.
button_title
}}
</gl-button>
</gl-button>
...
...
spec/frontend/jobs/components/manual_variables_form_spec.js
View file @
87ae36b1
...
@@ -23,6 +23,8 @@ describe('Manual Variables Form', () => {
...
@@ -23,6 +23,8 @@ describe('Manual Variables Form', () => {
});
});
};
};
const
findTriggerBtn
=
()
=>
wrapper
.
find
(
'
[data-testid="trigger-manual-job-btn"]
'
);
beforeEach
(()
=>
{
beforeEach
(()
=>
{
factory
(
requiredProps
);
factory
(
requiredProps
);
});
});
...
@@ -53,6 +55,10 @@ describe('Manual Variables Form', () => {
...
@@ -53,6 +55,10 @@ describe('Manual Variables Form', () => {
expect
(
wrapper
.
find
(
'
a
'
).
attributes
(
'
href
'
)).
toBe
(
requiredProps
.
variablesSettingsUrl
);
expect
(
wrapper
.
find
(
'
a
'
).
attributes
(
'
href
'
)).
toBe
(
requiredProps
.
variablesSettingsUrl
);
});
});
it
(
'
trigger button is not disabled on mount
'
,
()
=>
{
expect
(
findTriggerBtn
().
props
(
'
disabled
'
)).
toBe
(
false
);
});
describe
(
'
when adding a new variable
'
,
()
=>
{
describe
(
'
when adding a new variable
'
,
()
=>
{
it
(
'
creates a new variable when user types a new key and resets the form
'
,
(
done
)
=>
{
it
(
'
creates a new variable when user types a new key and resets the form
'
,
(
done
)
=>
{
wrapper
.
vm
wrapper
.
vm
...
...
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