Skip to content

Commit

Permalink
Merge pull request #957 from milobella/abilities
Browse files Browse the repository at this point in the history
fix: abilities can't be undefined
  • Loading branch information
celian-garcia authored Oct 16, 2022
2 parents 6a34288 + 6e1725d commit f1d39c9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
1 change: 1 addition & 0 deletions angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"serve:single-spa:try-it": "ng s --project try-it --disable-host-check --port 4202 --live-reload false",
"build:single-spa:abilities": "ng build abilities",
"serve:single-spa:abilities": "ng s --project abilities --disable-host-check --port 4203 --live-reload false",
"serve:dev:abilities": "ng s --project abilities --configuration=development --port 4203",
"build:single-spa:nlg": "ng build nlg --deploy-url",
"serve:single-spa:nlg": "ng s --project nlg --disable-host-check --port 4204 --live-reload false",
"serve:dev:nlg": "ng s --project nlg --configuration=development --port 4204"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ import { Abilities, Ability } from '../api/v1/ability.model';
})
export class ContainerComponent implements OnInit {

public abilities: Abilities;
public abilities: Abilities = {
config: [],
cache: [],
database: [],
}

public links: { from: Outlet, to: Outlet }[] = [
{
Expand Down Expand Up @@ -49,13 +53,16 @@ export class ContainerComponent implements OnInit {
}

ngOnInit(): void {
this.service.getAbilities().subscribe(value => {
value.config = ContainerComponent.mergeByNameAndHostAndPort(value.config);
value.database = ContainerComponent.mergeByNameAndHostAndPort(value.database);
this.abilities = value;
}, error => {
// console.log(error);
// alert(error);
this.service.getAbilities().subscribe({
next: value => {
value.config = ContainerComponent.mergeByNameAndHostAndPort(value.config);
value.database = ContainerComponent.mergeByNameAndHostAndPort(value.database);
this.abilities = value;
},
error: error => {
console.log(error);
alert(error);
}
});
}

Expand Down

0 comments on commit f1d39c9

Please sign in to comment.