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
3ca36aec
Commit
3ca36aec
authored
Nov 17, 2021
by
Mark Florian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use secondary action instead of cancel
parent
2d3e5fbd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
app/assets/javascripts/set_status_modal/set_status_modal_wrapper.vue
...javascripts/set_status_modal/set_status_modal_wrapper.vue
+4
-4
spec/frontend/set_status_modal/set_status_modal_wrapper_spec.js
...rontend/set_status_modal/set_status_modal_wrapper_spec.js
+7
-7
No files found.
app/assets/javascripts/set_status_modal/set_status_modal_wrapper.vue
View file @
3ca36aec
...
...
@@ -237,7 +237,7 @@ export default {
statusTimeRanges
,
safeHtmlConfig
:
{
ADD_TAGS
:
[
'
gl-emoji
'
]
},
actionPrimary
:
{
text
:
s__
(
'
SetStatusModal|Set status
'
)
},
action
Cancel
:
{
text
:
s__
(
'
SetStatusModal|Remove status
'
)
},
action
Secondary
:
{
text
:
s__
(
'
SetStatusModal|Remove status
'
)
},
};
</
script
>
...
...
@@ -246,12 +246,12 @@ export default {
:title=
"s__('SetStatusModal|Set a status')"
:modal-id=
"modalId"
:action-primary=
"$options.actionPrimary"
:action-
cancel=
"$options.actionCancel
"
:action-
secondary=
"$options.actionSecondary
"
modal-class=
"set-user-status-modal"
@
shown=
"setupEmojiListAndAutocomplete"
@
hide=
"hideEmojiMenu"
@
ok
=
"setStatus"
@
cancel
=
"removeStatus"
@
primary
=
"setStatus"
@
secondary
=
"removeStatus"
>
<div>
<input
...
...
spec/frontend/set_status_modal/set_status_modal_wrapper_spec.js
View file @
3ca36aec
...
...
@@ -198,7 +198,7 @@ describe('SetStatusModalWrapper', () => {
});
it
(
'
clicking "removeStatus" clears the emoji and message fields
'
,
async
()
=>
{
findModal
().
vm
.
$emit
(
'
cancel
'
);
findModal
().
vm
.
$emit
(
'
secondary
'
);
await
wrapper
.
vm
.
$nextTick
();
expect
(
findFormField
(
'
message
'
).
element
.
value
).
toBe
(
''
);
...
...
@@ -206,7 +206,7 @@ describe('SetStatusModalWrapper', () => {
});
it
(
'
clicking "setStatus" submits the user status
'
,
async
()
=>
{
findModal
().
vm
.
$emit
(
'
ok
'
);
findModal
().
vm
.
$emit
(
'
primary
'
);
await
wrapper
.
vm
.
$nextTick
();
// set the availability status
...
...
@@ -215,7 +215,7 @@ describe('SetStatusModalWrapper', () => {
// set the currentClearStatusAfter to 30 minutes
wrapper
.
find
(
'
[data-testid="thirtyMinutes"]
'
).
vm
.
$emit
(
'
click
'
);
findModal
().
vm
.
$emit
(
'
ok
'
);
findModal
().
vm
.
$emit
(
'
primary
'
);
await
wrapper
.
vm
.
$nextTick
();
const
commonParams
=
{
...
...
@@ -237,7 +237,7 @@ describe('SetStatusModalWrapper', () => {
});
it
(
'
calls the "onUpdateSuccess" handler
'
,
async
()
=>
{
findModal
().
vm
.
$emit
(
'
ok
'
);
findModal
().
vm
.
$emit
(
'
primary
'
);
await
wrapper
.
vm
.
$nextTick
();
expect
(
wrapper
.
vm
.
onUpdateSuccess
).
toHaveBeenCalled
();
...
...
@@ -253,7 +253,7 @@ describe('SetStatusModalWrapper', () => {
});
it
(
'
displays a toast success message
'
,
async
()
=>
{
findModal
().
vm
.
$emit
(
'
ok
'
);
findModal
().
vm
.
$emit
(
'
primary
'
);
await
wrapper
.
vm
.
$nextTick
();
expect
(
$toast
.
show
).
toHaveBeenCalledWith
(
'
Status updated
'
);
...
...
@@ -270,7 +270,7 @@ describe('SetStatusModalWrapper', () => {
});
it
(
'
calls the "onUpdateFail" handler
'
,
async
()
=>
{
findModal
().
vm
.
$emit
(
'
ok
'
);
findModal
().
vm
.
$emit
(
'
primary
'
);
await
wrapper
.
vm
.
$nextTick
();
expect
(
wrapper
.
vm
.
onUpdateFail
).
toHaveBeenCalled
();
...
...
@@ -286,7 +286,7 @@ describe('SetStatusModalWrapper', () => {
});
it
(
'
flashes an error message
'
,
async
()
=>
{
findModal
().
vm
.
$emit
(
'
ok
'
);
findModal
().
vm
.
$emit
(
'
primary
'
);
await
wrapper
.
vm
.
$nextTick
();
expect
(
createFlash
).
toHaveBeenCalledWith
({
...
...
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