diff options
author | Kushal Pandya <kushal@gitlab.com> | 2018-03-08 15:41:35 +0300 |
---|---|---|
committer | Kushal Pandya <kushal@gitlab.com> | 2018-03-12 08:19:55 +0300 |
commit | eeb957ec356d13269bb8fce3e125f7f750a2267b (patch) | |
tree | 7124fbfff53b1f1e390f514ffb445dac7d3d089d /app | |
parent | a831267c330e95a90e24021a637a8342ed36166c (diff) |
Add `isProject` and computed props to for contextual info for dropdown
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/vue_shared/components/sidebar/labels_select/base.vue | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/app/assets/javascripts/vue_shared/components/sidebar/labels_select/base.vue b/app/assets/javascripts/vue_shared/components/sidebar/labels_select/base.vue index c1dd4d42d9d..5ede53d8d01 100644 --- a/app/assets/javascripts/vue_shared/components/sidebar/labels_select/base.vue +++ b/app/assets/javascripts/vue_shared/components/sidebar/labels_select/base.vue @@ -1,4 +1,5 @@ <script> +import { __ } from '~/locale'; import LabelsSelect from '~/labels_select'; import LoadingIcon from '../../loading_icon.vue'; @@ -31,6 +32,11 @@ export default { required: false, default: false, }, + isProject: { + type: Boolean, + required: false, + default: false, + }, abilityName: { type: String, required: true, @@ -73,6 +79,20 @@ export default { hiddenInputName() { return this.showCreate ? `${this.abilityName}[label_names][]` : 'label_id[]'; }, + createLabelTitle() { + if (this.isProject) { + return __('Create project label'); + } + + return __('Create group label'); + }, + manageLabelsTitle() { + if (this.isProject) { + return __('Manage project labels'); + } + + return __('Manage group labels'); + }, }, mounted() { this.labelsDropdown = new LabelsSelect(this.$refs.dropdownButton, { @@ -137,10 +157,14 @@ dropdown-menu-labels dropdown-menu-selectable" <dropdown-footer v-if="showCreate" :labels-web-url="labelsWebUrl" + :create-label-title="createLabelTitle" + :manage-labels-title="manageLabelsTitle" /> </div> <dropdown-create-label v-if="showCreate" + :is-project="isProject" + :header-title="createLabelTitle" /> </div> </div> |