Commit aab9e61d authored by Coung Ngo's avatar Coung Ngo

Remove isProject from iterations

isProject is not necessary as we can derive it from isGroup
parent 5cb22c05
......@@ -57,7 +57,6 @@ export default {
fullPath: this.fullPath,
id: getIdFromGraphQLId(this.iterationId),
isGroup: this.namespaceType === Namespace.Group,
isProject: this.namespaceType === Namespace.Project,
};
},
completedPercent() {
......
......@@ -120,7 +120,6 @@ export default {
fullPath: this.fullPath,
id: getIdFromGraphQLId(this.iterationId),
isGroup: this.namespaceType === Namespace.Group,
isProject: this.namespaceType === Namespace.Project,
};
if (this.pagination.beforeCursor) {
......
......@@ -77,7 +77,6 @@ export default {
const vars = {
fullPath: this.fullPath,
isGroup: this.namespaceType === Namespace.Group,
isProject: this.namespaceType === Namespace.Project,
state: this.state,
};
......
......@@ -3,8 +3,7 @@
query IterationIssues(
$fullPath: ID!
$id: ID!
$isGroup: Boolean = false
$isProject: Boolean = false
$isGroup: Boolean = true
$beforeCursor: String = ""
$afterCursor: String = ""
$firstPageSize: Int
......@@ -21,7 +20,7 @@ query IterationIssues(
...IterationIssues
}
}
project(fullPath: $fullPath) @include(if: $isProject) {
project(fullPath: $fullPath) @skip(if: $isGroup) {
issues(
iterationId: [$id]
before: $beforeCursor
......
query IterationIssuesSummary(
$fullPath: ID!
$id: ID!
$isGroup: Boolean = false
$isProject: Boolean = false
) {
query IterationIssuesSummary($fullPath: ID!, $id: ID!, $isGroup: Boolean = true) {
group(fullPath: $fullPath) @include(if: $isGroup) {
openIssues: issues(iterationId: [$id], state: opened, assigneeId: "none") {
count
......@@ -15,7 +10,7 @@ query IterationIssuesSummary(
count
}
}
project(fullPath: $fullPath) @include(if: $isProject) {
project(fullPath: $fullPath) @skip(if: $isGroup) {
openIssues: issues(iterationId: [$id], state: opened, assigneeId: "none") {
count
}
......
#import "~/graphql_shared/fragments/pageInfo.fragment.graphql"
#import "./iteration_list.fragment.graphql"
#import "./iteration_list_item.fragment.graphql"
query Iterations(
$fullPath: ID!
$isGroup: Boolean = false
$isProject: Boolean = false
$isGroup: Boolean = true
$state: IterationState!
$beforeCursor: String = ""
$afterCursor: String = ""
......@@ -21,14 +20,14 @@ query Iterations(
last: $lastPageSize
) {
nodes {
...IterationList
...IterationListItem
}
pageInfo {
...PageInfo
}
}
}
project(fullPath: $fullPath) @include(if: $isProject) {
project(fullPath: $fullPath) @skip(if: $isGroup) {
iterations(
state: $state
before: $beforeCursor
......@@ -37,7 +36,7 @@ query Iterations(
last: $lastPageSize
) {
nodes {
...IterationList
...IterationListItem
}
pageInfo {
...PageInfo
......
......@@ -15,8 +15,6 @@ describe('Iterations report', () => {
const findTopbar = () => wrapper.find({ ref: 'topbar' });
const findTitle = () => wrapper.find({ ref: 'title' });
const findDescription = () => wrapper.find({ ref: 'description' });
const findIterationReportSummary = () => wrapper.find(IterationReportSummary);
const findIterationReportTabs = () => wrapper.find(IterationReportTabs);
const mountComponent = ({ props = defaultProps, loading = false } = {}) => {
wrapper = shallowMount(IterationReport, {
......@@ -96,15 +94,19 @@ describe('Iterations report', () => {
});
it('passes correct props to IterationReportSummary', () => {
expect(findIterationReportSummary().props('fullPath')).toBe(defaultProps.fullPath);
expect(findIterationReportSummary().props('iterationId')).toBe(iteration.id);
expect(findIterationReportSummary().props('namespaceType')).toBe(Namespace.Group);
const iterationReportSummary = wrapper.find(IterationReportSummary);
expect(iterationReportSummary.props('fullPath')).toBe(defaultProps.fullPath);
expect(iterationReportSummary.props('iterationId')).toBe(iteration.id);
expect(iterationReportSummary.props('namespaceType')).toBe(Namespace.Group);
});
it('passes correct props to IterationReportTabs', () => {
expect(findIterationReportTabs().props('fullPath')).toBe(defaultProps.fullPath);
expect(findIterationReportTabs().props('iterationId')).toBe(iteration.id);
expect(findIterationReportTabs().props('namespaceType')).toBe(Namespace.Group);
const iterationReportTabs = wrapper.find(IterationReportTabs);
expect(iterationReportTabs.props('fullPath')).toBe(defaultProps.fullPath);
expect(iterationReportTabs.props('iterationId')).toBe(iteration.id);
expect(iterationReportTabs.props('namespaceType')).toBe(Namespace.Group);
});
});
});
......@@ -108,7 +108,6 @@ describe('Iterations report summary', () => {
expect(wrapper.vm.queryVariables).toEqual({
...expected,
isGroup: true,
isProject: false,
});
});
});
......@@ -125,7 +124,6 @@ describe('Iterations report summary', () => {
expect(wrapper.vm.queryVariables).toEqual({
...expected,
isGroup: false,
isProject: true,
});
});
});
......
......@@ -150,7 +150,6 @@ describe('Iterations report tabs', () => {
id,
lastPageSize: 20,
isGroup: true,
isProject: false,
});
});
});
......@@ -163,7 +162,6 @@ describe('Iterations report tabs', () => {
id,
firstPageSize: 20,
isGroup: true,
isProject: false,
});
});
});
......@@ -190,7 +188,6 @@ describe('Iterations report tabs', () => {
expect(wrapper.vm.queryVariables).toEqual({
...expected,
isGroup: true,
isProject: false,
});
});
});
......@@ -207,7 +204,6 @@ describe('Iterations report tabs', () => {
expect(wrapper.vm.queryVariables).toEqual({
...expected,
isGroup: false,
isProject: true,
});
});
});
......
......@@ -103,7 +103,6 @@ describe('Iterations', () => {
expect(wrapper.vm.queryVariables).toEqual({
beforeCursor: 'first-item',
isGroup: true,
isProject: false,
lastPageSize: 20,
fullPath: defaultProps.fullPath,
state: 'opened',
......@@ -118,7 +117,6 @@ describe('Iterations', () => {
firstPageSize: 20,
fullPath: defaultProps.fullPath,
isGroup: true,
isProject: false,
state: 'opened',
});
});
......@@ -161,7 +159,6 @@ describe('Iterations', () => {
expect(wrapper.vm.queryVariables).toEqual({
...expected,
isGroup: true,
isProject: false,
});
});
});
......@@ -178,7 +175,6 @@ describe('Iterations', () => {
expect(wrapper.vm.queryVariables).toEqual({
...expected,
isGroup: false,
isProject: true,
});
});
});
......
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