Skip to content
This repository has been archived by the owner on Jun 10, 2021. It is now read-only.

Commit

Permalink
Fixed Artifacts not displaying properly to the UI #416 #449
Browse files Browse the repository at this point in the history
  • Loading branch information
monitobeko committed Nov 29, 2016
1 parent 897a6c0 commit 6abbfcb
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
4 changes: 3 additions & 1 deletion Server/src/main/java/io/hawkcd/model/dto/PipelineDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public class PipelineDto extends PipelineFamily {
private String triggerReason;
private List<JsTreeFile> artifactsFileStructure;
private List<StageDto> stages;
private boolean isScrollCall;

public PipelineDto() {
this.stages = new ArrayList<>();
Expand Down Expand Up @@ -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;
}
}
8 changes: 6 additions & 2 deletions Server/src/main/java/io/hawkcd/services/PipelineService.java
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ public ServiceResult getAllPipelineHistoryDTOs(String pipelineDefinitionId, Inte
List<PipelineDto> pipelineDtos = new ArrayList<>();
for (Pipeline pipeline : filteredPipelines) {
PipelineDto pipelineDto = new PipelineDto();
pipelineDto.constructArtifactPipelineDto(pipeline);
pipelineDto.constructHistoryPipelineDto(pipeline);
pipelineDtos.add(pipelineDto);
}

Expand Down Expand Up @@ -346,7 +346,11 @@ public ServiceResult getAllPipelineArtifactDTOs(String searchCriteria, Integer n
List<PipelineDto> 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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 6abbfcb

Please sign in to comment.