diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-04-22 21:01:50 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-04-22 21:01:50 +0200 |
commit | 8c8f6db4578051300794c7032bc63d68f70cce16 (patch) | |
tree | f48f82ed1418ff9a6d810b4f354629d7a275b606 /app/assets/javascripts/boards/components/modal/footer.js | |
parent | a8231ea1befd803fb5892ea3e6679219f5d7d8e5 (diff) | |
parent | 1005389f70070245092c1ae5f3f9b10b8e7c102e (diff) | |
download | gitlab-ce-8c8f6db4578051300794c7032bc63d68f70cce16.tar.gz |
Merge branch 'master' into feature/gb/manual-actions-protected-branches-permissions
* master: (274 commits)
Update VERSION to 9.2.0-pre
Update CHANGELOG.md for 9.1.0
Update Auto Deploy documentation
Disable import URL field in New project form since it's hidden by default
Remove reference to burndown charts since they don't exist for ce.
Use master_password for Sentinel
Refactor Discussions docs
Start versioning cached markdown fields
Refactor add_users method for project and group
Improved the spec Now correctly tests against different forms
Refactor environments components into vue files - part 3
Adding animation for all dropdown
fix placeholder visibility
submodule_links: handle urls that don't end with .git
Add help regarding vue resource and where to include it
Append .json to ajax endpoint to prevent browser to display raw json
Fixed the preview keyboard shortcut focusing wrong tab
Fix broken link
Added new discussions docs
Started on resolvable discussions docs
...
Diffstat (limited to 'app/assets/javascripts/boards/components/modal/footer.js')
-rw-r--r-- | app/assets/javascripts/boards/components/modal/footer.js | 126 |
1 files changed, 62 insertions, 64 deletions
diff --git a/app/assets/javascripts/boards/components/modal/footer.js b/app/assets/javascripts/boards/components/modal/footer.js index 887ce373096..ccd270b27da 100644 --- a/app/assets/javascripts/boards/components/modal/footer.js +++ b/app/assets/javascripts/boards/components/modal/footer.js @@ -5,80 +5,78 @@ import Vue from 'vue'; require('./lists_dropdown'); -(() => { - const ModalStore = gl.issueBoards.ModalStore; +const ModalStore = gl.issueBoards.ModalStore; - gl.issueBoards.ModalFooter = Vue.extend({ - mixins: [gl.issueBoards.ModalMixins], - data() { - return { - modal: ModalStore.store, - state: gl.issueBoards.BoardsStore.state, - }; +gl.issueBoards.ModalFooter = Vue.extend({ + mixins: [gl.issueBoards.ModalMixins], + data() { + return { + modal: ModalStore.store, + state: gl.issueBoards.BoardsStore.state, + }; + }, + computed: { + submitDisabled() { + return !ModalStore.selectedCount(); }, - computed: { - submitDisabled() { - return !ModalStore.selectedCount(); - }, - submitText() { - const count = ModalStore.selectedCount(); + submitText() { + const count = ModalStore.selectedCount(); - return `Add ${count > 0 ? count : ''} ${gl.text.pluralize('issue', count)}`; - }, + return `Add ${count > 0 ? count : ''} ${gl.text.pluralize('issue', count)}`; }, - methods: { - addIssues() { - const list = this.modal.selectedList || this.state.lists[0]; - const selectedIssues = ModalStore.getSelectedIssues(); - const issueIds = selectedIssues.map(issue => issue.globalId); + }, + methods: { + addIssues() { + const list = this.modal.selectedList || this.state.lists[0]; + const selectedIssues = ModalStore.getSelectedIssues(); + const issueIds = selectedIssues.map(issue => issue.globalId); - // Post the data to the backend - gl.boardService.bulkUpdate(issueIds, { - add_label_ids: [list.label.id], - }).catch(() => { - new Flash('Failed to update issues, please try again.', 'alert'); + // Post the data to the backend + gl.boardService.bulkUpdate(issueIds, { + add_label_ids: [list.label.id], + }).catch(() => { + new Flash('Failed to update issues, please try again.', 'alert'); - selectedIssues.forEach((issue) => { - list.removeIssue(issue); - list.issuesSize -= 1; - }); - }); - - // Add the issues on the frontend selectedIssues.forEach((issue) => { - list.addIssue(issue); - list.issuesSize += 1; + list.removeIssue(issue); + list.issuesSize -= 1; }); + }); - this.toggleModal(false); - }, - }, - components: { - 'lists-dropdown': gl.issueBoards.ModalFooterListsDropdown, + // Add the issues on the frontend + selectedIssues.forEach((issue) => { + list.addIssue(issue); + list.issuesSize += 1; + }); + + this.toggleModal(false); }, - template: ` - <footer - class="form-actions add-issues-footer"> - <div class="pull-left"> - <button - class="btn btn-success" - type="button" - :disabled="submitDisabled" - @click="addIssues"> - {{ submitText }} - </button> - <span class="inline add-issues-footer-to-list"> - to list - </span> - <lists-dropdown></lists-dropdown> - </div> + }, + components: { + 'lists-dropdown': gl.issueBoards.ModalFooterListsDropdown, + }, + template: ` + <footer + class="form-actions add-issues-footer"> + <div class="pull-left"> <button - class="btn btn-default pull-right" + class="btn btn-success" type="button" - @click="toggleModal(false)"> - Cancel + :disabled="submitDisabled" + @click="addIssues"> + {{ submitText }} </button> - </footer> - `, - }); -})(); + <span class="inline add-issues-footer-to-list"> + to list + </span> + <lists-dropdown></lists-dropdown> + </div> + <button + class="btn btn-default pull-right" + type="button" + @click="toggleModal(false)"> + Cancel + </button> + </footer> + `, +}); |