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
84cf1644
Commit
84cf1644
authored
Oct 02, 2017
by
Simon Knox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix board delete button
parent
3efbe1d4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
28 deletions
+52
-28
app/assets/javascripts/boards/components/board_form.vue
app/assets/javascripts/boards/components/board_form.vue
+42
-27
app/assets/javascripts/vue_shared/components/popup_dialog.vue
...assets/javascripts/vue_shared/components/popup_dialog.vue
+8
-1
app/views/shared/boards/_switcher.html.haml
app/views/shared/boards/_switcher.html.haml
+1
-0
ee/app/controllers/ee/boards/boards_controller.rb
ee/app/controllers/ee/boards/boards_controller.rb
+1
-0
No files found.
app/assets/javascripts/boards/components/board_form.vue
View file @
84cf1644
...
...
@@ -3,8 +3,9 @@
<popup-dialog
v-show=
"currentPage"
:title=
"title"
:primary
ButtonL
abel=
"buttonText"
:primary
-button-l
abel=
"buttonText"
:kind=
"buttonKind"
:submit-disabled=
"submitDisabled"
@
toggle=
"cancel"
@
submit=
"submit"
>
...
...
@@ -140,16 +141,20 @@ const Store = gl.issueBoards.BoardsStore;
export
default
Vue
.
extend
({
props
:
{
milestone
Path
:
{
board
Path
:
{
type
:
String
,
required
:
true
,
},
labelsPath
:
{
canAdminBoard
:
{
type
:
Boolean
,
required
:
true
,
},
milestonePath
:
{
type
:
String
,
required
:
true
,
},
canAdminBoard
:
{
type
:
Boolean
,
labelsPath
:
{
type
:
String
,
required
:
true
,
},
scopedIssueBoardFeatureEnabled
:
{
...
...
@@ -181,6 +186,7 @@ export default Vue.extend({
currentPage
:
Store
.
state
.
currentPage
,
milestones
:
[],
milestoneDropdownOpen
:
false
,
submitDisabled
:
false
,
};
},
components
:
{
...
...
@@ -227,9 +233,6 @@ export default Vue.extend({
milestoneToggleText
()
{
return
this
.
board
.
milestone
?
this
.
board
.
milestone
.
title
:
'
Milestone
'
;
},
submitDisabled
()
{
return
false
;
},
expandButtonText
()
{
return
this
.
expanded
?
'
Collapse
'
:
'
Expand
'
;
},
...
...
@@ -248,28 +251,40 @@ export default Vue.extend({
location
.
href
=
location
.
pathname
;
},
submit
()
{
gl
.
boardService
.
createBoard
(
this
.
board
)
.
then
(
resp
=>
resp
.
json
())
.
then
((
data
)
=>
{
if
(
this
.
currentBoard
&&
this
.
currentPage
!==
'
new
'
)
{
this
.
currentBoard
.
name
=
this
.
board
.
name
;
if
(
this
.
currentPage
===
'
delete
'
)
{
this
.
submitDisabled
=
true
;
this
.
$http
.
delete
(
this
.
boardPath
)
.
then
(({
redirect_to
})
=>
{
gl
.
utils
.
visitUrl
(
Store
.
rootPath
);
})
.
catch
(()
=>
{
Flash
(
'
Failed to delete board. Please try again.
'
)
this
.
submitDisabled
=
false
;
});
}
else
{
gl
.
boardService
.
createBoard
(
this
.
board
)
.
then
(
resp
=>
resp
.
json
())
.
then
((
data
)
=>
{
if
(
this
.
currentBoard
&&
this
.
currentPage
!==
'
new
'
)
{
this
.
currentBoard
.
name
=
this
.
board
.
name
;
// We reload the page to make sure the store & state of the app are correct
this
.
refreshPage
();
// We reload the page to make sure the store & state of the app are correct
this
.
refreshPage
();
// Enable the button thanks to our jQuery disabling it
$
(
this
.
$refs
.
submitBtn
).
enable
();
// Enable the button thanks to our jQuery disabling it
$
(
this
.
$refs
.
submitBtn
).
enable
();
// Reset the selectors current page
Store
.
state
.
currentPage
=
''
;
Store
.
state
.
reload
=
true
;
}
else
if
(
this
.
currentPage
===
'
new
'
)
{
gl
.
utils
.
visitUrl
(
`
${
Store
.
rootPath
}
/
${
data
.
id
}
`
);
}
})
.
catch
(()
=>
{
Flash
(
'
Unable to save your changes. Please try again.
'
)
});
// Reset the selectors current page
Store
.
state
.
currentPage
=
''
;
Store
.
state
.
reload
=
true
;
}
else
if
(
this
.
currentPage
===
'
new
'
)
{
gl
.
utils
.
visitUrl
(
`
${
Store
.
rootPath
}
/
${
data
.
id
}
`
);
}
})
.
catch
(()
=>
{
Flash
(
'
Unable to save your changes. Please try again.
'
)
});
}
},
cancel
()
{
Store
.
state
.
currentPage
=
''
;
...
...
app/assets/javascripts/vue_shared/components/popup_dialog.vue
View file @
84cf1644
...
...
@@ -20,6 +20,11 @@ export default {
type
:
String
,
required
:
false
,
},
submitDisabled
:
{
type
:
Boolean
,
required
:
false
,
default
:
false
,
}
},
computed
:
{
...
...
@@ -73,8 +78,10 @@ export default {
</div>
<slot
name=
"footer"
>
<div
class=
"modal-footer"
>
<button
type=
"button"
<button
type=
"button"
class=
"btn pull-left"
:disabled=
"submitDisabled"
:class=
"btnKindClass"
@
click=
"emitSubmit(true)"
>
{{
primaryButtonLabel
}}
...
...
app/views/shared/boards/_switcher.html.haml
View file @
84cf1644
...
...
@@ -36,6 +36,7 @@
Delete board
%board-form
{
":milestone-path"
=>
"milestonePath"
,
"board-path"
=>
current_board_path
(
board
),
"labels-path"
=>
labels_filter_path
(
true
),
"project-id"
=>
@project
&
.
id
,
"group-id"
=>
@group
&
.
id
,
...
...
ee/app/controllers/ee/boards/boards_controller.rb
View file @
84cf1644
...
...
@@ -44,6 +44,7 @@ module EE
service
.
execute
(
@board
)
respond_to
do
|
format
|
format
.
json
{
head
:ok
}
format
.
html
{
redirect_to
boards_path
,
status:
302
}
end
end
...
...
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