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
a4c18163
Commit
a4c18163
authored
May 12, 2020
by
Derek Knox
Committed by
Denys Mishunov
May 12, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update PublishToolbar with GlButton loading flag
parent
9056f109
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
17 deletions
+15
-17
app/assets/javascripts/static_site_editor/components/publish_toolbar.vue
...scripts/static_site_editor/components/publish_toolbar.vue
+9
-6
spec/frontend/static_site_editor/components/publish_toolbar_spec.js
...end/static_site_editor/components/publish_toolbar_spec.js
+6
-11
No files found.
app/assets/javascripts/static_site_editor/components/publish_toolbar.vue
View file @
a4c18163
<
script
>
import
{
GlButton
,
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
GlButton
}
from
'
@gitlab/ui
'
;
export
default
{
components
:
{
GlButton
,
GlLoadingIcon
,
},
props
:
{
returnUrl
:
{
...
...
@@ -26,14 +25,18 @@ export default {
};
</
script
>
<
template
>
<div
class=
"d-flex bg-light border-top justify-content-between align-items-center py-3 px-4"
>
<gl-loading-icon
:class=
"
{ invisible: !savingChanges }" size="md" />
<div
class=
"d-flex bg-light border-top justify-content-end align-items-center py-3 px-4"
>
<div>
<gl-button
v-if=
"returnUrl"
ref=
"returnUrlLink"
:href=
"returnUrl"
>
{{
s__
(
'
StaticSiteEditor|Return to site
'
)
}}
</gl-button>
<gl-button
variant=
"success"
:disabled=
"!saveable || savingChanges"
@
click=
"$emit('submit')"
>
{{
__
(
'
Submit Changes
'
)
}}
<gl-button
variant=
"success"
:disabled=
"!saveable"
:loading=
"savingChanges"
@
click=
"$emit('submit')"
>
<span>
{{
__
(
'
Submit Changes
'
)
}}
</span>
</gl-button>
</div>
</div>
...
...
spec/frontend/static_site_editor/components/publish_toolbar_spec.js
View file @
a4c18163
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlButton
,
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
GlButton
}
from
'
@gitlab/ui
'
;
import
PublishToolbar
from
'
~/static_site_editor/components/publish_toolbar.vue
'
;
...
...
@@ -19,7 +19,6 @@ describe('Static Site Editor Toolbar', () => {
const
findReturnUrlLink
=
()
=>
wrapper
.
find
({
ref
:
'
returnUrlLink
'
});
const
findSaveChangesButton
=
()
=>
wrapper
.
find
(
GlButton
);
const
findLoadingIndicator
=
()
=>
wrapper
.
find
(
GlLoadingIcon
);
beforeEach
(()
=>
{
buildWrapper
();
...
...
@@ -37,8 +36,8 @@ describe('Static Site Editor Toolbar', () => {
expect
(
findSaveChangesButton
().
attributes
(
'
disabled
'
)).
toBe
(
'
true
'
);
});
it
(
'
does not
display saving changes indicato
r
'
,
()
=>
{
expect
(
find
LoadingIndicator
().
classes
()).
toContain
(
'
invisible
'
);
it
(
'
does not
render the Submit Changes button with a loade
r
'
,
()
=>
{
expect
(
find
SaveChangesButton
().
props
(
'
loading
'
)).
toBe
(
false
);
});
it
(
'
does not render returnUrl link
'
,
()
=>
{
...
...
@@ -62,15 +61,11 @@ describe('Static Site Editor Toolbar', () => {
describe
(
'
when saving changes
'
,
()
=>
{
beforeEach
(()
=>
{
buildWrapper
({
sav
eable
:
true
,
sav
ingChanges
:
true
});
buildWrapper
({
savingChanges
:
true
});
});
it
(
'
disables Submit Changes button
'
,
()
=>
{
expect
(
findSaveChangesButton
().
attributes
(
'
disabled
'
)).
toBe
(
'
true
'
);
});
it
(
'
displays saving changes indicator
'
,
()
=>
{
expect
(
findLoadingIndicator
().
classes
()).
not
.
toContain
(
'
invisible
'
);
it
(
'
renders the Submit Changes button with a loading indicator
'
,
()
=>
{
expect
(
findSaveChangesButton
().
props
(
'
loading
'
)).
toBe
(
true
);
});
});
...
...
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