Commit 84d1dfcb authored by Simon Knox's avatar Simon Knox

use dialog component

parent 0c196e76
/* global BoardService */ /* global BoardService */
import Vue from 'vue'; import Vue from 'vue';
import PopupDialog from '~/vue_shared/components/popup_dialog.vue';
import boardMilestoneSelect from './milestone_select'; import boardMilestoneSelect from './milestone_select';
import extraMilestones from '../mixins/extra_milestones'; import extraMilestones from '../mixins/extra_milestones';
...@@ -25,6 +26,7 @@ import extraMilestones from '../mixins/extra_milestones'; ...@@ -25,6 +26,7 @@ import extraMilestones from '../mixins/extra_milestones';
milestone: extraMilestones[0], milestone: extraMilestones[0],
milestone_id: extraMilestones[0].id, milestone_id: extraMilestones[0].id,
}, },
issue: {},
currentBoard: Store.state.currentBoard, currentBoard: Store.state.currentBoard,
currentPage: Store.state.currentPage, currentPage: Store.state.currentPage,
milestones: [], milestones: [],
...@@ -34,6 +36,7 @@ import extraMilestones from '../mixins/extra_milestones'; ...@@ -34,6 +36,7 @@ import extraMilestones from '../mixins/extra_milestones';
}, },
components: { components: {
boardMilestoneSelect, boardMilestoneSelect,
PopupDialog,
}, },
mounted() { mounted() {
if (this.currentBoard && Object.keys(this.currentBoard).length && this.currentPage !== 'new') { if (this.currentBoard && Object.keys(this.currentBoard).length && this.currentPage !== 'new') {
...@@ -90,8 +93,6 @@ import extraMilestones from '../mixins/extra_milestones'; ...@@ -90,8 +93,6 @@ import extraMilestones from '../mixins/extra_milestones';
// We reload the page to make sure the store & state of the app are correct // We reload the page to make sure the store & state of the app are correct
this.refreshPage(); this.refreshPage();
$('#edit-board-modal').modal('hide');
// Enable the button thanks to our jQuery disabling it // Enable the button thanks to our jQuery disabling it
$(this.$refs.submitBtn).enable(); $(this.$refs.submitBtn).enable();
......
...@@ -29,6 +29,7 @@ import './board_new_form'; ...@@ -29,6 +29,7 @@ import './board_new_form';
loading: true, loading: true,
boards: [], boards: [],
state: Store.state, state: Store.state,
milestoneTitle: 'Milestone',
}; };
}, },
watch: { watch: {
......
...@@ -5,11 +5,11 @@ export default { ...@@ -5,11 +5,11 @@ export default {
props: { props: {
title: { title: {
type: String, type: String,
required: true, required: false,
}, },
body: { body: {
type: String, type: String,
required: true, required: false,
}, },
kind: { kind: {
type: String, type: String,
...@@ -23,7 +23,7 @@ export default { ...@@ -23,7 +23,7 @@ export default {
}, },
primaryButtonLabel: { primaryButtonLabel: {
type: String, type: String,
required: true, required: false,
}, },
}, },
...@@ -63,21 +63,25 @@ export default { ...@@ -63,21 +63,25 @@ export default {
<h4 class="modal-title">{{this.title}}</h4> <h4 class="modal-title">{{this.title}}</h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<p>{{this.body}}</p> <slot name="body">
<p>{{this.body}}</p>
</slot>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button <slot name="footer">
type="button" <button
class="btn btn-default" type="button"
@click="emitSubmit(false)"> class="btn btn-default"
{{closeButtonLabel}} @click="emitSubmit(false)">
</button> {{closeButtonLabel}}
<button type="button" </button>
class="btn" <button type="button"
:class="btnKindClass" class="btn"
@click="emitSubmit(true)"> :class="btnKindClass"
{{primaryButtonLabel}} @click="emitSubmit(true)">
</button> {{primaryButtonLabel}}
</button>
</slot>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -35,3 +35,31 @@ body.modal-open { ...@@ -35,3 +35,31 @@ body.modal-open {
width: 98%; width: 98%;
} }
} }
.modal-dialog {
// TODO: this needs top and bottom padding (inside content area)
max-height: calc(100vh - #{$new-navbar-height});
padding: $gl-padding;
}
.modal-header,
.modal-footer {
padding: $gl-padding;
background-color: $gray-light;
border-top: 1px solid $border-color;
}
.modal.popup-dialog {
display: flex;
justify-content: center;
align-items: center;
background-color: $black-transparent;
z-index: 2100;
@media (min-width: $screen-md-min) {
.modal-dialog {
width: 600px;
margin-top: $new-navbar-height;
}
}
}
...@@ -12,19 +12,6 @@ ...@@ -12,19 +12,6 @@
background: $black-transparent; background: $black-transparent;
} }
.modal.popup-dialog {
display: block;
background-color: $black-transparent;
z-index: 2100;
@media (min-width: $screen-md-min) {
.modal-dialog {
width: 600px;
margin: 30px auto;
}
}
}
.project-refs-form, .project-refs-form,
.project-refs-target-form { .project-refs-target-form {
display: inline-block; display: inline-block;
......
...@@ -28,13 +28,13 @@ ...@@ -28,13 +28,13 @@
%ul.dropdown-footer-list %ul.dropdown-footer-list
- if parent.feature_available?(:multiple_issue_boards) - if parent.feature_available?(:multiple_issue_boards)
%li %li
%a{ "href" => "#", "@click.prevent" => "showPage('new')", data: { toggle: 'modal', target: '#edit-board-modal' } } %a{ "href" => "#", "@click.prevent" => "showPage('new')" }
Create new board Create new board
%li %li
%a{ "href" => "#", "@click.prevent" => "showPage('edit')", data: { toggle: 'modal', target: '#edit-board-modal' } } %a{ "href" => "#", "@click.prevent" => "showPage('edit')" }
Edit board Edit board
%li{ "v-if" => "showDelete" } %li{ "v-if" => "showDelete" }
%a{ "href" => "#", "@click.prevent" => "showPage('delete')", data: { toggle: 'modal', target: '#edit-board-modal' } } %a{ "href" => "#", "@click.prevent" => "showPage('delete')" }
%span.text-danger %span.text-danger
Delete board Delete board
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment