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( ...@@ -89,6 +89,7 @@ query childItems(
iid iid
epicIssueId epicIssueId
title title
blocked
closedAt closedAt
state state
createdAt createdAt
......
...@@ -66,6 +66,9 @@ export default { ...@@ -66,6 +66,9 @@ export default {
isOpen() { isOpen() {
return this.item.state === ChildState.Open; return this.item.state === ChildState.Open;
}, },
isBlocked() {
return this.item.blocked;
},
isClosed() { isClosed() {
return this.item.state === ChildState.Closed; return this.item.state === ChildState.Closed;
}, },
...@@ -85,9 +88,15 @@ export default { ...@@ -85,9 +88,15 @@ export default {
if (this.item.type === ChildType.Epic) { if (this.item.type === ChildType.Epic) {
return this.isOpen ? 'epic' : 'epic-closed'; return this.isOpen ? 'epic' : 'epic-closed';
} }
if (this.isBlocked && this.isOpen) {
return 'issue-block';
}
return this.isOpen ? 'issues' : 'issue-closed'; return this.isOpen ? 'issues' : 'issue-closed';
}, },
stateIconClass() { stateIconClass() {
if (this.isBlocked && this.isOpen) {
return 'gl-text-red-500';
}
return this.isOpen return this.isOpen
? 'issue-token-state-icon-open gl-text-green-500' ? 'issue-token-state-icon-open gl-text-green-500'
: 'issue-token-state-icon-closed gl-text-blue-500'; : 'issue-token-state-icon-closed gl-text-blue-500';
......
...@@ -142,6 +142,18 @@ describe('RelatedItemsTree', () => { ...@@ -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', () => { describe('isClosed', () => {
it('returns true when `item.state` value is `closed`', () => { it('returns true when `item.state` value is `closed`', () => {
wrapper.setProps({ wrapper.setProps({
...@@ -199,6 +211,16 @@ describe('RelatedItemsTree', () => { ...@@ -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`', () => { it('returns string `issue-token-state-icon-closed gl-text-blue-500` when `item.state` value is `closed`', () => {
wrapper.setProps({ wrapper.setProps({
item: { ...mockItem, state: ChildState.Closed }, 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