Skip to content

Commit

Permalink
Merge pull request #303 from deNBI/feature/without_facility
Browse files Browse the repository at this point in the history
feat(Application):vo can approve without facility
  • Loading branch information
dweinholz authored Dec 14, 2018
2 parents 6aced1e + cc24531 commit 6d5a3d3
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 27 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@


#### Bug Fixes

* **Application:** fixed ram gb

#### Features

* **Application:**
* if without faciltiy approve
* vo can approve without facility


------
#### Bug Fixes
* **volume:** fixed volume bug
* **development:** remove nvmrc file
Expand Down
18 changes: 9 additions & 9 deletions src/app/applications/applications.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,13 @@ <h1>Applications Overview</h1>
<td>RAM</td>
<td>{{
application.RamPerVM
}}
}} GB
</td>
</tr>
<tr *ngIf="application.OpenStackProject && application.TotalRam != 0">
<td>RAM</td>
<td>{{
application.TotalRam}}
application.TotalRam}} GB
</td>
</tr>
<tr>
Expand Down Expand Up @@ -259,7 +259,7 @@ <h1>Applications Overview</h1>
class="form-control"
#selectedComputeCenter>

<!--option value="undefined" selected> no center</option-->
<option value="undefined" selected> no center</option>
<option *ngFor="let computeCenter of computeCenters"
value="{{computeCenter.FacilityId}}">
{{computeCenter.Name}}
Expand All @@ -279,7 +279,7 @@ <h1>Applications Overview</h1>
type="button"
class="btn btn-secondary">
<i class="fa fa-check"></i>&nbsp;
Approve
Assign
</button>
<button
*ngIf="application.Status == 6 && application.ComputeCenter?.FacilityId"
Expand Down Expand Up @@ -472,14 +472,14 @@ <h1>Applications Overview</h1>
<tr *ngIf="application.OpenStackProject && application.TotalRam == 0">
<td>RAM</td>
<td>{{
application.RamPerVM
}}
application.RamPerVM
}} GB
</td>
</tr>
<tr *ngIf="application.OpenStackProject && application.TotalRam != 0">
<td>RAM</td>
<td>{{
application.TotalRam}}
application.TotalRam}} GB
</td>
</tr>
<tr>
Expand Down Expand Up @@ -690,13 +690,13 @@ <h1>Applications Overview</h1>
<td>RAM</td>
<td>{{
application.RamPerVM
}}
}} GB
</td>
</tr>
<tr *ngIf="application.OpenStackProject && application.TotalRam != 0">
<td>RAM</td>
<td>{{
application.TotalRam}}
application.TotalRam}} GB
</td>
</tr>
<tr>
Expand Down
72 changes: 54 additions & 18 deletions src/app/applications/applications.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -738,32 +738,65 @@ export class ApplicationsComponent extends AbstractBaseClasse {
this.groupservice.addAdmin(new_group_id, manager_member_user_id, compute_center).subscribe(res => {
this.groupservice.setPerunGroupAttributes(application_id, new_group_id).subscribe(res => {
this.groupservice.assignGroupToResource(new_group_id.toString(), compute_center).subscribe(res => {
this.applicationstatusservice.setApplicationStatus(application_id, this.application_statuses.WAIT_FOR_CONFIRMATION, compute_center).subscribe(result => {
if (result['Error']) {
this.updateNotificationModal("Failed", result['Error'], true, "danger");
if (compute_center != 'undefined') {

}
else {
this.updateNotificationModal("Success", "The new project was created", true, "success");
}
for (let app of this.user_applications) {
if (app.Id == application_id) {
this.getUserApplication(app);
break;
this.applicationstatusservice.setApplicationStatus(application_id, this.application_statuses.WAIT_FOR_CONFIRMATION, compute_center).subscribe(result => {
if (result['Error']) {
this.updateNotificationModal("Failed", result['Error'], true, "danger");

}
else {
this.updateNotificationModal("Success", "The new project was created", true, "success");
}
for (let app of this.user_applications) {
if (app.Id == application_id) {
this.getUserApplication(app);
break;

}

}
for (let app of this.all_applications) {
if (app.Id == application_id) {
this.getApplication(app);
break;

}
for (let app of this.all_applications) {
if (app.Id == application_id) {
this.getApplication(app);
break;

}
}
}
}
)
)
} else {
this.groupservice.setPerunGroupStatus(new_group_id, this.application_statuses.APPROVED).subscribe(res => {
this.applicationstatusservice.setApplicationStatus(application_id, this.application_statuses.APPROVED, compute_center).subscribe(result => {
if (result['Error']) {
this.updateNotificationModal("Failed", result['Error'], true, "danger");

}
else {
this.updateNotificationModal("Success", "The new project was created", true, "success");
}
for (let app of this.user_applications) {
if (app.Id == application_id) {
this.getUserApplication(app);
break;

}


}
for (let app of this.all_applications) {
if (app.Id == application_id) {
this.getApplication(app);
break;

}
}
})

})

}
});
})

Expand Down Expand Up @@ -879,6 +912,9 @@ export class ApplicationsComponent extends AbstractBaseClasse {
this.updateNotificationModal("Failed", "Project could not be created!", true, "danger");
});
}
else {
this.updateNotificationModal("Failed", "You need to select an compute center!", true, "danger");
}

}

Expand Down

0 comments on commit 6d5a3d3

Please sign in to comment.