diff --git a/angular.json b/angular.json index c136d6e..5bf4787 100644 --- a/angular.json +++ b/angular.json @@ -3,7 +3,7 @@ "version": 1, "newProjectRoot": "projects", "projects": { - "socket-app": { + "greenvironment": { "root": "", "sourceRoot": "src", "projectType": "application", @@ -17,14 +17,15 @@ "build": { "builder": "@angular-devkit/build-angular:browser", "options": { - "outputPath": "dist/socket-app", + "outputPath": "dist/greenvironment", "index": "src/index.html", "main": "src/main.ts", "polyfills": "src/polyfills.ts", "tsConfig": "src/tsconfig.app.json", "assets": [ "src/favicon.ico", - "src/assets" + "src/assets", + "src/manifest.webmanifest" ], "styles": [ "src/styles/greenvironment-material-theme.scss", @@ -55,25 +56,27 @@ "maximumWarning": "2mb", "maximumError": "5mb" } - ] + ], + "serviceWorker": true, + "ngswConfigPath": "ngsw-config.json" } } }, "serve": { "builder": "@angular-devkit/build-angular:dev-server", "options": { - "browserTarget": "socket-app:build" + "browserTarget": "greenvironment:build" }, "configurations": { "production": { - "browserTarget": "socket-app:build:production" + "browserTarget": "greenvironment:build:production" } } }, "extract-i18n": { "builder": "@angular-devkit/build-angular:extract-i18n", "options": { - "browserTarget": "socket-app:build" + "browserTarget": "greenvironment:build" } }, "test": { @@ -90,7 +93,8 @@ "scripts": [], "assets": [ "src/favicon.ico", - "src/assets" + "src/assets", + "src/manifest.webmanifest" ] } }, @@ -108,7 +112,7 @@ } } }, - "socket-app-e2e": { + "greenvironment-e2e": { "root": "e2e/", "projectType": "application", "prefix": "", @@ -117,11 +121,11 @@ "builder": "@angular-devkit/build-angular:protractor", "options": { "protractorConfig": "e2e/protractor.conf.js", - "devServerTarget": "socket-app:serve" + "devServerTarget": "greenvironment:serve" }, "configurations": { "production": { - "devServerTarget": "socket-app:serve:production" + "devServerTarget": "greenvironment:serve:production" } } }, @@ -137,5 +141,5 @@ } } }, - "defaultProject": "socket-app" -} \ No newline at end of file + "defaultProject": "greenvironment" +} diff --git a/e2e/src/app.e2e-spec.ts b/e2e/src/app.e2e-spec.ts index 22f7cd7..b4f721a 100644 --- a/e2e/src/app.e2e-spec.ts +++ b/e2e/src/app.e2e-spec.ts @@ -9,6 +9,6 @@ describe('workspace-project App', () => { it('should display welcome message', () => { page.navigateTo(); - expect(page.getParagraphText()).toEqual('Welcome to socket-app!'); + expect(page.getParagraphText()).toEqual('Welcome to greenvironment!'); }); }); diff --git a/ngsw-config.json b/ngsw-config.json new file mode 100644 index 0000000..4ddf1a7 --- /dev/null +++ b/ngsw-config.json @@ -0,0 +1,29 @@ +{ + "$schema": "./node_modules/@angular/service-worker/config/schema.json", + "index": "/index.html", + "assetGroups": [ + { + "name": "app", + "installMode": "prefetch", + "resources": { + "files": [ + "/favicon.ico", + "/index.html", + "/manifest.webmanifest", + "/*.css", + "/*.js" + ] + } + }, { + "name": "assets", + "installMode": "lazy", + "updateMode": "prefetch", + "resources": { + "files": [ + "/assets/**", + "/*.(eot|svg|cur|jpg|png|webp|gif|otf|ttf|woff|woff2|ani)" + ] + } + } + ] +} diff --git a/package-lock.json b/package-lock.json index 60fde46..e0e0d51 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "socket-app", + "name": "greenvironment", "version": "0.0.0", "lockfileVersion": 1, "requires": true, @@ -607,6 +607,14 @@ "tslib": "^1.9.0" } }, + "@angular/service-worker": { + "version": "8.2.14", + "resolved": "https://registry.npmjs.org/@angular/service-worker/-/service-worker-8.2.14.tgz", + "integrity": "sha512-Xv1ES5bXDRxPJ5uyRqeKw6mGKaJVzKK0oFcR0mr4OSdyLXGZ+x6fC2S/QcLy4ugpb64fyEksrnHhHjeMVzGh2Q==", + "requires": { + "tslib": "^1.9.0" + } + }, "@babel/code-frame": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", diff --git a/package.json b/package.json index 162d32b..a12f028 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "socket-app", + "name": "greenvironment", "version": "0.0.0", "scripts": { "ng": "ng", @@ -23,6 +23,7 @@ "@angular/platform-browser": "8.2.14", "@angular/platform-browser-dynamic": "^8.2.14", "@angular/router": "~8.2.14", + "@angular/service-worker": "^8.2.14", "apollo-angular": "^1.8.0", "apollo-angular-link-http": "^1.9.0", "apollo-cache-inmemory": "^1.6.5", diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts index c38ca0a..9da27bb 100644 --- a/src/app/app.component.spec.ts +++ b/src/app/app.component.spec.ts @@ -16,16 +16,16 @@ describe('AppComponent', () => { expect(app).toBeTruthy(); }); - it(`should have as title 'socket-app'`, () => { + it(`should have as title 'greenvironment'`, () => { const fixture = TestBed.createComponent(AppComponent); const app = fixture.debugElement.componentInstance; - expect(app.title).toEqual('socket-app'); + expect(app.title).toEqual('greenvironment'); }); it('should render title in a h1 tag', () => { const fixture = TestBed.createComponent(AppComponent); fixture.detectChanges(); const compiled = fixture.debugElement.nativeElement; - expect(compiled.querySelector('h1').textContent).toContain('Welcome to socket-app!'); + expect(compiled.querySelector('h1').textContent).toContain('Welcome to greenvironment!'); }); }); diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 6a32cee..73b2909 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -20,7 +20,6 @@ import {DialogCreateEventComponent, GroupComponent} from './components/group/gro import {ChatmanagerComponent} from './components/chatmanager/chatmanager.component'; import {ChatlistComponent} from './components/chatlist/chatlist.component'; import {PostlistComponent} from './components/feed/postlist/postlist.component'; -import {GraphQLModule} from './graphql.module'; import {HttpClientModule} from '@angular/common/http'; import {ProfileComponent} from './components/profile/profile.component'; import {ImprintComponent} from './components/imprint/imprint.component'; @@ -63,6 +62,8 @@ import {MatDatepickerModule} from '@angular/material/datepicker'; import {MatNativeDateModule, MatProgressBarModule} from '@angular/material/'; import {MatSnackBarModule} from '@angular/material/snack-bar'; import {DialogFileUploadComponent} from './components/profile/fileUpload/fileUpload.component'; +import { ServiceWorkerModule } from '@angular/service-worker'; +import { environment } from '../environments/environment'; const config: SocketIoConfig = {url: 'http://localhost:4444', options: {}}; @@ -110,7 +111,6 @@ const appRoutes: Routes = [ FormsModule, HttpModule, SocketIoModule.forRoot(config), - GraphQLModule, HttpClientModule, InfiniteScrollModule, MatDatepickerModule, @@ -149,6 +149,7 @@ const appRoutes: Routes = [ MatDatepickerModule, MatSnackBarModule, MatProgressBarModule, + ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production }), ], entryComponents: [ DialogCreateGroupComponent, diff --git a/src/app/components/profile/fileUpload/fileUploadDialog.component.html b/src/app/components/profile/fileUpload/fileUploadDialog.component.html index 3ed10fd..cc54317 100644 --- a/src/app/components/profile/fileUpload/fileUploadDialog.component.html +++ b/src/app/components/profile/fileUpload/fileUploadDialog.component.html @@ -1,5 +1,5 @@
-

