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
f385d647
Commit
f385d647
authored
Nov 27, 2017
by
Simon Knox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplify usage of issuable mixin
parent
0a87e307
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
18 deletions
+13
-18
app/assets/javascripts/sidebar/components/lock/edit_form.vue
app/assets/javascripts/sidebar/components/lock/edit_form.vue
+2
-7
app/assets/javascripts/sidebar/components/lock/lock_issue_sidebar.vue
...avascripts/sidebar/components/lock/lock_issue_sidebar.vue
+2
-7
app/assets/javascripts/vue_shared/mixins/issuable.js
app/assets/javascripts/vue_shared/mixins/issuable.js
+9
-4
No files found.
app/assets/javascripts/sidebar/components/lock/edit_form.vue
View file @
f385d647
...
@@ -18,11 +18,6 @@ export default {
...
@@ -18,11 +18,6 @@ export default {
required
:
true
,
required
:
true
,
type
:
Function
,
type
:
Function
,
},
},
issuableType
:
{
required
:
true
,
type
:
String
,
},
},
},
mixins
:
[
mixins
:
[
...
@@ -39,13 +34,13 @@ export default {
...
@@ -39,13 +34,13 @@ export default {
<div
class=
"dropdown open"
>
<div
class=
"dropdown open"
>
<div
class=
"dropdown-menu sidebar-item-warning-message"
>
<div
class=
"dropdown-menu sidebar-item-warning-message"
>
<p
class=
"text"
v-if=
"isLocked"
>
<p
class=
"text"
v-if=
"isLocked"
>
Unlock this
{{
issuableDisplayName
(
issuableType
)
}}
?
Unlock this
{{
issuableDisplayName
}}
?
<strong>
Everyone
</strong>
<strong>
Everyone
</strong>
will be able to comment.
will be able to comment.
</p>
</p>
<p
class=
"text"
v-else
>
<p
class=
"text"
v-else
>
Lock this
{{
issuableDisplayName
(
issuableType
)
}}
?
Lock this
{{
issuableDisplayName
}}
?
Only
Only
<strong>
project members
</strong>
<strong>
project members
</strong>
will be able to comment.
will be able to comment.
...
...
app/assets/javascripts/sidebar/components/lock/lock_issue_sidebar.vue
View file @
f385d647
...
@@ -23,11 +23,6 @@ export default {
...
@@ -23,11 +23,6 @@ export default {
return
mediatorObject
.
service
&&
mediatorObject
.
service
.
update
&&
mediatorObject
.
store
;
return
mediatorObject
.
service
&&
mediatorObject
.
service
.
update
&&
mediatorObject
.
store
;
},
},
},
},
issuableType
:
{
required
:
true
,
type
:
String
,
},
},
},
mixins
:
[
mixins
:
[
...
@@ -59,7 +54,7 @@ export default {
...
@@ -59,7 +54,7 @@ export default {
discussion_locked
:
locked
,
discussion_locked
:
locked
,
})
})
.
then
(()
=>
location
.
reload
())
.
then
(()
=>
location
.
reload
())
.
catch
(()
=>
Flash
(
this
.
__
(
`Something went wrong trying to change the locked state of this
${
this
.
issuableDisplayName
(
this
.
issuableType
)
}
`
)));
.
catch
(()
=>
Flash
(
this
.
__
(
`Something went wrong trying to change the locked state of this
${
this
.
issuableDisplayName
}
`
)));
},
},
},
},
};
};
...
@@ -77,7 +72,7 @@ export default {
...
@@ -77,7 +72,7 @@ export default {
</div>
</div>
<div
class=
"title hide-collapsed"
>
<div
class=
"title hide-collapsed"
>
Lock
{{
issuableDisplayName
(
issuableType
)
}}
Lock
{{
issuableDisplayName
}}
<button
<button
v-if=
"isEditable"
v-if=
"isEditable"
class=
"pull-right lock-edit btn btn-blank"
class=
"pull-right lock-edit btn btn-blank"
...
...
app/assets/javascripts/vue_shared/mixins/issuable.js
View file @
f385d647
export
default
{
export
default
{
methods
:
{
props
:
{
issuableDisplayName
(
issuableType
)
{
issuableType
:
{
const
displayName
=
issuableType
.
replace
(
/_/
,
'
'
);
required
:
true
,
type
:
String
,
},
},
return
this
.
__
?
this
.
__
(
displayName
)
:
displayName
;
computed
:
{
issuableDisplayName
()
{
return
this
.
issuableType
.
replace
(
/_/g
,
'
'
);
},
},
},
},
};
};
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