diff options
author | Heinrich Lee Yu <hleeyu@gmail.com> | 2018-10-26 10:24:30 +0800 |
---|---|---|
committer | Heinrich Lee Yu <hleeyu@gmail.com> | 2018-10-26 12:08:48 +0800 |
commit | fdb46c55ee52542c6147f24363087185891e0703 (patch) | |
tree | 0c9199b15a27300420ce4b8ec0148010829e8729 | |
parent | 2ba71571de1147e6b5e6e6f8c14b05d07c6050c2 (diff) | |
download | gitlab-ce-fdb46c55ee52542c6147f24363087185891e0703.tar.gz |
Extract complex condition to computed prop
-rw-r--r-- | app/assets/javascripts/boards/components/board.js | 3 | ||||
-rw-r--r-- | app/views/shared/boards/components/_board.html.haml | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/app/assets/javascripts/boards/components/board.js b/app/assets/javascripts/boards/components/board.js index 75477ebb3b3..623cda5679a 100644 --- a/app/assets/javascripts/boards/components/board.js +++ b/app/assets/javascripts/boards/components/board.js @@ -53,6 +53,9 @@ export default Vue.extend({ const { issuesSize } = this.list; return `${n__('%d issue', '%d issues', issuesSize)}`; }, + isNewIssueShown() { + return this.list.type === 'backlog' || (!this.disabled && this.list.type !== 'closed'); + } }, watch: { filter: { diff --git a/app/views/shared/boards/components/_board.html.haml b/app/views/shared/boards/components/_board.html.haml index b79a1b17154..c6c5cadc3f5 100644 --- a/app/views/shared/boards/components/_board.html.haml +++ b/app/views/shared/boards/components/_board.html.haml @@ -41,7 +41,7 @@ %button.issue-count-badge-add-button.btn.btn-sm.btn-default.ml-1.has-tooltip.js-no-trigger-collapse{ type: "button", "@click" => "showNewIssueForm", - "v-if" => 'list.type == "backlog" || (!disabled && list.type !== "closed")', + "v-if" => "isNewIssueShown", "aria-label" => _("New issue"), "title" => _("New issue"), data: { placement: "top", container: "body" } } |