Verified Commit 50c5aa95 authored by uncol's avatar uncol
Browse files

add logo, move fonts

parent e23fbf65
Pipeline #20945 passed with stages
in 9 minutes and 40 seconds
{
"name": "noc-ngrx",
"name": "noc-ui",
"version": "0.0.0",
"scripts": {
"ng": "ng",
......
This diff is collapsed.
import { TestBed, async } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { AppComponent } from './app.component';
describe('AppComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
RouterTestingModule
],
declarations: [
AppComponent
],
}).compileComponents();
}));
it('should create the app', () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app).toBeTruthy();
});
it(`should have as title 'noc-ui'`, () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app.title).toEqual('noc-ui');
});
it('should render title', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.nativeElement;
expect(compiled.querySelector('.content span').textContent).toContain('noc-ui app is running!');
});
});
import { Component } from '@angular/core';
import { ClrCommonStringsService } from '@clr/angular';
import { ExtJSResponse, MoService, Pending } from './services/mo.service';
@Component({
selector: 'noc-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
readonly response$: Pending<ExtJSResponse>;
title = 'noc-ui';
collapsed = true;
constructor(
dataService: MoService,
public commonStrings: ClrCommonStringsService
) {
this.response$ = dataService.loadMO();
}
}
......@@ -6,9 +6,12 @@ import { VerticalNavItem } from '../models';
template: `
<clr-header class="header-6">
<div class="branding">
<a href="#" class="nav-link">
<clr-icon shape="vm-bug"></clr-icon>
<span class="title">Clarity-NOC</span>
<a href="/" class="nav-link">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500" height="36px">
<path fill="white"
d="M120 500 L0 380 H45 V75 A75 75 0 0 1 180 30 L305 197 V120 H259 L380
0 L500 120 H455 V425 A75 75 0 0 1 319 469 L195 302 L195 380 H241 Z"/>
</svg>
</a>
</div>
<div class="header-nav" *ngIf="headerLoading">
......
import { TestBed } from '@angular/core/testing';
import { MoService } from './mo.service';
describe('MoService', () => {
let service: MoService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(MoService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { defer, Observable, ReplaySubject } from 'rxjs';
import { catchError, retry, tap } from 'rxjs/operators';
export interface ExtJSResponse {
total: number;
success: boolean;
data: any[];
}
export interface Pending<T> {
data: Observable<T>;
status: Observable<Status>;
}
export enum Status {
LOADING = 'LOADING',
SUCCESS = 'SUCCESS',
ERROR = 'ERROR'
}
@Injectable({
providedIn: 'root'
})
export class MoService {
constructor(private httpClient: HttpClient) {
}
loadMO(): Pending<ExtJSResponse> {
const status = new ReplaySubject<Status>();
const request = this.httpClient
.get<ExtJSResponse>('assets/data/ui_ext_output.json')
.pipe(
retry(2),
catchError(error => {
status.next(Status.ERROR);
throw new Error(`error loading data: ${error.message}`);
}),
tap(() => status.next(Status.SUCCESS))
);
const data = defer(() => {
// Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked.
// Previous value: 'undefined'. Current value: 'LOADING'.
// status.next(Status.LOADING);
return request;
});
return {data, status};
}
}
Supports Markdown
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