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
86a705c4
Commit
86a705c4
authored
Sep 23, 2020
by
Jarek Ostrowski
Committed by
Natalia Tepluhina
Sep 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update confidential form buttons
MR:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/40893
parent
613044b1
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
19 deletions
+23
-19
app/assets/javascripts/sidebar/components/confidential/edit_form_buttons.vue
...pts/sidebar/components/confidential/edit_form_buttons.vue
+10
-10
changelogs/unreleased/229344-update-confidential-form-buttons.yml
...gs/unreleased/229344-update-confidential-form-buttons.yml
+5
-0
spec/features/issues/user_sees_live_update_spec.rb
spec/features/issues/user_sees_live_update_spec.rb
+1
-1
spec/frontend/sidebar/confidential/edit_form_buttons_spec.js
spec/frontend/sidebar/confidential/edit_form_buttons_spec.js
+7
-8
No files found.
app/assets/javascripts/sidebar/components/confidential/edit_form_buttons.vue
View file @
86a705c4
<
script
>
<
script
>
import
$
from
'
jquery
'
;
import
$
from
'
jquery
'
;
import
{
Gl
LoadingIc
on
}
from
'
@gitlab/ui
'
;
import
{
Gl
Butt
on
}
from
'
@gitlab/ui
'
;
import
{
mapActions
}
from
'
vuex
'
;
import
{
mapActions
}
from
'
vuex
'
;
import
{
__
}
from
'
~/locale
'
;
import
{
__
}
from
'
~/locale
'
;
import
{
deprecatedCreateFlash
as
Flash
}
from
'
~/flash
'
;
import
{
deprecatedCreateFlash
as
Flash
}
from
'
~/flash
'
;
...
@@ -8,7 +8,7 @@ import eventHub from '../../event_hub';
...
@@ -8,7 +8,7 @@ import eventHub from '../../event_hub';
export
default
{
export
default
{
components
:
{
components
:
{
Gl
LoadingIc
on
,
Gl
Butt
on
,
},
},
props
:
{
props
:
{
fullPath
:
{
fullPath
:
{
...
@@ -64,18 +64,18 @@ export default {
...
@@ -64,18 +64,18 @@ export default {
<
template
>
<
template
>
<div
class=
"sidebar-item-warning-message-actions"
>
<div
class=
"sidebar-item-warning-message-actions"
>
<
button
type=
"button"
class=
"btn btn-default
gl-mr-3"
@
click=
"closeForm"
>
<
gl-button
class=
"
gl-mr-3"
@
click=
"closeForm"
>
{{
__
(
'
Cancel
'
)
}}
{{
__
(
'
Cancel
'
)
}}
</button>
</gl-button>
<button
<gl-button
type=
"button"
category=
"secondary"
class=
"btn btn-close"
variant=
"warning"
data-testid=
"confidential-toggle"
:disabled=
"isLoading"
:disabled=
"isLoading"
:loading=
"isLoading"
data-testid=
"confidential-toggle"
@
click.prevent=
"submitForm"
@
click.prevent=
"submitForm"
>
>
<gl-loading-icon
v-if=
"isLoading"
inline
/>
{{
toggleButtonText
}}
{{
toggleButtonText
}}
</button>
</
gl-
button>
</div>
</div>
</
template
>
</
template
>
changelogs/unreleased/229344-update-confidential-form-buttons.yml
0 → 100644
View file @
86a705c4
---
title
:
Update confidential form buttons to gl-button
merge_request
:
40893
author
:
type
:
changed
spec/features/issues/user_sees_live_update_spec.rb
View file @
86a705c4
...
@@ -39,7 +39,7 @@ RSpec.describe 'Issues > User sees live update', :js do
...
@@ -39,7 +39,7 @@ RSpec.describe 'Issues > User sees live update', :js do
expect
(
page
).
to
have_css
(
'.sidebar-item-warning-message'
)
expect
(
page
).
to
have_css
(
'.sidebar-item-warning-message'
)
within
(
'.sidebar-item-warning-message'
)
do
within
(
'.sidebar-item-warning-message'
)
do
find
(
'
.btn-close
'
).
click
find
(
'
[data-testid="confidential-toggle"]
'
).
click
end
end
wait_for_requests
wait_for_requests
...
...
spec/frontend/sidebar/confidential/edit_form_buttons_spec.js
View file @
86a705c4
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
EditFormButtons
from
'
~/sidebar/components/confidential/edit_form_buttons.vue
'
;
import
EditFormButtons
from
'
~/sidebar/components/confidential/edit_form_buttons.vue
'
;
import
eventHub
from
'
~/sidebar/event_hub
'
;
import
eventHub
from
'
~/sidebar/event_hub
'
;
...
@@ -56,11 +55,11 @@ describe('Edit Form Buttons', () => {
...
@@ -56,11 +55,11 @@ describe('Edit Form Buttons', () => {
});
});
it
(
'
disables the toggle button
'
,
()
=>
{
it
(
'
disables the toggle button
'
,
()
=>
{
expect
(
findConfidentialToggle
().
attributes
(
'
disabled
'
)).
toBe
(
'
disabled
'
);
expect
(
findConfidentialToggle
().
props
(
'
disabled
'
)).
toBe
(
true
);
});
});
it
(
'
finds the GlLoadingIc
on
'
,
()
=>
{
it
(
'
sets loading on the toggle butt
on
'
,
()
=>
{
expect
(
wrapper
.
find
(
GlLoadingIcon
).
exists
(
)).
toBe
(
true
);
expect
(
findConfidentialToggle
().
props
(
'
loading
'
)).
toBe
(
true
);
});
});
});
});
...
@@ -99,7 +98,7 @@ describe('Edit Form Buttons', () => {
...
@@ -99,7 +98,7 @@ describe('Edit Form Buttons', () => {
describe
(
'
when succeeds
'
,
()
=>
{
describe
(
'
when succeeds
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
createComponent
({
data
:
{
isLoading
:
false
},
props
:
{
confidential
:
true
}
});
createComponent
({
data
:
{
isLoading
:
false
},
props
:
{
confidential
:
true
}
});
findConfidentialToggle
().
trigger
(
'
click
'
);
findConfidentialToggle
().
vm
.
$emit
(
'
click
'
,
new
Event
(
'
click
'
)
);
});
});
it
(
'
dispatches the correct action
'
,
()
=>
{
it
(
'
dispatches the correct action
'
,
()
=>
{
...
@@ -109,9 +108,9 @@ describe('Edit Form Buttons', () => {
...
@@ -109,9 +108,9 @@ describe('Edit Form Buttons', () => {
});
});
});
});
it
(
'
resets loading
'
,
()
=>
{
it
(
'
resets loading
on the toggle button
'
,
()
=>
{
return
waitForPromises
().
then
(()
=>
{
return
waitForPromises
().
then
(()
=>
{
expect
(
wrapper
.
find
(
GlLoadingIcon
).
exists
(
)).
toBe
(
false
);
expect
(
findConfidentialToggle
().
props
(
'
loading
'
)).
toBe
(
false
);
});
});
});
});
...
@@ -135,7 +134,7 @@ describe('Edit Form Buttons', () => {
...
@@ -135,7 +134,7 @@ describe('Edit Form Buttons', () => {
props
:
{
confidential
:
true
},
props
:
{
confidential
:
true
},
resolved
:
false
,
resolved
:
false
,
});
});
findConfidentialToggle
().
trigger
(
'
click
'
);
findConfidentialToggle
().
vm
.
$emit
(
'
click
'
,
new
Event
(
'
click
'
)
);
});
});
it
(
'
calls flash with the correct message
'
,
()
=>
{
it
(
'
calls flash with the correct message
'
,
()
=>
{
...
...
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