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
74922897
Commit
74922897
authored
Aug 20, 2020
by
Tom Quirk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add shared todo_button component
parent
be63a5e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
0 deletions
+60
-0
app/assets/javascripts/vue_shared/components/todo_button.vue
app/assets/javascripts/vue_shared/components/todo_button.vue
+60
-0
No files found.
app/assets/javascripts/vue_shared/components/todo_button.vue
0 → 100644
View file @
74922897
<
script
>
import
{
GlButton
}
from
'
@gitlab/ui
'
;
import
{
__
}
from
'
~/locale
'
;
const
MARK_TEXT
=
__
(
'
Mark as done
'
);
const
TODO_TEXT
=
__
(
'
Add a To-Do
'
);
export
default
{
components
:
{
GlButton
,
},
props
:
{
issuableId
:
{
type
:
Number
,
required
:
true
,
},
issuableType
:
{
type
:
String
,
required
:
true
,
},
isTodo
:
{
type
:
Boolean
,
required
:
false
,
default
:
true
,
},
isActionActive
:
{
type
:
Boolean
,
required
:
false
,
default
:
false
,
},
},
computed
:
{
buttonLabel
()
{
return
this
.
isTodo
?
MARK_TEXT
:
TODO_TEXT
;
},
buttonIcon
()
{
return
this
.
isTodo
?
'
todo-done
'
:
'
todo-add
'
;
},
},
methods
:
{
toggleTodo
()
{
this
.
$emit
(
'
toggleTodo
'
,
{
issuableType
:
this
.
issuableType
,
issuableId
:
this
.
issuableId
,
});
},
},
};
</
script
>
<
template
>
<div>
<slot
:toggleTodo=
"toggleTodo"
:label=
"buttonLabel"
>
<gl-button
:loading=
"isActionActive"
:aria-label=
"buttonLabel"
@
click=
"toggleTodo"
>
{{
buttonLabel
}}
</gl-button></slot
>
</div>
</
template
>
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