Skip to content

Commit

Permalink
forkjoin approach
Browse files Browse the repository at this point in the history
Signed-off-by: anthony <[email protected]>
  • Loading branch information
antoine29 authored and otherAnthony committed Sep 19, 2024
1 parent 80e4088 commit f1c142d
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 13 deletions.
3 changes: 3 additions & 0 deletions src/portal/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
.angular/

69 changes: 69 additions & 0 deletions src/portal/proxy.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"/api/*": {
"target": "http://172.17.0.1",
"secure": false,
"changeOrigin": true,
"logLevel": "debug"
},
"/service/*": {
"target": "http://172.17.0.1",
"secure": false,
"logLevel": "debug"
},
"/c/login": {
"target": "http://172.17.0.1",
"secure": false,
"logLevel": "debug"
},
"/sign_in": {
"target": "http://172.17.0.1",
"secure": false,
"logLevel": "debug"
},
"/c/log_out": {
"target": "http://172.17.0.1",
"secure": false,
"logLevel": "debug"
},
"/sendEmail": {
"target": "http://172.17.0.1",
"secure": false,
"logLevel": "debug"
},
"/language": {
"target": "http://172.17.0.1",
"secure": false,
"logLevel": "debug"
},
"/reset": {
"target": "http://172.17.0.1",
"secure": false,
"logLevel": "debug"
},
"/userExists": {
"target": "http://172.17.0.1",
"secure": false,
"logLevel": "debug"
},
"/reset_password": {
"target": "http://172.17.0.1",
"secure": false,
"logLevel": "debug"
},
"/i18n/lang/*.json": {
"target": "http://172.17.0.1",
"secure": false,
"logLevel": "debug",
"pathRewrite": { "^/src$": "" }
},
"/chartrepo": {
"target": "http://172.17.0.1",
"secure": false,
"logLevel": "debug"
},
"/*.json": {
"target": "http://172.17.0.1",
"secure": false,
"logLevel": "debug"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -528,26 +528,30 @@ export class ArtifactListTabComponent implements OnInit, OnDestroy {
addLabel(label: Label) {
if (!this.inprogress) {
this.inprogress = true;
this.selectedRow.forEach((artifact: Artifact) => {
const labelRequests = this.selectedRow.map((artifact: Artifact) => {
const params: NewArtifactService.AddLabelParams = {
projectName: this.projectName,
repositoryName: dbEncodeURIComponent(this.repoName),
reference: artifact.digest,
label: label,
};
this.newArtifactService

return this
.newArtifactService
.addLabel(params)
.pipe(finalize(() => (this.inprogress = false)))
.subscribe({
next: res => {
this.refresh();
},
error: err => {
this.refresh();
this.errorHandlerService.error(err);
},
});
});
.pipe(catchError(error => {
this.errorHandlerService.error(error);
return of(error);
}));
})

forkJoin(labelRequests)
.pipe(finalize(() => { this.inprogress = false; }))
.subscribe({
complete: () => {
this.refresh();
}
});
}
}
removeLabel(label: Label) {
Expand Down

0 comments on commit f1c142d

Please sign in to comment.