Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Branch cleanup.
Import from primeng/api
Remove quill, chart.js
Move node service to correct directory.
  • Loading branch information
dds14002 committed Feb 17, 2020
1 parent 20d2167 commit 26f3a46
Show file tree
Hide file tree
Showing 9 changed files with 404 additions and 320 deletions.
653 changes: 374 additions & 279 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 4 additions & 6 deletions package.json
Expand Up @@ -27,18 +27,16 @@
"@angular/platform-browser-dynamic": "~8.2.14",
"@angular/router": "~8.2.14",
"bootstrap": "^4.4.1",
"chart.js": "^2.9.3",
"jquery": "^3.4.1",
"primeicons": "^2.0.0",
"primeng": "^8.1.1",
"quill": "^1.3.7",
"rxjs": "~6.4.0",
"tslib": "^1.10.0",
"zone.js": "~0.9.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.803.23",
"@angular/cli": "~8.3.23",
"@angular-devkit/build-angular": "~0.803.25",
"@angular/cli": "~8.3.25",
"@angular/compiler-cli": "~8.2.14",
"@angular/language-service": "~8.2.14",
"@types/node": "~8.9.4",
Expand All @@ -51,8 +49,8 @@
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.4.0",
"protractor": "~5.4.0",
"karma-jasmine-html-reporter": "^1.5.2",
"protractor": "~5.4.3",
"ts-node": "~7.0.0",
"tslint": "~5.15.0",
"typescript": "~3.5.3"
Expand Down
28 changes: 14 additions & 14 deletions src/app/app.component.ts
Expand Up @@ -17,20 +17,20 @@ export class AppComponent implements OnInit {

ngOnInit() {
// Example usage of resource service.
this.resourceService.getResourceStandard('test.txt', 'text').toPromise().then(val => console.log('Test file', val))
.catch(err => console.log(err));
this.resourceService.getResourcePDF('radar.pdf').toPromise().then(val => {
console.log('Radar pdf', val);
const file = new Blob([val], { type: 'application/pdf' });
const url = URL.createObjectURL(file);
console.log('PDF Viewable at', url);
console.log('Adblock prevents it from opening');
// window.open(url);
})
.catch((err: HttpErrorResponse) => {
console.log('Error occurred with status value', err.status);
console.log(err);
});
// this.resourceService.getResourceStandard('test.txt', 'text').toPromise().then(val => console.log('Test file', val))
// .catch(err => console.log(err));
// this.resourceService.getResourcePDF('radar.pdf').toPromise().then(val => {
// console.log('Radar pdf', val);
// const file = new Blob([val], { type: 'application/pdf' });
// const url = URL.createObjectURL(file);
// console.log('PDF Viewable at', url);
// console.log('Adblock prevents it from opening');
// // window.open(url);
// })
// .catch((err: HttpErrorResponse) => {
// console.log('Error occurred with status value', err.status);
// console.log(err);
// });
}

}
5 changes: 2 additions & 3 deletions src/app/app.module.ts
Expand Up @@ -3,8 +3,8 @@ import { NgModule } from '@angular/core';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { ButtonModule, MessageService, TreeModule } from 'primeng/primeng';
import { HttpClientModule } from '@angular/common/http';
import { TreeModule } from 'primeng/tree';
import { MainComponent } from './main/main.component';
import { MainCenterComponent } from './main/main-center/main-center.component';
import { TreeComponent } from './main/tree/tree.component';
Expand All @@ -15,8 +15,7 @@ import { TreeComponent } from './main/tree/tree.component';
BrowserModule,
AppRoutingModule,
TreeModule,
HttpClientModule,
ButtonModule
HttpClientModule
],
providers: [],
bootstrap: [AppComponent]
Expand Down
1 change: 0 additions & 1 deletion src/app/main/main-center/main-center.component.html
@@ -1,4 +1,3 @@

<ng-container *ngIf="this.currentNode != null; else noNode">
<div class="d-flex h-100 flex-column">
<h1 class="ml-2">{{this.currentNode.label}}</h1>
Expand Down
2 changes: 1 addition & 1 deletion src/app/main/tree/tree.component.ts
@@ -1,6 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { TreeNode } from 'primeng/api';
import { NodeService } from 'src/app/node.service';
import { NodeService } from 'src/app/services/node.service';
import { TreeService } from 'src/app/services/tree.service';

@Component({
Expand Down
12 changes: 0 additions & 12 deletions src/app/node.service.spec.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/app/services/api/api.service.ts
@@ -1,4 +1,4 @@
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { HttpClient } from '@angular/common/http';
import { environment } from 'src/environments/environment';

export class APIService {
Expand Down
11 changes: 8 additions & 3 deletions src/app/node.service.ts → src/app/services/node.service.ts
Expand Up @@ -3,12 +3,17 @@ import { Injectable } from '@angular/core';

import { TreeNode } from 'primeng/api';

@Injectable({ providedIn: 'root' })
@Injectable({
providedIn: 'root'
})
export class NodeService {

constructor(private http: HttpClient) { }
constructor(
private http: HttpClient
) { }

async getFiles() {
return (await this.http.get<any>('http://localhost:4200/assets/files.json').toPromise()).data as TreeNode[];
return (await this.http.get<any>('assets/files.json').toPromise()).data as TreeNode[];
}

}

0 comments on commit 26f3a46

Please sign in to comment.