Skip to content

Commit

Permalink
Fix issue #104:Change query compoenents as they implement the query c…
Browse files Browse the repository at this point in the history
…omponent interface
  • Loading branch information
LaraMerdol committed Jan 28, 2024
1 parent ac1e791 commit b122fa2
Show file tree
Hide file tree
Showing 21 changed files with 109 additions and 83 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { TableViewInput, TableDataType, TableFiltering, TableRowMeta, TableData
import { Subject } from 'rxjs';
import { QueryHelperService} from '../../query-helper.service';
import { DbResponseType, GraphResponse } from 'src/app/visuall/db-service/data-types';
import { QueryComponent } from '../../query.component.interface';

export interface Anomaly {
issue: string;
Expand All @@ -16,9 +17,7 @@ export interface Anomaly {
templateUrl: './anomaly-statistic.component.html',
styleUrls: ['./anomaly-statistic.component.css']
})
export class AnomalyStatisticComponent implements OnInit {


export class AnomalyStatisticComponent implements OnInit, QueryComponent<Anomaly> {
tableInput: TableViewInput = {
columns: ['issue','anomalies'], results: [], results2: [],isEmphasizeOnHover: true, tableTitle: 'Query Results', classNameOfObjects: 'Issue', isShowExportAsCSV: true,
resultCnt: 0, currPage: 1, pageSize: 0, isLoadGraph: false, isMergeGraph: true, isNodeData: true, isSelect: false
Expand Down Expand Up @@ -129,7 +128,7 @@ export class AnomalyStatisticComponent implements OnInit {
this._dbService.runQuery(cql, cb);

}
private filterGraphResponse(x: GraphResponse): GraphResponse {
filterGraphResponse(x: GraphResponse): GraphResponse {
const r: GraphResponse = { nodes: [], edges: x.edges };

const nodeIdDict = {};
Expand Down Expand Up @@ -198,7 +197,7 @@ export class AnomalyStatisticComponent implements OnInit {
}
}

private filterTableResponse(x: Anomaly[], filter: TableFiltering): Anomaly[] {
filterTableResponse(x: Anomaly[], filter: TableFiltering): Anomaly[] {
if (!filter || ((!filter.txt || filter.txt.length < 1) && filter.orderDirection == '' && (!filter.skip || filter.skip == 0))) {
const skip = filter && filter.skip ? filter.skip : 0;
this.tableInput.resultCnt = x.length;
Expand Down Expand Up @@ -229,8 +228,6 @@ export class AnomalyStatisticComponent implements OnInit {
const skip = filter && filter.skip ? filter.skip : 0;
return filtered.slice(skip, skip + this._g.userPrefs.dataPageSize.getValue());
}
// tableInput is already filtered. Use that to filter graph elements.
// For this query, we should specifically bring the related nodes and their 1-neighborhood


}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { TableViewInput, TableDataType, TableFiltering, TableRowMeta, TableData
import { Subject } from 'rxjs';
import { QueryHelperService} from '../../query-helper.service';
import { DbResponseType, GraphResponse } from 'src/app/visuall/db-service/data-types';
import { getCyStyleFromColorAndWid } from 'src/app/visuall/constants';
import { QueryComponent } from '../../query.component.interface';

export interface Anomaly {
Issue: string;
Expand All @@ -20,7 +20,7 @@ export interface Anomaly {
templateUrl: './closed-reopen-ping-pong.component.html',
styleUrls: ['./closed-reopen-ping-pong.component.css']
})
export class ClosedReopenPingPongComponent implements OnInit {
export class ClosedReopenPingPongComponent implements OnInit, QueryComponent<Anomaly> {
count:number;
tableInput: TableViewInput = {
columns: ['issue','assignee','resolver','count'], results: [], results2: [],isEmphasizeOnHover: true, tableTitle: 'Query Results', classNameOfObjects: 'Issue', isShowExportAsCSV: true,
Expand Down Expand Up @@ -123,7 +123,7 @@ export class ClosedReopenPingPongComponent implements OnInit {
this._dbService.runQuery(cql, cb);

}
private filterGraphResponse(x: GraphResponse): GraphResponse {
filterGraphResponse(x: GraphResponse): GraphResponse {
const r: GraphResponse = { nodes: [], edges: x.edges };

const nodeIdDict = {};
Expand Down Expand Up @@ -189,7 +189,7 @@ export class ClosedReopenPingPongComponent implements OnInit {
}
}

private filterTableResponse(x: Anomaly[], filter: TableFiltering): Anomaly[] {
filterTableResponse(x: Anomaly[], filter: TableFiltering): Anomaly[] {
if (!filter || ((!filter.txt || filter.txt.length < 1) && filter.orderDirection == '' && (!filter.skip || filter.skip == 0))) {
const skip = filter && filter.skip ? filter.skip : 0;
this.tableInput.resultCnt = x.length;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { TableViewInput, TableDataType, TableFiltering, TableRowMeta, TableData
import { Subject } from 'rxjs';
import { QueryHelperService} from '../../query-helper.service';
import { DbResponseType, GraphResponse } from 'src/app/visuall/db-service/data-types';
import { getCyStyleFromColorAndWid } from 'src/app/visuall/constants';
import { QueryComponent } from '../../query.component.interface'

export interface Anomaly {
Issue: string;
Expand All @@ -19,7 +19,7 @@ export interface Anomaly {
templateUrl: './ignored-bugs.component.html',
styleUrls: ['./ignored-bugs.component.css']
})
export class IgnoredBugsComponent implements OnInit {
export class IgnoredBugsComponent implements OnInit, QueryComponent<Anomaly> {

time:number ;

Expand Down Expand Up @@ -128,7 +128,7 @@ export class IgnoredBugsComponent implements OnInit {
this._dbService.runQuery(cql, cb);

}
private filterGraphResponse(x: GraphResponse): GraphResponse {
filterGraphResponse(x: GraphResponse): GraphResponse {
const r: GraphResponse = { nodes: [], edges: x.edges };

const nodeIdDict = {};
Expand Down Expand Up @@ -218,7 +218,7 @@ export class IgnoredBugsComponent implements OnInit {
}
}

private filterTableResponse(x: Anomaly[], filter: TableFiltering): Anomaly[] {
filterTableResponse(x: Anomaly[], filter: TableFiltering): Anomaly[] {
if (!filter || ((!filter.txt || filter.txt.length < 1) && filter.orderDirection == '' && (!filter.skip || filter.skip == 0))) {
const skip = filter && filter.skip ? filter.skip : 0;
this.tableInput.resultCnt = x.length;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { TableViewInput, TableDataType, TableFiltering, TableRowMeta, TableData
import { Subject } from 'rxjs';
import { QueryHelperService} from '../../query-helper.service';
import { DbResponseType, GraphResponse } from 'src/app/visuall/db-service/data-types';
import { getCyStyleFromColorAndWid } from 'src/app/visuall/constants';
import { QueryComponent } from '../../query.component.interface';

export interface Anomaly {
Issue: string;
Expand All @@ -17,7 +17,7 @@ export interface Anomaly {
templateUrl: './missing-environment-information.component.html',
styleUrls: ['./missing-environment-information.component.css']
})
export class MissingEnvironmentInformationComponent implements OnInit {
export class MissingEnvironmentInformationComponent implements OnInit, QueryComponent<Anomaly> {



Expand Down Expand Up @@ -123,7 +123,7 @@ export class MissingEnvironmentInformationComponent implements OnInit {
this._dbService.runQuery(cql, cb);

}
private filterGraphResponse(x: GraphResponse): GraphResponse {
filterGraphResponse(x: GraphResponse): GraphResponse {
const r: GraphResponse = { nodes: [], edges: x.edges };

const nodeIdDict = {};
Expand Down Expand Up @@ -200,7 +200,7 @@ export class MissingEnvironmentInformationComponent implements OnInit {
}
}

private filterTableResponse(x: Anomaly[], filter: TableFiltering): Anomaly[] {
filterTableResponse(x: Anomaly[], filter: TableFiltering): Anomaly[] {
if (!filter || ((!filter.txt || filter.txt.length < 1) && filter.orderDirection == '' && (!filter.skip || filter.skip == 0))) {
const skip = filter && filter.skip ? filter.skip : 0;
this.tableInput.resultCnt = x.length;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { TableViewInput, TableDataType, TableFiltering, TableRowMeta, TableData
import { Subject } from 'rxjs';
import { QueryHelperService} from '../../query-helper.service';
import { DbResponseType, GraphResponse } from 'src/app/visuall/db-service/data-types';
import { getCyStyleFromColorAndWid } from 'src/app/visuall/constants';
import { QueryComponent } from '../../query.component.interface';

export interface Anomaly {
Issue: string;
Expand All @@ -18,7 +18,7 @@ export interface Anomaly {
templateUrl: './missing-priority.component.html',
styleUrls: ['./missing-priority.component.css']
})
export class MissingPriorityComponent implements OnInit {
export class MissingPriorityComponent implements OnInit, QueryComponent<Anomaly> {



Expand Down Expand Up @@ -126,7 +126,7 @@ export class MissingPriorityComponent implements OnInit {
this._dbService.runQuery(cql, cb);

}
private filterGraphResponse(x: GraphResponse): GraphResponse {
filterGraphResponse(x: GraphResponse): GraphResponse {
const r: GraphResponse = { nodes: [], edges: x.edges };

const nodeIdDict = {};
Expand Down Expand Up @@ -192,7 +192,7 @@ export class MissingPriorityComponent implements OnInit {
}
}

private filterTableResponse(x: Anomaly[], filter: TableFiltering): Anomaly[] {
filterTableResponse(x: Anomaly[], filter: TableFiltering): Anomaly[] {
if (!filter || ((!filter.txt || filter.txt.length < 1) && filter.orderDirection == '' && (!filter.skip || filter.skip == 0))) {
const skip = filter && filter.skip ? filter.skip : 0;
this.tableInput.resultCnt = x.length;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { TableViewInput, TableDataType, TableFiltering, TableRowMeta, TableData
import { Subject } from 'rxjs';
import { QueryHelperService} from '../../query-helper.service';
import { DbResponseType, GraphResponse } from 'src/app/visuall/db-service/data-types';
import { getCyStyleFromColorAndWid } from 'src/app/visuall/constants';
import { QueryComponent } from '../../query.component.interface';

export interface Anomaly {
Issue: string;
Expand All @@ -18,7 +18,7 @@ export interface Anomaly {
templateUrl: './no-assignee-resolver-bug.component.html',
styleUrls: ['./no-assignee-resolver-bug.component.css']
})
export class NoAssigneeResolverBugComponent implements OnInit {
export class NoAssigneeResolverBugComponent implements OnInit, QueryComponent<Anomaly> {



Expand Down Expand Up @@ -125,7 +125,7 @@ export class NoAssigneeResolverBugComponent implements OnInit {
this._dbService.runQuery(cql, cb);

}
private filterGraphResponse(x: GraphResponse): GraphResponse {
filterGraphResponse(x: GraphResponse): GraphResponse {
const r: GraphResponse = { nodes: [], edges: x.edges };

const nodeIdDict = {};
Expand Down Expand Up @@ -190,7 +190,7 @@ export class NoAssigneeResolverBugComponent implements OnInit {
}
}

private filterTableResponse(x: Anomaly[], filter: TableFiltering): Anomaly[] {
filterTableResponse(x: Anomaly[], filter: TableFiltering): Anomaly[] {
if (!filter || ((!filter.txt || filter.txt.length < 1) && filter.orderDirection == '' && (!filter.skip || filter.skip == 0))) {
const skip = filter && filter.skip ? filter.skip : 0;
this.tableInput.resultCnt = x.length;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { TableViewInput, TableDataType, TableFiltering, TableRowMeta, TableData
import { Subject } from 'rxjs';
import { QueryHelperService} from '../../query-helper.service';
import { DbResponseType, GraphResponse } from 'src/app/visuall/db-service/data-types';
import { getCyStyleFromColorAndWid } from 'src/app/visuall/constants';
import { QueryComponent } from '../../query.component.interface';

export interface Anomaly {
Issue: string;
Expand All @@ -16,7 +16,7 @@ export interface Anomaly {
templateUrl: './no-comment-bugs.component.html',
styleUrls: ['./no-comment-bugs.component.css']
})
export class NoCommentBugsComponent implements OnInit {
export class NoCommentBugsComponent implements OnInit, QueryComponent<Anomaly> {



Expand Down Expand Up @@ -123,7 +123,7 @@ export class NoCommentBugsComponent implements OnInit {
this._dbService.runQuery(cql, cb);

}
private filterGraphResponse(x: GraphResponse): GraphResponse {
filterGraphResponse(x: GraphResponse): GraphResponse {
const r: GraphResponse = { nodes: [], edges: x.edges };

const nodeIdDict = {};
Expand Down Expand Up @@ -189,7 +189,7 @@ export class NoCommentBugsComponent implements OnInit {
}
}

private filterTableResponse(x: Anomaly[], filter: TableFiltering): Anomaly[] {
filterTableResponse(x: Anomaly[], filter: TableFiltering): Anomaly[] {
if (!filter || ((!filter.txt || filter.txt.length < 1) && filter.orderDirection == '' && (!filter.skip || filter.skip == 0))) {
const skip = filter && filter.skip ? filter.skip : 0;
this.tableInput.resultCnt = x.length;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { TableViewInput, TableDataType, TableFiltering, TableRowMeta, TableData
import { Subject } from 'rxjs';
import { QueryHelperService} from '../../query-helper.service';
import { DbResponseType, GraphResponse } from 'src/app/visuall/db-service/data-types';
import { getCyStyleFromColorAndWid } from 'src/app/visuall/constants';
import { QueryComponent } from '../../query.component.interface';

export interface Anomaly {
Issue: string;
Expand All @@ -18,7 +18,7 @@ export interface Anomaly {
templateUrl: './no-link-to-bug-fixing-commit.component.html',
styleUrls: ['./no-link-to-bug-fixing-commit.component.css']
})
export class NoLinkToBugFixingCommitComponent implements OnInit {
export class NoLinkToBugFixingCommitComponent implements OnInit, QueryComponent<Anomaly> {



Expand Down Expand Up @@ -125,7 +125,7 @@ export class NoLinkToBugFixingCommitComponent implements OnInit {
this._dbService.runQuery(cql, cb);

}
private filterGraphResponse(x: GraphResponse): GraphResponse {
filterGraphResponse(x: GraphResponse): GraphResponse {
const r: GraphResponse = { nodes: [], edges: x.edges };

const nodeIdDict = {};
Expand Down Expand Up @@ -205,7 +205,7 @@ export class NoLinkToBugFixingCommitComponent implements OnInit {
}
}

private filterTableResponse(x: Anomaly[], filter: TableFiltering): Anomaly[] {
filterTableResponse(x: Anomaly[], filter: TableFiltering): Anomaly[] {
if (!filter || ((!filter.txt || filter.txt.length < 1) && filter.orderDirection == '' && (!filter.skip || filter.skip == 0))) {
const skip = filter && filter.skip ? filter.skip : 0;
this.tableInput.resultCnt = x.length;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { TableViewInput, TableDataType, TableFiltering, TableRowMeta, TableData
import { Subject } from 'rxjs';
import { QueryHelperService} from '../../query-helper.service';
import { DbResponseType, GraphResponse } from 'src/app/visuall/db-service/data-types';
import { getCyStyleFromColorAndWid } from 'src/app/visuall/constants';
import { QueryComponent } from '../../query.component.interface';

export interface Anomaly {
Issue: string;
Expand All @@ -17,7 +17,7 @@ export interface Anomaly {
templateUrl: './not-referenced-duplicates.component.html',
styleUrls: ['./not-referenced-duplicates.component.css']
})
export class NotReferencedDuplicatesComponent implements OnInit {
export class NotReferencedDuplicatesComponent implements OnInit, QueryComponent<Anomaly> {



Expand Down Expand Up @@ -126,7 +126,7 @@ export class NotReferencedDuplicatesComponent implements OnInit {
this._dbService.runQuery(cql, cb);

}
private filterGraphResponse(x: GraphResponse): GraphResponse {
filterGraphResponse(x: GraphResponse): GraphResponse {
const r: GraphResponse = { nodes: [], edges: x.edges };

const nodeIdDict = {};
Expand Down Expand Up @@ -195,7 +195,7 @@ export class NotReferencedDuplicatesComponent implements OnInit {
}
}

private filterTableResponse(x: Anomaly[], filter: TableFiltering): Anomaly[] {
filterTableResponse(x: Anomaly[], filter: TableFiltering): Anomaly[] {
if (!filter || ((!filter.txt || filter.txt.length < 1) && filter.orderDirection == '' && (!filter.skip || filter.skip == 0))) {
const skip = filter && filter.skip ? filter.skip : 0;
this.tableInput.resultCnt = x.length;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { TableViewInput, TableDataType, TableFiltering, TableRowMeta, TableData
import { Subject } from 'rxjs';
import { QueryHelperService} from '../../query-helper.service';
import { DbResponseType, GraphResponse } from 'src/app/visuall/db-service/data-types';
import { getCyStyleFromColorAndWid } from 'src/app/visuall/constants';
import { QueryComponent } from '../../query.component.interface';

export interface Anomaly {
Issue: string;
Expand All @@ -18,7 +18,7 @@ export interface Anomaly {
templateUrl: './reassignment-bug-assignee.component.html',
styleUrls: ['./reassignment-bug-assignee.component.css']
})
export class ReassignmentBugAssigneeComponent implements OnInit {
export class ReassignmentBugAssigneeComponent implements OnInit, QueryComponent<Anomaly> {
count :number;

tableInput: TableViewInput = {
Expand Down Expand Up @@ -131,7 +131,7 @@ export class ReassignmentBugAssigneeComponent implements OnInit {
this._dbService.runQuery(cql, cb);

}
private filterGraphResponse(x: GraphResponse): GraphResponse {
filterGraphResponse(x: GraphResponse): GraphResponse {
const r: GraphResponse = { nodes: [], edges: x.edges };
const nodeIdDict = {};
const start_edges = ["ASSIGNED_TO","ASSIGNED_BY", "REFERENCED"]
Expand Down Expand Up @@ -209,7 +209,7 @@ export class ReassignmentBugAssigneeComponent implements OnInit {
}
}

private filterTableResponse(x: Anomaly[], filter: TableFiltering): Anomaly[] {
filterTableResponse(x: Anomaly[], filter: TableFiltering): Anomaly[] {
if (!filter || ((!filter.txt || filter.txt.length < 1) && filter.orderDirection == '' && (!filter.skip || filter.skip == 0))) {
const skip = filter && filter.skip ? filter.skip : 0;
this.tableInput.resultCnt = x.length;
Expand Down
Loading

0 comments on commit b122fa2

Please sign in to comment.