Skip to content
Snippets Groups Projects
Commit 3c003cef authored by AndiMajore's avatar AndiMajore
Browse files

added warning for missing nodes in network conifg

parent 51c8d06c
No related branches found
No related tags found
No related merge requests found
......@@ -52,6 +52,7 @@ import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
import { SummaryNodeComponent } from './pages/explorer-page/summary-node/summary-node/summary-node.component';
import { NetworkOverviewComponent } from './pages/explorer-page/network-overview/network-overview/network-overview.component';
import { InfoTileEdgeComponent } from './components/info-tile-edge/info-tile-edge/info-tile-edge.component';
import { NetworkEmptyWarningComponent } from './components/network-empty-warning/network-empty-warning.component';
@NgModule({
......@@ -93,6 +94,7 @@ import { InfoTileEdgeComponent } from './components/info-tile-edge/info-tile-edg
SummaryNodeComponent,
NetworkOverviewComponent,
InfoTileEdgeComponent,
NetworkEmptyWarningComponent,
],
imports: [
BrowserModule,
......
......@@ -4,6 +4,7 @@
<app-fa-icons></app-fa-icons>
<app-loading-screen></app-loading-screen>
<app-network-warning></app-network-warning>
<app-network-empty-warning></app-network-empty-warning>
<app-group-warning></app-group-warning>
<app-parser-warning></app-parser-warning>
<app-privacy-banner></app-privacy-banner>
......
......@@ -77,7 +77,13 @@ export class ExplorerPageComponent implements OnInit, AfterViewInit {
return;
}
try {
this.networkJSON = JSON.stringify(typeof network === 'string' ? JSON5.parse(network) : network);
const nw = typeof network === 'string' ? JSON5.parse(network) : network;
if (!nw.nodes || nw.nodes.length === 0) {
this.drugstoneConfig.gettingNetworkEmpty = true;
console.log('No nodes specified in network config.');
return;
}
this.networkJSON = JSON.stringify(nw);
} catch (e) {
this.drugstoneConfig.parsingIssueNetwork = true;
console.error('Failed parsing input network');
......
......@@ -12,6 +12,7 @@ export class DrugstoneConfigService {
public parsingIssueNetwork = false;
public parsingIssueGroups = false;
public gettingNetworkIssue = true;
public gettingNetworkEmpty = false;
public groupIssue = false;
public groupIssueList = [];
public smallStyle = false;
......
......@@ -64,7 +64,8 @@ $text-normal-font-size: 12px;
$text-small-font-size: 11px;
$privacy-banner-z: 40;
$parser-issue-banner-z: 41;
$network-empty-banner-z: 41;
$parser-issue-banner-z: 42;
$fullscreen-z: 2147483646;
$toast-z: 2147483647;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment