diff --git a/src/app/custom/anomalies/.DS_Store b/src/app/custom/analyses/anomalies/.DS_Store similarity index 84% rename from src/app/custom/anomalies/.DS_Store rename to src/app/custom/analyses/anomalies/.DS_Store index 6e4a41fb..7fa98ebc 100644 Binary files a/src/app/custom/anomalies/.DS_Store and b/src/app/custom/analyses/anomalies/.DS_Store differ diff --git a/src/app/custom/analyses/anomalies/anomaly-statistic/anomaly-statistic.component.ts b/src/app/custom/analyses/anomalies/anomaly-statistic/anomaly-statistic.component.ts index bd0dbd8b..8f417c61 100644 --- a/src/app/custom/analyses/anomalies/anomaly-statistic/anomaly-statistic.component.ts +++ b/src/app/custom/analyses/anomalies/anomaly-statistic/anomaly-statistic.component.ts @@ -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; @@ -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 { 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 @@ -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 = {}; @@ -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; @@ -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 } \ No newline at end of file diff --git a/src/app/custom/analyses/anomalies/closed-reopen-ping-pong/closed-reopen-ping-pong.component.ts b/src/app/custom/analyses/anomalies/closed-reopen-ping-pong/closed-reopen-ping-pong.component.ts index 038d6b2c..cca1ca37 100644 --- a/src/app/custom/analyses/anomalies/closed-reopen-ping-pong/closed-reopen-ping-pong.component.ts +++ b/src/app/custom/analyses/anomalies/closed-reopen-ping-pong/closed-reopen-ping-pong.component.ts @@ -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; @@ -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 { count:number; tableInput: TableViewInput = { columns: ['issue','assignee','resolver','count'], results: [], results2: [],isEmphasizeOnHover: true, tableTitle: 'Query Results', classNameOfObjects: 'Issue', isShowExportAsCSV: true, @@ -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 = {}; @@ -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; diff --git a/src/app/custom/analyses/anomalies/ignored-bugs/ignored-bugs.component.ts b/src/app/custom/analyses/anomalies/ignored-bugs/ignored-bugs.component.ts index e523f385..5f2eeb2f 100644 --- a/src/app/custom/analyses/anomalies/ignored-bugs/ignored-bugs.component.ts +++ b/src/app/custom/analyses/anomalies/ignored-bugs/ignored-bugs.component.ts @@ -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; @@ -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 { time:number ; @@ -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 = {}; @@ -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; diff --git a/src/app/custom/analyses/anomalies/missing-environment-information/missing-environment-information.component.ts b/src/app/custom/analyses/anomalies/missing-environment-information/missing-environment-information.component.ts index a31f93fa..978106e2 100644 --- a/src/app/custom/analyses/anomalies/missing-environment-information/missing-environment-information.component.ts +++ b/src/app/custom/analyses/anomalies/missing-environment-information/missing-environment-information.component.ts @@ -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; @@ -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 { @@ -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 = {}; @@ -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; diff --git a/src/app/custom/analyses/anomalies/missing-priority/missing-priority.component.ts b/src/app/custom/analyses/anomalies/missing-priority/missing-priority.component.ts index 1a2836e5..17b595a2 100644 --- a/src/app/custom/analyses/anomalies/missing-priority/missing-priority.component.ts +++ b/src/app/custom/analyses/anomalies/missing-priority/missing-priority.component.ts @@ -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; @@ -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 { @@ -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 = {}; @@ -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; diff --git a/src/app/custom/analyses/anomalies/no-assignee-resolver-bug/no-assignee-resolver-bug.component.ts b/src/app/custom/analyses/anomalies/no-assignee-resolver-bug/no-assignee-resolver-bug.component.ts index 3ee4a107..abd4f89f 100644 --- a/src/app/custom/analyses/anomalies/no-assignee-resolver-bug/no-assignee-resolver-bug.component.ts +++ b/src/app/custom/analyses/anomalies/no-assignee-resolver-bug/no-assignee-resolver-bug.component.ts @@ -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; @@ -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 { @@ -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 = {}; @@ -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; diff --git a/src/app/custom/analyses/anomalies/no-comment-bugs/no-comment-bugs.component.ts b/src/app/custom/analyses/anomalies/no-comment-bugs/no-comment-bugs.component.ts index 623acb2d..5f42838e 100644 --- a/src/app/custom/analyses/anomalies/no-comment-bugs/no-comment-bugs.component.ts +++ b/src/app/custom/analyses/anomalies/no-comment-bugs/no-comment-bugs.component.ts @@ -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; @@ -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 { @@ -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 = {}; @@ -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; diff --git a/src/app/custom/analyses/anomalies/no-link-to-bug-fixing-commit/no-link-to-bug-fixing-commit.component.ts b/src/app/custom/analyses/anomalies/no-link-to-bug-fixing-commit/no-link-to-bug-fixing-commit.component.ts index cb99007c..7a5ad6b3 100644 --- a/src/app/custom/analyses/anomalies/no-link-to-bug-fixing-commit/no-link-to-bug-fixing-commit.component.ts +++ b/src/app/custom/analyses/anomalies/no-link-to-bug-fixing-commit/no-link-to-bug-fixing-commit.component.ts @@ -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; @@ -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 { @@ -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 = {}; @@ -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; diff --git a/src/app/custom/analyses/anomalies/not-referenced-duplicates/not-referenced-duplicates.component.ts b/src/app/custom/analyses/anomalies/not-referenced-duplicates/not-referenced-duplicates.component.ts index 5777ba1f..f7077056 100644 --- a/src/app/custom/analyses/anomalies/not-referenced-duplicates/not-referenced-duplicates.component.ts +++ b/src/app/custom/analyses/anomalies/not-referenced-duplicates/not-referenced-duplicates.component.ts @@ -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; @@ -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 { @@ -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 = {}; @@ -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; diff --git a/src/app/custom/analyses/anomalies/reassignment-bug-assignee/reassignment-bug-assignee.component.ts b/src/app/custom/analyses/anomalies/reassignment-bug-assignee/reassignment-bug-assignee.component.ts index d9aafb2b..c083e0b6 100644 --- a/src/app/custom/analyses/anomalies/reassignment-bug-assignee/reassignment-bug-assignee.component.ts +++ b/src/app/custom/analyses/anomalies/reassignment-bug-assignee/reassignment-bug-assignee.component.ts @@ -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; @@ -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 { count :number; tableInput: TableViewInput = { @@ -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"] @@ -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; diff --git a/src/app/custom/analyses/anomalies/same-resolver-closer/same-resolver-closer.component.ts b/src/app/custom/analyses/anomalies/same-resolver-closer/same-resolver-closer.component.ts index 9b9070ca..69d6acc8 100644 --- a/src/app/custom/analyses/anomalies/same-resolver-closer/same-resolver-closer.component.ts +++ b/src/app/custom/analyses/anomalies/same-resolver-closer/same-resolver-closer.component.ts @@ -7,6 +7,7 @@ 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 { Developer: string; @@ -18,7 +19,7 @@ export interface Anomaly { templateUrl: './same-resolver-closer.component.html', styleUrls: ['./same-resolver-closer.component.css'] }) -export class SameResolverCloserComponent implements OnInit { +export class SameResolverCloserComponent implements OnInit, QueryComponent { @@ -119,7 +120,7 @@ export class SameResolverCloserComponent 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 = {}; @@ -209,7 +210,7 @@ export class SameResolverCloserComponent 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; diff --git a/src/app/custom/analyses/anomalies/unassigned-bugs/unassigned-bugs.component.ts b/src/app/custom/analyses/anomalies/unassigned-bugs/unassigned-bugs.component.ts index a68ae7d0..fac39d0f 100644 --- a/src/app/custom/analyses/anomalies/unassigned-bugs/unassigned-bugs.component.ts +++ b/src/app/custom/analyses/anomalies/unassigned-bugs/unassigned-bugs.component.ts @@ -7,6 +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 { QueryComponent } from '../../query.component.interface'; export interface Anomaly { Issue: string; @@ -17,7 +18,7 @@ export interface Anomaly { templateUrl: './unassigned-bugs.component.html', styleUrls: ['./unassigned-bugs.component.css'] }) -export class UnassignedBugsComponent implements OnInit { +export class UnassignedBugsComponent implements OnInit, QueryComponent { tableInput: TableViewInput = { columns: ['issue','resolver'], results: [], results2: [],isEmphasizeOnHover: true, tableTitle: 'Query Results', classNameOfObjects: 'Issue', isShowExportAsCSV: true, @@ -110,7 +111,7 @@ export class UnassignedBugsComponent 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 = {}; for (let i = 0; i < this.tableInput.results.length; i++) { @@ -173,7 +174,7 @@ export class UnassignedBugsComponent 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; diff --git a/src/app/custom/analyses/collaborators/collaborators.component.ts b/src/app/custom/analyses/collaborators/collaborators.component.ts index 53b96199..413a4143 100644 --- a/src/app/custom/analyses/collaborators/collaborators.component.ts +++ b/src/app/custom/analyses/collaborators/collaborators.component.ts @@ -7,8 +7,10 @@ import { Subject } from 'rxjs'; import { QueryHelperService} from '../query-helper.service'; import { DbResponseType, GraphResponse } from 'src/app/visuall/db-service/data-types'; import { GENERIC_TYPE, LONG_MAX, LONG_MIN } from 'src/app/visuall/constants'; -import { GroupingOptionTypes, TimebarGraphInclusionTypes } from 'src/app/visuall/user-preference'; +import { TimebarGraphInclusionTypes } from 'src/app/visuall/user-preference'; import { GroupCustomizationService } from 'src/app/custom/customization-service/group-customization.service'; +import { QueryComponent } from '../query.component.interface'; + export interface Collaborator { Name: string; Collaboration: number; @@ -18,7 +20,7 @@ export interface Collaborator { templateUrl: './collaborators.component.html', styleUrls: ['./collaborators.component.css'] }) -export class CollaboratorsComponent implements OnInit { +export class CollaboratorsComponent implements OnInit, QueryComponent{ developer: String = ""; developerId : String = ""; @@ -192,7 +194,7 @@ export class CollaboratorsComponent 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 = {}; @@ -285,7 +287,7 @@ export class CollaboratorsComponent implements OnInit { return objArr; } - private filterTableResponse(x: Collaborator[], filter: TableFiltering): Collaborator[] { + filterTableResponse(x: Collaborator[], filter: TableFiltering): Collaborator[] { 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; diff --git a/src/app/custom/analyses/comment-collaborators/comment-collaborators.component.ts b/src/app/custom/analyses/comment-collaborators/comment-collaborators.component.ts index ee1f0d67..19297679 100644 --- a/src/app/custom/analyses/comment-collaborators/comment-collaborators.component.ts +++ b/src/app/custom/analyses/comment-collaborators/comment-collaborators.component.ts @@ -6,8 +6,10 @@ 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 { GENERIC_TYPE, LONG_MAX, LONG_MIN } from 'src/app/visuall/constants'; +import { LONG_MAX, LONG_MIN } from 'src/app/visuall/constants'; import { TimebarGraphInclusionTypes } from 'src/app/visuall/user-preference'; +import { QueryComponent } from '../query.component.interface'; + export interface Collaborator { Name: string; CollaborationCount: number; @@ -18,7 +20,7 @@ export interface Collaborator { templateUrl: './comment-collaborators.component.html', styleUrls: ['./comment-collaborators.component.css'] }) -export class CommentCollaboratorsComponent implements OnInit { +export class CommentCollaboratorsComponent implements OnInit, QueryComponent { developer: String = ""; developerId : String = ""; @@ -195,7 +197,7 @@ export class CommentCollaboratorsComponent 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 = {}; @@ -291,7 +293,7 @@ export class CommentCollaboratorsComponent implements OnInit { return objArr; } - private filterTableResponse(x: Collaborator[], filter: TableFiltering): Collaborator[] { + filterTableResponse(x: Collaborator[], filter: TableFiltering): Collaborator[] { 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; diff --git a/src/app/custom/analyses/comment-contributors/comment-contributors.component.ts b/src/app/custom/analyses/comment-contributors/comment-contributors.component.ts index 94629df6..889b0a3f 100644 --- a/src/app/custom/analyses/comment-contributors/comment-contributors.component.ts +++ b/src/app/custom/analyses/comment-contributors/comment-contributors.component.ts @@ -6,7 +6,7 @@ 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 Developer { Developer: string; @@ -17,7 +17,7 @@ templateUrl: './comment-contributors.component.html', styleUrls: ['./comment-contributors.component.css'] }) - export class CommentContributorsComponent implements OnInit { + export class CommentContributorsComponent implements OnInit, QueryComponent { tableInput: TableViewInput = { columns: ['developer','count'], 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 @@ -134,7 +134,7 @@ this._dbService.runQuery(cql, cb); } - private filterGraphResponse(x: GraphResponse): GraphResponse { + filterGraphResponse(x: GraphResponse): GraphResponse { const r: GraphResponse = { nodes: x.nodes, edges: x.edges }; return r; } @@ -190,7 +190,7 @@ } - private filterTableResponse(x: Developer[], filter: TableFiltering): Developer[] { + filterTableResponse(x: Developer[], filter: TableFiltering): Developer[] { 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; diff --git a/src/app/custom/analyses/developer-commits/developer-commits.component.ts b/src/app/custom/analyses/developer-commits/developer-commits.component.ts index eafb2ce6..9ea05a4a 100644 --- a/src/app/custom/analyses/developer-commits/developer-commits.component.ts +++ b/src/app/custom/analyses/developer-commits/developer-commits.component.ts @@ -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 { QueryComponent } from '../query.component.interface'; //This query is for export interface CommitData { id: string; @@ -18,7 +18,7 @@ export interface CommitData { styleUrls: ['./developer-commits.component.css'] }) -export class DeveloperCommitsComponent implements OnInit { +export class DeveloperCommitsComponent implements OnInit, QueryComponent { developer: string; developers: string[]; tableInput: TableViewInput = { @@ -204,7 +204,7 @@ export class DeveloperCommitsComponent implements OnInit { } } - private filterTableResponse(x: CommitData[], filter: TableFiltering): CommitData[] { + filterTableResponse(x: CommitData[], filter: TableFiltering): CommitData[] { 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; @@ -236,7 +236,7 @@ export class DeveloperCommitsComponent implements OnInit { return filtered.slice(skip, skip + this._g.userPrefs.dataPageSize.getValue()); } - private filterGraphResponse(x: GraphResponse): GraphResponse { + filterGraphResponse(x: GraphResponse): GraphResponse { const r: GraphResponse = { nodes: [], edges: x.edges }; const nodeIdDict = {}; diff --git a/src/app/custom/analyses/expert-recommendation/expert-recommendation.component.ts b/src/app/custom/analyses/expert-recommendation/expert-recommendation.component.ts index 298f9d75..79a49f24 100644 --- a/src/app/custom/analyses/expert-recommendation/expert-recommendation.component.ts +++ b/src/app/custom/analyses/expert-recommendation/expert-recommendation.component.ts @@ -11,9 +11,9 @@ import { DbResponseType, GraphResponse } from 'src/app/visuall/db-service/data-t import { getCyStyleFromColorAndWid, readTxtFile, isJson } from 'src/app/visuall/constants'; import { GroupingOptionTypes } from '../../../visuall/user-preference'; import { GroupCustomizationService } from 'src/app/custom/customization-service/group-customization.service'; -import { GENERIC_TYPE, LONG_MAX, LONG_MIN } from 'src/app/visuall/constants'; -import { TimebarGraphInclusionTypes } from 'src/app/visuall/user-preference'; import { TheoreticPropertiesCustomService } from 'src/app/custom/customization-service/theoretic-properties-custom.service' +import { QueryComponent } from '../query.component.interface'; + export interface DeveloperData { name: string; score: number; @@ -25,7 +25,7 @@ export interface DeveloperData { templateUrl: './expert-recommendation.component.html', styleUrls: ['./expert-recommendation.component.css'] }) -export class ExpertRecommendationComponent implements OnInit { +export class ExpertRecommendationComponent implements OnInit, QueryComponent { githubHttpOptions: any; authentication: any; file: string; @@ -342,7 +342,7 @@ export class ExpertRecommendationComponent implements OnInit { return objArr; } - private filterTableResponse(x: DeveloperData[], filter: TableFiltering): DeveloperData[] { + filterTableResponse(x: DeveloperData[], filter: TableFiltering): DeveloperData[] { 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; @@ -376,7 +376,7 @@ export class ExpertRecommendationComponent implements OnInit { // tableInput is already filtered. Use that to filter graph elements. // For this query, we should specifically bring the related nodes and their 1-neighborhood - private filterGraphResponse(x: GraphResponse): GraphResponse { + filterGraphResponse(x: GraphResponse): GraphResponse { /* const r: GraphResponse = { nodes: [], edges: x.edges }; const nodeIdDict = {}; diff --git a/src/app/custom/analyses/query.component.interface.ts b/src/app/custom/analyses/query.component.interface.ts new file mode 100644 index 00000000..65d2be5a --- /dev/null +++ b/src/app/custom/analyses/query.component.interface.ts @@ -0,0 +1,21 @@ +import { TableViewInput, TableFiltering, TableData } from '../../shared/table-view/table-view-types'; +import { Subject } from 'rxjs'; +import { GraphResponse } from 'src/app/visuall/db-service/data-types'; + +export interface QueryComponent { + tableInput: TableViewInput; + tableFilled: Subject; + tableResponse: T; + graphResponse: GraphResponse; + clearTableFilter: Subject; + + ngOnInit(): void; + prepareQuery(): void; + loadTable(skip: number, filter?: TableFiltering): void; + loadGraph(skip: number, filter?: TableFiltering): void; + filterGraphResponse(x: GraphResponse): GraphResponse; + fillTable(data: T[], totalDataCount: number | null): void; + getDataForQueryResult(e: any): void; + filterTable(filter: TableFiltering): void; + filterTableResponse(x: T[], filter: TableFiltering): T[]; +} \ No newline at end of file diff --git a/src/app/custom/analyses/reviewer-recommendation/reviewer-recommendation.component.ts b/src/app/custom/analyses/reviewer-recommendation/reviewer-recommendation.component.ts index 65caf897..3afcc2a1 100644 --- a/src/app/custom/analyses/reviewer-recommendation/reviewer-recommendation.component.ts +++ b/src/app/custom/analyses/reviewer-recommendation/reviewer-recommendation.component.ts @@ -1,4 +1,5 @@ import { Component, OnInit } from '@angular/core'; + import { HttpClient, HttpHeaders } from '@angular/common/http'; import * as C from 'src/app/visuall/constants'; import { Neo4jDb } from '../../../visuall/db-service/neo4j-db.service'; @@ -15,6 +16,7 @@ import { GroupCustomizationService } from 'src/app/custom/customization-service/ import { TheoreticPropertiesCustomService } from 'src/app/custom/customization-service/theoretic-properties-custom.service' import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { ModalContentComponent } from '../../operational-tabs/object-tab/modal-content/modal-content.component'; +import { QueryComponent } from '../query.component.interface'; export interface DeveloperData { name: string; score: number; @@ -25,7 +27,7 @@ export interface DeveloperData { templateUrl: './reviewer-recommendation.component.html', styleUrls: ['./reviewer-recommendation.component.css'] }) -export class ReviewerRecommendationComponent implements OnInit { +export class ReviewerRecommendationComponent implements OnInit, QueryComponent { githubHttpOptions: any; authentication: any; pr: string; @@ -59,15 +61,16 @@ export class ReviewerRecommendationComponent implements OnInit { algorithm = null; recency: boolean = false; - constructor(private http: HttpClient, private _dbService: Neo4jDb, private _cyService: CytoscapeService, private _g: GlobalVariableService, - private _group: GroupCustomizationService, private _gt: TheoreticPropertiesCustomService, private modalService: NgbModal, private _h: QueryHelperService) { - this.prs = []; - this.developers = []; - this.scores = []; - this.fileIds = []; - this.possibleDevelopers = []; - this.commits = []; - } + constructor( + private http: HttpClient, + private _dbService: Neo4jDb, + private _cyService: CytoscapeService, + private _g: GlobalVariableService, + private _group: GroupCustomizationService, + private _gt: TheoreticPropertiesCustomService, + private modalService: NgbModal, + private _h: QueryHelperService + ) {} ngOnInit() { this._dbService.runQuery('MATCH (m:PullRequest) return m.name as name , elementId(m) as id order by m.name ', (x) => { @@ -373,7 +376,7 @@ export class ReviewerRecommendationComponent implements OnInit { } - private filterTableResponse(x: DeveloperData[], filter: TableFiltering): DeveloperData[] { + filterTableResponse(x: DeveloperData[], filter: TableFiltering): DeveloperData[] { 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; @@ -407,7 +410,7 @@ export class ReviewerRecommendationComponent implements OnInit { // tableInput is already filtered. Use that to filter graph elements. // For this query, we should specifically bring the related nodes and their 1-neighborhood - private filterGraphResponse(x: GraphResponse): GraphResponse { + filterGraphResponse(x: GraphResponse): GraphResponse { /* const r: GraphResponse = { nodes: [], edges: x.edges }; const nodeIdDict = {}; diff --git a/src/app/custom/customization.module.ts b/src/app/custom/customization.module.ts index e2b02d70..817f63b3 100644 --- a/src/app/custom/customization.module.ts +++ b/src/app/custom/customization.module.ts @@ -86,7 +86,6 @@ export class CustomizationModule { { component: ReportComponent, text: 'Report' }, { component: ObjectQueriesComponent, text: 'Queries' } ]; - static mapSubTabs: { component: any, text: string }[] = []; static databaseSubTabs: { component: any, text: string }[] = []; static settingsSubTabs: { component: any, text: string }[] = [];