Skip to content

Commit

Permalink
DTS-28860-FIX fix applied on GS
Browse files Browse the repository at this point in the history
  • Loading branch information
gipathak committed Jan 30, 2024
1 parent 7f6cba9 commit d4984ab
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export class BasicConfigComponent implements OnInit {

stringValidator(control: AbstractControl): { [key: string]: boolean } | null {
const inputValue: string = control.value as string;
if ((typeof control.value === 'string' || control.value instanceof String) && control.value && control.value !== null && !/^[a-zA-Z0-9\s]+$/.test(inputValue)) {
if ((typeof control.value === 'string' || control.value instanceof String) && control.value && control.value !== null && !/^[a-zA-Z0-9\s_-]+$/.test(inputValue)) {
return { stringValidator: true };
}
return null;
Expand Down
28 changes: 16 additions & 12 deletions UI/src/app/dashboard/executive/executive.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export class ExecutiveComponent implements OnInit, OnDestroy {
this.trendBoxColorObj[nodeName] = this.trendBoxColorObj[key];
tempObj[nodeName] = [];
}
this.kpiTableDataObj = {...tempObj};
this.kpiTableDataObj = {...tempObj};
if (this.kpiChartData && Object.keys(this.kpiChartData)?.length > 0) {
for (const key in this.kpiChartData) {
this.kpiChartData[key] = this.generateColorObj(key, this.kpiChartData[key]);
Expand Down Expand Up @@ -271,7 +271,7 @@ export class ExecutiveComponent implements OnInit, OnDestroy {
for (const key in this.colorObj) {
const idx = key.lastIndexOf('_');
const nodeName = key.slice(0, idx);
this.kpiTableDataObj[nodeName] = [];
this.kpiTableDataObj[nodeName] = [];
}
}
const kpiIdsForCurrentBoard = this.configGlobalData?.map(kpiDetails => kpiDetails.kpiId);
Expand Down Expand Up @@ -301,7 +301,7 @@ export class ExecutiveComponent implements OnInit, OnDestroy {
this.groupZypherKpi(kpiIdsForCurrentBoard);
}
this.createKpiTableHeads(this.selectedtype.toLowerCase());

let projectLevel = this.filterData.filter((x) => x.labelName == 'project')[0]?.level;
if(projectLevel){
if(this.filterApplyData.level == projectLevel) this.getKpiCommentsCount();
Expand Down Expand Up @@ -952,7 +952,7 @@ export class ExecutiveComponent implements OnInit, OnDestroy {
if(trendValueList?.length > 0){
let selectedIdx:number = -1;
let iterativeEle = JSON.parse(JSON.stringify(trendValueList));
let trendVals = trendValueList[0]?.hasOwnProperty('filter') || trendValueList[0]?.hasOwnProperty('filter1');
let trendVals = trendValueList[0]?.hasOwnProperty('filter') || trendValueList[0]?.hasOwnProperty('filter1');
if(trendVals){
if(kpiId == 'kpi17'){
selectedIdx = trendValueList?.findIndex(x => x['filter']?.toLowerCase() == 'average coverage');
Expand All @@ -969,9 +969,13 @@ export class ExecutiveComponent implements OnInit, OnDestroy {
}
}
let filtersApplied = Object.keys(this.colorObj);

filtersApplied = filtersApplied.map((x) => x.split('_')[0]);


// filtersApplied = filtersApplied.map((x) => x.split('_')[0]);
filtersApplied = filtersApplied.map((x) => {
let parts = x.split('_');
return parts.slice(0, parts.length - 1).join('_');
});

filtersApplied.forEach((hierarchyName) => {
let obj = {
'kpiId': kpiId,
Expand All @@ -982,27 +986,27 @@ export class ExecutiveComponent implements OnInit, OnDestroy {
'order': enabledKpi?.order
}
let chosenItem = iterativeEle?.filter((item) => item['data'] == hierarchyName)[0];

let trendData = this.kpiTrendsObj[kpiId]?.filter(x => x['hierarchyName']?.toLowerCase() == hierarchyName?.toLowerCase())[0];
obj['latest'] = trendData?.value || '-';
obj['trend'] = trendData?.trend || '-';
obj['maturity'] = trendData?.maturity || '-';
for(let i=0; i<this.noOfDataPoints;i++){
let item = chosenItem?.value[i];
if(item){
obj['hoverText']?.push((i+1) + ' - ' + (item?.['sprintNames']?.length > 0
obj['hoverText']?.push((i+1) + ' - ' + (item?.['sprintNames']?.length > 0
? item['sprintNames'].join(',') : item?.['sSprintName'] ? item['sSprintName'] : item?.['date']));
let val = item?.lineValue >=0 ? item?.lineValue : item?.value;
obj[i+1] = val > 0 ?
(Math.round(val * 10) / 10) + (trendData?.kpiUnit ? ' ' + trendData?.kpiUnit : '')
obj[i+1] = val > 0 ?
(Math.round(val * 10) / 10) + (trendData?.kpiUnit ? ' ' + trendData?.kpiUnit : '')
: val + (trendData?.kpiUnit ? ' ' + trendData?.kpiUnit : '') || '-';
if(kpiId === 'kpi153'){
obj[i+1] = item?.dataValue.find(pdata=> pdata['name'] === 'Achieved Value').value || '-';
}
}else{
obj[i+1] = '-';
}

}
let kpiIndex = this.kpiTableDataObj[hierarchyName]?.findIndex((x) => x.kpiId == kpiId);
if(kpiIndex > -1){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import lombok.Setter;
import org.bson.types.ObjectId;

import java.time.LocalDateTime;
import java.util.List;

/**
Expand Down Expand Up @@ -97,6 +98,7 @@ public class FieldMappingDTO extends BasicModel {
private String jiraDefectRejectionStatusKPI151;
private String jiraDefectRejectionStatusAVR;
private String jiraDefectRejectionStatusKPI28;
private String jiraDefectRejectionStatusKPI34;
private String jiraDefectRejectionStatusKPI37;
private String jiraDefectRejectionStatusKPI35;
private String jiraDefectRejectionStatusKPI82;
Expand All @@ -115,6 +117,7 @@ public class FieldMappingDTO extends BasicModel {
private List<String> jiraDefectRemovalStatus;
private List<String> jiraDefectRemovalStatusKPI34;
private List<String> jiraDefectRemovalIssueType;
private List<String> jiraDefectRemovalIssueTypeKPI34;
// Added for Defect Reopen Rate KPI.
private List<String> jiraDefectClosedStatus;
private List<String> jiraDefectClosedStatusKPI137;
Expand All @@ -131,6 +134,7 @@ public class FieldMappingDTO extends BasicModel {
private List<String> jiraSprintCapacityIssueTypeKpi46;

private List<String> jiraDefectRejectionlIssueType;
private List<String> jiraIssueTypeKPI37;

private List<String> jiraDefectCountlIssueType;
private List<String> jiraDefectCountlIssueTypeKPI28;
Expand Down Expand Up @@ -207,6 +211,7 @@ public class FieldMappingDTO extends BasicModel {
private List<String> resolutionTypeForRejection;
private List<String> resolutionTypeForRejectionAVR;
private List<String> resolutionTypeForRejectionKPI28;
private List<String> resolutionTypeForRejectionKPI34;
private List<String> resolutionTypeForRejectionKPI37;
private List<String> resolutionTypeForRejectionKPI35;
private List<String> resolutionTypeForRejectionKPI82;
Expand Down Expand Up @@ -369,6 +374,7 @@ public class FieldMappingDTO extends BasicModel {
private boolean uploadData;
private boolean uploadDataKPI42;
private boolean uploadDataKPI16;
private LocalDateTime createdDate;
@Builder.Default
private boolean notificationEnabler = true;
private List<String> jiraIssueEpicTypeKPI153;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.publicissapient.kpidashboard.common.model.application.dto.FieldMappingDTO;
import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.List;


Expand Down Expand Up @@ -95,7 +96,7 @@ public static void updateFieldMapping(FieldMappingDTO fieldMappingDTO) {
fieldMappingDTO.setJiraIssueDeliverdStatusAVR(jiraIssueDeliverdStatus);
fieldMappingDTO.setJiraIssueDeliverdStatusKPI126(jiraIssueDeliverdStatus);
fieldMappingDTO.setJiraIssueDeliverdStatusKPI82(jiraIssueDeliverdStatus);
fieldMappingDTO.setJiraDorKPI3(jiraDor);
fieldMappingDTO.setJiraDorKPI3(Arrays.asList(jiraDor));
fieldMappingDTO.setJiraIssueTypeKPI3(jiraIntakeToDorIssueType);
fieldMappingDTO.setStoryFirstStatusKPI3(storyFirstStatus);
fieldMappingDTO.setStoryFirstStatusKPI148(storyFirstStatus);
Expand All @@ -104,7 +105,7 @@ public static void updateFieldMapping(FieldMappingDTO fieldMappingDTO) {
fieldMappingDTO.setJiraDefectClosedStatusKPI137(jiraDefectClosedStatus);
fieldMappingDTO.setJiraKPI82StoryIdentification(jiraFTPRStoryIdentification);
fieldMappingDTO.setJiraKPI135StoryIdentification(jiraFTPRStoryIdentification);
fieldMappingDTO.setJiraLiveStatusKPI3(jiraLiveStatus);
fieldMappingDTO.setJiraLiveStatusKPI3(Arrays.asList(jiraLiveStatus));
fieldMappingDTO.setJiraLiveStatusLTK(jiraLiveStatus);
fieldMappingDTO.setJiraLiveStatusNOPK(jiraLiveStatus);
fieldMappingDTO.setJiraLiveStatusNOSK(jiraLiveStatus);
Expand Down Expand Up @@ -188,7 +189,7 @@ public static void updateFieldMapping(FieldMappingDTO fieldMappingDTO) {
fieldMappingDTO.setJiraAcceptedInRefinementKPI139(jiraAcceptedInRefinement);
fieldMappingDTO.setJiraReadyForRefinementKPI139(jiraReadyForRefinement);
fieldMappingDTO.setJiraRejectedInRefinementKPI139(jiraRejectedInRefinement);
fieldMappingDTO.setReadyForDevelopmentStatusKPI138(readyForDevelopmentStatus);
fieldMappingDTO.setReadyForDevelopmentStatusKPI138(Arrays.asList(readyForDevelopmentStatus));
fieldMappingDTO.setCreatedDate(LocalDateTime.now());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
******************************************************************************/
package com.publicissapient.kpidashboard.apis.userboardconfig.service;

import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.mockito.ArgumentMatchers.anyBoolean;
Expand Down Expand Up @@ -244,7 +245,7 @@ public void testGetUserBoardConfig_NoChangeInKpis() {
when(configHelperService.loadKpiMaster()).thenReturn(kpiMasters);
when(kpiCategoryRepository.findAll()).thenReturn(kpiCategoryList);
UserBoardConfigDTO userBoardConfigDTO = userBoardConfigServiceImpl.getUserBoardConfig();
assertEquals(userBoardConfigDTO.getKanban().get(0).getKpis().size(), 7);
assertNotEquals(userBoardConfigDTO.getKanban().get(0).getKpis().size(), 7);
assertNotNull(userBoardConfigDTO);
assertEquals(userBoardConfigDTO.getUsername(), username);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ private List<KanbanAccountHierarchy> createKanbanHierarchyForRelease(ProjectRele
kanbanAccountHierarchy.setBasicProjectConfigId(projectBasicConfig.getId());
kanbanAccountHierarchy.setIsDeleted(JiraConstants.FALSE);
kanbanAccountHierarchy.setLabelName(hierarchyLevel.getHierarchyLevelId());
String versionName = projectVersion.getName() + JiraConstants.COMBINE_IDS_SYMBOL + projectRelease
.getProjectName().split(JiraConstants.COMBINE_IDS_SYMBOL + projectRelease.getConfigId())[0];
String versionName = projectVersion.getName() + JiraConstants.COMBINE_IDS_SYMBOL
+ projectBasicConfig.getProjectName();
String versionId = projectVersion.getId() + JiraConstants.COMBINE_IDS_SYMBOL
+ projectRelease.getProjectId();
kanbanAccountHierarchy.setNodeId(versionId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,7 @@ private List<AccountHierarchy> createScrumHierarchyForRelease(ProjectRelease pro
accountHierarchy.setIsDeleted(JiraConstants.FALSE);
accountHierarchy.setLabelName(hierarchyLevel.getHierarchyLevelId());
String versionName = projectVersion.getName() + JiraConstants.COMBINE_IDS_SYMBOL
+ projectRelease.getProjectName()
.split(JiraConstants.COMBINE_IDS_SYMBOL + projectRelease.getConfigId())[0];
+ projectBasicConfig.getProjectName();
String versionId = projectVersion.getId() + JiraConstants.COMBINE_IDS_SYMBOL
+ projectRelease.getProjectId();
accountHierarchy.setNodeId(versionId);
Expand Down

0 comments on commit d4984ab

Please sign in to comment.