PWA Implementation

This commit is contained in:
venbatechnologies@gmail.com 2020-10-23 12:16:35 +05:30
parent 465f234635
commit 5ec65f4594
16 changed files with 1892 additions and 835 deletions

View File

@ -20,6 +20,7 @@
"src/assets", "src/assets",
"src/favicon.ico", "src/favicon.ico",
"src/firebase-messaging-sw.js", "src/firebase-messaging-sw.js",
"src/manifest.json",
"src/manifest.json" "src/manifest.json"
], ],
"styles": [ "styles": [
@ -63,7 +64,8 @@
"replace": "src/environments/environment.ts", "replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts" "with": "src/environments/environment.prod.ts"
} }
] ],
"serviceWorker": true
}, },
"staging": { "staging": {
"optimization": true, "optimization": true,
@ -77,17 +79,18 @@
"buildOptimizer": true, "buildOptimizer": true,
"fileReplacements": [ "fileReplacements": [
{ {
"replace": "src/environments/environment.ts", "replace": "src/environments/environment.ts",
"with": "src/environments/environment.stage.ts" "with": "src/environments/environment.stage.ts"
}] }
]
}, },
"test": "test": {
{
"fileReplacements": [ "fileReplacements": [
{ {
"replace": "src/environments/environment.ts", "replace": "src/environments/environment.ts",
"with": "src/environments/environment.stage.ts" "with": "src/environments/environment.stage.ts"
}] }
]
} }
} }
}, },
@ -100,7 +103,7 @@
"production": { "production": {
"browserTarget": "optima:build:production" "browserTarget": "optima:build:production"
}, },
"test":{ "test": {
"browserTarget": "optima:build:test" "browserTarget": "optima:build:test"
} }
} }
@ -144,7 +147,8 @@
], ],
"assets": [ "assets": [
"src/assets", "src/assets",
"src/favicon.ico" "src/favicon.ico",
"src/manifest.json"
] ]
} }
}, },

26
ng6-seed/ngsw-config.json Normal file
View File

@ -0,0 +1,26 @@
{
"index": "/index.html",
"assetGroups": [
{
"name": "app",
"installMode": "prefetch",
"resources": {
"files": [
"/favicon.ico",
"/index.html",
"/*.css",
"/*.js"
]
}
}, {
"name": "assets",
"installMode": "lazy",
"updateMode": "prefetch",
"resources": {
"files": [
"/assets/**"
]
}
}
]
}

File diff suppressed because it is too large Load Diff

View File

@ -27,7 +27,9 @@
"@angular/material-moment-adapter": "^6.0.0-rc.5", "@angular/material-moment-adapter": "^6.0.0-rc.5",
"@angular/platform-browser": "^6.1.10", "@angular/platform-browser": "^6.1.10",
"@angular/platform-browser-dynamic": "^6.1.10", "@angular/platform-browser-dynamic": "^6.1.10",
"@angular/pwa": "^0.1001.7",
"@angular/router": "^6.1.10", "@angular/router": "^6.1.10",
"@angular/service-worker": "^6.1.10",
"@ngx-translate/core": "^10.0.2", "@ngx-translate/core": "^10.0.2",
"@ngx-translate/http-loader": "^3.0.1", "@ngx-translate/http-loader": "^3.0.1",
"@swimlane/ngx-charts": "^7.0.1", "@swimlane/ngx-charts": "^7.0.1",
@ -47,7 +49,7 @@
"font-awesome": "4.7.0", "font-awesome": "4.7.0",
"hammerjs": "2.0.8", "hammerjs": "2.0.8",
"intl": "^1.2.4", "intl": "^1.2.4",
"jquery": "^3.4.1", "jquery": "^3.5.1",
"karma-jasmine": "^1.1.1", "karma-jasmine": "^1.1.1",
"leaflet": "^1.4.0", "leaflet": "^1.4.0",
"moment": "^2.24.0", "moment": "^2.24.0",
@ -64,9 +66,9 @@
"ngx-mat-select-search": "^1.8.0", "ngx-mat-select-search": "^1.8.0",
"ngx-perfect-scrollbar": "5.0.0-7", "ngx-perfect-scrollbar": "5.0.0-7",
"ngx-viewer": "^1.0.1", "ngx-viewer": "^1.0.1",
"node-sass": "^4.12.0", "node-sass": "^4.14.1",
"perfect-scrollbar": "^1.3.0", "perfect-scrollbar": "^1.3.0",
"quill": "^1.2.0", "quill": "^1.3.7",
"rxjs": "^6.5.1", "rxjs": "^6.5.1",
"rxjs-compat": "^6.5.1", "rxjs-compat": "^6.5.1",
"screenfull": "^3.2.2", "screenfull": "^3.2.2",

View File

