From bb1ebe0597dd9acf0b21092f66a20be0b5a732d2 Mon Sep 17 00:00:00 2001 From: basvareddy-bytes Date: Sun, 28 May 2023 17:14:55 +0530 Subject: [PATCH 01/16] Added functions for IQA dashboard --- src/GenericDashboard.ts | 137 ++++++++++++------ src/MESQA-Config-RF.json | 135 +++++++++++++++++ src/api/Matrix.Labels.ts | 11 ++ src/commons/Commons.GenericFunctionalities.ts | 61 ++++++++ src/interfaces/generic-dashboard.d.ts | 14 ++ 5 files changed, 316 insertions(+), 42 deletions(-) diff --git a/src/GenericDashboard.ts b/src/GenericDashboard.ts index f66b7c4..d9f0d32 100644 --- a/src/GenericDashboard.ts +++ b/src/GenericDashboard.ts @@ -76,7 +76,7 @@ namespace GenericDashboard { labelHistoryData: XRLabelEntry[] = []; - dateRangeData : dateRangeData = { + dateRangeData: dateRangeData = { currentWeekCategoryData: [], currentMonthCategoryData: {}, threeMonthsCategoryData: [], @@ -159,6 +159,15 @@ namespace GenericDashboard { dataSourcePromises.push(Matrix.Labels.getNeedlesByCategoryAndFiledId(needleSourceCategory, needleSourceFieldId)); } + } else if (dataSourceConfig.type == "NeedlesBySearch") { + if (dataSourceConfig.sourceAtrributes.length > 0) { + let searchParams = ""; + dataSourceConfig.sourceAtrributes.forEach(sourceAttribute => { + let searchParam = sourceAttribute.name + '=' + sourceAttribute.value; + searchParams += searchParam + '&' + }); + dataSourcePromises.push(Matrix.Labels.getNeedlesBySearch(searchParams)); + } } else if (dataSourceConfig.type == "Labels") { dataSourcePromises.push(Matrix.Labels.projectLabelHistory()); } @@ -208,7 +217,7 @@ namespace GenericDashboard { that.currentTimeRangeSelected = renderTemplateData.currentTimeRangeSelected; renderTemplateData.dateRangeData.forEach(dateRangeItem => { - that.initiateDateRangeActions(dateRangeItem.range,dateRangeItem.contentId); + that.initiateDateRangeActions(dateRangeItem.range, dateRangeItem.contentId); }); @@ -278,14 +287,14 @@ namespace GenericDashboard { categoriesFunctionalities.forEach(category => { category.functionalities.forEach(functionality => { - if(functionality.type === 'dateRangeComapre'){ + if (functionality.type === 'dateRangeComapre') { functionality.dateRanges.forEach(dateRange => { - that.initiateDateRangeActions(dateRange,functionality.id); + that.initiateDateRangeActions(dateRange, functionality.id); }); } }); }); - + } @@ -366,7 +375,7 @@ namespace GenericDashboard { if (byCategoryLabelData.groupByData.length > 0) { byCategoryLabelData.groupByData.forEach(groupByObject => { if (dateFilterId == groupByObject.id) { - that.renderGroupByChart(groupByObject.labelsDesc,groupByObject.groupWiseData,groupByObject.id); + that.renderGroupByChart(groupByObject.labelsDesc, groupByObject.groupWiseData, groupByObject.id); } }); } @@ -375,7 +384,7 @@ namespace GenericDashboard { if (byCategoryLabelData.groupByStateData.length > 0) { byCategoryLabelData.groupByStateData.forEach(groupByStateObject => { if (dateFilterId == groupByStateObject.id) { - that.renderGroupByStateChart(groupByStateObject.stateWiseData,groupByStateObject.stateColors,groupByStateObject.id); + that.renderGroupByStateChart(groupByStateObject.stateWiseData, groupByStateObject.stateColors, groupByStateObject.id); } }); } @@ -384,7 +393,7 @@ namespace GenericDashboard { if (byCategoryLabelData.groupByStateOverdueData.length > 0) { byCategoryLabelData.groupByStateOverdueData.forEach(groupByStateOverdueObject => { if (dateFilterId == groupByStateOverdueObject.id) { - that.renderGroupByStateChart(groupByStateOverdueObject.stateWiseData,groupByStateOverdueObject.stateColors,groupByStateOverdueObject.id); + that.renderGroupByStateChart(groupByStateOverdueObject.stateWiseData, groupByStateOverdueObject.stateColors, groupByStateOverdueObject.id); } }); } @@ -393,7 +402,7 @@ namespace GenericDashboard { if (byCategoryLabelData.groupByStackData.length > 0) { byCategoryLabelData.groupByStackData.forEach(groupByStackObject => { if (dateFilterId == groupByStackObject.id) { - that.renderGroupByStackChart(groupByStackObject.groupByStackData,groupByStackObject.groupByCodesDesc,groupByStackObject.categoryDesc,groupByStackObject.groupByCodeColors,groupByStackObject.id); + that.renderGroupByStackChart(groupByStackObject.groupByStackData, groupByStackObject.groupByCodesDesc, groupByStackObject.categoryDesc, groupByStackObject.groupByCodeColors, groupByStackObject.id); } }); } @@ -402,7 +411,7 @@ namespace GenericDashboard { if (byCategoryLabelData.avgData.length > 0) { byCategoryLabelData.avgData.forEach(avgObject => { if (dateFilterId == avgObject.id) { - that.renderAvgChart(avgObject.stateDesc,avgObject.statusWiseAvgData,avgObject.id); + that.renderAvgChart(avgObject.stateDesc, avgObject.statusWiseAvgData, avgObject.id); } }); } @@ -411,7 +420,7 @@ namespace GenericDashboard { if (byCategoryLabelData.closureData.length > 0) { byCategoryLabelData.closureData.forEach(closureObject => { if (dateFilterId == closureObject.id) { - that.renderClosureChart(closureObject.closedItemsData,closureObject.closureTimeData,closureObject.id); + that.renderClosureChart(closureObject.closedItemsData, closureObject.closureTimeData, closureObject.id); } }); } @@ -420,14 +429,14 @@ namespace GenericDashboard { if (byCategoryLabelData.trackerData.length > 0) { byCategoryLabelData.trackerData.forEach(trackerObject => { if (dateFilterId == trackerObject.id) { - that.renderTrackerChart(trackerObject.stateDesc,trackerObject.stateTrackerData,trackerObject.stateColors,trackerObject.id); + that.renderTrackerChart(trackerObject.stateDesc, trackerObject.stateTrackerData, trackerObject.stateColors, trackerObject.id); } }); } break; case 'table': if (byCategoryLabelData.itemCurrentStateValues.length > 0) { - that.renderPluginTable(byCategoryLabelData.itemCurrentStateTableHeaders,byCategoryLabelData.itemCurrentStateValues); + that.renderPluginTable(byCategoryLabelData.itemCurrentStateTableHeaders, byCategoryLabelData.itemCurrentStateValues); } break; } @@ -501,28 +510,28 @@ namespace GenericDashboard { } - initiateDateRangeActions(range,contentId){ + initiateDateRangeActions(range, contentId) { let that = this; - $("#"+range+"Range").click(function () { + $("#" + range + "Range").click(function () { - if(range == "dateCompare"){ - $("#"+contentId+"-date-filter").show(); - }else{ - $("#"+contentId+"-date-filter").hide(); + if (range == "dateCompare") { + $("#" + contentId + "-date-filter").show(); + } else { + $("#" + contentId + "-date-filter").hide(); } - + if (that.currentTimeRangeSelected !== range) { - $("#"+range+"Range").removeClass("timerangenormal"); - $("#"+range+"Range").addClass("timerangeselected"); + $("#" + range + "Range").removeClass("timerangenormal"); + $("#" + range + "Range").addClass("timerangeselected"); $('#' + that.currentTimeRangeSelected + 'Range').removeClass("timerangeselected"); $('#' + that.currentTimeRangeSelected + 'Range').addClass("timerangenormal"); that.currentTimeRangeSelected = range; - - if(range !== "dateCompare"){ - that.renderDateRangeByAction(range,contentId); + + if (range !== "dateCompare") { + that.renderDateRangeByAction(range, contentId); } } @@ -530,7 +539,7 @@ namespace GenericDashboard { } - renderDateRangeByAction(range,contentId){ + renderDateRangeByAction(range, contentId) { let that = this; let columnData; let categoryData; @@ -547,42 +556,42 @@ namespace GenericDashboard { case 'threeMonths': columnData = that.dateRangeData.threeMonthsColumnsData; categoryData = that.dateRangeData.threeMonthsCategoryData; - break; + break; case 'sixMonths': columnData = that.dateRangeData.sixMonthsColumnsData; categoryData = that.dateRangeData.sixMonthsCategoryData; - break; + break; case 'twelveMonths': columnData = that.dateRangeData.twelveMonthsColumnsData; categoryData = that.dateRangeData.twelveMonthsCategoryData; - break; + break; case 'ytd': columnData = that.dateRangeData.ytdColumnsData; categoryData = that.dateRangeData.ytdCategoryData; - break; + break; case 'moreThanYear': columnData = that.dateRangeData.moreThanYearColumnsData; categoryData = that.dateRangeData.moreThanYearCategoryData; - break; + break; case 'quarterlyCY': columnData = that.dateRangeData.quarterlyCYColumnsData; categoryData = that.dateRangeData.quarterlyCYCategoryData.categories; - break; + break; case 'quarterlyFY': columnData = that.dateRangeData.quarterlyFYColumnsData; categoryData = that.dateRangeData.quarterlyFYCategoryData.categories; - break; + break; }; let ByCategoryLabelData = this.ByCategoryLabelDetails .find(({ category }) => category === this.currentCat); - if(ByCategoryLabelData.dateRangeCompareData.length > 0){ + if (ByCategoryLabelData.dateRangeCompareData.length > 0) { ByCategoryLabelData.dateRangeCompareData.forEach(dateRangeCompareObject => { - if(dateRangeCompareObject.id == contentId){ - that.renderDateRangeChart(columnData,categoryData,dateRangeCompareObject.labelsDesc, - dateRangeCompareObject.labelColors,dateRangeCompareObject.id); - } + if (dateRangeCompareObject.id == contentId) { + that.renderDateRangeChart(columnData, categoryData, dateRangeCompareObject.labelsDesc, + dateRangeCompareObject.labelColors, dateRangeCompareObject.id); + } }); } } @@ -593,7 +602,7 @@ namespace GenericDashboard { if (cat == undefined) { return; } - if (cat == ""){ + if (cat == "") { cat = $("#itemSelectionLabelDashboard .dropdown-menu li:first").text(); } @@ -656,6 +665,13 @@ namespace GenericDashboard { }); } + if (ByCategoryLabelData.groupByNcrDeptData && ByCategoryLabelData.groupByNcrDeptData.length > 0) { + ByCategoryLabelData.groupByNcrDeptData.forEach(groupByNcrDeptObject => { + that.renderGroupByNcrDeptChart(groupByNcrDeptObject.labelsDesc, groupByNcrDeptObject.groupByNcrDeptWiseData, groupByNcrDeptObject.id); + }); + } + + if (ByCategoryLabelData.dateRangeCompareData && ByCategoryLabelData.dateRangeCompareData.length > 0) { ByCategoryLabelData.dateRangeCompareData.forEach(dateRangeCompareObject => { @@ -1350,6 +1366,36 @@ namespace GenericDashboard { that.allChartsMap.set(groupId, trackerChart); } + renderGroupByNcrDeptChart(labels, groupByNcrDeptWiseData, groupId) { + let that = this; + //prepare template "${contentConfig.id}-Chart" + let groupByChartparams: c3.ChartConfiguration = { + bindto: `#${groupId}Graph`, + data: { + x: 'x', + columns: [ + ['x', ...labels], + groupByNcrDeptWiseData + ], + type: 'bar' + }, + axis: { + x: { + type: 'category' + } + } + }; + + //prepare chart config and render + $(`#${groupId}-Chart div`).remove(); + + $(`#${groupId}-Chart`).append(`
`); + + let groupByChart = c3.generate(groupByChartparams); + + that.allChartsMap.set(groupId, groupByChart); + } + renderPluginTableByDateRanges(fromDateVal: any, toDateVal: any, byCategoryLabelData: ByCategoryLabelData) { let fromDate = new Date(fromDateVal); @@ -1472,7 +1518,7 @@ namespace GenericDashboard { //process groupByState functionality ByCategoryLabelData.groupByStateData.forEach(groupByStateObject => { let groupByStateDataSource = functionalityDataSources.find((functionalityDataSource) => functionalityDataSource.type === groupByStateObject.dataSourceType); - if(groupByStateDataSource.type === "Labels"){ + if (groupByStateDataSource.type === "Labels") { Commons.GenericFunctionalities.processGroupByStateData(groupByStateObject, groupByStateDataSource.source, ByCategoryLabelData.category, @@ -1480,13 +1526,13 @@ namespace GenericDashboard { ByCategoryLabelData.itemCurrentStateTableHeaders, ByCategoryLabelData.itemCurrentStateValues ); - }else if(groupByStateDataSource.type === "Needles"){ + } else if (groupByStateDataSource.type === "Needles") { Commons.GenericFunctionalities.processGroupByStateNeedleData(groupByStateObject, groupByStateDataSource.source ); } - if(groupByStateObject.type === "groupByGapAnalysis"){ + if (groupByStateObject.type === "groupByGapAnalysis") { that.currentCat = "QMS"; } }); @@ -1559,6 +1605,13 @@ namespace GenericDashboard { ByCategoryLabelData.itemCurrentStateValues ); }); + + //process groupBy functionality + ByCategoryLabelData.groupByNcrDeptData.forEach(groupByNcrDeptObject => { + let groupByNcrDeptObjectDataSource = functionalityDataSources.find((functionalityDataSource) => functionalityDataSource.type === groupByNcrDeptObject.dataSourceType); + Commons.GenericFunctionalities.processGroupByNcrDeptObjectData(groupByNcrDeptObject, + groupByNcrDeptObjectDataSource.source); + }); } } } diff --git a/src/MESQA-Config-RF.json b/src/MESQA-Config-RF.json index 8e8866e..2c1770d 100644 --- a/src/MESQA-Config-RF.json +++ b/src/MESQA-Config-RF.json @@ -1,5 +1,140 @@ { "plugins" : [ + { + "id": "IQAO", + "title": "IQA Overview", + "folder": "DASHBOARDS", + "order": 3000, + "icon": "fal fa-chart-bar", + "name": "IQA Overview", + "version": "1.0.0", + "dataSources": [ + { + "type": "Labels" + }, + { + "type": "NeedlesBySearch", + "sourceAtrributes": [ + { + "name": "category", + "value": "IQA" + }, + { + "name": "fieldsOut", + "value": 2459 + }, + { + "name": "labels", + "value": 1 + } + ] + } + ], + "layoutConfig": { + "rowConfig": [ + { + "columnConfig": [ + { + "size": 6, + "contentType": "chart", + "contentConfig": { + "id" : "status", + "functionality" : "groupByState", + "title" : "Status wise IQA count overview", + "dateFilterRequired" : "Y", + "contentClass" : "chart" + } + }, + { + "size": 6, + "contentType": "chart", + "contentConfig": { + "id" : "avg", + "functionality" : "avg", + "title" : "Average time state wise overview", + "dateFilterRequired" : "N", + "contentClass" : "chart" + } + } + ] + }, + { + "columnConfig": [ + { + "size": 6, + "contentType": "chart", + "contentConfig": { + "id" : "ncrDeptWise", + "functionality" : "groupByNcrDept", + "title" : "NCR department wise overview", + "dateFilterRequired" : "N", + "contentClass" : "chart" + } + } + ] + }, + { + "columnConfig": [ + { + "size": 12, + "contentType": "table", + "contentConfig": { + "id" : "IQAO", + "functionality" : "table", + "title" : "IQA current status list", + "dateFilterRequired" : "Y" + } + } + ] + } + ], + "layoutDomStyle":" .chart { width: 90%; min-height: 350px; cursor:pointer; } .dateFilter{ display:flex; margin-left: 45px; } .filterDates { width: 115px; margin: 0 6px; } .date-filter-form-control { height: 20px; padding: 6px 12px; font-size: 14px; line-height: 1.42857143; color: #555; background-color: #fff; background-image: none; border: 1px solid #ccc; border-radius: 4px; } .date-filter-btn { margin-bottom: 0; margin-left: 12px; font-weight: 400; text-align: center; white-space: nowrap; vertical-align: middle; touch-action: manipulation; cursor: pointer; background-image: none; border: 1px solid transparent; padding: 0px 5px; font-size: 12px; line-height: 1.42857143; border-radius: 4px; } .tableDateFilter{ display:flex; margin-left: 350px; } .closureTimeChart{ width: 90%; min-height: 315px; cursor:pointer; } .bigChart{ width: 90%; min-height: 900px; cursor:pointer; }" + }, + "categories":["IQA"], + "categoriesFunctionalities":[ + { + "id":"IQA", + "functionalities": [ + { + "id": "status", + "type": "groupByState", + "dataSourceType": "Labels", + "renderChart": "Y", + "showInTable": "Y", + "tableHeader": "Current State", + "labels": ["Q4", "PLN1", "Q1", "Q2", "Q3"], + "labelsDesc": ["IQA Initiated", "IQA Plan Approved", "Report Approved", "Response Accepted", "IQA CLosed"], + "labelColors": ["#d62728", "#ff7f0e", "#9467bd", "#1f77b4", "#2ca02c"] + }, + { + "id": "avg", + "type": "avg", + "dataSourceType": "Labels", + "renderChart": "Y", + "title": "average time spent in state", + "labels": ["Q4", "PLN1", "Q1", "Q2"], + "labelsDesc": ["IQA Initiated", "IQA Plan Approved", "Report Approved", "Response Accepted"], + "allLabels": ["Q4", "PLN1", "Q1", "Q2", "Q3"], + "initialStateLabels": ["Q4", "PLN1", "Q1", "Q2"], + "allLabelDesc": ["IQA Initiated", "IQA Plan Approved", "Report Approved", "Response Accepted", "IQA CLosed"], + "initialSateLabel": "Q4", + "closedStateLabel": "Q3", + "rejectedStateLabel": "" + }, + { + "id": "ncrDeptWise", + "type": "groupByNcrDept", + "dataSourceType": "NeedlesBySearch", + "renderChart": "Y", + "sourceTableName": "Audit Findings", + "sourceTableColumnName": "NC Category", + "labels": ["PROD-AB", "PROD-C", "QC-AB", "QC-C", "QA", "RA", "SCM", "MICRO", "PUR", "Packaging", "HR", "ENG", "ST", "UT", "NDLP"], + "labelsDesc": ["PAB", "PC", "QCAB", "QCC", "QA", "RA", "SCM", "MI", "PUR", "PKG", "HR", "ENG","ST", "UT", "NDL"] + } + ] + } + ] + }, { "id": "CAPAO", "title": "CAPA Status Overview", diff --git a/src/api/Matrix.Labels.ts b/src/api/Matrix.Labels.ts index 9cd22b8..e189c09 100644 --- a/src/api/Matrix.Labels.ts +++ b/src/api/Matrix.Labels.ts @@ -27,5 +27,16 @@ namespace Matrix { .catch((error) => reject(error)); }); } + + /** + * Get needles by category and field id for all items in a project + */ + export function getNeedlesBySearch(searchParams: string): Promise { + return new Promise((resolve, reject) => { + Matrix.REST.projectGETRequest("/needle?search=mrql:"+searchParams) + .then((data: XRTrimNeedle) => resolve(data.needles as XRTrimNeedleItem[])) + .catch((error) => reject(error)); + }); + } } } diff --git a/src/commons/Commons.GenericFunctionalities.ts b/src/commons/Commons.GenericFunctionalities.ts index bf6c900..8a89d38 100644 --- a/src/commons/Commons.GenericFunctionalities.ts +++ b/src/commons/Commons.GenericFunctionalities.ts @@ -82,6 +82,7 @@ namespace Commons { let avgData: avgObject[] = []; let closureData: closureObject[] = []; let trackerData: trackerObject[] = []; + let groupByNcrDeptData: groupByNcrDeptObject[] = []; let dateRangeCompareData: dateRangeCompareObject[] = []; let groupByStackCurrentLabelData: groupByStackCurrentData[] = []; let groupByObjectCurrentLabelData: groupByObjectCurrentData[] = []; @@ -341,6 +342,33 @@ namespace Commons { }; dateRangeCompareData.push(dateRangeComapreObject); break; + case 'groupByNcrDept': + let ncOptions = []; + let groupByNcrDeptWiseData = []; + let groupByNcrDeptInitials = Array(functionality.labels.length).fill(0); + let fieldAuditFindings = IC.getFieldByName("IQA","Audit Findings"); + let ncCatColumn = fieldAuditFindings.parameterJson.columns.find(col=>col.name == "NC Category"); + let ncDropDownOptions = IC.getDropDowns(ncCatColumn.options.setting).pop(); + if( ncDropDownOptions && ncDropDownOptions.value && ncDropDownOptions.value.options){ + ncOptions = ncDropDownOptions.value.options; + for( let option of ncDropDownOptions.value.options){ + groupByNcrDeptWiseData.push([option.label, ...groupByNcrDeptInitials]); + } + } + let groupByNcrDeptObject: groupByNcrDeptObject = { + id: functionality.id, + dataSourceType: functionality.dataSourceType, + renderChart: functionality.renderChart, + sourceTableName: functionality.sourceTableName, + sourceTableColumnName: functionality.sourceTableColumnName, + labels: functionality.labels, + labelsDesc: functionality.labelsDesc, + ncOptions: ncOptions, + ncCatColumnField: ncCatColumn.field, + groupByNcrDeptWiseData: groupByNcrDeptWiseData + }; + groupByNcrDeptData.push(groupByNcrDeptObject); + break; }; }); @@ -352,6 +380,7 @@ namespace Commons { groupByStateData: groupByStateData, groupByStateOverdueData: groupByStateOverdueData, groupByStackData: groupByStackData, + groupByNcrDeptData: groupByNcrDeptData, avgData: avgData, closureData: closureData, trackerData: trackerData, @@ -1097,5 +1126,37 @@ namespace Commons { } + export function processGroupByNcrDeptObjectData(groupByNcrDeptObject: groupByNcrDeptObject, + groupByNcrDeptObjectDataSource: XRTrimNeedleItem[]) { + + for (const item of groupByNcrDeptObjectDataSource) { + if(item.labels){ + let itemDeptIndex = -1; + for(const label of groupByNcrDeptObject.labels){ + if(item.labels.includes(label)){ + let labelIndex = groupByNcrDeptObject.labels.findIndex(labelCode => labelCode === label); + itemDeptIndex = labelIndex; + break; + } + } + + if(itemDeptIndex > 0){ + if(item.fieldVal.length == 1){ + let auditFindingTable = JSON.parse(item.fieldVal[0].value); + for( let auditFindingLine of auditFindingTable){ + let ncId = auditFindingLine[groupByNcrDeptObject.ncCatColumnField]; + let ncOption = groupByNcrDeptObject.ncOptions.find(ncOption => ncOption.id === ncId); + groupByNcrDeptObject.groupByNcrDeptWiseData.forEach(ncDeptWiseData => { + if(ncDeptWiseData[0] == ncOption.label){ + ncDeptWiseData[itemDeptIndex+1] += 1; + } + }); + } + } + } + } + } + } + } } \ No newline at end of file diff --git a/src/interfaces/generic-dashboard.d.ts b/src/interfaces/generic-dashboard.d.ts index 49d6931..d516623 100644 --- a/src/interfaces/generic-dashboard.d.ts +++ b/src/interfaces/generic-dashboard.d.ts @@ -79,6 +79,19 @@ interface groupByStateObject { currentLabelData: groupByObjectCurrentData[]; } +interface groupByNcrDeptObject { + id: string; + dataSourceType: string; + renderChart: string; + sourceTableName: string; + sourceTableColumnName: string; + labels: any[]; + labelsDesc: any[]; + ncOptions: any[]; + ncCatColumnField: string; + groupByNcrDeptWiseData: any[]; +} + interface groupByStateOverDueObject extends groupByStateObject { dataSources: any[]; OpenItemsDueDateMap: Map; @@ -178,6 +191,7 @@ interface ByCategoryLabelData { groupByStateData: groupByStateObject[]; groupByStackData: groupByStackObject[]; groupByStateOverdueData: groupByStateOverDueObject[]; + groupByNcrDeptData: groupByNcrDeptObject[]; avgData: avgObject[]; closureData: closureObject[]; trackerData: trackerObject[]; From 4e0e74be7e9375b190d662b65b33c327e095c11b Mon Sep 17 00:00:00 2001 From: basvareddy-bytes Date: Tue, 30 May 2023 23:18:24 +0530 Subject: [PATCH 02/16] adding IQA dashboard functions --- src/GenericDashboard.ts | 2 +- src/MESQA-Config-RF.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/GenericDashboard.ts b/src/GenericDashboard.ts index d9f0d32..53bcd6e 100644 --- a/src/GenericDashboard.ts +++ b/src/GenericDashboard.ts @@ -179,7 +179,7 @@ namespace GenericDashboard { if (dataSourcePromiseResult.length > 0 && that.instanceOfXRTrimNeedleItem(dataSourcePromiseResult[0])) { dashboardPluginSources.push({ - "type": "Needles", + "type": "NeedlesBySearch", "source": dataSourcePromiseResult }) } else if (dataSourcePromiseResult.length > 0 && that.instanceOfXRLabelEntry(dataSourcePromiseResult[0])) { diff --git a/src/MESQA-Config-RF.json b/src/MESQA-Config-RF.json index 2c1770d..1bfcd25 100644 --- a/src/MESQA-Config-RF.json +++ b/src/MESQA-Config-RF.json @@ -61,7 +61,7 @@ { "columnConfig": [ { - "size": 6, + "size": 12, "contentType": "chart", "contentConfig": { "id" : "ncrDeptWise", From 00f22da2d56911b60acf568d546bdda20fb34820 Mon Sep 17 00:00:00 2001 From: basvareddy-bytes Date: Tue, 30 May 2023 23:34:33 +0530 Subject: [PATCH 03/16] adding IQA dashboard functions --- src/GenericDashboard.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GenericDashboard.ts b/src/GenericDashboard.ts index 53bcd6e..9f2c8e2 100644 --- a/src/GenericDashboard.ts +++ b/src/GenericDashboard.ts @@ -1375,7 +1375,7 @@ namespace GenericDashboard { x: 'x', columns: [ ['x', ...labels], - groupByNcrDeptWiseData + ...groupByNcrDeptWiseData ], type: 'bar' }, From 3fe9277172102552a348c1eca18c8708440dde40 Mon Sep 17 00:00:00 2001 From: basvareddy-bytes Date: Sat, 10 Jun 2023 17:04:46 +0530 Subject: [PATCH 04/16] added changes for auditor performance chart feature --- src/GenericDashboard.ts | 54 ++++++++++--------- src/MESQA-Config-RF.json | 51 ++++++++++++++++-- src/api/Matrix.Labels.ts | 21 ++++---- src/api/Matrix.d.ts | 7 +++ src/commons/Commons.GenericFunctionalities.ts | 35 ++++++++++++ src/interfaces/generic-dashboard.d.ts | 15 ++++++ 6 files changed, 145 insertions(+), 38 deletions(-) create mode 100644 src/api/Matrix.d.ts diff --git a/src/GenericDashboard.ts b/src/GenericDashboard.ts index 9f2c8e2..caae5b2 100644 --- a/src/GenericDashboard.ts +++ b/src/GenericDashboard.ts @@ -156,7 +156,7 @@ namespace GenericDashboard { } }); if (needleSourceCategory && needleSourceFieldId) { - dataSourcePromises.push(Matrix.Labels.getNeedlesByCategoryAndFiledId(needleSourceCategory, + dataSourcePromises.push(Matrix.Labels.getNeedlesByCategoryAndFiledId(dataSourceConfig.id,needleSourceCategory, needleSourceFieldId)); } } else if (dataSourceConfig.type == "NeedlesBySearch") { @@ -166,10 +166,11 @@ namespace GenericDashboard { let searchParam = sourceAttribute.name + '=' + sourceAttribute.value; searchParams += searchParam + '&' }); - dataSourcePromises.push(Matrix.Labels.getNeedlesBySearch(searchParams)); + dataSourcePromises.push(Matrix.Labels.getNeedlesBySearch(dataSourceConfig.id,searchParams)); } } else if (dataSourceConfig.type == "Labels") { - dataSourcePromises.push(Matrix.Labels.projectLabelHistory()); + dataSourcePromises.push(Matrix.Labels.projectLabelHistory(dataSourceConfig.id)); + } }); @@ -177,18 +178,21 @@ namespace GenericDashboard { dataSourcePromisesResults.forEach(dataSourcePromiseResult => { - if (dataSourcePromiseResult.length > 0 && that.instanceOfXRTrimNeedleItem(dataSourcePromiseResult[0])) { - dashboardPluginSources.push({ - "type": "NeedlesBySearch", - "source": dataSourcePromiseResult - }) - } else if (dataSourcePromiseResult.length > 0 && that.instanceOfXRLabelEntry(dataSourcePromiseResult[0])) { - that.labelHistoryData = dataSourcePromiseResult; - dashboardPluginSources.push({ - "type": "Labels", - "source": dataSourcePromiseResult - }) - } + // if (dataSourcePromiseResult.length > 0 && that.instanceOfXRTrimNeedleItem(dataSourcePromiseResult[0])) { + // dashboardPluginSources.push({ + // "type": "NeedlesBySearch", + // "source": dataSourcePromiseResult + // }) + // } else if (dataSourcePromiseResult.length > 0 && that.instanceOfXRLabelEntry(dataSourcePromiseResult[0])) { + // that.labelHistoryData = dataSourcePromiseResult; + // dashboardPluginSources.push({ + // "type": "Labels", + // "source": dataSourcePromiseResult + // }) + // } + + dashboardPluginSources.push(dataSourcePromiseResult); + }); @@ -1483,7 +1487,7 @@ namespace GenericDashboard { //process groupBy functionality ByCategoryLabelData.groupByData.forEach(groupByObject => { - let groupByObjectDataSource = functionalityDataSources.find((functionalityDataSource) => functionalityDataSource.type === groupByObject.dataSourceType); + let groupByObjectDataSource = functionalityDataSources.find((functionalityDataSource) => functionalityDataSource.id === groupByObject.dataSourceType); Commons.GenericFunctionalities.processGroupByObjectData(groupByObject, groupByObjectDataSource.source, ByCategoryLabelData.category, @@ -1496,7 +1500,7 @@ namespace GenericDashboard { //process groupBy-operands functionality ByCategoryLabelData.groupByOperandsData.forEach(groupByOperandsObject => { - let groupByOperandsDataSource = functionalityDataSources.find((functionalityDataSource) => functionalityDataSource.type === groupByOperandsObject.dataSourceType); + let groupByOperandsDataSource = functionalityDataSources.find((functionalityDataSource) => functionalityDataSource.id === groupByOperandsObject.dataSourceType); Commons.GenericFunctionalities.processGroupByOperandsData(groupByOperandsObject, groupByOperandsDataSource.source, ByCategoryLabelData.category @@ -1506,7 +1510,7 @@ namespace GenericDashboard { //process groupByStack functionality ByCategoryLabelData.groupByStackData.forEach(groupByStackObject => { - let groupByStackDataSource = functionalityDataSources.find((functionalityDataSource) => functionalityDataSource.type === groupByStackObject.dataSourceType); + let groupByStackDataSource = functionalityDataSources.find((functionalityDataSource) => functionalityDataSource.id === groupByStackObject.dataSourceType); Commons.GenericFunctionalities.processGroupByStackData(groupByStackObject, groupByStackDataSource.source, ByCategoryLabelData.category, @@ -1517,7 +1521,7 @@ namespace GenericDashboard { //process groupByState functionality ByCategoryLabelData.groupByStateData.forEach(groupByStateObject => { - let groupByStateDataSource = functionalityDataSources.find((functionalityDataSource) => functionalityDataSource.type === groupByStateObject.dataSourceType); + let groupByStateDataSource = functionalityDataSources.find((functionalityDataSource) => functionalityDataSource.id === groupByStateObject.dataSourceType); if (groupByStateDataSource.type === "Labels") { Commons.GenericFunctionalities.processGroupByStateData(groupByStateObject, groupByStateDataSource.source, @@ -1545,7 +1549,7 @@ namespace GenericDashboard { for (const dataSourceType of groupByStateOverDueObject.dataSources) { - let dataSource = functionalityDataSources.find((functionalityDataSource) => functionalityDataSource.type === dataSourceType); + let dataSource = functionalityDataSources.find((functionalityDataSource) => functionalityDataSource.id === dataSourceType); if (dataSourceType === "Labels") { labelsDataSource = dataSource.source; } else if (dataSourceType === "Needles") { @@ -1566,7 +1570,7 @@ namespace GenericDashboard { //process avg functionality ByCategoryLabelData.avgData.forEach(avgObject => { - let avgDataSource = functionalityDataSources.find((functionalityDataSource) => functionalityDataSource.type === avgObject.dataSourceType); + let avgDataSource = functionalityDataSources.find((functionalityDataSource) => functionalityDataSource.id === avgObject.dataSourceType); Commons.GenericFunctionalities.processAvgData(avgObject, avgDataSource.source, ByCategoryLabelData.category @@ -1575,7 +1579,7 @@ namespace GenericDashboard { //process closure functionality ByCategoryLabelData.closureData.forEach(closureObject => { - let closureDataSource = functionalityDataSources.find((functionalityDataSource) => functionalityDataSource.type === closureObject.dataSourceType); + let closureDataSource = functionalityDataSources.find((functionalityDataSource) => functionalityDataSource.id === closureObject.dataSourceType); Commons.GenericFunctionalities.processClosureData(closureObject, closureDataSource.source, ByCategoryLabelData.category, @@ -1587,7 +1591,7 @@ namespace GenericDashboard { //process dateRangeComapre functionality ByCategoryLabelData.dateRangeCompareData.forEach(dateRangeCompareObject => { - let dateRangeCompareDataSource = functionalityDataSources.find((functionalityDataSource) => functionalityDataSource.type === dateRangeCompareObject.dataSourceType); + let dateRangeCompareDataSource = functionalityDataSources.find((functionalityDataSource) => functionalityDataSource.id === dateRangeCompareObject.dataSourceType); Commons.GenericFunctionalities.processDateRangeCompareData(dateRangeCompareObject, dateRangeCompareDataSource.source, ByCategoryLabelData.category @@ -1596,7 +1600,7 @@ namespace GenericDashboard { //process tracker functionality ByCategoryLabelData.trackerData.forEach(trackerObject => { - let trackerDataSource = functionalityDataSources.find((functionalityDataSource) => functionalityDataSource.type === trackerObject.dataSourceType); + let trackerDataSource = functionalityDataSources.find((functionalityDataSource) => functionalityDataSource.id === trackerObject.dataSourceType); Commons.GenericFunctionalities.processTrackerData(trackerObject, trackerDataSource.source, ByCategoryLabelData.category, @@ -1608,7 +1612,7 @@ namespace GenericDashboard { //process groupBy functionality ByCategoryLabelData.groupByNcrDeptData.forEach(groupByNcrDeptObject => { - let groupByNcrDeptObjectDataSource = functionalityDataSources.find((functionalityDataSource) => functionalityDataSource.type === groupByNcrDeptObject.dataSourceType); + let groupByNcrDeptObjectDataSource = functionalityDataSources.find((functionalityDataSource) => functionalityDataSource.id === groupByNcrDeptObject.dataSourceType); Commons.GenericFunctionalities.processGroupByNcrDeptObjectData(groupByNcrDeptObject, groupByNcrDeptObjectDataSource.source); }); diff --git a/src/MESQA-Config-RF.json b/src/MESQA-Config-RF.json index 1bfcd25..c0969f7 100644 --- a/src/MESQA-Config-RF.json +++ b/src/MESQA-Config-RF.json @@ -10,9 +10,11 @@ "version": "1.0.0", "dataSources": [ { + "id": "iqalabels", "type": "Labels" }, { + "id": "audit-findings", "type": "NeedlesBySearch", "sourceAtrributes": [ { @@ -28,6 +30,24 @@ "value": 1 } ] + }, + { + "id": "general-auditor-information", + "type": "NeedlesBySearch", + "sourceAtrributes": [ + { + "name": "category", + "value": "IQA" + }, + { + "name": "fieldsOut", + "value": 2456 + }, + { + "name": "labels", + "value": 1 + } + ] } ], "layoutConfig": { @@ -73,6 +93,21 @@ } ] }, + { + "columnConfig": [ + { + "size": 12, + "contentType": "chart", + "contentConfig": { + "id" : "ncrauditorWise", + "functionality" : "groupByNcrAuditor", + "title" : "Auditor performance overview", + "dateFilterRequired" : "N", + "contentClass" : "chart" + } + } + ] + }, { "columnConfig": [ { @@ -98,7 +133,7 @@ { "id": "status", "type": "groupByState", - "dataSourceType": "Labels", + "dataSourceType": "iqalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Current State", @@ -109,7 +144,7 @@ { "id": "avg", "type": "avg", - "dataSourceType": "Labels", + "dataSourceType": "iqalabels", "renderChart": "Y", "title": "average time spent in state", "labels": ["Q4", "PLN1", "Q1", "Q2"], @@ -124,12 +159,22 @@ { "id": "ncrDeptWise", "type": "groupByNcrDept", - "dataSourceType": "NeedlesBySearch", + "dataSourceType": "audit-findings", "renderChart": "Y", "sourceTableName": "Audit Findings", "sourceTableColumnName": "NC Category", "labels": ["PROD-AB", "PROD-C", "QC-AB", "QC-C", "QA", "RA", "SCM", "MICRO", "PUR", "Packaging", "HR", "ENG", "ST", "UT", "NDLP"], "labelsDesc": ["PAB", "PC", "QCAB", "QCC", "QA", "RA", "SCM", "MI", "PUR", "PKG", "HR", "ENG","ST", "UT", "NDL"] + }, + { + "id": "ncrauditorWise", + "type": "groupByNcrAuditor", + "dataSources":["audit-findings","general-auditor-information"], + "renderChart": "Y", + "auditorSourceTableName": "General Audit Information:", + "auditorTypeColumnName": "Member Details", + "auditorNameColumnName": "Name", + "auditorOptionLabel": "Auditor" } ] } diff --git a/src/api/Matrix.Labels.ts b/src/api/Matrix.Labels.ts index e189c09..ea68f87 100644 --- a/src/api/Matrix.Labels.ts +++ b/src/api/Matrix.Labels.ts @@ -1,5 +1,6 @@ /// /// +/// /// namespace Matrix { @@ -7,11 +8,11 @@ namespace Matrix { /** * Get the label history for all items in a project */ - export function projectLabelHistory(): Promise { - return new Promise((resolve, reject) => { + export function projectLabelHistory(resourceId: string): Promise { + return new Promise((resolve, reject) => { // eslint-disable-next-line @typescript-eslint/no-unused-vars - Matrix.REST.projectGETRequest("/labelhistory") - .then((data: XRLabelHistory) => resolve(data.entries as XRLabelEntry[])) + Matrix.REST.projectGETRequest("/labelhistory") + .then((data: XRLabelHistory) => resolve({id:resourceId,source:data.entries})) .catch((error) => reject(error)); }); } @@ -19,11 +20,11 @@ namespace Matrix { /** * Get needles by category and field id for all items in a project */ - export function getNeedlesByCategoryAndFiledId(category: string, fieldId: Number): Promise { - return new Promise((resolve, reject) => { + export function getNeedlesByCategoryAndFiledId(resourceId: string, category: string, fieldId: Number): Promise { + return new Promise((resolve, reject) => { // eslint-disable-next-line @typescript-eslint/no-unused-vars Matrix.REST.projectGETRequest("/needle?search=mrql:category="+category+"&fieldsOut="+fieldId) - .then((data: XRTrimNeedle) => resolve(data.needles as XRTrimNeedleItem[])) + .then((data: XRTrimNeedle) => resolve({id:resourceId,source:data.needles})) .catch((error) => reject(error)); }); } @@ -31,10 +32,10 @@ namespace Matrix { /** * Get needles by category and field id for all items in a project */ - export function getNeedlesBySearch(searchParams: string): Promise { - return new Promise((resolve, reject) => { + export function getNeedlesBySearch(resourceId: string,searchParams: string): Promise { + return new Promise((resolve, reject) => { Matrix.REST.projectGETRequest("/needle?search=mrql:"+searchParams) - .then((data: XRTrimNeedle) => resolve(data.needles as XRTrimNeedleItem[])) + .then((data: XRTrimNeedle) => resolve({id:resourceId,source:data.needles})) .catch((error) => reject(error)); }); } diff --git a/src/api/Matrix.d.ts b/src/api/Matrix.d.ts new file mode 100644 index 0000000..688bf75 --- /dev/null +++ b/src/api/Matrix.d.ts @@ -0,0 +1,7 @@ +/// +/// + +interface resourcesData { + id: string; + source: XRLabelEntry[] | XRTrimNeedleItem[]; +} \ No newline at end of file diff --git a/src/commons/Commons.GenericFunctionalities.ts b/src/commons/Commons.GenericFunctionalities.ts index 8a89d38..fde8792 100644 --- a/src/commons/Commons.GenericFunctionalities.ts +++ b/src/commons/Commons.GenericFunctionalities.ts @@ -83,6 +83,7 @@ namespace Commons { let closureData: closureObject[] = []; let trackerData: trackerObject[] = []; let groupByNcrDeptData: groupByNcrDeptObject[] = []; + let groupByNcrAuditorData: groupByNcrAuditorObject[] = []; let dateRangeCompareData: dateRangeCompareObject[] = []; let groupByStackCurrentLabelData: groupByStackCurrentData[] = []; let groupByObjectCurrentLabelData: groupByObjectCurrentData[] = []; @@ -369,6 +370,39 @@ namespace Commons { }; groupByNcrDeptData.push(groupByNcrDeptObject); break; + case 'groupByNcrAuditor': + let groupByNcrAuditorWiseData = [ + ['x'], + ['No of audits performed'], + ['No of NC given'] + ]; + let fieldAuditorInfo = IC.getFieldByName(category.id,functionality.auditorSourceTableName); + let auditorTypeColumn = fieldAuditorInfo.parameterJson.columns.find(col=>col.name == functionality.auditorTypeColumnName); + let auditorNameColumn = fieldAuditorInfo.parameterJson.columns.find(col=>col.name == functionality.auditorNameColumnName); + let auditorDropDownOptions = IC.getDropDowns(auditorTypeColumn.options.setting).pop(); + let auditorOptionId = ""; + if( auditorDropDownOptions && auditorDropDownOptions.value && auditorDropDownOptions.value.options){ + for( let option of auditorDropDownOptions.value.options){ + if(option.label == functionality.auditorOptionLabel){ + auditorOptionId = option.id; + } + } + } + let groupByNcrAuditorObject: groupByNcrAuditorObject = { + id: functionality.id, + dataSources: functionality.dataSources, + renderChart: functionality.renderChart, + auditorSourceTableName: functionality.auditorSourceTableName, + auditorTypeColumnName: functionality.auditorTypeColumnName, + auditorNameColumnName: functionality.auditorNameColumnName, + auditorOptionLabel: functionality.auditorOptionLabel, + auditorOptionId: auditorOptionId, + auditorTypeColumnField: auditorTypeColumn.field, + auditorNameColumnField: auditorNameColumn.field, + groupByNcrAuditorWiseData: groupByNcrAuditorWiseData + }; + groupByNcrAuditorData.push(groupByNcrAuditorObject); + break; }; }); @@ -381,6 +415,7 @@ namespace Commons { groupByStateOverdueData: groupByStateOverdueData, groupByStackData: groupByStackData, groupByNcrDeptData: groupByNcrDeptData, + groupByNcrAuditorData: groupByNcrAuditorData, avgData: avgData, closureData: closureData, trackerData: trackerData, diff --git a/src/interfaces/generic-dashboard.d.ts b/src/interfaces/generic-dashboard.d.ts index d516623..aa7d274 100644 --- a/src/interfaces/generic-dashboard.d.ts +++ b/src/interfaces/generic-dashboard.d.ts @@ -92,6 +92,20 @@ interface groupByNcrDeptObject { groupByNcrDeptWiseData: any[]; } +interface groupByNcrAuditorObject { + id: string; + dataSources: string[]; + renderChart: string; + auditorSourceTableName: string; + auditorTypeColumnName: string; + auditorNameColumnName: string; + auditorOptionLabel: string; + auditorOptionId: string; + auditorTypeColumnField: string; + auditorNameColumnField: string; + groupByNcrAuditorWiseData: any[]; +} + interface groupByStateOverDueObject extends groupByStateObject { dataSources: any[]; OpenItemsDueDateMap: Map; @@ -192,6 +206,7 @@ interface ByCategoryLabelData { groupByStackData: groupByStackObject[]; groupByStateOverdueData: groupByStateOverDueObject[]; groupByNcrDeptData: groupByNcrDeptObject[]; + groupByNcrAuditorData: groupByNcrAuditorObject[]; avgData: avgObject[]; closureData: closureObject[]; trackerData: trackerObject[]; From c4b54616ab621d0e51899dd0d3117fb76157a741 Mon Sep 17 00:00:00 2001 From: basvareddy-bytes Date: Sat, 10 Jun 2023 19:03:08 +0530 Subject: [PATCH 05/16] added changes for auditor performance chart feature --- src/GenericDashboard.ts | 54 ++++++++++++++++++- src/commons/Commons.GenericFunctionalities.ts | 54 +++++++++++++++++++ 2 files changed, 107 insertions(+), 1 deletion(-) diff --git a/src/GenericDashboard.ts b/src/GenericDashboard.ts index caae5b2..ceb431b 100644 --- a/src/GenericDashboard.ts +++ b/src/GenericDashboard.ts @@ -675,6 +675,12 @@ namespace GenericDashboard { }); } + if (ByCategoryLabelData.groupByNcrAuditorData && ByCategoryLabelData.groupByNcrAuditorData.length > 0) { + ByCategoryLabelData.groupByNcrAuditorData.forEach(groupByNcrAuditorObject => { + that.renderGroupByNcrAuditorChart(groupByNcrAuditorObject.groupByNcrAuditorWiseData, groupByNcrAuditorObject.id); + }); + } + if (ByCategoryLabelData.dateRangeCompareData && ByCategoryLabelData.dateRangeCompareData.length > 0) { ByCategoryLabelData.dateRangeCompareData.forEach(dateRangeCompareObject => { @@ -1400,6 +1406,33 @@ namespace GenericDashboard { that.allChartsMap.set(groupId, groupByChart); } + renderGroupByNcrAuditorChart(groupByNcrAuditorWiseData, groupId) { + let that = this; + //prepare template "${contentConfig.id}-Chart" + let groupByChartparams: c3.ChartConfiguration = { + bindto: `#${groupId}Graph`, + data: { + x: 'x', + columns: groupByNcrAuditorWiseData, + type: 'bar' + }, + axis: { + x: { + type: 'category' + } + } + }; + + //prepare chart config and render + $(`#${groupId}-Chart div`).remove(); + + $(`#${groupId}-Chart`).append(`
`); + + let groupByChart = c3.generate(groupByChartparams); + + that.allChartsMap.set(groupId, groupByChart); + } + renderPluginTableByDateRanges(fromDateVal: any, toDateVal: any, byCategoryLabelData: ByCategoryLabelData) { let fromDate = new Date(fromDateVal); @@ -1610,12 +1643,31 @@ namespace GenericDashboard { ); }); - //process groupBy functionality + //process groupBy NCR department wise functionality ByCategoryLabelData.groupByNcrDeptData.forEach(groupByNcrDeptObject => { let groupByNcrDeptObjectDataSource = functionalityDataSources.find((functionalityDataSource) => functionalityDataSource.id === groupByNcrDeptObject.dataSourceType); Commons.GenericFunctionalities.processGroupByNcrDeptObjectData(groupByNcrDeptObject, groupByNcrDeptObjectDataSource.source); }); + + //process groupBy NCR auditor wise functionality + ByCategoryLabelData.groupByNcrAuditorData.forEach(groupByNcrAuditorObject => { + let auditFindingsDataSource: XRTrimNeedleItem[]; + let auditorinfoDataSource: XRTrimNeedleItem[]; + + for (const dataSource of functionalityDataSources) { + + + if (dataSource.id === "audit-findings") { + auditFindingsDataSource = dataSource.source; + } else if (dataSource.id === "general-auditor-information") { + auditorinfoDataSource = dataSource.source; + } + + } + Commons.GenericFunctionalities.processGroupByNcrAuditorObjectData(groupByNcrAuditorObject, + auditFindingsDataSource,auditorinfoDataSource); + }); } } } diff --git a/src/commons/Commons.GenericFunctionalities.ts b/src/commons/Commons.GenericFunctionalities.ts index fde8792..8a00962 100644 --- a/src/commons/Commons.GenericFunctionalities.ts +++ b/src/commons/Commons.GenericFunctionalities.ts @@ -1193,5 +1193,59 @@ namespace Commons { } } + export function processGroupByNcrAuditorObjectData(groupByNcrAuditorObject: groupByNcrAuditorObject, + auditFindingsDataSource: XRTrimNeedleItem[], + auditorinfoDataSource: XRTrimNeedleItem[], + ) { + + let auditorsData = []; + let auditCountData = []; + let auditItemsData = []; + let auditNcCountData = []; + + for (const auditInfoItem of auditorinfoDataSource) { + if(auditInfoItem.fieldVal.length == 1){ + let auditInfoTable = JSON.parse(auditInfoItem.fieldVal[0].value); + for( let auditInfoLine of auditInfoTable){ + let auditorOptionId = auditInfoLine[groupByNcrAuditorObject.auditorTypeColumnField]; + if(auditorOptionId == groupByNcrAuditorObject.auditorOptionId){ + let auditorName = auditInfoLine[groupByNcrAuditorObject.auditorNameColumnField]; + let auditorIndex = auditorsData.findIndex(auditor => auditor === auditorName); + if(auditorIndex > 0){ + auditCountData[auditorIndex] += 1; + auditItemsData[auditorIndex].push(auditInfoItem.itemOrFolderRef); + }else{ + auditorsData.push(auditorName); + auditCountData.push(1); + auditItemsData.push([auditInfoItem.itemOrFolderRef]) + auditNcCountData.push(0); + } + } + } + } + } + + for (const auditFindingItem of auditFindingsDataSource) { + if(auditFindingItem.fieldVal.length == 1){ + let auditFindingTable = JSON.parse(auditFindingItem.fieldVal[0].value); + let itemIndex = -1; + for( let auditItems of auditItemsData){ + itemIndex += 1; + let auditorItemIndex = auditItems.findIndex(itemRefId => itemRefId === auditFindingItem.itemOrFolderRef); + if(auditorItemIndex > 0){ + auditNcCountData[itemIndex] += auditFindingTable.length; + break; + } + } + } + } + + groupByNcrAuditorObject.groupByNcrAuditorWiseData = [ + ['x', ...auditorsData], + ['No of audits performed',...auditCountData], + ['No of NC given', ...auditNcCountData] + ]; + } + } } \ No newline at end of file From a3dfabd2a4fa8745a71b1dd97366976d4d9bb1f2 Mon Sep 17 00:00:00 2001 From: basvareddy-bytes Date: Sat, 17 Jun 2023 12:38:10 +0530 Subject: [PATCH 06/16] Fixing bugs of IQA dashboard --- src/GenericDashboard.ts | 5 +---- src/api/Matrix.Labels.ts | 12 ++++++------ src/api/Matrix.d.ts | 1 + 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/GenericDashboard.ts b/src/GenericDashboard.ts index ceb431b..3b3883b 100644 --- a/src/GenericDashboard.ts +++ b/src/GenericDashboard.ts @@ -1655,15 +1655,12 @@ namespace GenericDashboard { let auditFindingsDataSource: XRTrimNeedleItem[]; let auditorinfoDataSource: XRTrimNeedleItem[]; - for (const dataSource of functionalityDataSources) { - - + for (const dataSource of functionalityDataSources) { if (dataSource.id === "audit-findings") { auditFindingsDataSource = dataSource.source; } else if (dataSource.id === "general-auditor-information") { auditorinfoDataSource = dataSource.source; } - } Commons.GenericFunctionalities.processGroupByNcrAuditorObjectData(groupByNcrAuditorObject, auditFindingsDataSource,auditorinfoDataSource); diff --git a/src/api/Matrix.Labels.ts b/src/api/Matrix.Labels.ts index ea68f87..4cdac7f 100644 --- a/src/api/Matrix.Labels.ts +++ b/src/api/Matrix.Labels.ts @@ -8,11 +8,11 @@ namespace Matrix { /** * Get the label history for all items in a project */ - export function projectLabelHistory(resourceId: string): Promise { + export function projectLabelHistory(resourceId: string, resourceType: string): Promise { return new Promise((resolve, reject) => { // eslint-disable-next-line @typescript-eslint/no-unused-vars Matrix.REST.projectGETRequest("/labelhistory") - .then((data: XRLabelHistory) => resolve({id:resourceId,source:data.entries})) + .then((data: XRLabelHistory) => resolve({id:resourceId,type:resourceType,source:data.entries})) .catch((error) => reject(error)); }); } @@ -20,11 +20,11 @@ namespace Matrix { /** * Get needles by category and field id for all items in a project */ - export function getNeedlesByCategoryAndFiledId(resourceId: string, category: string, fieldId: Number): Promise { + export function getNeedlesByCategoryAndFiledId(resourceId: string, resourceType: string, category: string, fieldId: Number): Promise { return new Promise((resolve, reject) => { // eslint-disable-next-line @typescript-eslint/no-unused-vars Matrix.REST.projectGETRequest("/needle?search=mrql:category="+category+"&fieldsOut="+fieldId) - .then((data: XRTrimNeedle) => resolve({id:resourceId,source:data.needles})) + .then((data: XRTrimNeedle) => resolve({id:resourceId,type:resourceType,source:data.needles})) .catch((error) => reject(error)); }); } @@ -32,10 +32,10 @@ namespace Matrix { /** * Get needles by category and field id for all items in a project */ - export function getNeedlesBySearch(resourceId: string,searchParams: string): Promise { + export function getNeedlesBySearch(resourceId: string, resourceType: string, searchParams: string): Promise { return new Promise((resolve, reject) => { Matrix.REST.projectGETRequest("/needle?search=mrql:"+searchParams) - .then((data: XRTrimNeedle) => resolve({id:resourceId,source:data.needles})) + .then((data: XRTrimNeedle) => resolve({id:resourceId,type:resourceType,source:data.needles})) .catch((error) => reject(error)); }); } diff --git a/src/api/Matrix.d.ts b/src/api/Matrix.d.ts index 688bf75..5561ab4 100644 --- a/src/api/Matrix.d.ts +++ b/src/api/Matrix.d.ts @@ -3,5 +3,6 @@ interface resourcesData { id: string; + type: string; source: XRLabelEntry[] | XRTrimNeedleItem[]; } \ No newline at end of file From 2ab80898864eaf7392b9a7c31fc852e2cc1bb5ea Mon Sep 17 00:00:00 2001 From: basvareddy-bytes Date: Sat, 17 Jun 2023 12:41:45 +0530 Subject: [PATCH 07/16] Fixing bugs of IQA dashboard --- src/GenericDashboard.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/GenericDashboard.ts b/src/GenericDashboard.ts index 3b3883b..41093d5 100644 --- a/src/GenericDashboard.ts +++ b/src/GenericDashboard.ts @@ -156,7 +156,7 @@ namespace GenericDashboard { } }); if (needleSourceCategory && needleSourceFieldId) { - dataSourcePromises.push(Matrix.Labels.getNeedlesByCategoryAndFiledId(dataSourceConfig.id,needleSourceCategory, + dataSourcePromises.push(Matrix.Labels.getNeedlesByCategoryAndFiledId(dataSourceConfig.id,dataSourceConfig.type,needleSourceCategory, needleSourceFieldId)); } } else if (dataSourceConfig.type == "NeedlesBySearch") { @@ -166,10 +166,10 @@ namespace GenericDashboard { let searchParam = sourceAttribute.name + '=' + sourceAttribute.value; searchParams += searchParam + '&' }); - dataSourcePromises.push(Matrix.Labels.getNeedlesBySearch(dataSourceConfig.id,searchParams)); + dataSourcePromises.push(Matrix.Labels.getNeedlesBySearch(dataSourceConfig.id,dataSourceConfig.type,searchParams)); } } else if (dataSourceConfig.type == "Labels") { - dataSourcePromises.push(Matrix.Labels.projectLabelHistory(dataSourceConfig.id)); + dataSourcePromises.push(Matrix.Labels.projectLabelHistory(dataSourceConfig.id,dataSourceConfig.type)); } }); From 61c5bbac82f577598c7d351bc6d27853f3b0587d Mon Sep 17 00:00:00 2001 From: basvareddy-bytes Date: Sat, 17 Jun 2023 13:11:50 +0530 Subject: [PATCH 08/16] Fixing bugs of IQA dashboard --- src/commons/Commons.GenericFunctionalities.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commons/Commons.GenericFunctionalities.ts b/src/commons/Commons.GenericFunctionalities.ts index 8a00962..5481520 100644 --- a/src/commons/Commons.GenericFunctionalities.ts +++ b/src/commons/Commons.GenericFunctionalities.ts @@ -1211,7 +1211,7 @@ namespace Commons { if(auditorOptionId == groupByNcrAuditorObject.auditorOptionId){ let auditorName = auditInfoLine[groupByNcrAuditorObject.auditorNameColumnField]; let auditorIndex = auditorsData.findIndex(auditor => auditor === auditorName); - if(auditorIndex > 0){ + if(auditorIndex > -1){ auditCountData[auditorIndex] += 1; auditItemsData[auditorIndex].push(auditInfoItem.itemOrFolderRef); }else{ From b5414785e781921ccda5b83e5d0b6af1b1d9294c Mon Sep 17 00:00:00 2001 From: basvareddy-bytes Date: Sat, 24 Jun 2023 23:17:49 +0530 Subject: [PATCH 09/16] added changes for auditor performance chart feature --- src/commons/Commons.GenericFunctionalities.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/commons/Commons.GenericFunctionalities.ts b/src/commons/Commons.GenericFunctionalities.ts index 5481520..59e237e 100644 --- a/src/commons/Commons.GenericFunctionalities.ts +++ b/src/commons/Commons.GenericFunctionalities.ts @@ -327,7 +327,6 @@ namespace Commons { } break; case 'dateRangeComapre': - let dateRangeComapreObject: dateRangeCompareObject = { id: functionality.id, dataSourceType: functionality.dataSourceType, @@ -374,7 +373,8 @@ namespace Commons { let groupByNcrAuditorWiseData = [ ['x'], ['No of audits performed'], - ['No of NC given'] + ['No of NC given'], + ['NC ratio'] ]; let fieldAuditorInfo = IC.getFieldByName(category.id,functionality.auditorSourceTableName); let auditorTypeColumn = fieldAuditorInfo.parameterJson.columns.find(col=>col.name == functionality.auditorTypeColumnName); @@ -1202,6 +1202,7 @@ namespace Commons { let auditCountData = []; let auditItemsData = []; let auditNcCountData = []; + let auditNcRatio = []; for (const auditInfoItem of auditorinfoDataSource) { if(auditInfoItem.fieldVal.length == 1){ @@ -1219,6 +1220,7 @@ namespace Commons { auditCountData.push(1); auditItemsData.push([auditInfoItem.itemOrFolderRef]) auditNcCountData.push(0); + auditNcRatio.push(0); } } } @@ -1234,6 +1236,9 @@ namespace Commons { let auditorItemIndex = auditItems.findIndex(itemRefId => itemRefId === auditFindingItem.itemOrFolderRef); if(auditorItemIndex > 0){ auditNcCountData[itemIndex] += auditFindingTable.length; + if(auditFindingTable.length !== 0){ + auditNcRatio[itemIndex] = auditFindingTable.length/auditCountData[itemIndex]; + } break; } } @@ -1243,7 +1248,8 @@ namespace Commons { groupByNcrAuditorObject.groupByNcrAuditorWiseData = [ ['x', ...auditorsData], ['No of audits performed',...auditCountData], - ['No of NC given', ...auditNcCountData] + ['No of NC given', ...auditNcCountData], + ['NC ratio', ...auditNcRatio] ]; } From df1fd9e63a3b09681a3ce8f09febafcf47837b33 Mon Sep 17 00:00:00 2001 From: basvareddy-bytes Date: Sat, 24 Jun 2023 23:34:06 +0530 Subject: [PATCH 10/16] Fixing bugs of IQA dashboard --- src/commons/Commons.GenericFunctionalities.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commons/Commons.GenericFunctionalities.ts b/src/commons/Commons.GenericFunctionalities.ts index 59e237e..717f77a 100644 --- a/src/commons/Commons.GenericFunctionalities.ts +++ b/src/commons/Commons.GenericFunctionalities.ts @@ -1237,7 +1237,7 @@ namespace Commons { if(auditorItemIndex > 0){ auditNcCountData[itemIndex] += auditFindingTable.length; if(auditFindingTable.length !== 0){ - auditNcRatio[itemIndex] = auditFindingTable.length/auditCountData[itemIndex]; + auditNcRatio[itemIndex] = Math.round(((auditFindingTable.length/auditCountData[itemIndex]) + Number.EPSILON) * 100) / 100; } break; } From 3624a0f496d8c2e9be470776fd290e7313bb7dea Mon Sep 17 00:00:00 2001 From: basvareddy-bytes Date: Thu, 29 Jun 2023 21:18:14 +0530 Subject: [PATCH 11/16] added date filter functionality for IQA dashboard --- src/GenericDashboard.ts | 130 ++++++++++++++++++ src/MESQA-Config-RF.json | 4 +- src/commons/Commons.GenericFunctionalities.ts | 55 ++++++-- src/interfaces/generic-dashboard.d.ts | 23 ++++ 4 files changed, 202 insertions(+), 10 deletions(-) diff --git a/src/GenericDashboard.ts b/src/GenericDashboard.ts index 41093d5..db193c0 100644 --- a/src/GenericDashboard.ts +++ b/src/GenericDashboard.ts @@ -438,6 +438,24 @@ namespace GenericDashboard { }); } break; + case 'groupByNcrDept': + if (byCategoryLabelData.groupByNcrDeptData.length > 0) { + byCategoryLabelData.groupByNcrDeptData.forEach(groupByNcrDeptObject => { + if (dateFilterId == groupByNcrDeptObject.id) { + that.renderGroupByNcrDeptChart(groupByNcrDeptObject.labelsDesc, groupByNcrDeptObject.groupByNcrDeptWiseData, groupByNcrDeptObject.id); + } + }); + } + break; + case 'groupByNcrAuditor': + if (byCategoryLabelData.groupByNcrAuditorData.length > 0) { + byCategoryLabelData.groupByNcrAuditorData.forEach(groupByNcrAuditorObject => { + if (dateFilterId == groupByNcrAuditorObject.id) { + that.renderGroupByNcrAuditorChart(groupByNcrAuditorObject.groupByNcrAuditorWiseData, groupByNcrAuditorObject.id); + } + }); + } + break; case 'table': if (byCategoryLabelData.itemCurrentStateValues.length > 0) { that.renderPluginTable(byCategoryLabelData.itemCurrentStateTableHeaders, byCategoryLabelData.itemCurrentStateValues); @@ -1376,6 +1394,50 @@ namespace GenericDashboard { that.allChartsMap.set(groupId, trackerChart); } + renderGroupByNcrDeptChartByDateRanges(fromDateVal: any, toDateVal: any, byCategoryLabelData: ByCategoryLabelData, groupId: String) { + + let fromDate = new Date(fromDateVal); + let toDate = new Date(toDateVal); + + if (byCategoryLabelData.groupByNcrDeptData.length > 0) { + byCategoryLabelData.groupByNcrDeptData.forEach(groupByNcrDeptObject => { + if (groupByNcrDeptObject.id == groupId) { + + let groupByNcrDeptWiseData = []; + let groupByNcrDeptInitials = Array(groupByNcrDeptObject.labels.length).fill(0); + + for( let option of groupByNcrDeptObject.ncOptions){ + groupByNcrDeptWiseData.push([option.label, ...groupByNcrDeptInitials]); + } + + groupByNcrDeptObject.currentLabelData.forEach( (itemCurrentStateData) => { + if (itemCurrentStateData.creationDate && + (itemCurrentStateData.creationDate >= fromDate && itemCurrentStateData.creationDate <= toDate)) { + let itemDeptIndex = -1; + for(const label of groupByNcrDeptObject.labels){ + if(itemCurrentStateData.labels.includes(label)){ + let labelIndex = groupByNcrDeptObject.labels.findIndex(labelCode => labelCode === label); + itemDeptIndex = labelIndex; + break; + } + } + + if(itemDeptIndex > 0){ + groupByNcrDeptObject.groupByNcrDeptWiseData.forEach(ncDeptWiseData => { + if(ncDeptWiseData[0] == itemCurrentStateData.ncLabel){ + ncDeptWiseData[itemDeptIndex+1] += 1; + } + }); + } + } + }); + + this.renderGroupByNcrDeptChart(groupByNcrDeptObject.labelsDesc, groupByNcrDeptWiseData, groupByNcrDeptObject.id); + } + }); + } + } + renderGroupByNcrDeptChart(labels, groupByNcrDeptWiseData, groupId) { let that = this; //prepare template "${contentConfig.id}-Chart" @@ -1406,6 +1468,74 @@ namespace GenericDashboard { that.allChartsMap.set(groupId, groupByChart); } + renderGroupByNcrAuditorChartByDateRanges(fromDateVal: any, toDateVal: any, byCategoryLabelData: ByCategoryLabelData, groupId: String) { + + let fromDate = new Date(fromDateVal); + let toDate = new Date(toDateVal); + + if (byCategoryLabelData.groupByNcrAuditorData.length > 0) { + byCategoryLabelData.groupByNcrAuditorData.forEach(groupByNcrAuditorObject => { + if (groupByNcrAuditorObject.id == groupId) { + + let auditorsData = []; + let auditCountData = []; + let auditItemsData = []; + let auditNcCountData = []; + let auditNcRatio = []; + + groupByNcrAuditorObject.currentAuditorInfoData.forEach( (currentAuditorData) => { + if (currentAuditorData.creationDate && + (currentAuditorData.creationDate >= fromDate && currentAuditorData.creationDate <= toDate)) { + let auditorIndex = auditorsData.findIndex(auditor => auditor === currentAuditorData.auditorName); + if(auditorIndex > -1){ + auditCountData[auditorIndex] += 1; + auditItemsData[auditorIndex].push(currentAuditorData.id); + }else{ + auditorsData.push(currentAuditorData.auditorName); + auditCountData.push(1); + auditItemsData.push([currentAuditorData.id]) + auditNcCountData.push(0); + auditNcRatio.push(0); + } + } + }); + + groupByNcrAuditorObject.currentAuditFindingsData.forEach( (currentAuditFindingsData) => { + if (currentAuditFindingsData.creationDate && + (currentAuditFindingsData.creationDate >= fromDate && currentAuditFindingsData.creationDate <= toDate)) { + let itemIndex = -1; + for( let auditItems of auditItemsData){ + itemIndex += 1; + let auditorItemIndex = auditItems.findIndex(itemRefId => itemRefId === currentAuditFindingsData.id); + if(auditorItemIndex > 0){ + let auditNcCount = currentAuditFindingsData.auditNcCount; + auditNcCountData[itemIndex] += auditNcCount; + break; + } + } + } + }); + + auditorsData.forEach((auditor, index) => { + if(auditNcCountData[index] !== 0){ + auditNcRatio[index] = Math.round(((auditNcCountData[index]/auditCountData[index]) + Number.EPSILON) * 100) / 100; + } + }); + + let groupByNcrAuditorWiseData = [ + ['x', ...auditorsData], + ['No of audits performed',...auditCountData], + ['No of NC given', ...auditNcCountData], + ['NC ratio', ...auditNcRatio] + ]; + + this.renderGroupByNcrAuditorChart(groupByNcrAuditorWiseData, groupByNcrAuditorObject.id); + + } + }); + } + } + renderGroupByNcrAuditorChart(groupByNcrAuditorWiseData, groupId) { let that = this; //prepare template "${contentConfig.id}-Chart" diff --git a/src/MESQA-Config-RF.json b/src/MESQA-Config-RF.json index c0969f7..45633c2 100644 --- a/src/MESQA-Config-RF.json +++ b/src/MESQA-Config-RF.json @@ -87,7 +87,7 @@ "id" : "ncrDeptWise", "functionality" : "groupByNcrDept", "title" : "NCR department wise overview", - "dateFilterRequired" : "N", + "dateFilterRequired" : "Y", "contentClass" : "chart" } } @@ -102,7 +102,7 @@ "id" : "ncrauditorWise", "functionality" : "groupByNcrAuditor", "title" : "Auditor performance overview", - "dateFilterRequired" : "N", + "dateFilterRequired" : "Y", "contentClass" : "chart" } } diff --git a/src/commons/Commons.GenericFunctionalities.ts b/src/commons/Commons.GenericFunctionalities.ts index 717f77a..3aa2ffb 100644 --- a/src/commons/Commons.GenericFunctionalities.ts +++ b/src/commons/Commons.GenericFunctionalities.ts @@ -90,6 +90,9 @@ namespace Commons { let closureLabelCurrentData: closureObjectCurrentData[] = []; let dateRangeCompareCurrentLabelData: groupByObjectCurrentData[] = []; let trackerLabelCurrentData: Map = new Map(); + let groupByNcrDeptCurrentLabelData: groupByNcrDeptCurrentData[] = []; + let currentAuditorInfoData: auditorInfoCurrentData[] = []; + let currentAuditFindingsData: auditFindingsCurrentData[] = []; let operandsData: Map = new Map(); category.functionalities.forEach(functionality => { @@ -346,8 +349,8 @@ namespace Commons { let ncOptions = []; let groupByNcrDeptWiseData = []; let groupByNcrDeptInitials = Array(functionality.labels.length).fill(0); - let fieldAuditFindings = IC.getFieldByName("IQA","Audit Findings"); - let ncCatColumn = fieldAuditFindings.parameterJson.columns.find(col=>col.name == "NC Category"); + let fieldAuditFindings = IC.getFieldByName(category.id,functionality.sourceTableName); + let ncCatColumn = fieldAuditFindings.parameterJson.columns.find(col=>col.name == functionality.sourceTableColumnName); let ncDropDownOptions = IC.getDropDowns(ncCatColumn.options.setting).pop(); if( ncDropDownOptions && ncDropDownOptions.value && ncDropDownOptions.value.options){ ncOptions = ncDropDownOptions.value.options; @@ -365,7 +368,8 @@ namespace Commons { labelsDesc: functionality.labelsDesc, ncOptions: ncOptions, ncCatColumnField: ncCatColumn.field, - groupByNcrDeptWiseData: groupByNcrDeptWiseData + groupByNcrDeptWiseData: groupByNcrDeptWiseData, + currentLabelData: groupByNcrDeptCurrentLabelData }; groupByNcrDeptData.push(groupByNcrDeptObject); break; @@ -399,7 +403,9 @@ namespace Commons { auditorOptionId: auditorOptionId, auditorTypeColumnField: auditorTypeColumn.field, auditorNameColumnField: auditorNameColumn.field, - groupByNcrAuditorWiseData: groupByNcrAuditorWiseData + groupByNcrAuditorWiseData: groupByNcrAuditorWiseData, + currentAuditorInfoData: currentAuditorInfoData, + currentAuditFindingsData: currentAuditFindingsData }; groupByNcrAuditorData.push(groupByNcrAuditorObject); break; @@ -1186,6 +1192,16 @@ namespace Commons { ncDeptWiseData[itemDeptIndex+1] += 1; } }); + + let groupByNcrDeptCurrentData: groupByNcrDeptCurrentData = { + id: item.itemOrFolderRef, + creationDate: new Date(item.creationDate), + labels: item.labels, + ncLabel: ncOption.label + }; + + groupByNcrDeptObject.currentLabelData.push(groupByNcrDeptCurrentData); + } } } @@ -1211,6 +1227,16 @@ namespace Commons { let auditorOptionId = auditInfoLine[groupByNcrAuditorObject.auditorTypeColumnField]; if(auditorOptionId == groupByNcrAuditorObject.auditorOptionId){ let auditorName = auditInfoLine[groupByNcrAuditorObject.auditorNameColumnField]; + + let auditorInfoCurrentData: auditorInfoCurrentData = { + id: auditInfoItem.itemOrFolderRef, + creationDate: new Date(auditInfoItem.creationDate), + auditorName: auditorName, + auditorOptionId: auditorOptionId + }; + + groupByNcrAuditorObject.currentAuditorInfoData.push(auditorInfoCurrentData); + let auditorIndex = auditorsData.findIndex(auditor => auditor === auditorName); if(auditorIndex > -1){ auditCountData[auditorIndex] += 1; @@ -1235,16 +1261,29 @@ namespace Commons { itemIndex += 1; let auditorItemIndex = auditItems.findIndex(itemRefId => itemRefId === auditFindingItem.itemOrFolderRef); if(auditorItemIndex > 0){ - auditNcCountData[itemIndex] += auditFindingTable.length; - if(auditFindingTable.length !== 0){ - auditNcRatio[itemIndex] = Math.round(((auditFindingTable.length/auditCountData[itemIndex]) + Number.EPSILON) * 100) / 100; - } + let auditNcCount = auditFindingTable.length; + auditNcCountData[itemIndex] += auditNcCount; + + let auditFindingsCurrentData: auditFindingsCurrentData = { + id: auditFindingItem.itemOrFolderRef, + creationDate: new Date(auditFindingItem.creationDate), + auditNcCount: auditNcCount + }; + + groupByNcrAuditorObject.currentAuditFindingsData.push(auditFindingsCurrentData); + break; } } } } + auditorsData.forEach((auditor, index) => { + if(auditNcCountData[index] !== 0){ + auditNcRatio[index] = Math.round(((auditNcCountData[index]/auditCountData[index]) + Number.EPSILON) * 100) / 100; + } + }); + groupByNcrAuditorObject.groupByNcrAuditorWiseData = [ ['x', ...auditorsData], ['No of audits performed',...auditCountData], diff --git a/src/interfaces/generic-dashboard.d.ts b/src/interfaces/generic-dashboard.d.ts index aa7d274..fa3976c 100644 --- a/src/interfaces/generic-dashboard.d.ts +++ b/src/interfaces/generic-dashboard.d.ts @@ -24,6 +24,26 @@ interface trackerObjectCurrentData { itemStateDays: Map; } +interface groupByNcrDeptCurrentData { + id: string; + creationDate: Date; + labels: string; + ncLabel: string; +} + +interface auditorInfoCurrentData { + id: string; + creationDate: Date; + auditorName: string; + auditorOptionId: string; +} + +interface auditFindingsCurrentData { + id: string; + creationDate: Date; + auditNcCount: Number; +} + interface operandObjectData { operand: string; labelsState: Map; @@ -90,6 +110,7 @@ interface groupByNcrDeptObject { ncOptions: any[]; ncCatColumnField: string; groupByNcrDeptWiseData: any[]; + currentLabelData: groupByNcrDeptCurrentData[]; } interface groupByNcrAuditorObject { @@ -104,6 +125,8 @@ interface groupByNcrAuditorObject { auditorTypeColumnField: string; auditorNameColumnField: string; groupByNcrAuditorWiseData: any[]; + currentAuditorInfoData: auditorInfoCurrentData[]; + currentAuditFindingsData: auditFindingsCurrentData[]; } interface groupByStateOverDueObject extends groupByStateObject { From 1d391ef2ee48604cca8c0c090324e0d9e7bb9805 Mon Sep 17 00:00:00 2001 From: basvareddy-bytes Date: Thu, 29 Jun 2023 21:34:18 +0530 Subject: [PATCH 12/16] added date filter functionality for IQA dashboard --- src/GenericDashboard.ts | 9 +++++++++ src/commons/Commons.GenericFunctionalities.ts | 1 - 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/GenericDashboard.ts b/src/GenericDashboard.ts index db193c0..d267d81 100644 --- a/src/GenericDashboard.ts +++ b/src/GenericDashboard.ts @@ -521,6 +521,12 @@ namespace GenericDashboard { case 'tracker': that.renderTrackerChartByDateRanges(fromDateSelected, toDateSelected, byCategoryLabelData, dateFilterId); break; + case 'groupByNcrDept': + that.renderGroupByNcrDeptChartByDateRanges(fromDateSelected, toDateSelected, byCategoryLabelData, dateFilterId); + break; + case 'groupByNcrAuditor': + that.renderGroupByNcrAuditorChartByDateRanges(fromDateSelected, toDateSelected, byCategoryLabelData, dateFilterId); + break; case 'dateRangeComapre': that.renderDateRangeComapreDataByDateRanges(fromDateSelected, toDateSelected, byCategoryLabelData, dateFilterId); break; @@ -1394,6 +1400,8 @@ namespace GenericDashboard { that.allChartsMap.set(groupId, trackerChart); } + + renderGroupByNcrDeptChartByDateRanges(fromDateVal: any, toDateVal: any, byCategoryLabelData: ByCategoryLabelData, groupId: String) { let fromDate = new Date(fromDateVal); @@ -1468,6 +1476,7 @@ namespace GenericDashboard { that.allChartsMap.set(groupId, groupByChart); } + renderGroupByNcrAuditorChartByDateRanges(fromDateVal: any, toDateVal: any, byCategoryLabelData: ByCategoryLabelData, groupId: String) { let fromDate = new Date(fromDateVal); diff --git a/src/commons/Commons.GenericFunctionalities.ts b/src/commons/Commons.GenericFunctionalities.ts index 3aa2ffb..6aace6d 100644 --- a/src/commons/Commons.GenericFunctionalities.ts +++ b/src/commons/Commons.GenericFunctionalities.ts @@ -1271,7 +1271,6 @@ namespace Commons { }; groupByNcrAuditorObject.currentAuditFindingsData.push(auditFindingsCurrentData); - break; } } From a80af68a8311375c3c0bdb24dd46e23b7d6f6ac4 Mon Sep 17 00:00:00 2001 From: basvareddy-bytes Date: Thu, 29 Jun 2023 21:54:53 +0530 Subject: [PATCH 13/16] added date filter functionality for IQA dashboard --- src/GenericDashboard.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GenericDashboard.ts b/src/GenericDashboard.ts index d267d81..7c32de8 100644 --- a/src/GenericDashboard.ts +++ b/src/GenericDashboard.ts @@ -1431,7 +1431,7 @@ namespace GenericDashboard { } if(itemDeptIndex > 0){ - groupByNcrDeptObject.groupByNcrDeptWiseData.forEach(ncDeptWiseData => { + groupByNcrDeptWiseData.forEach(ncDeptWiseData => { if(ncDeptWiseData[0] == itemCurrentStateData.ncLabel){ ncDeptWiseData[itemDeptIndex+1] += 1; } From 987cb5d830ce8acf4f371e07160775d5f937cd5c Mon Sep 17 00:00:00 2001 From: basvareddy-bytes Date: Mon, 10 Jul 2023 22:57:43 +0530 Subject: [PATCH 14/16] added IQA configurations to MHC QA config file and corrected MES QA config with data source configurations --- src/MESQA-Config-RF.json | 106 +++---- src/MHCQA-Config-RF.json | 633 +++++++++++++++++++++++++++++++++------ 2 files changed, 601 insertions(+), 138 deletions(-) diff --git a/src/MESQA-Config-RF.json b/src/MESQA-Config-RF.json index 45633c2..e9a4d3d 100644 --- a/src/MESQA-Config-RF.json +++ b/src/MESQA-Config-RF.json @@ -190,6 +190,7 @@ "version": "1.12.0", "dataSources": [ { + "id": "capalabels", "type": "Labels" } ], @@ -302,7 +303,7 @@ { "id": "dept", "type": "groupBy", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Department", @@ -313,7 +314,7 @@ { "id": "cat", "type": "groupBy", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Category", @@ -324,7 +325,7 @@ { "id": "status", "type": "groupByState", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Current State", @@ -335,7 +336,7 @@ { "id": "avg", "type": "avg", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "title": "average time spent in state", "labels": ["CAN1", "CAN2", "CAN5", "CAN3"], @@ -350,7 +351,7 @@ { "id": "tracker", "type": "tracker", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "labels": ["CAN1", "CAN2", "CAN5", "CAN3"], @@ -365,7 +366,7 @@ { "id": "closure", "type": "closure", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Closure Time", @@ -386,7 +387,7 @@ { "id": "dept", "type": "groupBy", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Department", @@ -397,7 +398,7 @@ { "id": "cat", "type": "groupBy", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Category", @@ -408,7 +409,7 @@ { "id": "status", "type": "groupByState", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Current State", @@ -419,7 +420,7 @@ { "id": "avg", "type": "avg", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "title": "average time spent in state", "labels": ["CAN1", "CAN2", "CAN5", "CAN3"], @@ -434,7 +435,7 @@ { "id": "tracker", "type": "tracker", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "labels": ["CAN1", "CAN2", "CAN5", "CAN3"], @@ -449,7 +450,7 @@ { "id": "closure", "type": "closure", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Closure Time", @@ -470,7 +471,7 @@ { "id": "dept", "type": "groupBy", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Department", @@ -481,7 +482,7 @@ { "id": "cat", "type": "groupBy", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Category", @@ -492,7 +493,7 @@ { "id": "status", "type": "groupByState", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Current State", @@ -503,7 +504,7 @@ { "id": "avg", "type": "avg", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "title": "average time spent in state", "labels": ["PN1", "PN2", "PN3", "PN4"], @@ -518,7 +519,7 @@ { "id": "tracker", "type": "tracker", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "labels": ["PN1", "PN2", "PN3", "PN4"], @@ -533,7 +534,7 @@ { "id": "closure", "type": "closure", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Closure Time", @@ -554,7 +555,7 @@ { "id": "dept", "type": "groupBy", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Department", @@ -565,7 +566,7 @@ { "id": "cat", "type": "groupBy", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Category", @@ -576,7 +577,7 @@ { "id": "status", "type": "groupByState", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Current State", @@ -587,7 +588,7 @@ { "id": "avg", "type": "avg", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "title": "average time spent in state", "labels": ["PN1", "PN2", "PN3", "PN4"], @@ -602,7 +603,7 @@ { "id": "tracker", "type": "tracker", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "labels": ["PN1", "PN2", "PN3", "PN4"], @@ -617,7 +618,7 @@ { "id": "closure", "type": "closure", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Closure Time", @@ -645,6 +646,7 @@ "version": "1.0.0", "dataSources": [ { + "id": "capalabels", "type": "Labels" } ], @@ -746,7 +748,7 @@ { "id": "dept", "type": "groupBy", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Department", @@ -757,7 +759,7 @@ { "id": "status", "type": "groupByState", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Current State", @@ -768,7 +770,7 @@ { "id": "avg", "type": "avg", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "title": "average time spent in state", "labels": ["CN2", "CC1", "CN3", "CN4"], @@ -783,7 +785,7 @@ { "id": "tracker", "type": "tracker", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "labels": ["CN2", "CC1", "CN3", "CN4"], @@ -798,7 +800,7 @@ { "id": "closure", "type": "closure", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Closure Time", @@ -818,7 +820,7 @@ { "id": "dept", "type": "groupBy", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Department", @@ -829,7 +831,7 @@ { "id": "status", "type": "groupByState", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Current State", @@ -840,7 +842,7 @@ { "id": "avg", "type": "avg", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "title": "average time spent in state", "labels": ["CN2", "CC1", "CN3", "CN4"], @@ -855,7 +857,7 @@ { "id": "tracker", "type": "tracker", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "labels": ["CN2", "CC1", "CN3", "CN4"], @@ -870,7 +872,7 @@ { "id": "closure", "type": "closure", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Closure Time", @@ -890,7 +892,7 @@ { "id": "dept", "type": "groupBy", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Department", @@ -901,7 +903,7 @@ { "id": "status", "type": "groupByState", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Current State", @@ -912,7 +914,7 @@ { "id": "avg", "type": "avg", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "title": "average time spent in state", "labels": ["DN1", "DN2", "DN3"], @@ -927,7 +929,7 @@ { "id": "tracker", "type": "tracker", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "labels": ["DN1", "DN2", "DN3"], @@ -942,7 +944,7 @@ { "id": "closure", "type": "closure", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Closure Time", @@ -969,6 +971,7 @@ "version": "1.0.0", "dataSources": [ { + "id": "capalabels", "type": "Labels" } ], @@ -1081,7 +1084,7 @@ { "id": "dept", "type": "groupBy", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Department", @@ -1092,7 +1095,7 @@ { "id": "cat", "type": "groupBy", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Category", @@ -1103,7 +1106,7 @@ { "id": "status", "type": "groupByState", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Current State", @@ -1114,7 +1117,7 @@ { "id": "avg", "type": "avg", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "title": "average time spent in state", "labels": ["NN1", "NN2"], @@ -1129,7 +1132,7 @@ { "id": "tracker", "type": "tracker", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "labels": ["NN1", "NN2"], @@ -1144,7 +1147,7 @@ { "id": "closure", "type": "closure", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Closure Time", @@ -1171,6 +1174,7 @@ "version": "1.0.0", "dataSources": [ { + "id": "capalabels", "type": "Labels" } ], @@ -1283,7 +1287,7 @@ { "id": "dept", "type": "groupBy", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Department", @@ -1294,7 +1298,7 @@ { "id": "cat", "type": "groupBy", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Category", @@ -1305,7 +1309,7 @@ { "id": "status", "type": "groupByState", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Current State", @@ -1316,7 +1320,7 @@ { "id": "avg", "type": "avg", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "title": "average time spent in state", "labels": ["EV1", "EN2"], @@ -1331,7 +1335,7 @@ { "id": "tracker", "type": "tracker", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "labels": ["EV1", "EN2"], @@ -1346,7 +1350,7 @@ { "id": "closure", "type": "closure", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Closure Time", diff --git a/src/MHCQA-Config-RF.json b/src/MHCQA-Config-RF.json index ffd3481..16bb5bd 100644 --- a/src/MHCQA-Config-RF.json +++ b/src/MHCQA-Config-RF.json @@ -1,5 +1,263 @@ { "plugins": [ + { + "id": "IQAO", + "title": "IQA Overview", + "folder": "DASHBOARDS", + "order": 3000, + "icon": "fal fa-chart-bar", + "name": "IQA Overview", + "version": "1.0.0", + "dataSources": [ + { + "id": "iqalabels", + "type": "Labels" + }, + { + "id": "audit-findings", + "type": "NeedlesBySearch", + "sourceAtrributes": [ + { + "name": "category", + "value": "IQA" + }, + { + "name": "fieldsOut", + "value": 2950 + }, + { + "name": "labels", + "value": 1 + } + ] + }, + { + "id": "general-auditor-information", + "type": "NeedlesBySearch", + "sourceAtrributes": [ + { + "name": "category", + "value": "IQA" + }, + { + "name": "fieldsOut", + "value": 2947 + }, + { + "name": "labels", + "value": 1 + } + ] + } + ], + "layoutConfig": { + "rowConfig": [ + { + "columnConfig": [ + { + "size": 6, + "contentType": "chart", + "contentConfig": { + "id": "status", + "functionality": "groupByState", + "title": "Status wise IQA count overview", + "dateFilterRequired": "Y", + "contentClass": "chart" + } + }, + { + "size": 6, + "contentType": "chart", + "contentConfig": { + "id": "avg", + "functionality": "avg", + "title": "Average time state wise overview", + "dateFilterRequired": "N", + "contentClass": "chart" + } + } + ] + }, + { + "columnConfig": [ + { + "size": 12, + "contentType": "chart", + "contentConfig": { + "id": "ncrDeptWise", + "functionality": "groupByNcrDept", + "title": "NCR department wise overview", + "dateFilterRequired": "Y", + "contentClass": "chart" + } + } + ] + }, + { + "columnConfig": [ + { + "size": 12, + "contentType": "chart", + "contentConfig": { + "id": "ncrauditorWise", + "functionality": "groupByNcrAuditor", + "title": "Auditor performance overview", + "dateFilterRequired": "Y", + "contentClass": "chart" + } + } + ] + }, + { + "columnConfig": [ + { + "size": 12, + "contentType": "table", + "contentConfig": { + "id": "IQAO", + "functionality": "table", + "title": "IQA current status list", + "dateFilterRequired": "Y" + } + } + ] + } + ], + "layoutDomStyle": " .chart { width: 90%; min-height: 350px; cursor:pointer; } .dateFilter{ display:flex; margin-left: 45px; } .filterDates { width: 115px; margin: 0 6px; } .date-filter-form-control { height: 20px; padding: 6px 12px; font-size: 14px; line-height: 1.42857143; color: #555; background-color: #fff; background-image: none; border: 1px solid #ccc; border-radius: 4px; } .date-filter-btn { margin-bottom: 0; margin-left: 12px; font-weight: 400; text-align: center; white-space: nowrap; vertical-align: middle; touch-action: manipulation; cursor: pointer; background-image: none; border: 1px solid transparent; padding: 0px 5px; font-size: 12px; line-height: 1.42857143; border-radius: 4px; } .tableDateFilter{ display:flex; margin-left: 350px; } .closureTimeChart{ width: 90%; min-height: 315px; cursor:pointer; } .bigChart{ width: 90%; min-height: 900px; cursor:pointer; }" + }, + "categories": [ + "IQA" + ], + "categoriesFunctionalities": [ + { + "id": "IQA", + "functionalities": [ + { + "id": "status", + "type": "groupByState", + "dataSourceType": "iqalabels", + "renderChart": "Y", + "showInTable": "Y", + "tableHeader": "Current State", + "labels": [ + "QA1", + "QA5", + "QA2", + "QA3", + "QA4" + ], + "labelsDesc": [ + "IQA Initiated", + "IQA Plan Approved", + "Report Approved", + "Response Accepted", + "IQA CLosed" + ], + "labelColors": [ + "#d62728", + "#ff7f0e", + "#9467bd", + "#1f77b4", + "#2ca02c" + ] + }, + { + "id": "avg", + "type": "avg", + "dataSourceType": "iqalabels", + "renderChart": "Y", + "title": "average time spent in state", + "labels": [ + "QA1", + "QA5", + "QA2", + "QA3" + ], + "labelsDesc": [ + "IQA Initiated", + "IQA Plan Approved", + "Report Approved", + "Response Accepted" + ], + "allLabels": [ + "QA1", + "QA5", + "QA2", + "QA3", + "QA4" + ], + "initialStateLabels": [ + "QA1", + "QA5", + "QA2", + "QA3" + ], + "allLabelDesc": [ + "IQA Initiated", + "IQA Plan Approved", + "Report Approved", + "Response Accepted", + "IQA CLosed" + ], + "initialSateLabel": "QA1", + "closedStateLabel": "QA4", + "rejectedStateLabel": "" + }, + { + "id": "ncrDeptWise", + "type": "groupByNcrDept", + "dataSourceType": "audit-findings", + "renderChart": "Y", + "sourceTableName": "Audit Findings", + "sourceTableColumnName": "NC Category", + "labels": [ + "MHC", + "QC", + "RA", + "Production", + "PUR", + "MICRO", + "PACK", + "Design", + "HR", + "SUC", + "ST", + "UT", + "QA" + ], + "labelsDesc": [ + "Common", + "QC", + "RA", + "Prod", + "PUR", + "MICRO", + "PACK", + "D&D", + "HR", + "SUC", + "ST", + "Utility", + "QA" + ] + }, + { + "id": "ncrauditorWise", + "type": "groupByNcrAuditor", + "dataSources": [ + "audit-findings", + "general-auditor-information" + ], + "renderChart": "Y", + "auditorSourceTableName": "General Audit Information:", + "auditorTypeColumnName": "Member Details", + "auditorNameColumnName": "Name", + "auditorOptionLabel": "Auditor" + } + ] + } + ] + }, { "id": "CAPAO", "title": "CAPA Status Overview", @@ -10,6 +268,7 @@ "version": "1.11.0", "dataSources": [ { + "id": "capalabels", "type": "Labels" } ], @@ -114,7 +373,12 @@ ], "layoutDomStyle": " .chart { width: 90%; min-height: 350px; cursor:pointer; } .dateFilter{ display:flex; margin-left: 45px; } .filterDates { width: 115px; margin: 0 6px; } .date-filter-form-control { height: 20px; padding: 6px 12px; font-size: 14px; line-height: 1.42857143; color: #555; background-color: #fff; background-image: none; border: 1px solid #ccc; border-radius: 4px; } .date-filter-btn { margin-bottom: 0; margin-left: 12px; font-weight: 400; text-align: center; white-space: nowrap; vertical-align: middle; touch-action: manipulation; cursor: pointer; background-image: none; border: 1px solid transparent; padding: 0px 5px; font-size: 12px; line-height: 1.42857143; border-radius: 4px; } .tableDateFilter{ display:flex; margin-left: 350px; } .closureTimeChart{ width: 90%; min-height: 315px; cursor:pointer; } .bigChart{ width: 90%; min-height: 900px; cursor:pointer; }" }, - "categories": ["CAA","PAA","CA","PA"], + "categories": [ + "CAA", + "PAA", + "CA", + "PA" + ], "categoriesFunctionalities": [ { "id": "CA", @@ -122,12 +386,13 @@ { "id": "dept", "type": "groupBy", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Department", "title": "count by department", "labels": [ + "MHC", "QC", "RA", "Production", @@ -142,6 +407,7 @@ "QA" ], "labelsDesc": [ + "Common", "QC", "RA", "Prod", @@ -159,7 +425,7 @@ { "id": "cat", "type": "groupBy", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Category", @@ -182,7 +448,7 @@ { "id": "status", "type": "groupByState", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Current State", @@ -214,7 +480,7 @@ { "id": "avg", "type": "avg", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "title": "average time spent in state", "labels": [ @@ -258,7 +524,7 @@ { "id": "tracker", "type": "tracker", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "labels": [ @@ -307,7 +573,7 @@ { "id": "closure", "type": "closure", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Closure Time", @@ -346,12 +612,13 @@ { "id": "dept", "type": "groupBy", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Department", "title": "count by department", "labels": [ + "MHC", "QC", "RA", "Production", @@ -366,6 +633,7 @@ "QA" ], "labelsDesc": [ + "Common", "QC", "RA", "Prod", @@ -383,7 +651,7 @@ { "id": "cat", "type": "groupBy", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Category", @@ -406,7 +674,7 @@ { "id": "status", "type": "groupByState", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Current State", @@ -438,7 +706,7 @@ { "id": "avg", "type": "avg", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "title": "average time spent in state", "labels": [ @@ -482,7 +750,7 @@ { "id": "tracker", "type": "tracker", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "labels": [ @@ -531,7 +799,7 @@ { "id": "closure", "type": "closure", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Closure Time", @@ -570,12 +838,13 @@ { "id": "dept", "type": "groupBy", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Department", "title": "count by department", "labels": [ + "MHC", "QC", "RA", "Production", @@ -590,6 +859,7 @@ "QA" ], "labelsDesc": [ + "Common", "QC", "RA", "Prod", @@ -607,7 +877,7 @@ { "id": "cat", "type": "groupBy", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Category", @@ -630,7 +900,7 @@ { "id": "status", "type": "groupByState", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Current State", @@ -662,7 +932,7 @@ { "id": "avg", "type": "avg", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "title": "average time spent in state", "labels": [ @@ -706,7 +976,7 @@ { "id": "tracker", "type": "tracker", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "labels": [ @@ -755,7 +1025,7 @@ { "id": "closure", "type": "closure", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Closure Time", @@ -794,12 +1064,13 @@ { "id": "dept", "type": "groupBy", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Department", "title": "count by department", "labels": [ + "MHC", "QC", "RA", "Production", @@ -814,6 +1085,7 @@ "QA" ], "labelsDesc": [ + "Common", "QC", "RA", "Prod", @@ -831,7 +1103,7 @@ { "id": "cat", "type": "groupBy", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Category", @@ -854,7 +1126,7 @@ { "id": "status", "type": "groupByState", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Current State", @@ -886,7 +1158,7 @@ { "id": "avg", "type": "avg", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "title": "average time spent in state", "labels": [ @@ -930,7 +1202,7 @@ { "id": "tracker", "type": "tracker", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "labels": [ @@ -979,7 +1251,7 @@ { "id": "closure", "type": "closure", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Closure Time", @@ -1024,6 +1296,7 @@ "version": "1.0.0", "dataSources": [ { + "id": "capalabels", "type": "Labels" } ], @@ -1129,12 +1402,13 @@ { "id": "dept", "type": "groupBy", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Department", "title": "count by department", "labels": [ + "MHC", "QC", "RA", "Production", @@ -1149,6 +1423,7 @@ "QA" ], "labelsDesc": [ + "Common", "QC", "RA", "Prod", @@ -1166,7 +1441,7 @@ { "id": "status", "type": "groupByState", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Current State", @@ -1198,7 +1473,7 @@ { "id": "avg", "type": "avg", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "title": "average time spent in state", "labels": [ @@ -1221,7 +1496,12 @@ "CCN5", "CCR" ], - "initialStateLabels": ["CCN1", "CCN2", "CCN3", "CCN4"], + "initialStateLabels": [ + "CCN1", + "CCN2", + "CCN3", + "CCN4" + ], "allLabelDesc": [ "CC Initiated", "CC Approved", @@ -1237,7 +1517,7 @@ { "id": "tracker", "type": "tracker", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "labels": [ @@ -1258,23 +1538,61 @@ "#9467bd", "#1f77b4" ], - "allLabels": ["CCN1", "CCN2", "CCN3", "CCN4", "CCN5", "CCR"], - "allLabelDesc": ["CC Initiated", "CC Approved", "UI", "IV", "CC Closed", "CC Rejected"], - "tableLabelDesc": ["CC Initiated", "CC Approved", "UI", "IV"], + "allLabels": [ + "CCN1", + "CCN2", + "CCN3", + "CCN4", + "CCN5", + "CCR" + ], + "allLabelDesc": [ + "CC Initiated", + "CC Approved", + "UI", + "IV", + "CC Closed", + "CC Rejected" + ], + "tableLabelDesc": [ + "CC Initiated", + "CC Approved", + "UI", + "IV" + ], "closedStateLabel": "CCN5", "rejectedStateLabel": "CCR" }, { "id": "closure", "type": "closure", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Closure Time", "title": "closure time(in days)", - "allLabels": ["CCN1", "CCN2", "CCN3", "CCN4", "CCN5", "CCR"], - "initialStateLabels": ["CCN1", "CCN2", "CCN3", "CCN4"], - "allLabelDesc": ["CC Initiated", "CC Approved", "UI", "IV", "CC Closed", "CC Rejected"], + "allLabels": [ + "CCN1", + "CCN2", + "CCN3", + "CCN4", + "CCN5", + "CCR" + ], + "initialStateLabels": [ + "CCN1", + "CCN2", + "CCN3", + "CCN4" + ], + "allLabelDesc": [ + "CC Initiated", + "CC Approved", + "UI", + "IV", + "CC Closed", + "CC Rejected" + ], "initialSateLabel": "CCN1", "closedStateLabel": "CCN5", "rejectedStateLabel": "CCR" @@ -1287,12 +1605,13 @@ { "id": "dept", "type": "groupBy", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Department", "title": "count by department", "labels": [ + "MHC", "QC", "RA", "Production", @@ -1307,6 +1626,7 @@ "QA" ], "labelsDesc": [ + "Common", "QC", "RA", "Prod", @@ -1324,7 +1644,7 @@ { "id": "status", "type": "groupByState", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Current State", @@ -1356,7 +1676,7 @@ { "id": "avg", "type": "avg", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "title": "average time spent in state", "labels": [ @@ -1379,7 +1699,12 @@ "CCN5", "CCR" ], - "initialStateLabels": ["CCN1", "CCN2", "CCN3", "CCN4"], + "initialStateLabels": [ + "CCN1", + "CCN2", + "CCN3", + "CCN4" + ], "allLabelDesc": [ "CC Initiated", "CC Approved", @@ -1395,7 +1720,7 @@ { "id": "tracker", "type": "tracker", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "labels": [ @@ -1416,23 +1741,61 @@ "#9467bd", "#1f77b4" ], - "allLabels": ["CCN1", "CCN2", "CCN3", "CCN4", "CCN5", "CCR"], - "allLabelDesc": ["CC Initiated", "CC Approved", "UI", "IV", "CC Closed", "CC Rejected"], - "tableLabelDesc": ["CC Initiated", "CC Approved", "UI", "IV"], + "allLabels": [ + "CCN1", + "CCN2", + "CCN3", + "CCN4", + "CCN5", + "CCR" + ], + "allLabelDesc": [ + "CC Initiated", + "CC Approved", + "UI", + "IV", + "CC Closed", + "CC Rejected" + ], + "tableLabelDesc": [ + "CC Initiated", + "CC Approved", + "UI", + "IV" + ], "closedStateLabel": "CCN5", "rejectedStateLabel": "CCR" }, { "id": "closure", "type": "closure", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Closure Time", "title": "closure time(in days)", - "allLabels": ["CCN1", "CCN2", "CCN3", "CCN4", "CCN5", "CCR"], - "initialStateLabels": ["CCN1", "CCN2", "CCN3", "CCN4"], - "allLabelDesc": ["CC Initiated", "CC Approved", "UI", "IV", "CC Closed", "CC Rejected"], + "allLabels": [ + "CCN1", + "CCN2", + "CCN3", + "CCN4", + "CCN5", + "CCR" + ], + "initialStateLabels": [ + "CCN1", + "CCN2", + "CCN3", + "CCN4" + ], + "allLabelDesc": [ + "CC Initiated", + "CC Approved", + "UI", + "IV", + "CC Closed", + "CC Rejected" + ], "initialSateLabel": "CCN1", "closedStateLabel": "CCN5", "rejectedStateLabel": "CCR" @@ -1445,12 +1808,13 @@ { "id": "dept", "type": "groupBy", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Department", "title": "count by department", "labels": [ + "MHC", "QC", "RA", "Production", @@ -1465,6 +1829,7 @@ "QA" ], "labelsDesc": [ + "Common", "QC", "RA", "Prod", @@ -1482,7 +1847,7 @@ { "id": "status", "type": "groupByState", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Current State", @@ -1511,7 +1876,7 @@ { "id": "avg", "type": "avg", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "title": "average time spent in state", "labels": [ @@ -1531,7 +1896,11 @@ "DCN4", "DR1" ], - "initialStateLabels": ["DCN1", "DCN2", "DCN3"], + "initialStateLabels": [ + "DCN1", + "DCN2", + "DCN3" + ], "allLabelDesc": [ "DC Initiated", "Approved by HOD", @@ -1546,7 +1915,7 @@ { "id": "tracker", "type": "tracker", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "labels": [ @@ -1564,23 +1933,55 @@ "#ff7f0e", "#9467bd" ], - "allLabels": ["DCN1", "DCN2", "DCN3", "DCN4","DR1"], - "allLabelDesc": ["DC Initiated", "Approved by HOD", "DC Approved", "DC Closed", "DC Rejected"], - "tableLabelDesc": ["DC Initiated", "Approved by HOD", "DC Approved"], + "allLabels": [ + "DCN1", + "DCN2", + "DCN3", + "DCN4", + "DR1" + ], + "allLabelDesc": [ + "DC Initiated", + "Approved by HOD", + "DC Approved", + "DC Closed", + "DC Rejected" + ], + "tableLabelDesc": [ + "DC Initiated", + "Approved by HOD", + "DC Approved" + ], "closedStateLabel": "DCN4", "rejectedStateLabel": "DR1" }, { "id": "closure", "type": "closure", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Closure Time", "title": "closure time(in days)", - "allLabels": ["DCN1", "DCN2", "DCN3", "DCN4","DR1"], - "initialStateLabels": ["DCN1", "DCN2", "DCN3"], - "allLabelDesc": ["DC Initiated", "Approved by HOD", "DC Approved", "DC Closed", "DC Rejected"], + "allLabels": [ + "DCN1", + "DCN2", + "DCN3", + "DCN4", + "DR1" + ], + "initialStateLabels": [ + "DCN1", + "DCN2", + "DCN3" + ], + "allLabelDesc": [ + "DC Initiated", + "Approved by HOD", + "DC Approved", + "DC Closed", + "DC Rejected" + ], "initialSateLabel": "DCN1", "closedStateLabel": "DCN4", "rejectedStateLabel": "DR1" @@ -1599,6 +2000,7 @@ "version": "1.0.0", "dataSources": [ { + "id": "capalabels", "type": "Labels" } ], @@ -1713,12 +2115,13 @@ { "id": "dept", "type": "groupBy", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Department", "title": "count by department", "labels": [ + "MHC", "QC", "RA", "Production", @@ -1733,6 +2136,7 @@ "QA" ], "labelsDesc": [ + "Common", "QC", "RA", "Prod", @@ -1750,7 +2154,7 @@ { "id": "cat", "type": "groupBy", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Category", @@ -1771,7 +2175,7 @@ { "id": "status", "type": "groupByState", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Current State", @@ -1794,7 +2198,7 @@ { "id": "avg", "type": "avg", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "title": "average time spent in state", "labels": [ @@ -1810,7 +2214,10 @@ "CR2", "CR3" ], - "initialStateLabels": ["CR1", "CR2"], + "initialStateLabels": [ + "CR1", + "CR2" + ], "allLabelDesc": [ "NCR Initiated", "NCR Approved", @@ -1823,7 +2230,7 @@ { "id": "tracker", "type": "tracker", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "labels": [ @@ -1838,23 +2245,45 @@ "#d62728", "#ff7f0e" ], - "allLabels": ["CR1", "CR2", "CR3"], - "allLabelDesc": ["NCR Initiated", "NCR Approved", "NCR Closed"], - "tableLabelDesc": ["NCR Initiated", "NCR Approved"], + "allLabels": [ + "CR1", + "CR2", + "CR3" + ], + "allLabelDesc": [ + "NCR Initiated", + "NCR Approved", + "NCR Closed" + ], + "tableLabelDesc": [ + "NCR Initiated", + "NCR Approved" + ], "closedStateLabel": "CR3", "rejectedStateLabel": "" }, { "id": "closure", "type": "closure", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Closure Time", "title": "closure time(in days)", - "allLabels": ["CR1", "CR2", "CR3"], - "initialStateLabels": ["CR1", "CR2"], - "allLabelDesc": ["NCR Initiated", "NCR Approved", "NCR Closed"], + "allLabels": [ + "CR1", + "CR2", + "CR3" + ], + "initialStateLabels": [ + "CR1", + "CR2" + ], + "allLabelDesc": [ + "NCR Initiated", + "NCR Approved", + "NCR Closed" + ], "initialSateLabel": "CR1", "closedStateLabel": "CR3", "rejectedStateLabel": "" @@ -1873,6 +2302,7 @@ "version": "1.0.0", "dataSources": [ { + "id": "capalabels", "type": "Labels" } ], @@ -1987,12 +2417,13 @@ { "id": "dept", "type": "groupBy", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Department", "title": "count by department", "labels": [ + "MHC", "QC", "RA", "Production", @@ -2007,6 +2438,7 @@ "QA" ], "labelsDesc": [ + "Common", "QC", "RA", "Prod", @@ -2024,7 +2456,7 @@ { "id": "cat", "type": "groupBy", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Category", @@ -2047,7 +2479,7 @@ { "id": "status", "type": "groupByState", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Current State", @@ -2073,7 +2505,7 @@ { "id": "avg", "type": "avg", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "title": "average time spent in state", "labels": [ @@ -2090,7 +2522,10 @@ "EV3", "DR" ], - "initialStateLabels": ["EV1", "EN2"], + "initialStateLabels": [ + "EV1", + "EN2" + ], "allLabelDesc": [ "Deviation Initiated", "Deviation Approved", @@ -2104,7 +2539,7 @@ { "id": "tracker", "type": "tracker", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "labels": [ @@ -2119,10 +2554,21 @@ "#d62728", "#ff7f0e" ], - "allLabels": ["EV1", "EN2", "EV3", "DR"], - "allLabelDesc": ["Deviation Initiated", "Deviation Approved", "Deviation Closed","Deviation Rejected"], + "allLabels": [ + "EV1", + "EN2", + "EV3", + "DR" + ], + "allLabelDesc": [ + "Deviation Initiated", + "Deviation Approved", + "Deviation Closed", + "Deviation Rejected" + ], "tableLabelDesc": [ - "Deviation Initiated", "Deviation Approved" + "Deviation Initiated", + "Deviation Approved" ], "closedStateLabel": "EV3", "rejectedStateLabel": "DR" @@ -2130,14 +2576,27 @@ { "id": "closure", "type": "closure", - "dataSourceType": "Labels", + "dataSourceType": "capalabels", "renderChart": "Y", "showInTable": "Y", "tableHeader": "Closure Time", "title": "closure time(in days)", - "allLabels": ["EV1", "EN2", "EV3", "DR"], - "initialStateLabels": ["EV1", "EN2"], - "allLabelDesc": ["Deviation Initiated", "Deviation Approved", "Deviation Closed","Deviation Rejected"], + "allLabels": [ + "EV1", + "EN2", + "EV3", + "DR" + ], + "initialStateLabels": [ + "EV1", + "EN2" + ], + "allLabelDesc": [ + "Deviation Initiated", + "Deviation Approved", + "Deviation Closed", + "Deviation Rejected" + ], "initialSateLabel": "EV1", "closedStateLabel": "EV3", "rejectedStateLabel": "DR" From 3c2f5978863c1e76c3baddcb1051dd6d0f979ec1 Mon Sep 17 00:00:00 2001 From: basvareddy-bytes Date: Thu, 27 Jul 2023 09:13:01 +0530 Subject: [PATCH 15/16] resolving IQA dashboard config issues --- src/GenericDashboard.ts | 38 +++++++++++++++++++++++++++++--------- src/MESQA-Config-RF.json | 8 ++++---- src/api/Matrix.Labels.ts | 15 +++++++++++++-- 3 files changed, 46 insertions(+), 15 deletions(-) diff --git a/src/GenericDashboard.ts b/src/GenericDashboard.ts index 7c32de8..a2cb0da 100644 --- a/src/GenericDashboard.ts +++ b/src/GenericDashboard.ts @@ -147,27 +147,47 @@ namespace GenericDashboard { dataSources.forEach(dataSourceConfig => { if (dataSourceConfig.type == "Needles") { let needleSourceCategory; + let needleSourceFieldName; let needleSourceFieldId; dataSourceConfig.sourceAtrributes.forEach(sourceAttribute => { if (sourceAttribute.name == "category") { needleSourceCategory = sourceAttribute.value; - } else if (sourceAttribute.name == "fieldId") { - needleSourceFieldId = sourceAttribute.value; + } else if (sourceAttribute.name == "fieldName") { + needleSourceFieldName = sourceAttribute.value; } }); + needleSourceFieldId = IC.getFieldByName(needleSourceCategory,needleSourceFieldName).id; if (needleSourceCategory && needleSourceFieldId) { dataSourcePromises.push(Matrix.Labels.getNeedlesByCategoryAndFiledId(dataSourceConfig.id,dataSourceConfig.type,needleSourceCategory, needleSourceFieldId)); } } else if (dataSourceConfig.type == "NeedlesBySearch") { - if (dataSourceConfig.sourceAtrributes.length > 0) { - let searchParams = ""; - dataSourceConfig.sourceAtrributes.forEach(sourceAttribute => { - let searchParam = sourceAttribute.name + '=' + sourceAttribute.value; - searchParams += searchParam + '&' - }); - dataSourcePromises.push(Matrix.Labels.getNeedlesBySearch(dataSourceConfig.id,dataSourceConfig.type,searchParams)); + + let needleSourceCategory; + let needleSourceFieldName; + let needleSourceFieldId; + dataSourceConfig.sourceAtrributes.forEach(sourceAttribute => { + if (sourceAttribute.name == "category") { + needleSourceCategory = sourceAttribute.value; + } else if (sourceAttribute.name == "fieldName") { + needleSourceFieldName = sourceAttribute.value; + } + }); + needleSourceFieldId = IC.getFieldByName(needleSourceCategory,needleSourceFieldName).id; + if (needleSourceCategory && needleSourceFieldId) { + dataSourcePromises.push(Matrix.Labels.getNeedlesBySearch(dataSourceConfig.id,dataSourceConfig.type,needleSourceCategory, + needleSourceFieldId)); } + + // if (dataSourceConfig.sourceAtrributes.length > 0) { + // let searchParams = ""; + // dataSourceConfig.sourceAtrributes.forEach(sourceAttribute => { + // let searchParam; + // searchParam = sourceAttribute.name + '=' + sourceAttribute.value; + // searchParams += searchParam + '&' + // }); + // dataSourcePromises.push(Matrix.Labels.getNeedlesBySearch(dataSourceConfig.id,dataSourceConfig.type,searchParams)); + // } } else if (dataSourceConfig.type == "Labels") { dataSourcePromises.push(Matrix.Labels.projectLabelHistory(dataSourceConfig.id,dataSourceConfig.type)); diff --git a/src/MESQA-Config-RF.json b/src/MESQA-Config-RF.json index e9a4d3d..9f9a844 100644 --- a/src/MESQA-Config-RF.json +++ b/src/MESQA-Config-RF.json @@ -22,8 +22,8 @@ "value": "IQA" }, { - "name": "fieldsOut", - "value": 2459 + "name": "fieldName", + "value": "Audit Findings" }, { "name": "labels", @@ -40,8 +40,8 @@ "value": "IQA" }, { - "name": "fieldsOut", - "value": 2456 + "name": "fieldName", + "value": "General Audit Information:" }, { "name": "labels", diff --git a/src/api/Matrix.Labels.ts b/src/api/Matrix.Labels.ts index 4cdac7f..0120034 100644 --- a/src/api/Matrix.Labels.ts +++ b/src/api/Matrix.Labels.ts @@ -32,9 +32,20 @@ namespace Matrix { /** * Get needles by category and field id for all items in a project */ - export function getNeedlesBySearch(resourceId: string, resourceType: string, searchParams: string): Promise { + // export function getNeedlesBySearch(resourceId: string, resourceType: string, searchParams: string): Promise { + // return new Promise((resolve, reject) => { + // Matrix.REST.projectGETRequest("/needle?search=mrql:"+searchParams) + // .then((data: XRTrimNeedle) => resolve({id:resourceId,type:resourceType,source:data.needles})) + // .catch((error) => reject(error)); + // }); + // } + + /** + * Get needles by category and field id for all items in a project + */ + export function getNeedlesBySearch(resourceId: string, resourceType: string, category: string, fieldId: Number): Promise { return new Promise((resolve, reject) => { - Matrix.REST.projectGETRequest("/needle?search=mrql:"+searchParams) + Matrix.REST.projectGETRequest("/needle?search=mrql:category="+category+"&fieldsOut="+fieldId+"&labels=1") .then((data: XRTrimNeedle) => resolve({id:resourceId,type:resourceType,source:data.needles})) .catch((error) => reject(error)); }); From 2688c8f63119409414e0238d5af98bd4bbdba75e Mon Sep 17 00:00:00 2001 From: basvareddy-bytes Date: Thu, 27 Jul 2023 09:22:05 +0530 Subject: [PATCH 16/16] corrected IQA dashboard config --- src/MHCQA-Config-RF.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/MHCQA-Config-RF.json b/src/MHCQA-Config-RF.json index 16bb5bd..1cd30a6 100644 --- a/src/MHCQA-Config-RF.json +++ b/src/MHCQA-Config-RF.json @@ -22,8 +22,8 @@ "value": "IQA" }, { - "name": "fieldsOut", - "value": 2950 + "name": "fieldName", + "value": "Audit Findings" }, { "name": "labels", @@ -40,8 +40,8 @@ "value": "IQA" }, { - "name": "fieldsOut", - "value": 2947 + "name": "fieldName", + "value": "General Audit Information:" }, { "name": "labels",