diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-28 12:10:54 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-28 12:10:54 +0300 |
commit | 801820054081d4b795e6037a1c3e3d340dd831df (patch) | |
tree | 7c4e34baf19b7e7ba5a74d96c63f708e2c86f9f6 /app/assets/javascripts/work_items | |
parent | ce42a2ec96165f05c4611d012afb22baf75a9686 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/work_items')
7 files changed, 25 insertions, 8 deletions
diff --git a/app/assets/javascripts/work_items/components/item_state.vue b/app/assets/javascripts/work_items/components/item_state.vue index 2dc8e3a1101..cf1d9040334 100644 --- a/app/assets/javascripts/work_items/components/item_state.vue +++ b/app/assets/javascripts/work_items/components/item_state.vue @@ -26,7 +26,7 @@ export default { type: String, required: true, }, - loading: { + disabled: { type: Boolean, required: false, default: false, @@ -61,15 +61,17 @@ export default { :id="$options.labelId" :value="state" :options="$options.states" - :disabled="loading" + :disabled="disabled" class="gl-w-auto hide-select-decoration" + :class="{ 'gl-bg-transparent! gl-cursor-text!': disabled }" @change="setState" /> </gl-form-group> </template> <style> -.hide-select-decoration:not(:focus, :hover) { +.hide-select-decoration:not(:focus, :hover), +.hide-select-decoration:disabled { background-image: none; box-shadow: none; } diff --git a/app/assets/javascripts/work_items/components/item_title.vue b/app/assets/javascripts/work_items/components/item_title.vue index 1cdc9c28f05..551ebbadb21 100644 --- a/app/assets/javascripts/work_items/components/item_title.vue +++ b/app/assets/javascripts/work_items/components/item_title.vue @@ -36,7 +36,7 @@ export default { <template> <h2 class="gl-font-weight-normal gl-sm-font-weight-bold gl-mb-5 gl-mt-0 gl-w-full" - :class="{ 'gl-cursor-not-allowed': disabled }" + :class="{ 'gl-cursor-text': disabled }" aria-labelledby="item-title" > <div @@ -46,7 +46,8 @@ export default { :aria-label="__('Title')" :data-placeholder="placeholder" :contenteditable="!disabled" - class="gl-pseudo-placeholder gl-px-4 gl-py-3 gl-ml-n4 gl-border gl-border-white gl-hover-border-gray-200 gl-rounded-base" + class="gl-px-4 gl-py-3 gl-ml-n4 gl-border gl-border-white gl-rounded-base" + :class="{ 'gl-hover-border-gray-200 gl-pseudo-placeholder': !disabled }" @blur="handleBlur" @keyup="handleInput" @keydown.enter.exact="handleSubmit" diff --git a/app/assets/javascripts/work_items/components/work_item_detail.vue b/app/assets/javascripts/work_items/components/work_item_detail.vue index f49d8eab9f0..48ac17dc55f 100644 --- a/app/assets/javascripts/work_items/components/work_item_detail.vue +++ b/app/assets/javascripts/work_items/components/work_item_detail.vue @@ -206,11 +206,13 @@ export default { :work-item-title="workItem.title" :work-item-type="workItemType" :work-item-parent-id="workItemParentId" + :can-update="canUpdate" @error="error = $event" /> <work-item-state :work-item="workItem" :work-item-parent-id="workItemParentId" + :can-update="canUpdate" @error="error = $event" /> <template v-if="workItemsMvc2Enabled"> diff --git a/app/assets/javascripts/work_items/components/work_item_labels.vue b/app/assets/javascripts/work_items/components/work_item_labels.vue index 78ed67998d7..e73488bbd70 100644 --- a/app/assets/javascripts/work_items/components/work_item_labels.vue +++ b/app/assets/javascripts/work_items/components/work_item_labels.vue @@ -202,7 +202,8 @@ export default { :dropdown-items="searchLabels" :loading="isLoading" :view-only="!canUpdate" - class="gl-flex-grow-1 gl-border gl-border-white gl-hover-border-gray-200 gl-rounded-base col-9 gl-align-self-start gl-px-0! gl-mx-2!" + class="gl-flex-grow-1 gl-border gl-border-white gl-rounded-base col-9 gl-align-self-start gl-px-0! gl-mx-2!" + :class="{ 'gl-hover-border-gray-200': canUpdate }" @input="focusTokenSelector" @text-input="debouncedSearchKeyUpdate" @focus="handleFocus" diff --git a/app/assets/javascripts/work_items/components/work_item_state.vue b/app/assets/javascripts/work_items/components/work_item_state.vue index 87f4a8822b1..080d4025cc3 100644 --- a/app/assets/javascripts/work_items/components/work_item_state.vue +++ b/app/assets/javascripts/work_items/components/work_item_state.vue @@ -27,6 +27,11 @@ export default { required: false, default: null, }, + canUpdate: { + type: Boolean, + required: false, + default: false, + }, }, data() { return { @@ -102,7 +107,7 @@ export default { <item-state v-if="workItem.state" :state="workItem.state" - :loading="updateInProgress" + :disabled="updateInProgress || !canUpdate" @changed="updateWorkItemState" /> </template> diff --git a/app/assets/javascripts/work_items/components/work_item_title.vue b/app/assets/javascripts/work_items/components/work_item_title.vue index b4c13037038..cd5cc3894f6 100644 --- a/app/assets/javascripts/work_items/components/work_item_title.vue +++ b/app/assets/javascripts/work_items/components/work_item_title.vue @@ -31,6 +31,11 @@ export default { required: false, default: null, }, + canUpdate: { + type: Boolean, + required: false, + default: false, + }, }, computed: { tracking() { @@ -84,5 +89,5 @@ export default { </script> <template> - <item-title :title="workItemTitle" @title-changed="updateTitle" /> + <item-title :title="workItemTitle" :disabled="!canUpdate" @title-changed="updateTitle" /> </template> diff --git a/app/assets/javascripts/work_items/components/work_item_weight.vue b/app/assets/javascripts/work_items/components/work_item_weight.vue index db97f16a010..b0ad7c97bb1 100644 --- a/app/assets/javascripts/work_items/components/work_item_weight.vue +++ b/app/assets/javascripts/work_items/components/work_item_weight.vue @@ -98,6 +98,7 @@ export default { } }, updateWeight(event) { + if (!this.canUpdate) return; this.isEditing = false; const weight = Number(event.target.value); |