Skip to content
代码片段 群组 项目
未验证 提交 1a2ea5c1 编辑于 作者: Kushal Pandya's avatar Kushal Pandya 提交者: GitLab
浏览文件

Merge branch...

Merge branch '365380-toggling-edit-button-for-labels-select-dropdown-for-board-configuration-no-longer-closes' into 'master' 

Fix toggle behavior for board iteration and label edits

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/149443



Merged-by: default avatarKushal Pandya <kushal@gitlab.com>
Approved-by: default avatarAnnabel Dunstone Gray <annabel.dunstone@gmail.com>
Approved-by: default avatarJay Montal <jmontal@gitlab.com>
Approved-by: default avatarKushal Pandya <kushal@gitlab.com>
Co-authored-by: default avatarChad Lavimoniere <clavimoniere@gitlab.com>
No related branches found
No related tags found
无相关合并请求
......@@ -169,7 +169,8 @@ export default {
this.isEditing = true;
this.showDropdown();
} else {
this.hideDropdown();
this.isEditing = false;
this.isDropdownShowing = false;
}
},
showDropdown() {
......@@ -178,7 +179,6 @@ export default {
},
hideDropdown() {
this.isEditing = false;
this.isDropdownShowing = false;
},
setSearch(search) {
this.search = search;
......
......@@ -40,6 +40,7 @@ export default {
labels: [],
selected: this.board.labels,
isEditing: false,
isDropdownShowing: false,
showDropdownContentsCreateView: false,
};
},
......@@ -122,18 +123,20 @@ export default {
this.$emit('set-labels', labels);
},
toggleEdit() {
if (!this.isEditing) {
if (!this.isEditing && !this.isDropdownShowing) {
this.isEditing = true;
this.showDropdown();
} else {
this.hideDropdown();
this.isEditing = false;
this.isDropdownShowing = false;
}
},
showDropdown() {
this.isEditing = true;
this.$refs.editDropdown.showDropdown();
debounce(() => {
this.setFocus();
}, 50)();
this.isDropdownShowing = true;
},
hideDropdown() {
this.isEditing = false;
......
......@@ -128,6 +128,16 @@ describe('Labels select component', () => {
it('shows Edit button if true', () => {
expect(findEditButton().exists()).toBe(true);
});
it('toggles edit state when edit button is clicked', async () => {
findEditButton().vm.$emit('click');
await nextTick();
expect(findDropdown().isVisible()).toBe(true);
findEditButton().vm.$emit('click');
await nextTick();
expect(findDropdown().isVisible()).toBe(false);
});
});
it.each`
......
......@@ -109,6 +109,16 @@ describe('Iteration select component', () => {
expect(findEditButton().exists()).toBe(true);
});
it('toggles edit state when edit button is clicked', async () => {
findEditButton().vm.$emit('click');
await nextTick();
expect(findDropdown().isVisible()).toBe(true);
findEditButton().vm.$emit('click');
await nextTick();
expect(findDropdown().isVisible()).toBe(false);
});
it('renders cadence when Any in cadence is selected', async () => {
findEditButton().vm.$emit('click');
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册