Skip to content

Commit

Permalink
Issue #SB-4923 fix: Fixed framework issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
anilguptatarento committed Jun 29, 2018
1 parent 83835a3 commit c869575
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/services/framework/bean.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ export class CategoryRequest {
export class FrameworkDetailsRequest {
frameworkId?: string;
refreshFrameworkDetails?: boolean = false;
defaultFrameworkDetails: boolean = true;
defaultFrameworkDetails: boolean = false;
}
27 changes: 25 additions & 2 deletions src/services/framework/framework.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,29 @@ export class FrameworkService {
successCallback: (response: string) => void,
errorCallback: (error: string) => void) {

if (this.updatedFrameworkResponseBody.result == undefined
|| request.frameworkId !== this.updatedFrameworkResponseBody.result.framework.identifier) {
let fr = new FrameworkDetailsRequest();
if (request.frameworkId !== undefined
&& request.frameworkId !== "") {
fr.frameworkId = request.frameworkId;
} else {
fr.defaultFrameworkDetails = true;
}
this.getFrameworkDetails(fr, r => {
this.getCategory(request, successCallback, errorCallback);
}, e => {
//ignore as of now
errorCallback(e);
})
} else {
this.getCategory(request, successCallback, errorCallback);
}
}

private getCategory(request: CategoryRequest,
successCallback: (response: string) => void,
errorCallback: (error: string) => void) {
if (request.prevCategory && request.selectedCode) {
let filteredCategory = this.currentCategories.filter(c => {
return c.code === request.prevCategory;
Expand All @@ -84,7 +107,7 @@ export class FrameworkService {
}
return request.selectedCode!.some(check);
});

let check2 = function (element) {
return element.associations !== undefined;
}
Expand All @@ -100,7 +123,7 @@ export class FrameworkService {
successCallback(JSON.stringify(Array.from(map.values())));
return;
}

}

let nextCategories = this.currentCategories.filter(c => {
Expand Down

0 comments on commit c869575

Please sign in to comment.