Skip to content

Commit f857189

Browse files
committed
add report for primeng
1 parent c83a374 commit f857189

14 files changed

+194
-37
lines changed

package.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,15 @@
66
"ng": "ng",
77
"start": "ng serve",
88
"ssr": "npm run build:universal && npm run server",
9+
"ssr:debug": "ng build --dev --aot=true --output-hashing=all --named-chunks=false --build-optimizer=true && ng build --dev --aot=true --output-hashing=all --named-chunks=false --build-optimizer=true --app 1 && webpack && node server.js",
910
"build": "ng build",
1011
"build:prod": "ng build --prod",
1112
"build:universal": "ng build --prod && ng build --prod --app 1 && webpack",
1213
"server": "node server.js",
1314
"test": "ng test",
1415
"lint": "ng lint",
1516
"e2e": "ng e2e",
16-
"universal": "ng build --prod && ng build --prod --app 1 && ts-node server",
17-
"client:watch": "ng build --watch --prod --aot",
18-
"server:watch": "ng build --app 1 --watch --prod --aot",
19-
"webpack:watch": "webpack --watch"
17+
"universal": "ng build --prod && ng build --prod --app 1 && ts-node server"
2018
},
2119
"private": true,
2220
"dependencies": {
@@ -74,4 +72,4 @@
7472
"tslint": "5.8.0",
7573
"typescript": "2.4.2"
7674
}
77-
}
75+
}

