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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
854e9de9
Commit
854e9de9
authored
May 30, 2017
by
Simon Knox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
animate adding issue to boards
fix some false positive tests for board_new_issue
parent
e5226177
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
88 additions
and
26 deletions
+88
-26
app/assets/javascripts/boards/components/board_list.js
app/assets/javascripts/boards/components/board_list.js
+10
-3
app/assets/javascripts/boards/components/board_new_issue.js
app/assets/javascripts/boards/components/board_new_issue.js
+2
-0
app/assets/javascripts/boards/models/list.js
app/assets/javascripts/boards/models/list.js
+7
-1
app/assets/javascripts/boards/stores/boards_store.js
app/assets/javascripts/boards/stores/boards_store.js
+1
-0
app/assets/stylesheets/pages/boards.scss
app/assets/stylesheets/pages/boards.scss
+37
-4
changelogs/unreleased/31633-animate-issue.yml
changelogs/unreleased/31633-animate-issue.yml
+4
-0
spec/javascripts/boards/board_new_issue_spec.js
spec/javascripts/boards/board_new_issue_spec.js
+27
-18
No files found.
app/assets/javascripts/boards/components/board_list.js
View file @
854e9de9
...
@@ -57,6 +57,9 @@ export default {
...
@@ -57,6 +57,9 @@ export default {
scrollTop
()
{
scrollTop
()
{
return
this
.
$refs
.
list
.
scrollTop
+
this
.
listHeight
();
return
this
.
$refs
.
list
.
scrollTop
+
this
.
listHeight
();
},
},
scrollToTop
()
{
this
.
$refs
.
list
.
scrollTop
=
0
;
},
loadNextPage
()
{
loadNextPage
()
{
const
getIssues
=
this
.
list
.
nextPage
();
const
getIssues
=
this
.
list
.
nextPage
();
const
loadingDone
=
()
=>
{
const
loadingDone
=
()
=>
{
...
@@ -108,6 +111,7 @@ export default {
...
@@ -108,6 +111,7 @@ export default {
},
},
created
()
{
created
()
{
eventHub
.
$on
(
`hide-issue-form-
${
this
.
list
.
id
}
`
,
this
.
toggleForm
);
eventHub
.
$on
(
`hide-issue-form-
${
this
.
list
.
id
}
`
,
this
.
toggleForm
);
eventHub
.
$on
(
`scroll-board-list-
${
this
.
list
.
id
}
`
,
this
.
scrollToTop
);
},
},
mounted
()
{
mounted
()
{
const
options
=
gl
.
issueBoards
.
getBoardSortableDefaultOptions
({
const
options
=
gl
.
issueBoards
.
getBoardSortableDefaultOptions
({
...
@@ -150,6 +154,7 @@ export default {
...
@@ -150,6 +154,7 @@ export default {
},
},
beforeDestroy
()
{
beforeDestroy
()
{
eventHub
.
$off
(
`hide-issue-form-
${
this
.
list
.
id
}
`
,
this
.
toggleForm
);
eventHub
.
$off
(
`hide-issue-form-
${
this
.
list
.
id
}
`
,
this
.
toggleForm
);
eventHub
.
$off
(
`scroll-board-list-
${
this
.
list
.
id
}
`
,
this
.
scrollToTop
);
this
.
$refs
.
list
.
removeEventListener
(
'
scroll
'
,
this
.
onScroll
);
this
.
$refs
.
list
.
removeEventListener
(
'
scroll
'
,
this
.
onScroll
);
},
},
template
:
`
template
:
`
...
@@ -160,9 +165,11 @@ export default {
...
@@ -160,9 +165,11 @@ export default {
v-if="loading">
v-if="loading">
<loading-icon />
<loading-icon />
</div>
</div>
<board-new-issue
<transition name="slide-down">
:list="list"
<board-new-issue
v-if="list.type !== 'closed' && showIssueForm"/>
:list="list"
v-if="list.type !== 'closed' && showIssueForm"/>
</transition>
<ul
<ul
class="board-list"
class="board-list"
v-show="!loading"
v-show="!loading"
...
...
app/assets/javascripts/boards/components/board_new_issue.js
View file @
854e9de9
...
@@ -48,6 +48,7 @@ export default {
...
@@ -48,6 +48,7 @@ export default {
this
.
error
=
true
;
this
.
error
=
true
;
});
});
eventHub
.
$emit
(
`scroll-board-list-
${
this
.
list
.
id
}
`
);
this
.
cancel
();
this
.
cancel
();
},
},
cancel
()
{
cancel
()
{
...
@@ -75,6 +76,7 @@ export default {
...
@@ -75,6 +76,7 @@ export default {
type="text"
type="text"
v-model="title"
v-model="title"
ref="input"
ref="input"
autocomplete="off"
:id="list.id + '-title'" />
:id="list.id + '-title'" />
<div class="clearfix prepend-top-10">
<div class="clearfix prepend-top-10">
<button class="btn btn-success pull-left"
<button class="btn btn-success pull-left"
...
...
app/assets/javascripts/boards/models/list.js
View file @
854e9de9
...
@@ -103,13 +103,19 @@ class List {
...
@@ -103,13 +103,19 @@ class List {
}
}
newIssue
(
issue
)
{
newIssue
(
issue
)
{
this
.
addIssue
(
issue
);
this
.
addIssue
(
issue
,
null
,
0
);
this
.
issuesSize
+=
1
;
this
.
issuesSize
+=
1
;
return
gl
.
boardService
.
newIssue
(
this
.
id
,
issue
)
return
gl
.
boardService
.
newIssue
(
this
.
id
,
issue
)
.
then
((
resp
)
=>
{
.
then
((
resp
)
=>
{
const
data
=
resp
.
json
();
const
data
=
resp
.
json
();
issue
.
id
=
data
.
iid
;
issue
.
id
=
data
.
iid
;
})
.
then
(()
=>
{
if
(
this
.
issuesSize
>
1
)
{
const
moveBeforeIid
=
this
.
issues
[
1
].
id
;
gl
.
boardService
.
moveIssue
(
issue
.
id
,
null
,
null
,
null
,
moveBeforeIid
);
}
});
});
}
}
...
...
app/assets/javascripts/boards/stores/boards_store.js
View file @
854e9de9
...
@@ -22,6 +22,7 @@ gl.issueBoards.BoardsStore = {
...
@@ -22,6 +22,7 @@ gl.issueBoards.BoardsStore = {
create
()
{
create
()
{
this
.
state
.
lists
=
[];
this
.
state
.
lists
=
[];
this
.
filter
.
path
=
gl
.
utils
.
getUrlParamsArray
().
join
(
'
&
'
);
this
.
filter
.
path
=
gl
.
utils
.
getUrlParamsArray
().
join
(
'
&
'
);
this
.
detail
=
{
issue
:
{}
};
},
},
addList
(
listObj
,
defaultAvatar
)
{
addList
(
listObj
,
defaultAvatar
)
{
const
list
=
new
List
(
listObj
,
defaultAvatar
);
const
list
=
new
List
(
listObj
,
defaultAvatar
);
...
...
app/assets/stylesheets/pages/boards.scss
View file @
854e9de9
...
@@ -175,21 +175,53 @@
...
@@ -175,21 +175,53 @@
}
}
}
}
.slide-down-enter
{
transform
:
translateY
(
-100%
);
}
.slide-down-enter-active
{
transition
:
transform
$fade-in-duration
;
+
.board-list
{
transform
:
translateY
(
-136px
);
transition
:
none
;
}
}
.slide-down-enter-to
{
+
.board-list
{
transform
:
translateY
(
0
);
transition
:
transform
$fade-in-duration
ease
;
}
}
.slide-down-leave
{
transform
:
translateY
(
0
);
}
.slide-down-leave-active
{
transition
:
all
$fade-in-duration
;
transform
:
translateY
(
-136px
);
+
.board-list
{
transition
:
transform
$fade-in-duration
ease
;
transform
:
translateY
(
-136px
);
}
}
.board-list-component
{
.board-list-component
{
height
:
calc
(
100%
-
49px
);
height
:
calc
(
100%
-
49px
);
overflow
:
hidden
;
}
}
.board-list
{
.board-list
{
height
:
100%
;
height
:
100%
;
width
:
100%
;
margin-bottom
:
0
;
margin-bottom
:
0
;
padding
:
5px
;
padding
:
5px
;
list-style
:
none
;
list-style
:
none
;
overflow-y
:
scroll
;
overflow-y
:
scroll
;
overflow-x
:
hidden
;
overflow-x
:
hidden
;
&
.is-smaller
{
height
:
calc
(
100%
-
136px
);
}
}
}
.board-list-loading
{
.board-list-loading
{
...
@@ -351,6 +383,7 @@
...
@@ -351,6 +383,7 @@
}
}
.board-new-issue-form
{
.board-new-issue-form
{
z-index
:
1
;
margin
:
5px
;
margin
:
5px
;
}
}
...
...
changelogs/unreleased/31633-animate-issue.yml
0 → 100644
View file @
854e9de9
---
title
:
animate adding issue to boards
merge_request
:
author
:
spec/javascripts/boards/board_new_issue_spec.js
View file @
854e9de9
...
@@ -19,6 +19,7 @@ describe('Issue boards new issue form', () => {
...
@@ -19,6 +19,7 @@ describe('Issue boards new issue form', () => {
};
};
},
},
};
};
const
submitIssue
=
()
=>
{
const
submitIssue
=
()
=>
{
vm
.
$el
.
querySelector
(
'
.btn-success
'
).
click
();
vm
.
$el
.
querySelector
(
'
.btn-success
'
).
click
();
};
};
...
@@ -107,7 +108,7 @@ describe('Issue boards new issue form', () => {
...
@@ -107,7 +108,7 @@ describe('Issue boards new issue form', () => {
setTimeout
(()
=>
{
setTimeout
(()
=>
{
submitIssue
();
submitIssue
();
expect
(
vm
.
$el
.
querySelector
(
'
.btn-success
'
).
dis
bled
).
not
.
toBe
(
tru
e
);
expect
(
vm
.
$el
.
querySelector
(
'
.btn-success
'
).
dis
abled
).
toBe
(
fals
e
);
done
();
done
();
},
0
);
},
0
);
});
});
...
@@ -115,36 +116,43 @@ describe('Issue boards new issue form', () => {
...
@@ -115,36 +116,43 @@ describe('Issue boards new issue form', () => {
it
(
'
clears title after submit
'
,
(
done
)
=>
{
it
(
'
clears title after submit
'
,
(
done
)
=>
{
vm
.
title
=
'
submit issue
'
;
vm
.
title
=
'
submit issue
'
;
setTimeout
(()
=>
{
Vue
.
nextTick
(()
=>
{
submitIssue
();
submitIssue
();
expect
(
vm
.
title
).
toBe
(
''
);
setTimeout
(()
=>
{
done
();
expect
(
vm
.
title
).
toBe
(
''
);
},
0
);
done
();
},
0
);
});
});
});
it
(
'
adds new issue to
list after submi
t
'
,
(
done
)
=>
{
it
(
'
adds new issue to
top of list after submit reques
t
'
,
(
done
)
=>
{
vm
.
title
=
'
submit issue
'
;
vm
.
title
=
'
submit issue
'
;
setTimeout
(()
=>
{
setTimeout
(()
=>
{
submitIssue
();
submitIssue
();
expect
(
list
.
issues
.
length
).
toBe
(
2
);
setTimeout
(()
=>
{
expect
(
list
.
issues
[
1
].
title
).
toBe
(
'
submit issue
'
);
expect
(
list
.
issues
.
length
).
toBe
(
2
);
expect
(
list
.
issues
[
1
].
subscribed
).
toBe
(
true
);
expect
(
list
.
issues
[
0
].
title
).
toBe
(
'
submit issue
'
);
done
();
expect
(
list
.
issues
[
0
].
subscribed
).
toBe
(
true
);
done
();
},
0
);
},
0
);
},
0
);
});
});
it
(
'
sets detail issue after submit
'
,
(
done
)
=>
{
it
(
'
sets detail issue after submit
'
,
(
done
)
=>
{
expect
(
gl
.
issueBoards
.
BoardsStore
.
detail
.
issue
.
title
).
toBe
(
undefined
);
vm
.
title
=
'
submit issue
'
;
vm
.
title
=
'
submit issue
'
;
setTimeout
(()
=>
{
setTimeout
(()
=>
{
submitIssue
();
submitIssue
();
expect
(
gl
.
issueBoards
.
BoardsStore
.
detail
.
issue
.
title
).
toBe
(
'
submit issue
'
);
setTimeout
(()
=>
{
done
();
expect
(
gl
.
issueBoards
.
BoardsStore
.
detail
.
issue
.
title
).
toBe
(
'
submit issue
'
);
});
done
();
},
0
);
},
0
);
});
});
it
(
'
sets detail list after submit
'
,
(
done
)
=>
{
it
(
'
sets detail list after submit
'
,
(
done
)
=>
{
...
@@ -153,8 +161,10 @@ describe('Issue boards new issue form', () => {
...
@@ -153,8 +161,10 @@ describe('Issue boards new issue form', () => {
setTimeout
(()
=>
{
setTimeout
(()
=>
{
submitIssue
();
submitIssue
();
expect
(
gl
.
issueBoards
.
BoardsStore
.
detail
.
list
.
id
).
toBe
(
list
.
id
);
setTimeout
(()
=>
{
done
();
expect
(
gl
.
issueBoards
.
BoardsStore
.
detail
.
list
.
id
).
toBe
(
list
.
id
);
done
();
},
0
);
},
0
);
},
0
);
});
});
});
});
...
@@ -169,13 +179,12 @@ describe('Issue boards new issue form', () => {
...
@@ -169,13 +179,12 @@ describe('Issue boards new issue form', () => {
setTimeout
(()
=>
{
setTimeout
(()
=>
{
expect
(
list
.
issues
.
length
).
toBe
(
1
);
expect
(
list
.
issues
.
length
).
toBe
(
1
);
done
();
done
();
},
50
0
);
},
0
);
},
0
);
},
0
);
});
});
it
(
'
shows error
'
,
(
done
)
=>
{
it
(
'
shows error
'
,
(
done
)
=>
{
vm
.
title
=
'
error
'
;
vm
.
title
=
'
error
'
;
submitIssue
();
setTimeout
(()
=>
{
setTimeout
(()
=>
{
submitIssue
();
submitIssue
();
...
@@ -183,7 +192,7 @@ describe('Issue boards new issue form', () => {
...
@@ -183,7 +192,7 @@ describe('Issue boards new issue form', () => {
setTimeout
(()
=>
{
setTimeout
(()
=>
{
expect
(
vm
.
error
).
toBe
(
true
);
expect
(
vm
.
error
).
toBe
(
true
);
done
();
done
();
},
50
0
);
},
0
);
},
0
);
},
0
);
});
});
});
});
...
...
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