add the default Task App

This commit is contained in:
mauriziovitale84
2016-09-20 17:38:21 +01:00
parent 87b4364c97
commit 9b83798a63
2 changed files with 9 additions and 3 deletions
@@ -36,6 +36,8 @@ export class ActivitiApps implements OnInit {
public static LAYOUT_LIST: string = 'LIST'; public static LAYOUT_LIST: string = 'LIST';
public static LAYOUT_GRID: string = 'GRID'; public static LAYOUT_GRID: string = 'GRID';
public static DEFAULT_TASKS_APP: string = 'tasks';
public static DEFAULT_TASKS_APP_NAME: string = 'Task App';
@Input() @Input()
layoutType: string = ActivitiApps.LAYOUT_GRID; layoutType: string = ActivitiApps.LAYOUT_GRID;
@@ -80,8 +82,12 @@ export class ActivitiApps implements OnInit {
public load(name?: string) { public load(name?: string) {
this.activitiTaskList.getDeployedApplications(name).subscribe( this.activitiTaskList.getDeployedApplications(name).subscribe(
(res) => { (res) => {
res.forEach((app) => { res.forEach((app: AppDefinitionRepresentationModel) => {
if (app.deploymentId) { if (app.defaultAppId === ActivitiApps.DEFAULT_TASKS_APP) {
app.name = ActivitiApps.DEFAULT_TASKS_APP_NAME;
this.appsObserver.next(app);
this.selectApp(app);
} else if (app.deploymentId) {
this.appsObserver.next(app); this.appsObserver.next(app);
} }
}); });
@@ -82,7 +82,7 @@ export class ActivitiFilters implements OnInit, OnChanges {
ngOnChanges(changes: SimpleChanges) { ngOnChanges(changes: SimpleChanges) {
let appId = changes['appId']; let appId = changes['appId'];
if (appId && appId.currentValue) { if (appId) {
this.load(); this.load();
return; return;
} }