summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app
diff options
context:
space:
mode:
authork.kedron <k.kedron@partner.samsung.com>2020-03-02 13:51:08 +0100
committerOfir Sonsino <ofir.sonsino@intl.att.com>2020-03-05 11:01:39 +0000
commit9b0f5789fade52e551917018c5fb82b6e5ee7845 (patch)
tree5e41e4b3fc1472926db928e68d46dc0a6bf95367 /catalog-ui/src/app
parent8f29cc7a6dec1881d8e4197b0585ed1c0f616f16 (diff)
Fix update the policy in SDC UI
Refresh the property.value which is sent to the backend to properly update the policy property. Issue-ID: SDC-2797 Signed-off-by: Krystian Kedron <k.kedron@partner.samsung.com> Change-Id: If87c7acb5324cf933e9c8a4ebd5616a11d8b4c71
Diffstat (limited to 'catalog-ui/src/app')
-rw-r--r--catalog-ui/src/app/ng2/services/component-instance-services/component-instance.service.ts2
-rw-r--r--catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view-model.ts13
2 files changed, 10 insertions, 5 deletions
diff --git a/catalog-ui/src/app/ng2/services/component-instance-services/component-instance.service.ts b/catalog-ui/src/app/ng2/services/component-instance-services/component-instance.service.ts
index cc382a3df0..af6ed9d4b0 100644
--- a/catalog-ui/src/app/ng2/services/component-instance-services/component-instance.service.ts
+++ b/catalog-ui/src/app/ng2/services/component-instance-services/component-instance.service.ts
@@ -93,7 +93,7 @@ export class ComponentInstanceServiceNg2 {
.map((res) => {
return res.map((resProperty) => {
let newProp = new PropertyModel(resProperty);
- newProp.resourceInstanceUniqueId = componentInstanceId
+ newProp.resourceInstanceUniqueId = componentInstanceId;
return newProp;
});
});
diff --git a/catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view-model.ts b/catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view-model.ts
index 37b1ce75a8..3d1ac3d591 100644
--- a/catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view-model.ts
+++ b/catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view-model.ts
@@ -272,12 +272,17 @@ export class PropertyFormViewModel {
};
//Not clean, but doing this as a temporary fix until we update the property right panel modals
- if(this.propertyOwnerType == "group"){
+ if (this.propertyOwnerType === "group"){
this.ComponentInstanceServiceNg2.updateComponentGroupInstanceProperties(this.workspaceService.metadata.componentType, this.workspaceService.metadata.uniqueId, this.propertyOwnerId, [property])
- .subscribe((propertiesFromBE) => { onPropertySuccess(<PropertyModel>propertiesFromBE[0])}, error => onPropertyFaild);
- } else if(this.propertyOwnerType == "policy"){
+ .subscribe((propertiesFromBE) => { onPropertySuccess(<PropertyModel>propertiesFromBE[0])}, error => onPropertyFaild(error));
+ } else if (this.propertyOwnerType === "policy"){
+ if (!this.$scope.editPropertyModel.property.simpleType &&
+ !this.$scope.isSimpleType(this.$scope.editPropertyModel.property.type) &&
+ !_.isNil(this.$scope.myValue)) {
+ property.value = JSON.stringify(this.$scope.myValue);
+ }
this.ComponentInstanceServiceNg2.updateComponentPolicyInstanceProperties(this.workspaceService.metadata.componentType, this.workspaceService.metadata.uniqueId, this.propertyOwnerId, [property])
- .subscribe((propertiesFromBE) => { onPropertySuccess(<PropertyModel>propertiesFromBE[0])}, error => onPropertyFaild);
+ .subscribe((propertiesFromBE) => { onPropertySuccess(<PropertyModel>propertiesFromBE[0])}, error => onPropertyFaild(error));
} else {
//in case we have uniqueId we call update method
if (this.$scope.isPropertyValueOwner) {
id='n292' href='#n292'>292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462