Commit 12a16d18 authored by Ammar Alakkad's avatar Ammar Alakkad

Show blocked icon on epic blocked issues

Changelog: added
EE: true
parent a97ccbe5
......@@ -89,6 +89,7 @@ query childItems(
iid
epicIssueId
title
blocked
closedAt
state
createdAt
......
......@@ -66,6 +66,9 @@ export default {
isOpen() {
return this.item.state === ChildState.Open;
},
isBlocked() {
return this.item.blocked;
},
isClosed() {
return this.item.state === ChildState.Closed;
},
......@@ -85,9 +88,15 @@ export default {
if (this.item.type === ChildType.Epic) {
return this.isOpen ? 'epic' : 'epic-closed';
}
if (this.isBlocked && this.isOpen) {
return 'issue-block';
}
return this.isOpen ? 'issues' : 'issue-closed';
},
stateIconClass() {
if (this.isBlocked && this.isOpen) {
return 'gl-text-red-500';
}
return this.isOpen
? 'issue-token-state-icon-open gl-text-green-500'
: 'issue-token-state-icon-closed gl-text-blue-500';
......
......@@ -142,6 +142,18 @@ describe('RelatedItemsTree', () => {
});
});
describe('isBlocked', () => {
it('returns true when `item.blocked` value is `true`', () => {
wrapper.setProps({
item: { ...mockItem, blocked: true },
});
return wrapper.vm.$nextTick(() => {
expect(wrapper.vm.isBlocked).toBe(true);
});
});
});
describe('isClosed', () => {
it('returns true when `item.state` value is `closed`', () => {
wrapper.setProps({
......@@ -199,6 +211,16 @@ describe('RelatedItemsTree', () => {
});
});
it('return string `gl-text-red-500` when `item.blocked` value is `true`', () => {
wrapper.setProps({
item: { ...mockItem, blocked: true },
});
return wrapper.vm.$nextTick(() => {
expect(wrapper.vm.stateIconClass).toBe('gl-text-red-500');
});
});
it('returns string `issue-token-state-icon-closed gl-text-blue-500` when `item.state` value is `closed`', () => {
wrapper.setProps({
item: { ...mockItem, state: ChildState.Closed },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment