@@ -102,9 +102,9 @@ export class ApplicationsComponent extends ApplicationBaseClassComponent impleme
102
102
this . getApplicationHistory ( ) ;
103
103
this . getComputeCenters ( ) ;
104
104
this . applicationsservice . getExtensionRequestsCounter ( ) . subscribe ( ( result : any ) : void => {
105
- this . numberOfCreditRequests = result [ 'credits_extension_requests_vo ' ] ;
106
- this . numberOfExtensionRequests = result [ 'lifetime_extension_requests_vo ' ] ;
107
- this . numberOfModificationRequests = result [ 'modification_requests_vo ' ] ;
105
+ this . numberOfCreditRequests = result [ 'credits_extension_requests_all ' ] ;
106
+ this . numberOfExtensionRequests = result [ 'lifetime_extension_requests_all ' ] ;
107
+ this . numberOfModificationRequests = result [ 'modification_requests_all ' ] ;
108
108
this . numberOfProjectApplications = result [ 'applications_submitted_vo' ] ;
109
109
} ) ;
110
110
} else {
@@ -161,12 +161,19 @@ export class ApplicationsComponent extends ApplicationBaseClassComponent impleme
161
161
this . applicationsservice . approveAdditionalLifetime ( application . project_application_id )
162
162
. subscribe ( ( res : any ) : void => {
163
163
if ( application . project_application_openstack_project ) {
164
+ application . project_application_status = [ ]
165
+ this . getApplication ( application )
166
+
167
+
164
168
this . updateNotificationModal ( 'Success' , 'The request has been sent to the facility manager.' , true , 'success' ) ;
165
169
} else {
166
170
this . updateNotificationModal ( 'Success' , 'The project has been extended!' , true , 'success' ) ;
167
171
}
168
- this . all_applications . splice ( this . all_applications . indexOf ( application ) , 1 ) ;
169
- this . numberOfExtensionRequests -- ;
172
+ if ( ! application . project_application_openstack_project ) {
173
+ this . numberOfExtensionRequests -- ;
174
+ this . all_applications . splice ( this . all_applications . indexOf ( application ) , 1 ) ;
175
+
176
+ }
170
177
} ,
171
178
( err : any ) : void => {
172
179
console . log ( 'error' , err . status ) ;
@@ -194,9 +201,18 @@ export class ApplicationsComponent extends ApplicationBaseClassComponent impleme
194
201
195
202
this . applicationsservice . approveModificationRequest ( application . project_application_id )
196
203
. subscribe ( ( res : any ) : void => {
204
+
197
205
this . updateNotificationModal ( 'Success' , 'The resource modification request was approved!' , true , 'success' ) ;
198
- this . all_applications . splice ( this . all_applications . indexOf ( application ) , 1 ) ;
199
- this . numberOfModificationRequests -- ;
206
+ if ( ! application . project_application_openstack_project ) {
207
+
208
+ this . numberOfModificationRequests -- ;
209
+ this . all_applications . splice ( this . all_applications . indexOf ( application ) , 1 ) ;
210
+
211
+ } else {
212
+ application . project_application_status = [ ]
213
+
214
+ this . getApplication ( application )
215
+ }
200
216
} ,
201
217
( err : any ) : void => {
202
218
console . log ( 'error' , err . status ) ;
@@ -221,9 +237,18 @@ export class ApplicationsComponent extends ApplicationBaseClassComponent impleme
221
237
approveCreditExtension ( application : Application ) : void {
222
238
this . applicationsservice . approveAdditionalCreditsRequest ( application . project_application_id )
223
239
. subscribe ( ( res : any ) : void => {
240
+
224
241
this . updateNotificationModal ( 'Success' , 'The credit extension request was approved!' , true , 'success' ) ;
225
- this . all_applications . splice ( this . all_applications . indexOf ( application ) , 1 ) ;
226
- this . numberOfCreditRequests -- ;
242
+ if ( ! application . project_application_openstack_project ) {
243
+
244
+ this . numberOfCreditRequests -- ;
245
+ this . all_applications . splice ( this . all_applications . indexOf ( application ) , 1 ) ;
246
+
247
+ } else {
248
+ application . project_application_status = [ ]
249
+
250
+ this . getApplication ( application )
251
+ }
227
252
} ,
228
253
( err : any ) : void => {
229
254
console . log ( 'error' , err . status ) ;
@@ -424,15 +449,17 @@ export class ApplicationsComponent extends ApplicationBaseClassComponent impleme
424
449
this . groupservice . createGroupOpenStack (
425
450
application . project_application_id , compute_center )
426
451
. subscribe ( ( result : { [ key : string ] : string } ) : void => {
452
+
427
453
if ( result [ 'Error' ] ) {
428
454
this . updateNotificationModal ( 'Failed' , result [ 'Error' ] , true , 'danger' ) ;
429
455
430
456
} else {
457
+ application . project_application_status = [ ]
458
+
431
459
this . updateNotificationModal ( 'Success' , 'The new project was created' , true , 'success' ) ;
432
- this . all_applications . splice ( this . all_applications . indexOf ( application ) , 1 ) ;
433
- this . numberOfProjectApplications -- ;
460
+ this . getApplication ( application ) ;
461
+
434
462
}
435
- this . getApplication ( application ) ;
436
463
} ,
437
464
( ) : void => {
438
465
this . updateNotificationModal ( 'Failed' , 'Project could not be created!' , true , 'danger' ) ;
0 commit comments