server.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ app.get('*', (req, res) => {
4444
global['navigator'] = req['headers']['user-agent'];
4545
global['CSS'] = null;
4646
// global['XMLHttpRequest'] = require('xmlhttprequest').XMLHttpRequest;
47+
global['Prism'] = null;
48+
4749
res.render('../dist/index', {
4850
req: req,
4951
res: res,

src/app/app.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<ul>
33
<li><a [routerLink]="['']" [routerLinkActive]="['router-link-active']">home</a></li>
44
<li><a [routerLink]="['/material']" [routerLinkActive]="['router-link-active']">material</a></li>
5-
<li><a [routerLink]="['/primeng']" [routerLinkActive]="['router-link-active']">primeng</a></li>
5+
<li><a [routerLink]="['/primeng/report']" [routerLinkActive]="['router-link-active']">primeng</a></li>
66
</ul>
77
</nav>
88
<router-outlet></router-outlet>

src/app/primengPage/components/notworking/notworking.module.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import { NgModule } from '@angular/core';
22
import { CommonModule } from '@angular/common';
33
import { NotworkingComponent } from './notworking.component';
4+
import { NotworkingRoutes } from './notworking.routing';
45

56
@NgModule({
67
imports: [
7-
CommonModule
8+
CommonModule,
9+
NotworkingRoutes
810
],
911
declarations: [NotworkingComponent]
1012
})
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { NotworkingComponent } from './notworking.component';
2+
import { Routes, RouterModule } from '@angular/router';
3+
4+
const routes: Routes = [
5+
{ path: '' , component: NotworkingComponent },
6+
];
7+
8+
export const NotworkingRoutes = RouterModule.forChild(routes);
Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import { Component, OnInit } from '@angular/core';
1+
import { Component, OnInit, Inject, PLATFORM_ID } from '@angular/core';
22
import { Message } from 'primeng/components/common/api';
3+
import { isPlatformBrowser } from '@angular/common';
34

45
@Component({
56
templateUrl: './progressbardemo.html'
@@ -11,15 +12,21 @@ export class ProgressBarDemo implements OnInit {
1112

1213
msgs: Message[];
1314

15+
constructor( @Inject(PLATFORM_ID) private platformId: Object) {
16+
17+
}
18+
1419
ngOnInit() {
15-
const interval = setInterval(() => {
16-
this.value = this.value + Math.floor(Math.random() * 10) + 1;
17-
if (this.value >= 100) {
18-
this.value = 100;
19-
this.msgs = [{ severity: 'info', summary: 'Success', detail: 'Process Completed' }];
20-
clearInterval(interval);
21-
}
22-
}, 2000);
20+
if (isPlatformBrowser(this.platformId)) {
21+
const interval = setInterval(() => {
22+
this.value = this.value + Math.floor(Math.random() * 10) + 1;
23+
if (this.value >= 100) {
24+
this.value = 100;
25+
this.msgs = [{ severity: 'info', summary: 'Success', detail: 'Process Completed' }];
26+
clearInterval(interval);
27+
}
28+
}, 2000);
29+
}
2330
}
2431

2532
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<div class="mar">
2+
<h2>Отчет:</h2>
3+
<p>
4+
<b>ok</b> - все работает без ошибок<br>
5+
<b>work</b> - значит работает, но с ошибками<br>
6+
<b>TypeError</b> - никак не работает<br>
7+
</p>
8+
не забываем перегружать страницу после перехода по ссылке для работы ssr
9+
</div>
10+
<br>
11+
<div class="mar">
12+
<div *ngFor="let report of reports">
13+
<a [routerLink]="['/primeng'+ report.link]">{{report.link}}</a> - {{report.desc}}
14+
<div *ngIf="report.error" class="error">
15+
{{report.error}}
16+
</div>
17+
<hr>
18+
</div>
19+
</div>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.mar {
2+
margin: 10px;
3+
}
4+
5+
.error {
6+
color: red;
7+
}
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
import { Component, OnInit } from '@angular/core';
2+
3+
@Component({
4+
selector: 'app-report-of-work',
5+
templateUrl: './report-of-work.component.html',
6+
styleUrls: ['./report-of-work.component.scss']
7+
})
8+
export class ReportOfWorkComponent implements OnInit {
9+
reports: Array<any>;
10+
constructor() {
11+
this.reports = [];
12+
this.reports.push({ link: '/setup', desc: 'ok' });
13+
this.reports.push({ link: '/theming', desc: 'ok' });
14+
this.reports.push({ link: '/accorsdion', desc: 'work', error: 'document.createElement is not a function' });
15+
this.reports.push({ link: '/autocomplete', desc: 'work', error: 'document.createElement is not a function' });
16+
this.reports.push({ link: '/blockui', desc: 'work', error: 'document.createElement is not a function' });
17+
this.reports.push({ link: '/breadcrumb', desc: 'ok' });
18+
this.reports.push({ link: '/button', desc: 'work', error: 'document.createElement is not a function' });
19+
this.reports.push({ link: '/calendar', desc: 'work', error: 'document.createElement is not a function' });
20+
this.reports.push({ link: '/captcha', desc: 'ok' });
21+
this.reports.push({ link: '/carousel', desc: 'no' });
22+
this.reports.push({ link: '/chart', desc: 'ok' });
23+
this.reports.push({ link: '/checkbox', desc: 'ok' });
24+
this.reports.push({ link: '/chips', desc: 'ok' });
25+
this.reports.push({ link: '/codehighlighter', desc: 'ok если использовать global[\'Prism\'] = null;' });
26+
this.reports.push({ link: '/colorpicker', desc: 'ok' });
27+
this.reports.push({ link: '/confirmdialog', desc: 'work', error: 'document.createElement is not a function' });
28+
// tslint:disable-next-line:max-line-length
29+
this.reports.push({ link: '/contextmenu', desc: 'work', error: 'No provider for ContextMenu' });
30+
this.reports.push({ link: '/datagrid', desc: 'ok' });
31+
this.reports.push({ link: '/datalist', desc: 'ok' });
32+
this.reports.push({ link: '/datascroller', desc: 'ok' });
33+
// tslint:disable-next-line:max-line-length
34+
this.reports.push({ link: '/datatable', desc: 'work', error: 'No provider for DataTable!' });
35+
this.reports.push({ link: '/defer', desc: 'work', error: 'this.el.nativeElement.getBoundingClientRect is not a function' });
36+
this.reports.push({ link: '/dialog', desc: 'work', error: 'document.createElement is not a function' });
37+
// tslint:disable-next-line:max-line-length
38+
this.reports.push({ link: '/dragdrop', desc: 'work', error: 'No provider for DataTable!' });
39+
this.reports.push({ link: '/dropdown', desc: 'ok' });
40+
this.reports.push({ link: '/editor', desc: 'bad', error: 'Quill is not defined' });
41+
this.reports.push({ link: '/fieldset', desc: 'ok' });
42+
this.reports.push({ link: '/fileupload', desc: 'work', error: 'document.createElement is not a function' });
43+
this.reports.push({ link: '/galleria', desc: 'work', error: 'getComputedStyle is not defined' });
44+
this.reports.push({ link: '/grid', desc: 'ok' });
45+
this.reports.push({ link: '/growl', desc: 'work', error: 'document.createElement is not a function' });
46+
// tslint:disable-next-line:max-line-length
47+
this.reports.push({ link: '/inplace', desc: 'work', error: 'No provider for DataTable' });
48+
this.reports.push({ link: '/inputmask', desc: 'ok' });
49+
this.reports.push({ link: '/inputswitch', desc: 'ok' });
50+
this.reports.push({ link: '/inputtext', desc: 'work', error: 'document.createElement is not a function' });
51+
this.reports.push({ link: '/inputgroup', desc: 'work', error: 'document.createElement is not a function' });
52+
this.reports.push({ link: '/inputtextarea', desc: 'ok' });
53+
this.reports.push({ link: '/lightbox', desc: 'ok' });
54+
this.reports.push({ link: '/listbox', desc: 'work', error: 'document.createElement is not a function' });
55+
this.reports.push({ link: '/megamenu', desc: 'ok' });
56+
// tslint:disable-next-line:max-line-length
57+
this.reports.push({ link: '/menu', desc: 'work', error: ' No provider for Menu!' });
58+
this.reports.push({ link: '/menubar', desc: 'work', error: 'document.createElement is not a function' });
59+
this.reports.push({ link: '/menumodel', desc: 'ok' });
60+
this.reports.push({ link: '/messages', desc: 'work', error: 'document.createElement is not a function' });
61+
this.reports.push({ link: '/multiselect', desc: 'ok' });
62+
this.reports.push({ link: '/orderlist', desc: 'work', error: 'document.createElement is not a function' });
63+
this.reports.push({ link: '/organizationchart', desc: 'work', error: 'No provider for OrganizationChart!' });
64+
this.reports.push({ link: '/overlaypanel', desc: 'work', error: ' No provider for DataTable!' });
65+
this.reports.push({ link: '/paginator', desc: 'work', error: 'getComputedStyle is not defined' });
66+
this.reports.push({ link: '/panel', desc: 'work', error: 'document.createElement is not a function' });
67+
this.reports.push({ link: '/panelmenu', desc: 'ok' });
68+
this.reports.push({
69+
link: '/password',
70+
desc: 'TypeError',
71+
error: 'Cannot read property \'removeChild\' of undefined at Password.ngOnDestroy'
72+
});
73+
this.reports.push({ link: '/picklist', desc: 'work', error: 'document.createElement is not a function' });
74+
this.reports.push({ link: '/progressbar', desc: 'ok'});
75+
this.reports.push({ link: '/progressspinner', desc: 'ok' });
76+
this.reports.push({ link: '/radiobutton', desc: 'ok', error: '' });
77+
this.reports.push({ link: '/rating', desc: 'ok', error: '' });
78+
this.reports.push({ link: '/responsive', desc: 'TypeError', error: 'Cannot read property \'removeChild\' of undefined' });
79+
this.reports.push({ link: '/rtl', desc: 'work', error: 'document.createElement is not a function' });
80+
this.reports.push({ link: '/schedule', desc: 'TypeError', error: 'jQuery is not defined' });
81+
this.reports.push({ link: '/selectbutton', desc: 'work', error: 'document.createElement is not a function' });
82+
this.reports.push({ link: '/sidebar', desc: 'work', error: 'document.createElement is not a function' });
83+
this.reports.push({ link: '/slidemenu', desc: 'work', error: 'No provider for SlideMenu!' });
84+
this.reports.push({ link: '/slider', desc: 'ok', error: '' });
85+
this.reports.push({ link: '/spinner', desc: 'ok', error: '' });
86+
this.reports.push({ link: '/splitbutton', desc: 'work', error: 'document.createElement is not a function' });
87+
this.reports.push({ link: '/steps', desc: 'ok', error: '' });
88+
this.reports.push({ link: '/support', desc: 'ok', error: '' });
89+
this.reports.push({ link: '/tabmenu', desc: 'ok', error: '' });
90+
this.reports.push({ link: '/tabview', desc: 'ok', error: '' });
91+
this.reports.push({ link: '/terminal', desc: 'ok', error: '' });
92+
this.reports.push({ link: '/tieredmenu', desc: 'work', error: 'document.createElement is not a function' });
93+
this.reports.push({ link: '/togglebutton', desc: 'ok', error: '' });
94+
this.reports.push({ link: '/toolbar', desc: 'work', error: 'document.createElement is not a function' });
95+
this.reports.push({ link: '/tooltip', desc: 'Event error build', error: 'Event is not defined' });
96+
this.reports.push({ link: '/tree', desc: 'work', error: 'No provider for ContextMenu' });
97+
this.reports.push({ link: '/treetable', desc: 'work', error: ' No provider for ContextMenu' });
98+
this.reports.push({ link: '/tristatecheckbox', desc: 'ok', error: '' });
99+
this.reports.push({ link: '/validation', desc: 'work', error: 'document.createElement is not a function' });
100+
}
101+
102+
ngOnInit() {
103+
}
104+
105+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { NgModule } from '@angular/core';
2+
import { CommonModule } from '@angular/common';
3+
import { ReportOfWorkComponent } from './report-of-work.component';
4+
import { ReportOfWorkRoutes } from './report-of-work.routing';
5+
6+
@NgModule({
7+
imports: [
8+
CommonModule,
9+
ReportOfWorkRoutes
10+
],
11+
declarations: [ReportOfWorkComponent],
12+
})
13+
export class ReportOfWorkModule { }

0 commit comments

Comments
 (0)