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
cbb53c38
Commit
cbb53c38
authored
Aug 18, 2020
by
Taurie Davis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate knative domain loading button
parent
49a39c70
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
12 deletions
+14
-12
app/assets/javascripts/clusters/components/knative_domain_editor.vue
...javascripts/clusters/components/knative_domain_editor.vue
+9
-6
spec/frontend/clusters/components/knative_domain_editor_spec.js
...rontend/clusters/components/knative_domain_editor_spec.js
+5
-6
No files found.
app/assets/javascripts/clusters/components/knative_domain_editor.vue
View file @
cbb53c38
...
...
@@ -6,8 +6,8 @@ import {
GlLoadingIcon
,
GlSearchBoxByType
,
GlSprintf
,
GlButton
,
}
from
'
@gitlab/ui
'
;
import
LoadingButton
from
'
~/vue_shared/components/loading_button.vue
'
;
import
ClipboardButton
from
'
../../vue_shared/components/clipboard_button.vue
'
;
import
{
__
,
s__
}
from
'
~/locale
'
;
...
...
@@ -17,7 +17,7 @@ const { UPDATING, UNINSTALLING } = APPLICATION_STATUS;
export
default
{
components
:
{
Loading
Button
,
Gl
Button
,
ClipboardButton
,
GlLoadingIcon
,
GlDeprecatedDropdown
,
...
...
@@ -215,13 +215,16 @@ export default {
}}
</p>
<loading-button
class=
"btn-success js-knative-save-domain-button mt-3 ml-3"
<gl-button
class=
"js-knative-save-domain-button gl-mt-5 gl-ml-5"
variant=
"success"
category=
"primary"
:loading=
"saving"
:disabled=
"saveButtonDisabled"
:label=
"saveButtonLabel"
@
click=
"$emit('save')"
/>
>
{{
saveButtonLabel
}}
</gl-button>
</
template
>
</div>
</template>
spec/frontend/clusters/components/knative_domain_editor_spec.js
View file @
cbb53c38
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlDeprecatedDropdownItem
}
from
'
@gitlab/ui
'
;
import
{
GlDeprecatedDropdownItem
,
GlButton
}
from
'
@gitlab/ui
'
;
import
KnativeDomainEditor
from
'
~/clusters/components/knative_domain_editor.vue
'
;
import
LoadingButton
from
'
~/vue_shared/components/loading_button.vue
'
;
import
{
APPLICATION_STATUS
}
from
'
~/clusters/constants
'
;
const
{
UPDATING
}
=
APPLICATION_STATUS
;
...
...
@@ -79,7 +78,7 @@ describe('KnativeDomainEditor', () => {
});
it
(
'
triggers save event and pass current knative hostname
'
,
()
=>
{
wrapper
.
find
(
Loading
Button
).
vm
.
$emit
(
'
click
'
);
wrapper
.
find
(
Gl
Button
).
vm
.
$emit
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
wrapper
.
emitted
(
'
save
'
).
length
).
toEqual
(
1
);
});
...
...
@@ -166,15 +165,15 @@ describe('KnativeDomainEditor', () => {
});
it
(
'
renders loading spinner in save button
'
,
()
=>
{
expect
(
wrapper
.
find
(
Loading
Button
).
props
(
'
loading
'
)).
toBe
(
true
);
expect
(
wrapper
.
find
(
Gl
Button
).
props
(
'
loading
'
)).
toBe
(
true
);
});
it
(
'
renders disabled save button
'
,
()
=>
{
expect
(
wrapper
.
find
(
Loading
Button
).
props
(
'
disabled
'
)).
toBe
(
true
);
expect
(
wrapper
.
find
(
Gl
Button
).
props
(
'
disabled
'
)).
toBe
(
true
);
});
it
(
'
renders save button with "Saving" label
'
,
()
=>
{
expect
(
wrapper
.
find
(
LoadingButton
).
props
(
'
label
'
)).
toBe
(
'
Saving
'
);
expect
(
wrapper
.
find
(
GlButton
).
text
(
)).
toBe
(
'
Saving
'
);
});
});
});
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