Commit 26df7a4a authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰 Committed by Tomek Mrugalski

[#164] prettier_ui fixes

parent cdcc4449
......@@ -11,11 +11,7 @@ describe('GlobalSearchComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [GlobalSearchComponent],
providers: [
SearchService,
HttpClient,
HttpHandler
]
providers: [SearchService, HttpClient, HttpHandler],
}).compileComponents()
}))
......
......@@ -39,13 +39,14 @@ export class LoginScreenComponent implements OnInit {
})
this.api.getVersion().subscribe(
(data) => {
console.info(data)
this.version = data.version
},
(error) => {
console.log(error)
})
(data) => {
console.info(data)
this.version = data.version
},
(error) => {
console.log(error)
}
)
}
get f() {
......
......@@ -57,16 +57,17 @@ export class SharedNetworksPageComponent implements OnInit {
// subscribe to subsequent changes to query params
this.route.queryParamMap.subscribe(
(params) => {
this.updateOurQueryParams(params)
let event = { first: 0, rows: 10 }
if (this.networksTable) {
event = this.networksTable.createLazyLoadMetadata()
this.updateOurQueryParams(params)
let event = { first: 0, rows: 10 }
if (this.networksTable) {
event = this.networksTable.createLazyLoadMetadata()
}
this.loadNetworks(event)
},
(error) => {
console.log(error)
}
this.loadNetworks(event)
},
(error) => {
console.log(error)
})
)
}
updateOurQueryParams(params) {
......@@ -88,13 +89,14 @@ export class SharedNetworksPageComponent implements OnInit {
this.dhcpApi
.getSharedNetworks(event.first, event.rows, params.appId, params.dhcpVersion, params.text)
.subscribe(
(data) => {
this.networks = data.items
this.totalNetworks = data.total
},
(error) => {
console.log(error)
})
(data) => {
this.networks = data.items
this.totalNetworks = data.total
},
(error) => {
console.log(error)
}
)
}
/**
......
......@@ -32,7 +32,7 @@ describe('SubnetsPageComponent', () => {
provide: ActivatedRoute,
useValue: {
snapshot: { queryParamMap: new MockParamMap() },
queryParamMap: of(new MockParamMap())
queryParamMap: of(new MockParamMap()),
},
},
{
......
......@@ -51,11 +51,14 @@ export class SubnetsPageComponent implements OnInit {
{ label: 'DHCPv6', value: '6', id: 'dhcpv6-menu' },
]
this.settingSvc.getSettings().subscribe((data) => {
this.grafanaUrl = data['grafana_url']
}, (error) => {
console.log(error)
})
this.settingSvc.getSettings().subscribe(
(data) => {
this.grafanaUrl = data['grafana_url']
},
(error) => {
console.log(error)
}
)
// handle initial query params
const ssParams = this.route.snapshot.queryParamMap
......@@ -70,16 +73,19 @@ export class SubnetsPageComponent implements OnInit {
this.updateOurQueryParams(ssParams)
// subscribe to subsequent changes to query params
this.route.queryParamMap.subscribe((params) => {
this.updateOurQueryParams(params)
let event = { first: 0, rows: 10 }
if (this.subnetsTable) {
event = this.subnetsTable.createLazyLoadMetadata()
this.route.queryParamMap.subscribe(
(params) => {
this.updateOurQueryParams(params)
let event = { first: 0, rows: 10 }
if (this.subnetsTable) {
event = this.subnetsTable.createLazyLoadMetadata()
}
this.loadSubnets(event)
},
(error) => {
console.log(error)
}
this.loadSubnets(event)
}, (error) => {
console.log(error)
})
)
}
updateOurQueryParams(params) {
......@@ -99,14 +105,15 @@ export class SubnetsPageComponent implements OnInit {
loadSubnets(event) {
const params = this.queryParams
this.dhcpApi
.getSubnets(event.first, event.rows, params.appId, params.dhcpVersion, params.text)
.subscribe((data) => {
this.dhcpApi.getSubnets(event.first, event.rows, params.appId, params.dhcpVersion, params.text).subscribe(
(data) => {
this.subnets = data.items
this.totalSubnets = data.total
}, (error) => {
},
(error) => {
console.log(error)
})
}
)
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment