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
58565ac5
Commit
58565ac5
authored
Sep 27, 2017
by
Simon Knox
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'issue-board-edit-modal' into edit-board
parents
9b802ed9
32ac090e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
109 additions
and
84 deletions
+109
-84
app/assets/javascripts/boards/components/board_form.vue
app/assets/javascripts/boards/components/board_form.vue
+5
-1
app/assets/javascripts/boards/components/form_block.vue
app/assets/javascripts/boards/components/form_block.vue
+32
-39
app/assets/javascripts/boards/components/milestone_select.vue
...assets/javascripts/boards/components/milestone_select.vue
+72
-44
No files found.
app/assets/javascripts/boards/components/board_form.vue
View file @
58565ac5
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
Board name
Board name
</label>
</label>
<input
<input
ref=
"name"
class=
"form-control"
class=
"form-control"
type=
"text"
type=
"text"
id=
"board-new-name"
id=
"board-new-name"
...
@@ -64,7 +65,7 @@
...
@@ -64,7 +65,7 @@
<board-milestone-select
<board-milestone-select
:board=
"board"
:board=
"board"
:milestone-path=
"milestonePath"
:milestone-path=
"milestonePath"
v-model=
"board.milestone"
>
v-model=
"board.milestone
_id
"
>
</board-milestone-select>
</board-milestone-select>
</form-block>
</form-block>
...
@@ -154,6 +155,9 @@ export default Vue.extend({
...
@@ -154,6 +155,9 @@ export default Vue.extend({
if
(
this
.
currentBoard
&&
Object
.
keys
(
this
.
currentBoard
).
length
&&
this
.
currentPage
!==
'
new
'
)
{
if
(
this
.
currentBoard
&&
Object
.
keys
(
this
.
currentBoard
).
length
&&
this
.
currentPage
!==
'
new
'
)
{
this
.
board
=
Vue
.
util
.
extend
({},
this
.
currentBoard
);
this
.
board
=
Vue
.
util
.
extend
({},
this
.
currentBoard
);
}
}
if
(
this
.
$refs
.
name
)
{
this
.
$refs
.
name
.
focus
();
}
},
},
computed
:
{
computed
:
{
buttonText
()
{
buttonText
()
{
...
...
app/assets/javascripts/boards/components/form_block.vue
View file @
58565ac5
...
@@ -11,17 +11,8 @@
...
@@ -11,17 +11,8 @@
Edit
Edit
</a>
</a>
</div>
</div>
<div
<slot></slot>
v-if=
"editing"
<div>
class=
"dropdown open"
>
<input
v-if=
"fieldName"
:name=
"fieldName"
>
<slot></slot>
</div>
<div
:class=
"
{ invisible: editing }">
<slot
name=
"currentValue"
>
<slot
name=
"currentValue"
>
{{
defaultText
}}
{{
defaultText
}}
</slot>
</slot>
...
@@ -30,35 +21,37 @@
...
@@ -30,35 +21,37 @@
</
template
>
</
template
>
<
script
>
<
script
>
export
default
{
import
eventHub
from
'
../eventhub
'
;
props
:
{
defaultText
:
{
export
default
{
type
:
String
,
props
:
{
required
:
true
,
defaultText
:
{
},
type
:
String
,
title
:
{
required
:
true
,
type
:
String
,
},
required
:
true
,
title
:
{
},
type
:
String
,
fieldName
:
{
required
:
true
,
type
:
String
,
required
:
false
,
},
canEdit
:
{
type
:
Boolean
,
required
:
false
,
default
:
false
,
}
},
},
data
()
{
fieldName
:
{
return
{
type
:
String
,
editing
:
false
,
required
:
false
,
};
},
},
methods
:
{
canEdit
:
{
toggleEditing
()
{
type
:
Boolean
,
this
.
editing
=
!
this
.
editing
;
required
:
false
,
},
default
:
false
,
}
},
data
()
{
return
{
editing
:
false
,
};
},
methods
:
{
toggleEditing
()
{
eventHub
.
$emit
(
'
toggle
'
);
},
},
};
},
};
</
script
>
</
script
>
\ No newline at end of file
app/assets/javascripts/boards/components/milestone_select.vue
View file @
58565ac5
<
template
>
<
template
>
<div
class=
"dropdown-menu dropdown-menu-wide"
>
<div
class=
"dropdown"
:class=
"
{ open: isOpen }">
<div
class=
"dropdown-input"
>
<div
<input
class=
"dropdown-menu dropdown-menu-wide"
class=
"dropdown-input-field"
type=
"search"
placeholder=
"Search milestones"
>
<i
aria-hidden=
"true"
data-hidden=
"true"
class=
"fa fa-search dropdown-input-search"
></i>
</div>
<ul
ref=
"list"
>
>
<li
<div
class=
"dropdown-input"
>
v-for=
"milestone in extraMilestones"
<input
:key=
"milestone.id"
ref=
"search"
>
class=
"dropdown-input-field"
<a
type=
"search"
href=
"#"
placeholder=
"Search milestones"
>
@
click.prevent.stop=
"selectMilestone(milestone)"
>
<i
aria-hidden=
"true"
data-hidden=
"true"
class=
"fa fa-search dropdown-input-search"
></i>
<i
</div>
class=
"fa fa-check"
<ul
v-if=
"false"
></i>
ref=
"list"
{{
milestone
.
title
}}
</a>
</li>
<li
class=
"divider"
></li>
<li
v-if=
"loading"
>
<loading-icon
/>
</li>
<li
v-else
v-for=
"milestone in milestones"
:key=
"milestone.id"
>
>
<a
<li
href=
"#"
v-for=
"milestone in extraMilestones"
@
click.prevent.stop=
"selectMilestone(milestone)"
>
:key=
"milestone.id"
<i
>
class=
"fa fa-check"
<a
v-if=
"false"
></i>
href=
"#"
{{
milestone
.
title
}}
@
click.prevent.stop=
"selectMilestone(milestone)"
>
</a>
<i
</li>
class=
"fa fa-check"
</ul>
v-if=
"milestone.id === value"
></i>
{{
milestone
.
title
}}
</a>
</li>
<li
class=
"divider"
></li>
<li
v-if=
"loading"
>
<loading-icon
/>
</li>
<li
v-else
v-for=
"milestone in milestones"
:key=
"milestone.id"
>
<a
href=
"#"
@
click.prevent.stop=
"selectMilestone(milestone)"
>
<i
class=
"fa fa-check"
v-if=
"milestone.id === value"
></i>
{{
milestone
.
title
}}
</a>
</li>
</ul>
</div>
</div>
</div>
</
template
>
</
template
>
...
@@ -50,6 +55,7 @@
...
@@ -50,6 +55,7 @@
import
loadingIcon
from
'
~/vue_shared/components/loading_icon.vue
'
;
import
loadingIcon
from
'
~/vue_shared/components/loading_icon.vue
'
;
import
extraMilestones
from
'
../mixins/extra_milestones
'
;
import
extraMilestones
from
'
../mixins/extra_milestones
'
;
import
eventHub
from
'
../eventhub
'
;
export
default
{
export
default
{
props
:
{
props
:
{
...
@@ -62,7 +68,7 @@ export default {
...
@@ -62,7 +68,7 @@ export default {
required
:
true
,
required
:
true
,
},
},
value
:
{
value
:
{
type
:
String
,
type
:
Number
,
required
:
false
,
required
:
false
,
},
},
},
},
...
@@ -71,6 +77,7 @@ export default {
...
@@ -71,6 +77,7 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
isOpen
:
false
,
loading
:
true
,
loading
:
true
,
milestones
:
[],
milestones
:
[],
extraMilestones
,
extraMilestones
,
...
@@ -78,11 +85,32 @@ export default {
...
@@ -78,11 +85,32 @@ export default {
},
},
mounted
()
{
mounted
()
{
BoardService
.
loadMilestones
.
call
(
this
).
then
(()
=>
this
.
loading
=
false
);
BoardService
.
loadMilestones
.
call
(
this
).
then
(()
=>
this
.
loading
=
false
);
eventHub
.
$on
(
'
open
'
,
this
.
open
);
eventHub
.
$on
(
'
close
'
,
this
.
close
);
eventHub
.
$on
(
'
toggle
'
,
this
.
toggle
);
this
.
$nextTick
(()
=>
{
this
.
$refs
.
search
.
focus
();
});
},
beforeDestroy
()
{
eventHub
.
$off
(
'
open
'
,
this
.
open
);
eventHub
.
$off
(
'
close
'
,
this
.
close
);
eventHub
.
$off
(
'
toggle
'
,
this
.
toggle
);
},
},
methods
:
{
methods
:
{
selectMilestone
(
milestone
)
{
selectMilestone
(
milestone
)
{
this
.
board
.
milestone_id
=
milestone
.
id
;
this
.
board
.
milestone
=
milestone
;
this
.
$emit
(
'
input
'
,
milestone
);
this
.
$emit
(
'
input
'
,
milestone
.
id
);
this
.
close
();
},
open
()
{
this
.
isOpen
=
true
;
},
close
()
{
this
.
isOpen
=
false
;
},
toggle
()
{
this
.
isOpen
=
!
this
.
isOpen
;
},
},
},
},
};
};
...
...
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