Skip to content

Commit b5d9c6a

Browse files
authored
fix: startupservice store full response (#661)
1 parent a6ab38f commit b5d9c6a

File tree

8 files changed

+31
-39
lines changed

8 files changed

+31
-39
lines changed

src/app/app.component.spec.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@ import { RouterTestingModule } from '@angular/router/testing'
33
import { AppComponent } from './app.component'
44

55
describe('AppComponent', () => {
6-
beforeEach(
7-
waitForAsync(() => {
8-
TestBed.configureTestingModule({
9-
imports: [RouterTestingModule],
10-
declarations: [AppComponent]
11-
}).compileComponents()
12-
})
13-
)
6+
beforeEach(waitForAsync(() => {
7+
TestBed.configureTestingModule({
8+
imports: [RouterTestingModule],
9+
declarations: [AppComponent]
10+
}).compileComponents()
11+
}))
1412

1513
it('should create the app', () => {
1614
const fixture = TestBed.createComponent(AppComponent)

src/app/components/login-modal/login-modal.component.spec.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@ describe('LoginModalComponent', () => {
66
let component: LoginModalComponent
77
let fixture: ComponentFixture<LoginModalComponent>
88

9-
beforeEach(
10-
waitForAsync(() => {
11-
TestBed.configureTestingModule({
12-
declarations: [LoginModalComponent]
13-
}).compileComponents()
14-
})
15-
)
9+
beforeEach(waitForAsync(() => {
10+
TestBed.configureTestingModule({
11+
declarations: [LoginModalComponent]
12+
}).compileComponents()
13+
}))
1614

1715
beforeEach(() => {
1816
fixture = TestBed.createComponent(LoginModalComponent)

src/app/components/requests-modal/requests-modal.component.spec.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@ describe('RequestsModalComponent', () => {
66
let component: RequestsModalComponent
77
let fixture: ComponentFixture<RequestsModalComponent>
88

9-
beforeEach(
10-
waitForAsync(() => {
11-
TestBed.configureTestingModule({
12-
declarations: [RequestsModalComponent]
13-
}).compileComponents()
14-
})
15-
)
9+
beforeEach(waitForAsync(() => {
10+
TestBed.configureTestingModule({
11+
declarations: [RequestsModalComponent]
12+
}).compileComponents()
13+
}))
1614

1715
beforeEach(() => {
1816
fixture = TestBed.createComponent(RequestsModalComponent)

src/app/data/data.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
</div>
2222

2323
<span *ngIf="springsLoading" class="spinner spinner-md"> Loading... </span>
24-
<p *ngIf="noData"> No Data in Response </p>
24+
<p *ngIf="noData">No Data in Response</p>
2525

2626
<table *ngIf="springs?.length > 0 && !springsLoading" class="table">
2727
<thead>

src/app/data/data.component.spec.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@ describe('DataComponent', () => {
66
let component: DataComponent
77
let fixture: ComponentFixture<DataComponent>
88

9-
beforeEach(
10-
waitForAsync(() => {
11-
TestBed.configureTestingModule({
12-
declarations: [DataComponent]
13-
}).compileComponents()
14-
})
15-
)
9+
beforeEach(waitForAsync(() => {
10+
TestBed.configureTestingModule({
11+
declarations: [DataComponent]
12+
}).compileComponents()
13+
}))
1614

1715
beforeEach(() => {
1816
fixture = TestBed.createComponent(DataComponent)

src/app/data/data.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ export class DataComponent implements OnInit {
3131

3232
ngOnInit(): void {
3333
this.stateService.startupData.subscribe((data: any) => {
34-
this.areas = data
34+
this.areas = data.areas
35+
// Example to access another table from same response:
36+
// data.secondTable
3537
})
3638
}
3739

src/app/home-page/home-page.component.spec.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@ describe('HomePageComponent', () => {
66
let component: HomePageComponent
77
let fixture: ComponentFixture<HomePageComponent>
88

9-
beforeEach(
10-
waitForAsync(() => {
11-
TestBed.configureTestingModule({
12-
declarations: [HomePageComponent]
13-
}).compileComponents()
14-
})
15-
)
9+
beforeEach(waitForAsync(() => {
10+
TestBed.configureTestingModule({
11+
declarations: [HomePageComponent]
12+
}).compileComponents()
13+
}))
1614

1715
beforeEach(() => {
1816
fixture = TestBed.createComponent(HomePageComponent)

src/app/sas.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export class SasService {
1818
public fetchStartupData() {
1919
this.request('common/appinit', null).then((response: any) => {
2020
console.log(response)
21-
this.stateService.setStartupData(response.areas)
21+
this.stateService.setStartupData(response)
2222
})
2323
}
2424

0 commit comments

Comments
 (0)