diff --git a/Server/src/main/java/io/hawkcd/model/dto/PipelineDto.java b/Server/src/main/java/io/hawkcd/model/dto/PipelineDto.java index d5831281..1d2ada86 100644 --- a/Server/src/main/java/io/hawkcd/model/dto/PipelineDto.java +++ b/Server/src/main/java/io/hawkcd/model/dto/PipelineDto.java @@ -40,6 +40,7 @@ public class PipelineDto extends PipelineFamily { private String triggerReason; private List artifactsFileStructure; private List stages; + private boolean isScrollCall; public PipelineDto() { this.stages = new ArrayList<>(); @@ -78,8 +79,9 @@ public void constructHistoryPipelineDto(Pipeline pipeline) { this.materials = pipeline.getMaterials(); } - public void constructArtifactPipelineDto(Pipeline pipeline) { + public void constructArtifactPipelineDto(Pipeline pipeline, boolean isScrollCall) { this.constructHistoryPipelineDto(pipeline); this.artifactsFileStructure = pipeline.getArtifactsFileStructure(); + this.isScrollCall = isScrollCall; } } diff --git a/Server/src/main/java/io/hawkcd/services/PipelineService.java b/Server/src/main/java/io/hawkcd/services/PipelineService.java index 0365f9c9..2e55c309 100644 --- a/Server/src/main/java/io/hawkcd/services/PipelineService.java +++ b/Server/src/main/java/io/hawkcd/services/PipelineService.java @@ -303,7 +303,7 @@ public ServiceResult getAllPipelineHistoryDTOs(String pipelineDefinitionId, Inte List pipelineDtos = new ArrayList<>(); for (Pipeline pipeline : filteredPipelines) { PipelineDto pipelineDto = new PipelineDto(); - pipelineDto.constructArtifactPipelineDto(pipeline); + pipelineDto.constructHistoryPipelineDto(pipeline); pipelineDtos.add(pipelineDto); } @@ -346,7 +346,11 @@ public ServiceResult getAllPipelineArtifactDTOs(String searchCriteria, Integer n List pipelineDtos = new ArrayList<>(); for (Pipeline pipeline : filteredPipelines) { PipelineDto pipelineDto = new PipelineDto(); - pipelineDto.constructArtifactPipelineDto(pipeline); + boolean isScrollCall = false; + if(pipelineId.length() > 0){ + isScrollCall = true; + } + pipelineDto.constructArtifactPipelineDto(pipeline, isScrollCall); pipelineDtos.add(pipelineDto); } diff --git a/Server/ui/src/app/application/services/ws/websocketReceiver.service.js b/Server/ui/src/app/application/services/ws/websocketReceiver.service.js index 668d90ab..ae892bf9 100644 --- a/Server/ui/src/app/application/services/ws/websocketReceiver.service.js +++ b/Server/ui/src/app/application/services/ws/websocketReceiver.service.js @@ -185,16 +185,19 @@ angular validationService.dispatcherFlow(object, [pipelineUpdater.getAllHistoryPipelines]); }, getAllPipelineArtifactDTOs: function (object) { - // if(object.args[2].object == "\"\""){ - // for(var i = 0; i < viewModel.artifactPipelines.length - 1; i++){ - // if(viewModel.artifactPipelines[i].searchCriteria){ - // object.result[0].searchCriteria = viewModel.artifactPipelines[i].searchCriteria; - // break; - // } - // } - // viewModel.artifactPipelines = []; - // } - viewModel.artifactPipelines = []; + if(object.result[0]){ + if(object.result[0].isScrollCall){ + for(var i = 0; i < viewModel.artifactPipelines.length - 1; i++){ + if(viewModel.artifactPipelines[i].searchCriteria){ + object.result[0].searchCriteria = viewModel.artifactPipelines[i].searchCriteria; + break; + } + } + } else { + viewModel.artifactPipelines = []; + } + } + // viewModel.artifactPipelines = []; validationService.dispatcherFlow(object, [pipelineUpdater.getAllArtifactPipelines]); }, add: function(object) {