diff options
author | Michael Lando <ml636r@att.com> | 2017-06-11 14:22:02 +0300 |
---|---|---|
committer | Michael Lando <ml636r@att.com> | 2017-06-11 17:48:32 +0300 |
commit | b3d4898d9e8452ea0b8d848c048e712d43b8d9a3 (patch) | |
tree | 0609319203be13f6c29ccbe24cb39c9d64f90095 /catalog-ui/src/app/models/components/component.ts | |
parent | af9929df75604ce407d0ca542b200630164e0ae6 (diff) |
[SDC-29] rebase continue work to align source
Change-Id: I218f1c5ee23fb2c8314f1c70921d3ad8682c10f4
Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'catalog-ui/src/app/models/components/component.ts')
-rw-r--r-- | catalog-ui/src/app/models/components/component.ts | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/catalog-ui/src/app/models/components/component.ts b/catalog-ui/src/app/models/components/component.ts index 898285f032..c7cc81fae7 100644 --- a/catalog-ui/src/app/models/components/component.ts +++ b/catalog-ui/src/app/models/components/component.ts @@ -205,7 +205,19 @@ export abstract class Component implements IComponent { //------------------------------------------ API Calls ----------------------------------------------------------------// public changeLifecycleState = (state:string, commentObj:AsdcComment):ng.IPromise<Component> => { - return this.componentService.changeLifecycleState(this, state, JSON.stringify(commentObj)); + let deferred = this.$q.defer(); + let onSuccess = (componentMetadata:ComponentMetadata):void => { + this.setComponentMetadata(componentMetadata); + // this.version = componentMetadata.version; + this.lifecycleState = componentMetadata.lifecycleState; + + deferred.resolve(this); + }; + let onError = (error:any):void => { + deferred.reject(error); + }; + this.componentService.changeLifecycleState(this, state, JSON.stringify(commentObj)).then(onSuccess, onError); + return deferred.promise; }; public getComponent = ():ng.IPromise<Component> => { @@ -892,7 +904,7 @@ export abstract class Component implements IComponent { this.systemName = componentMetadata.systemName; this.projectCode = componentMetadata.projectCode; this.categories = componentMetadata.categories; - + } public toJSON = ():any => { |