Upload a new Profile picture!

+

Upload a new Profile Picture!

diff --git a/src/app/graphql.module.ts b/src/app/graphql.module.ts deleted file mode 100644 index 113f535..0000000 --- a/src/app/graphql.module.ts +++ /dev/null @@ -1,27 +0,0 @@ -import {NgModule} from '@angular/core'; -import {APOLLO_OPTIONS, ApolloModule} from 'apollo-angular'; -import {HttpLink, HttpLinkModule} from 'apollo-angular-link-http'; -import {InMemoryCache} from 'apollo-cache-inmemory'; - -const uri = 'https://o5x5jzoo7z.sse.codesandbox.io/graphql'; - -// 'https://greenvironment.net/graphql:443'; // <-- add the URL of the GraphQL server here -export function createApollo(httpLink: HttpLink) { - return { - link: httpLink.create({uri}), - cache: new InMemoryCache(), - }; -} - -@NgModule({ - exports: [ApolloModule, HttpLinkModule], - providers: [ - { - provide: APOLLO_OPTIONS, - useFactory: createApollo, - deps: [HttpLink], - }, - ], -}) -export class GraphQLModule { -} diff --git a/src/assets/icons/favicon.ico b/src/assets/icons/favicon.ico new file mode 100755 index 0000000..ab70824 Binary files /dev/null and b/src/assets/icons/favicon.ico differ diff --git a/src/assets/icons/icon-128x128.png b/src/assets/icons/icon-128x128.png new file mode 100755 index 0000000..60762e8 Binary files /dev/null and b/src/assets/icons/icon-128x128.png differ diff --git a/src/assets/icons/icon-144x144.png b/src/assets/icons/icon-144x144.png new file mode 100755 index 0000000..c7fbdae Binary files /dev/null and b/src/assets/icons/icon-144x144.png differ diff --git a/src/assets/icons/icon-152x152.png b/src/assets/icons/icon-152x152.png new file mode 100755 index 0000000..9efdeda Binary files /dev/null and b/src/assets/icons/icon-152x152.png differ diff --git a/src/assets/icons/icon-192x192.png b/src/assets/icons/icon-192x192.png new file mode 100755 index 0000000..6d21b22 Binary files /dev/null and b/src/assets/icons/icon-192x192.png differ diff --git a/src/assets/icons/icon-384x384.png b/src/assets/icons/icon-384x384.png new file mode 100755 index 0000000..4fc2d5f Binary files /dev/null and b/src/assets/icons/icon-384x384.png differ diff --git a/src/assets/icons/icon-512x512.png b/src/assets/icons/icon-512x512.png new file mode 100755 index 0000000..2ae0d33 Binary files /dev/null and b/src/assets/icons/icon-512x512.png differ diff --git a/src/assets/icons/icon-72x72.png b/src/assets/icons/icon-72x72.png new file mode 100755 index 0000000..d2e038b Binary files /dev/null and b/src/assets/icons/icon-72x72.png differ diff --git a/src/assets/icons/icon-96x96.png b/src/assets/icons/icon-96x96.png new file mode 100755 index 0000000..88fbfde Binary files /dev/null and b/src/assets/icons/icon-96x96.png differ diff --git a/src/favicon.ico b/src/favicon.ico index 279b7a9..ab70824 100755 Binary files a/src/favicon.ico and b/src/favicon.ico differ diff --git a/src/index.html b/src/index.html index 24372da..e12f86a 100644 --- a/src/index.html +++ b/src/index.html @@ -7,10 +7,13 @@ - + + + + diff --git a/src/manifest.webmanifest b/src/manifest.webmanifest new file mode 100644 index 0000000..e659809 --- /dev/null +++ b/src/manifest.webmanifest @@ -0,0 +1,51 @@ +{ + "name": "greenvironment", + "short_name": "greenvironment", + "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" + } + ] +} \ No newline at end of file