@ -1,6 +1,6 @@
import { BrowserModule } from '@angular/platform-browser'; import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { RouterModule } from '@angular/router'; import { PreloadAllModules, RouterModule } from '@angular/router';
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { HttpModule, Http } from '@angular/http'; import { HttpModule, Http } from '@angular/http';
@ -49,6 +49,8 @@ import { PdTrigerService } from './personal-discussion/pd-service/pd-triger.serv
import { LoaderService } from './shared/loaderService/loader.service'; import { LoaderService } from './shared/loaderService/loader.service';
import { HttpLoaderComponent } from './layouts/http-loader/http-loader.component'; import { HttpLoaderComponent } from './layouts/http-loader/http-loader.component';
import { AdvanceFilterComponent } from './sales-pd/advance-filter/advance-filter.component'; import { AdvanceFilterComponent } from './sales-pd/advance-filter/advance-filter.component';
import { ServiceWorkerModule } from '@angular/service-worker';
import { environment } from '../environments/environment';
export function HttpLoaderFactory(http: HttpClient) { export function HttpLoaderFactory(http: HttpClient) {
return new TranslateHttpLoader(http); return new TranslateHttpLoader(http);
} }
@ -57,9 +59,9 @@ export function createTranslateLoader(http: HttpClient) {
return new TranslateHttpLoader(http, './assets/i18n/', '.json'); return new TranslateHttpLoader(http, './assets/i18n/', '.json');
} }
const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = { // const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = {
suppressScrollX: true // suppressScrollX: true
}; // };
@NgModule({ @NgModule({
declarations: [ declarations: [
@ -75,7 +77,7 @@ const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = {
BrowserModule, BrowserModule,
BrowserAnimationsModule, BrowserAnimationsModule,
SharedModule, SharedModule,
RouterModule.forRoot(AppRoutes), RouterModule.forRoot(AppRoutes,{preloadingStrategy:PreloadAllModules}),
FormsModule, FormsModule,
HttpModule, HttpModule,
MatSidenavModule, MatSidenavModule,
@ -104,6 +106,7 @@ const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = {
} }
}), }),
FlexLayoutModule, FlexLayoutModule,
ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production }),
], ],
providers: [ providers: [
{ {

View File

@ -13,22 +13,23 @@ export const AppRoutes: Routes = [{
path: '', path: '',
component: AdminLayoutComponent, component: AdminLayoutComponent,
canActivateChild:[AuthGuard], canActivateChild:[AuthGuard],
children: [{ children: [
path: 'home', // {
loadChildren: './dashboard/dashboard.module#DashboardModule' // path: 'home',
},{ // loadChildren: './dashboard/dashboard.module#DashboardModule'
path:'setting', // },{
loadChildren:'./settings/settings.module#SettingsModule' // path:'setting',
} // loadChildren:'./settings/settings.module#SettingsModule'
, // }
// ,
{ {
path:'personal_discussion', path:'personal_discussion',
loadChildren:'./personal-discussion/personal-discussion.module#PersonalDiscussionModule' loadChildren:'./personal-discussion/personal-discussion.module#PersonalDiscussionModule'
}, },
{ // {
path:'quality_check_discussion', // path:'quality_check_discussion',
loadChildren:'./quality-check/quality-check.module#QualityCheckModule' // loadChildren:'./quality-check/quality-check.module#QualityCheckModule'
}, // },
{ {
path:'sales-pd-list', path:'sales-pd-list',
component:SalesPdComponent component:SalesPdComponent
@ -37,10 +38,10 @@ export const AppRoutes: Routes = [{
path:'credit_pd', path:'credit_pd',
loadChildren:'./lender-credit-pd/lender-credit-pd.module#LenderCreditPdModule' loadChildren:'./lender-credit-pd/lender-credit-pd.module#LenderCreditPdModule'
}, },
{ // {
path:'reports', // path:'reports',
loadChildren:'./reports/reports.module#ReportsModule' // loadChildren:'./reports/reports.module#ReportsModule'
}, // },
] ]
}, { }, {
path: '', path: '',

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 792 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 958 B

View File

@ -150,6 +150,8 @@
<link rel="stylesheet" href="assets/wheather-icon/css/weather-icons.min.css" /> <link rel="stylesheet" href="assets/wheather-icon/css/weather-icons.min.css" />
<!-- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.5/css/materialize.min.css">--> <!-- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.5/css/materialize.min.css">-->
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,700|Material+Icons" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,700|Material+Icons" rel="stylesheet">
<link rel="manifest" href="manifest.json">
<meta name="theme-color" content="#1976d2">
</head> </head>
<body> <body>
@ -168,6 +170,7 @@
</div> </div>
</div> </div>
</app-root> </app-root>
<noscript>Please enable JavaScript to continue using this application.</noscript>
</body> </body>
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/js/materialize.min.js"></script> --> <!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/js/materialize.min.js"></script> -->

View File

@ -0,0 +1,51 @@
{
"name": "optima",
"short_name": "optima",
"theme_color": "#1976d2",
"background_color": "#fafafa",
"display": "standalone",
"scope": "/",
"start_url": "/",
"icons": [
{
"src": "assets/icons/icon-72x72.png",
"sizes": "72x72",
"type": "image/png"
},
{
"src": "assets/icons/icon-96x96.png",
"sizes": "96x96",
"type": "image/png"
},
{
"src": "assets/icons/icon-128x128.png",
"sizes": "128x128",
"type": "image/png"
},
{
"src": "assets/icons/icon-144x144.png",
"sizes": "144x144",
"type": "image/png"
},
{
"src": "assets/icons/icon-152x152.png",
"sizes": "152x152",
"type": "image/png"
},
{
"src": "assets/icons/icon-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "assets/icons/icon-384x384.png",
"sizes": "384x384",
"type": "image/png"
},
{
"src": "assets/icons/icon-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
]
}