From ad1ab6ecd27e7ac0fd51341ae4d4fa382b973639 Mon Sep 17 00:00:00 2001 From: lampe_n1 Date: Tue, 15 Oct 2019 13:20:31 +0200 Subject: [PATCH] Merged Niklas and Max into Master --- package-lock.json | 170 +++++++++++++++++- package.json | 9 +- src/app/app.component.html | 1 + src/app/app.component.sass | 36 ++++ src/app/app.component.spec.ts | 31 ++++ src/app/app.component.ts | 12 ++ src/app/app.module.ts | 75 ++++++++ src/app/components/about/about.component.html | 9 + src/app/components/about/about.component.sass | 17 ++ .../components/about/about.component.spec.ts | 25 +++ src/app/components/about/about.component.ts | 15 ++ .../app-scaffold/app-scaffold.component.html | 16 ++ .../app-scaffold/app-scaffold.component.sass | 64 +++++++ .../app-scaffold.component.spec.ts | 25 +++ .../app-scaffold/app-scaffold.component.ts | 15 ++ src/app/components/chat/chat.component.html | 16 ++ src/app/components/chat/chat.component.sass | 83 +++++++++ .../components/chat/chat.component.spec.ts | 25 +++ src/app/components/chat/chat.component.ts | 28 +++ .../chatlist/chatlist.component.html | 14 ++ .../chatlist/chatlist.component.sass | 72 ++++++++ .../chatlist/chatlist.component.spec.ts | 25 +++ .../components/chatlist/chatlist.component.ts | 32 ++++ .../chatmanager/chatmanager.component.html | 6 + .../chatmanager/chatmanager.component.sass | 6 + .../chatmanager/chatmanager.component.spec.ts | 25 +++ .../chatmanager/chatmanager.component.ts | 33 ++++ .../document-list.component.html | 4 + .../document-list.component.scss | 24 +++ .../document-list.component.spec.ts | 25 +++ .../document-list/document-list.component.ts | 35 ++++ .../document/document.component.html | 1 + .../document/document.component.scss | 12 ++ .../document/document.component.spec.ts | 25 +++ .../components/document/document.component.ts | 30 ++++ src/app/components/feed/feed.component.html | 40 +++++ src/app/components/feed/feed.component.sass | 73 ++++++++ .../components/feed/feed.component.spec.ts | 25 +++ src/app/components/feed/feed.component.ts | 50 ++++++ .../feed/postlist/postlist.component.html | 19 ++ .../feed/postlist/postlist.component.sass | 58 ++++++ .../feed/postlist/postlist.component.spec.ts | 25 +++ .../feed/postlist/postlist.component.ts | 18 ++ src/app/components/home/home.component.html | 6 + src/app/components/home/home.component.sass | 31 ++++ .../components/home/home.component.spec.ts | 25 +++ src/app/components/home/home.component.ts | 15 ++ .../components/imprint/imprint.component.html | 8 + .../components/imprint/imprint.component.sass | 17 ++ .../imprint/imprint.component.spec.ts | 25 +++ .../components/imprint/imprint.component.ts | 15 ++ src/app/components/login/login.component.html | 17 ++ src/app/components/login/login.component.sass | 18 ++ src/app/components/login/login.component.scss | 0 .../components/login/login.component.spec.ts | 25 +++ src/app/components/login/login.component.ts | 15 ++ .../components/profile/profile.component.html | 4 + .../components/profile/profile.component.sass | 25 +++ .../profile/profile.component.spec.ts | 25 +++ .../components/profile/profile.component.ts | 15 ++ .../register/register.component.html | 25 +++ .../register/register.component.sass | 20 +++ .../register/register.component.spec.ts | 25 +++ .../components/register/register.component.ts | 34 ++++ .../social/friends/friends.component.html | 10 ++ .../social/friends/friends.component.sass | 24 +++ .../social/friends/friends.component.spec.ts | 25 +++ .../social/friends/friends.component.ts | 15 ++ .../social/groups/groups.component.html | 10 ++ .../social/groups/groups.component.sass | 24 +++ .../social/groups/groups.component.spec.ts | 25 +++ .../social/groups/groups.component.ts | 15 ++ .../components/social/social.component.html | 2 + .../components/social/social.component.sass | 44 +++++ .../social/social.component.spec.ts | 25 +++ src/app/components/social/social.component.ts | 15 ++ src/app/graphql.module.ts | 25 +++ src/app/models/chatinfo.ts | 9 + src/app/models/chatmessage.ts | 9 + src/app/models/document.ts | 4 + src/app/models/post.ts | 17 ++ src/app/models/registration.ts | 5 + src/app/services/chat/chat.service.spec.ts | 12 ++ src/app/services/chat/chat.service.ts | 59 ++++++ src/app/services/document.service.spec.ts | 12 ++ src/app/services/document.service.ts | 38 ++++ src/app/services/login/login.service.spec.ts | 12 ++ src/app/services/login/login.service.ts | 9 + .../register/register.service.spec.ts | 12 ++ src/app/services/register/register.service.ts | 34 ++++ src/assets/.gitkeep | 0 src/browserslist | 11 ++ src/environments/environment.prod.ts | 3 + src/environments/environment.ts | 16 ++ src/favicon.ico | Bin 0 -> 5430 bytes src/index.html | 14 ++ src/karma.conf.js | 31 ++++ src/main.ts | 13 ++ src/polyfills.ts | 82 +++++++++ src/styles.sass | 10 ++ src/styles/mixins.sass | 5 + src/styles/vars.sass | 27 +++ src/test.ts | 20 +++ src/tsconfig.app.json | 11 ++ src/tsconfig.spec.json | 18 ++ src/tslint.json | 17 ++ tsconfig.json | 5 +- 107 files changed, 2508 insertions(+), 5 deletions(-) create mode 100644 src/app/app.component.html create mode 100644 src/app/app.component.sass create mode 100644 src/app/app.component.spec.ts create mode 100644 src/app/app.component.ts create mode 100644 src/app/app.module.ts create mode 100644 src/app/components/about/about.component.html create mode 100644 src/app/components/about/about.component.sass create mode 100644 src/app/components/about/about.component.spec.ts create mode 100644 src/app/components/about/about.component.ts create mode 100644 src/app/components/app-scaffold/app-scaffold.component.html create mode 100644 src/app/components/app-scaffold/app-scaffold.component.sass create mode 100644 src/app/components/app-scaffold/app-scaffold.component.spec.ts create mode 100644 src/app/components/app-scaffold/app-scaffold.component.ts create mode 100644 src/app/components/chat/chat.component.html create mode 100644 src/app/components/chat/chat.component.sass create mode 100644 src/app/components/chat/chat.component.spec.ts create mode 100644 src/app/components/chat/chat.component.ts create mode 100644 src/app/components/chatlist/chatlist.component.html create mode 100644 src/app/components/chatlist/chatlist.component.sass create mode 100644 src/app/components/chatlist/chatlist.component.spec.ts create mode 100644 src/app/components/chatlist/chatlist.component.ts create mode 100644 src/app/components/chatmanager/chatmanager.component.html create mode 100644 src/app/components/chatmanager/chatmanager.component.sass create mode 100644 src/app/components/chatmanager/chatmanager.component.spec.ts create mode 100644 src/app/components/chatmanager/chatmanager.component.ts create mode 100644 src/app/components/document-list/document-list.component.html create mode 100644 src/app/components/document-list/document-list.component.scss create mode 100644 src/app/components/document-list/document-list.component.spec.ts create mode 100644 src/app/components/document-list/document-list.component.ts create mode 100644 src/app/components/document/document.component.html create mode 100644 src/app/components/document/document.component.scss create mode 100644 src/app/components/document/document.component.spec.ts create mode 100644 src/app/components/document/document.component.ts create mode 100644 src/app/components/feed/feed.component.html create mode 100644 src/app/components/feed/feed.component.sass create mode 100644 src/app/components/feed/feed.component.spec.ts create mode 100644 src/app/components/feed/feed.component.ts create mode 100644 src/app/components/feed/postlist/postlist.component.html create mode 100644 src/app/components/feed/postlist/postlist.component.sass create mode 100644 src/app/components/feed/postlist/postlist.component.spec.ts create mode 100644 src/app/components/feed/postlist/postlist.component.ts create mode 100644 src/app/components/home/home.component.html create mode 100644 src/app/components/home/home.component.sass create mode 100644 src/app/components/home/home.component.spec.ts create mode 100644 src/app/components/home/home.component.ts create mode 100644 src/app/components/imprint/imprint.component.html create mode 100644 src/app/components/imprint/imprint.component.sass create mode 100644 src/app/components/imprint/imprint.component.spec.ts create mode 100644 src/app/components/imprint/imprint.component.ts create mode 100644 src/app/components/login/login.component.html create mode 100644 src/app/components/login/login.component.sass create mode 100644 src/app/components/login/login.component.scss create mode 100644 src/app/components/login/login.component.spec.ts create mode 100644 src/app/components/login/login.component.ts create mode 100644 src/app/components/profile/profile.component.html create mode 100644 src/app/components/profile/profile.component.sass create mode 100644 src/app/components/profile/profile.component.spec.ts create mode 100644 src/app/components/profile/profile.component.ts create mode 100644 src/app/components/register/register.component.html create mode 100644 src/app/components/register/register.component.sass create mode 100644 src/app/components/register/register.component.spec.ts create mode 100644 src/app/components/register/register.component.ts create mode 100644 src/app/components/social/friends/friends.component.html create mode 100644 src/app/components/social/friends/friends.component.sass create mode 100644 src/app/components/social/friends/friends.component.spec.ts create mode 100644 src/app/components/social/friends/friends.component.ts create mode 100644 src/app/components/social/groups/groups.component.html create mode 100644 src/app/components/social/groups/groups.component.sass create mode 100644 src/app/components/social/groups/groups.component.spec.ts create mode 100644 src/app/components/social/groups/groups.component.ts create mode 100644 src/app/components/social/social.component.html create mode 100644 src/app/components/social/social.component.sass create mode 100644 src/app/components/social/social.component.spec.ts create mode 100644 src/app/components/social/social.component.ts create mode 100644 src/app/graphql.module.ts create mode 100644 src/app/models/chatinfo.ts create mode 100644 src/app/models/chatmessage.ts create mode 100644 src/app/models/document.ts create mode 100644 src/app/models/post.ts create mode 100644 src/app/models/registration.ts create mode 100644 src/app/services/chat/chat.service.spec.ts create mode 100644 src/app/services/chat/chat.service.ts create mode 100644 src/app/services/document.service.spec.ts create mode 100644 src/app/services/document.service.ts create mode 100644 src/app/services/login/login.service.spec.ts create mode 100644 src/app/services/login/login.service.ts create mode 100644 src/app/services/register/register.service.spec.ts create mode 100644 src/app/services/register/register.service.ts create mode 100644 src/assets/.gitkeep create mode 100644 src/browserslist create mode 100644 src/environments/environment.prod.ts create mode 100644 src/environments/environment.ts create mode 100644 src/favicon.ico create mode 100644 src/index.html create mode 100644 src/karma.conf.js create mode 100644 src/main.ts create mode 100644 src/polyfills.ts create mode 100644 src/styles.sass create mode 100644 src/styles/mixins.sass create mode 100644 src/styles/vars.sass create mode 100644 src/test.ts create mode 100644 src/tsconfig.app.json create mode 100644 src/tsconfig.spec.json create mode 100644 src/tslint.json diff --git a/package-lock.json b/package-lock.json index 6c6f9ff..0a6c5de 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1036,6 +1036,11 @@ } } }, + "@types/zen-observable": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@types/zen-observable/-/zen-observable-0.8.0.tgz", + "integrity": "sha512-te5lMAWii1uEJ4FwLjzdlbw3+n0FZNOvFXHxQDKeT0dilh7HOzdMzV2TrJVUzq8ep7J4Na8OUYPRLSQkJHAlrg==" + }, "@webassemblyjs/ast": { "version": "1.7.11", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.7.11.tgz", @@ -1190,6 +1195,23 @@ "@xtuc/long": "4.2.1" } }, + "@wry/context": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/@wry/context/-/context-0.4.4.tgz", + "integrity": "sha512-LrKVLove/zw6h2Md/KZyWxIkFM6AoyKp71OqpH9Hiip1csjPVoD3tPxlbQUNxEnHENks3UGgNpSBCAfq9KWuag==", + "requires": { + "@types/node": ">=6", + "tslib": "^1.9.3" + } + }, + "@wry/equality": { + "version": "0.1.9", + "resolved": "https://registry.npmjs.org/@wry/equality/-/equality-0.1.9.tgz", + "integrity": "sha512-mB6ceGjpMGz1ZTza8HYnrPGos2mC6So4NhS1PtZ8s4Qt0K7fBiIGhpSxUbQmhwcSWE3no+bYxmI2OL6KuXYmoQ==", + "requires": { + "tslib": "^1.9.3" + } + }, "@xtuc/ieee754": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", @@ -1308,6 +1330,98 @@ "normalize-path": "^2.1.1" } }, + "apollo-angular": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/apollo-angular/-/apollo-angular-1.7.0.tgz", + "integrity": "sha512-V/I1w4L2LfC4pMT9GzoGpj64QCPBXXWuBdrPMAUxmKYe3Q7nvQzpwha3KE5THE0bjzcdMlybDVD43iZG+4i42w==", + "requires": { + "semver": "^6.0.0", + "tslib": "^1.9.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + } + } + }, + "apollo-angular-link-http": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/apollo-angular-link-http/-/apollo-angular-link-http-1.8.0.tgz", + "integrity": "sha512-waby6cqjohVf5QV1ej3B1YqLvLflLqhDIsISQW583jPZ5/A1DIYmHJR5l+1KvFqEpwIRHRaXW6PyWABd8KzfSg==", + "requires": { + "apollo-angular-link-http-common": "~1.8.0", + "extract-files": "5.0.1", + "tslib": "^1.9.0" + } + }, + "apollo-angular-link-http-common": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/apollo-angular-link-http-common/-/apollo-angular-link-http-common-1.8.0.tgz", + "integrity": "sha512-Dx/OXIOT8RBIIxr9cUSbes1Qnolqgy678o5qT/oDE3/pHcBLiJhTph57Nqhr1/zRYU6fnhKJ6E50wFX7/5LI5g==", + "requires": { + "tslib": "^1.9.0" + } + }, + "apollo-cache": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/apollo-cache/-/apollo-cache-1.3.2.tgz", + "integrity": "sha512-+KA685AV5ETEJfjZuviRTEImGA11uNBp/MJGnaCvkgr+BYRrGLruVKBv6WvyFod27WEB2sp7SsG8cNBKANhGLg==", + "requires": { + "apollo-utilities": "^1.3.2", + "tslib": "^1.9.3" + } + }, + "apollo-cache-inmemory": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/apollo-cache-inmemory/-/apollo-cache-inmemory-1.6.3.tgz", + "integrity": "sha512-S4B/zQNSuYc0M/1Wq8dJDTIO9yRgU0ZwDGnmlqxGGmFombOZb9mLjylewSfQKmjNpciZ7iUIBbJ0mHlPJTzdXg==", + "requires": { + "apollo-cache": "^1.3.2", + "apollo-utilities": "^1.3.2", + "optimism": "^0.10.0", + "ts-invariant": "^0.4.0", + "tslib": "^1.9.3" + } + }, + "apollo-client": { + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/apollo-client/-/apollo-client-2.6.4.tgz", + "integrity": "sha512-oWOwEOxQ9neHHVZrQhHDbI6bIibp9SHgxaLRVPoGvOFy7OH5XUykZE7hBQAVxq99tQjBzgytaZffQkeWo1B4VQ==", + "requires": { + "@types/zen-observable": "^0.8.0", + "apollo-cache": "1.3.2", + "apollo-link": "^1.0.0", + "apollo-utilities": "1.3.2", + "symbol-observable": "^1.0.2", + "ts-invariant": "^0.4.0", + "tslib": "^1.9.3", + "zen-observable": "^0.8.0" + } + }, + "apollo-link": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/apollo-link/-/apollo-link-1.2.13.tgz", + "integrity": "sha512-+iBMcYeevMm1JpYgwDEIDt/y0BB7VWyvlm/7x+TIPNLHCTCMgcEgDuW5kH86iQZWo0I7mNwQiTOz+/3ShPFmBw==", + "requires": { + "apollo-utilities": "^1.3.0", + "ts-invariant": "^0.4.0", + "tslib": "^1.9.3", + "zen-observable-ts": "^0.8.20" + } + }, + "apollo-utilities": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/apollo-utilities/-/apollo-utilities-1.3.2.tgz", + "integrity": "sha512-JWNHj8XChz7S4OZghV6yc9FNnzEXj285QYp/nLNh943iObycI5GTDO3NGR9Dth12LRrSFMeDOConPfPln+WGfg==", + "requires": { + "@wry/equality": "^0.1.2", + "fast-json-stable-stringify": "^2.0.0", + "ts-invariant": "^0.4.0", + "tslib": "^1.9.3" + } + }, "app-root-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/app-root-path/-/app-root-path-2.1.0.tgz", @@ -3681,6 +3795,11 @@ } } }, + "extract-files": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/extract-files/-/extract-files-5.0.1.tgz", + "integrity": "sha512-qRW6y9eKF0VbCyOoOEtFhzJ3uykAw8GKwQVXyAIqwocyEWW4m+v+evec34RwtUkkxxHh7NKBLJ6AnXM8W4dH5w==" + }, "extsprintf": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", @@ -4580,6 +4699,19 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==" }, + "graphql": { + "version": "14.5.8", + "resolved": "https://registry.npmjs.org/graphql/-/graphql-14.5.8.tgz", + "integrity": "sha512-MMwmi0zlVLQKLdGiMfWkgQD7dY/TUKt4L+zgJ/aR0Howebod3aNgP5JkgvAULiR2HPVZaP2VEElqtdidHweLkg==", + "requires": { + "iterall": "^1.2.2" + } + }, + "graphql-tag": { + "version": "2.10.1", + "resolved": "https://registry.npmjs.org/graphql-tag/-/graphql-tag-2.10.1.tgz", + "integrity": "sha512-jApXqWBzNXQ8jYa/HLkZJaVw9jgwNqZkywa2zfFn16Iv1Zb7ELNHkJaXHR7Quvd5SIGsy6Ny7SUKATgnu05uEg==" + }, "handle-thing": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/handle-thing/-/handle-thing-2.0.0.tgz", @@ -5625,6 +5757,11 @@ "handlebars": "^4.0.11" } }, + "iterall": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/iterall/-/iterall-1.2.2.tgz", + "integrity": "sha512-yynBb1g+RFUPY64fTrFv7nsjRrENBQJaX2UL+2Szc9REFrSNm1rpSXHGzhmAy7a9uv3vlvgBlXnf9RqmPH1/DA==" + }, "jasmine": { "version": "2.8.0", "resolved": "https://registry.npmjs.org/jasmine/-/jasmine-2.8.0.tgz", @@ -6843,6 +6980,14 @@ "is-wsl": "^1.1.0" } }, + "optimism": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/optimism/-/optimism-0.10.3.tgz", + "integrity": "sha512-9A5pqGoQk49H6Vhjb9kPgAeeECfUDF6aIICbMDL23kDLStBn1MWk3YvcZ4xWF9CsSf6XEgvRLkXy4xof/56vVw==", + "requires": { + "@wry/context": "^0.4.0" + } + }, "optimist": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", @@ -8914,8 +9059,7 @@ "symbol-observable": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", - "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==", - "dev": true + "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==" }, "tapable": { "version": "1.1.3", @@ -9291,6 +9435,14 @@ "glob": "^7.1.2" } }, + "ts-invariant": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.4.4.tgz", + "integrity": "sha512-uEtWkFM/sdZvRNNDL3Ehu4WVpwaulhwQszV8mrtcdeE8nN00BV9mAmQ88RkrBhFgl9gMgvjJLAQcZbnPXI9mlA==", + "requires": { + "tslib": "^1.9.3" + } + }, "ts-node": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-7.0.1.tgz", @@ -10247,6 +10399,20 @@ "integrity": "sha1-5a2ryKz0CPY4X8dklWhMiOavaJo=", "dev": true }, + "zen-observable": { + "version": "0.8.14", + "resolved": "https://registry.npmjs.org/zen-observable/-/zen-observable-0.8.14.tgz", + "integrity": "sha512-kQz39uonEjEESwh+qCi83kcC3rZJGh4mrZW7xjkSQYXkq//JZHTtKo+6yuVloTgMtzsIWOJrjIrKvk/dqm0L5g==" + }, + "zen-observable-ts": { + "version": "0.8.20", + "resolved": "https://registry.npmjs.org/zen-observable-ts/-/zen-observable-ts-0.8.20.tgz", + "integrity": "sha512-2rkjiPALhOtRaDX6pWyNqK1fnP5KkJJybYebopNSn6wDG1lxBoFs2+nwwXKoA6glHIrtwrfBBy6da0stkKtTAA==", + "requires": { + "tslib": "^1.9.3", + "zen-observable": "^0.8.0" + } + }, "zone.js": { "version": "0.8.26", "resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.8.26.tgz", diff --git a/package.json b/package.json index 06b1d3f..c877d22 100644 --- a/package.json +++ b/package.json @@ -22,10 +22,17 @@ "@angular/platform-browser": "~7.0.0", "@angular/platform-browser-dynamic": "~7.0.0", "@angular/router": "~7.0.0", + "apollo-angular": "^1.7.0", "core-js": "^2.5.4", "ngx-socket-io": "^2.0.0", "rxjs": "~6.3.3", - "zone.js": "~0.8.26" + "zone.js": "~0.8.26", + "apollo-angular-link-http": "^1.6.0", + "apollo-link": "^1.2.11", + "apollo-client": "^2.6.0", + "apollo-cache-inmemory": "^1.3.2", + "graphql-tag": "^2.10.0", + "graphql": "^14.3.1" }, "devDependencies": { "@angular/cli": "~7.0.4", diff --git a/src/app/app.component.html b/src/app/app.component.html new file mode 100644 index 0000000..90c6b64 --- /dev/null +++ b/src/app/app.component.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/app/app.component.sass b/src/app/app.component.sass new file mode 100644 index 0000000..f00d56b --- /dev/null +++ b/src/app/app.component.sass @@ -0,0 +1,36 @@ +@import '../styles/mixins.sass' +@import '../styles/vars.sass' +/* + #content + grid-template: 7.5% 92.5% / 25% 50% 25% + display: grid + min-height: 100vh + max-height: 100vh*/ + +#imprint + background-color: $cSecondaryBackground + grid-template: 15% 70% 15% / 15% 70% 15% + display: grid + min-height: 100vh + max-height: 100vh + +#about + background-color: $cSecondaryBackground + grid-template: 15% 70% 15% / 15% 70% 15% + display: grid + min-height: 100vh + max-height: 100vh + +#login + background-color: $cSecondaryBackground + grid-template: 15% 70% 15% / 15% 70% 15% + display: grid + min-height: 100vh + max-height: 100vh + +#register + background-color: $cSecondaryBackground + grid-template: 15% 70% 15% / 15% 70% 15% + display: grid + min-height: 100vh + max-height: 100vh diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts new file mode 100644 index 0000000..89617e1 --- /dev/null +++ b/src/app/app.component.spec.ts @@ -0,0 +1,31 @@ +import { TestBed, async } from '@angular/core/testing'; +import { AppComponent } from './app.component'; + +describe('AppComponent', () => { + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ + AppComponent + ], + }).compileComponents(); + })); + + it('should create the app', () => { + const fixture = TestBed.createComponent(AppComponent); + const app = fixture.debugElement.componentInstance; + expect(app).toBeTruthy(); + }); + + it(`should have as title 'socket-app'`, () => { + const fixture = TestBed.createComponent(AppComponent); + const app = fixture.debugElement.componentInstance; + expect(app.title).toEqual('socket-app'); + }); + + 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!'); + }); +}); diff --git a/src/app/app.component.ts b/src/app/app.component.ts new file mode 100644 index 0000000..73203c5 --- /dev/null +++ b/src/app/app.component.ts @@ -0,0 +1,12 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-root', + templateUrl: './app.component.html', + styleUrls: ['./app.component.sass'] +}) +export class AppComponent implements OnInit { + constructor() { } + + ngOnInit() { } +} diff --git a/src/app/app.module.ts b/src/app/app.module.ts new file mode 100644 index 0000000..70177f6 --- /dev/null +++ b/src/app/app.module.ts @@ -0,0 +1,75 @@ +import { BrowserModule } from '@angular/platform-browser'; +import { NgModule } from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { RouterModule, Routes } from '@angular/router'; +import { SocketIoModule, SocketIoConfig } from 'ngx-socket-io'; +import { HttpModule } from '@angular/http'; + +import { AppComponent } from './app.component'; +import { DocumentListComponent } from './components/document-list/document-list.component'; +import { DocumentComponent } from './components/document/document.component'; +import { RegisterComponent } from './components/register/register.component'; +import { LoginComponent } from './components/login/login.component'; +import { AppScaffoldComponent } from './components/app-scaffold/app-scaffold.component'; +import { ChatComponent } from './components/chat/chat.component'; +import { FriendsComponent } from './components/social/friends/friends.component'; +import { FeedComponent } from './components/feed/feed.component'; +import { HomeComponent } from './components/home/home.component'; +import { SocialComponent } from './components/social/social.component'; +import { GroupsComponent } from './components/social/groups/groups.component'; +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'; +import { AboutComponent } from './components/about/about.component'; + +const config: SocketIoConfig = { url: 'http://localhost:4444', options: {} }; + +const appRoutes: Routes = [ + { path: '', component: HomeComponent }, + { path: 'profile/:id', component: ProfileComponent }, + { path: 'login', component: LoginComponent }, + { path: 'register', component: RegisterComponent }, + { path: 'about', component: AboutComponent }, + { path: 'imprint', component: ImprintComponent }, +] + +@NgModule({ + declarations: [ + AppComponent, + DocumentListComponent, + DocumentComponent, + RegisterComponent, + LoginComponent, + AppScaffoldComponent, + ChatComponent, + FriendsComponent, + FeedComponent, + HomeComponent, + SocialComponent, + GroupsComponent, + ChatmanagerComponent, + ChatlistComponent, + PostlistComponent, + ImprintComponent, + AboutComponent, + ProfileComponent + ], + imports: [ + BrowserModule, + FormsModule, + HttpModule, + SocketIoModule.forRoot(config), + GraphQLModule, + HttpClientModule, + RouterModule.forRoot( + appRoutes + ) + ], + providers: [], + bootstrap: [AppComponent] +}) +export class AppModule { } diff --git a/src/app/components/about/about.component.html b/src/app/components/about/about.component.html new file mode 100644 index 0000000..e215ccc --- /dev/null +++ b/src/app/components/about/about.component.html @@ -0,0 +1,9 @@ +
+
+

What´s Greenvironment?

+

Hello Greenvironment!

+

We, the greenviroment team want to create a netwok for environmentalists who care for our nature and our planet as much as we do.

+

We believe, that together we can do amazing things to protect our environment and keep it clean and green.

+ You aren´t part of greenvironment yet? - join us here +
+
\ No newline at end of file diff --git a/src/app/components/about/about.component.sass b/src/app/components/about/about.component.sass new file mode 100644 index 0000000..3d9a21b --- /dev/null +++ b/src/app/components/about/about.component.sass @@ -0,0 +1,17 @@ +@import '../../../styles/mixins.sass' +@import '../../../styles/vars.sass' + +#about + background-color: $cSecondaryBackground + grid-template: 15% 70% 15% / 15% 70% 15% + display: grid + min-height: 100vh + max-height: 100vh + +#aboutcontainer + @include gridPosition(2, 2,2,2) + background-color: $cPrimaryBackground +input + margin: 0.25em +#header + @include gridPosition(1, 2, 1, 2) diff --git a/src/app/components/about/about.component.spec.ts b/src/app/components/about/about.component.spec.ts new file mode 100644 index 0000000..6b77344 --- /dev/null +++ b/src/app/components/about/about.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { AboutComponent } from './about.component'; + +describe('AboutComponent', () => { + let component: AboutComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ AboutComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(AboutComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/components/about/about.component.ts b/src/app/components/about/about.component.ts new file mode 100644 index 0000000..88f7f9f --- /dev/null +++ b/src/app/components/about/about.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-about', + templateUrl: './about.component.html', + styleUrls: ['./about.component.sass'] +}) +export class AboutComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/src/app/components/app-scaffold/app-scaffold.component.html b/src/app/components/app-scaffold/app-scaffold.component.html new file mode 100644 index 0000000..cfd5a41 --- /dev/null +++ b/src/app/components/app-scaffold/app-scaffold.component.html @@ -0,0 +1,16 @@ +

Greenvironment

+ + + + + + + diff --git a/src/app/components/app-scaffold/app-scaffold.component.sass b/src/app/components/app-scaffold/app-scaffold.component.sass new file mode 100644 index 0000000..fd527fc --- /dev/null +++ b/src/app/components/app-scaffold/app-scaffold.component.sass @@ -0,0 +1,64 @@ +@import '../../../styles/mixins.sass' +@import '../../../styles/vars.sass' + +button + border: 2px solid $cHeadPrimaryBackground + margin-top: 0.125em + padding: 0.125em + background-color: $cHeadPrimaryBackground + color: $cHeadFontColor + font-weight: bold + transition-duration: 0.25s + +button:hover + background-color: lighten($cHeadPrimaryBackground, 10%) + cursor: pointer + +button:active + background-color: darken($cHeadPrimaryBackground, 5%) + box-shadow: inset 0.25em 0.25em 0.1em rgba(0, 0, 0, 0.25) + +h1 + @include gridPosition(1, 2, 1, 2) + line-height: 100% + margin-left: 0.5em + margin-top: 0.25em + +#tab-home + @include gridPosition(1, 2, 2, 3) + +#tab-profile + @include gridPosition(1, 2, 3, 4) + +#tab-rank + @include gridPosition(1, 2, 4, 5) + +#tab-about + @include gridPosition(1, 2, 5, 6) + +#tab-about + @include gridPosition(1, 2, 6, 7) + +#dropdown + @include gridPosition(1, 2, 7, 8) + display: flex + align-items: center + margin-left: 2em + span + margin-left: 1em + #dropdown-content + display: none + position: absolute + background-color: #f9f9f9 + min-width: 160px + box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2) + padding: 12px 16px + z-index: 1 + div:hover + background-color: lighten($cHeadPrimaryBackground, 10%) + cursor: pointer + div:hover #dropdown-content + display: block + +#logoutbutton + @include gridPosition(1, 2, 8, 9) \ No newline at end of file diff --git a/src/app/components/app-scaffold/app-scaffold.component.spec.ts b/src/app/components/app-scaffold/app-scaffold.component.spec.ts new file mode 100644 index 0000000..7ba9186 --- /dev/null +++ b/src/app/components/app-scaffold/app-scaffold.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { AppScaffoldComponent } from './app-scaffold.component'; + +describe('AppScaffoldComponent', () => { + let component: AppScaffoldComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ AppScaffoldComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(AppScaffoldComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/components/app-scaffold/app-scaffold.component.ts b/src/app/components/app-scaffold/app-scaffold.component.ts new file mode 100644 index 0000000..75a2283 --- /dev/null +++ b/src/app/components/app-scaffold/app-scaffold.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-scaffold', + templateUrl: './app-scaffold.component.html', + styleUrls: ['./app-scaffold.component.sass'] +}) +export class AppScaffoldComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/src/app/components/chat/chat.component.html b/src/app/components/chat/chat.component.html new file mode 100644 index 0000000..b4daf21 --- /dev/null +++ b/src/app/components/chat/chat.component.html @@ -0,0 +1,16 @@ +
+ +
+
+
{{message.content}}
+
{{message.content}}
+
+
+
+ + +
+
\ No newline at end of file diff --git a/src/app/components/chat/chat.component.sass b/src/app/components/chat/chat.component.sass new file mode 100644 index 0000000..cd1c90d --- /dev/null +++ b/src/app/components/chat/chat.component.sass @@ -0,0 +1,83 @@ +@import '../../../styles/mixins.sass' +@import '../../../styles/vars.sass' + +#chat + display: grid + grid-template: 7.5% 82.5% 10%/100% + width: 100% + height: 100% + +#header + @include gridPosition(1, 2, 1, 2) + background-color: $cBoxHeaderBackground + display: grid + grid-template: 100% /20% 80% + + span + color: $cFontWhite + span.title + @include gridPosition(1, 2, 2, 3) + margin-top: 0.25em + margin-left: 0.25em + line-height: 100% + font-size: 2em + + button + background-color: $cBoxHeaderBackground + border: none + + button:hover + background-color: lighten($cBoxHeaderBackground, 10%) + cursor: pointer + + button:active + background-color: darken($cBoxHeaderBackground, 5%) + + #goback + @include gridPosition(1, 2, 1, 2) + +#chatheader + @include gridPosition(1, 2, 1, 2) + display: grid + grid-template: 100% /10% 90% + #goback + @include gridPosition(1, 2, 1, 2) + #name + @include gridPosition(1, 2, 2, 3) + +#messagecontainer + @include gridPosition(2, 3, 1, 2) + overflow: auto +.chatmessage + width: 100% + #ownmessage + text-align: right + margin: 0.5em + span + background-color: $cMessageOwn + border: solid + border-color: $cMessageOwn + border-radius: 0.25em + #foreignmessage + text-align: left + margin: 0.5em + span + background-color: $cMessageForeign + border: solid + border-color: $cMessageForeign + border-radius: 0.25em + + +#newmessage + @include gridPosition(3, 4, 1, 2) + margin: 0.5em + display: grid + grid-template: 100% /80% 20% + #input + @include gridPosition(1, 2, 1, 2) + border-radius: 0.25em + border: 1px solid $cFeedInputBorder + padding: 0.125em + resize: none + #send + @include gridPosition(1, 2, 2, 3) \ No newline at end of file diff --git a/src/app/components/chat/chat.component.spec.ts b/src/app/components/chat/chat.component.spec.ts new file mode 100644 index 0000000..1f642f2 --- /dev/null +++ b/src/app/components/chat/chat.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ChatComponent } from './chat.component'; + +describe('ChatComponent', () => { + let component: ChatComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ChatComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ChatComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/components/chat/chat.component.ts b/src/app/components/chat/chat.component.ts new file mode 100644 index 0000000..45b8749 --- /dev/null +++ b/src/app/components/chat/chat.component.ts @@ -0,0 +1,28 @@ +import { Component, OnInit, EventEmitter, Output, Input } from '@angular/core'; +import { Chatmessage } from 'src/app/models/chatmessage'; +import { Chatinfo } from 'src/app/models/chatinfo'; + +@Component({ + selector: 'chatmanager-chat', + templateUrl: './chat.component.html', + styleUrls: ['./chat.component.sass'] +}) +export class ChatComponent implements OnInit { + + messages:Array = [new Chatmessage("Hallo",true), new Chatmessage("Hallo",false), + new Chatmessage("Hallo",true), new Chatmessage("Hallo",false), new Chatmessage("Hallo",true), + new Chatmessage("Hallo",false)] + + @Output() goBackEvent = new EventEmitter(); + @Input() childChat: Chatinfo; + + constructor() { } + + ngOnInit() { + } + + goBack() { + this.goBackEvent.emit(true) + } + +} diff --git a/src/app/components/chatlist/chatlist.component.html b/src/app/components/chatlist/chatlist.component.html new file mode 100644 index 0000000..aaf6b06 --- /dev/null +++ b/src/app/components/chatlist/chatlist.component.html @@ -0,0 +1,14 @@ +
+ +
+
+
Pic
+
{{chat.id}}
+ +
+
+
diff --git a/src/app/components/chatlist/chatlist.component.sass b/src/app/components/chatlist/chatlist.component.sass new file mode 100644 index 0000000..4db994c --- /dev/null +++ b/src/app/components/chatlist/chatlist.component.sass @@ -0,0 +1,72 @@ +@import '../../../styles/mixins.sass' +@import '../../../styles/vars.sass' + +#chatlist + display: grid + grid-template: 7.5% 92.5%/100% + width: 100% + height: 100% + +#header + @include gridPosition(1, 2, 1, 2) + background-color: $cBoxHeaderBackground + display: grid + grid-template: 100% /80% 20% + + span + color: $cFontWhite + span.title + @include gridPosition(1, 2, 1, 2) + margin-top: 0.25em + margin-left: 0.25em + line-height: 100% + font-size: 2em + + button + background-color: $cBoxHeaderBackground + border: none + + button:hover + background-color: lighten($cBoxHeaderBackground, 10%) + cursor: pointer + + button:active + background-color: darken($cBoxHeaderBackground, 5%) + + #newchat + @include gridPosition(1, 2, 2, 3) + +#chats + overflow: auto + @include gridPosition(2, 3, 1, 2) + + div:hover + background-color: darken($cPrimaryBackground, 10%) + cursor: pointer + .chatitem + background-color: $cPrimaryBackground + height: 3em + margin: 0.2em + padding: 0.25em + border-radius: 0.25em + border: solid + display: grid + grid-template: 100% / 20% 60% 20% + .picture + @include gridPosition(1, 2, 1, 2) + border: solid + .name, .date + margin-top: auto + margin-bottom: auto + .name + @include gridPosition(1, 2, 2, 3) + font-weight: bold + text-align: left + padding-left: 0.5em + span + font-size: 125% + .date + @include gridPosition(1, 2, 3, 4) + color: $cInactiveText + text-align: right + padding-right: 0.5em \ No newline at end of file diff --git a/src/app/components/chatlist/chatlist.component.spec.ts b/src/app/components/chatlist/chatlist.component.spec.ts new file mode 100644 index 0000000..19e8849 --- /dev/null +++ b/src/app/components/chatlist/chatlist.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ChatlistComponent } from './chatlist.component'; + +describe('ChatlistComponent', () => { + let component: ChatlistComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ChatlistComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ChatlistComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/components/chatlist/chatlist.component.ts b/src/app/components/chatlist/chatlist.component.ts new file mode 100644 index 0000000..83c2402 --- /dev/null +++ b/src/app/components/chatlist/chatlist.component.ts @@ -0,0 +1,32 @@ +import { Component, OnInit, Output, EventEmitter } from '@angular/core'; +import { Chatinfo } from 'src/app/models/chatinfo'; +import { ChatService } from 'src/app/services/chat/chat.service'; + +@Component({ + selector: 'chatmanager-chatlist', + templateUrl: './chatlist.component.html', + styleUrls: ['./chatlist.component.sass'] +}) +export class ChatlistComponent implements OnInit { + + chats:Array = [new Chatinfo("Max", "23.06.19 12:50"), new Chatinfo("Julius", "17.04.19 16:50"), + new Chatinfo("David", "23.06.19 12:50"), new Chatinfo("Bruno", "23.06.19 12:50")] + + @Output() showChatEvent = new EventEmitter(); + selectedChat: Chatinfo; + + constructor(private chatService: ChatService) { } + + ngOnInit() { + } + + newChat() { + this.chatService.getSelfName() + } + + showChat(pChat: Chatinfo) { + this.selectedChat = pChat + this.showChatEvent.emit(this.selectedChat) + } + +} diff --git a/src/app/components/chatmanager/chatmanager.component.html b/src/app/components/chatmanager/chatmanager.component.html new file mode 100644 index 0000000..e3964c7 --- /dev/null +++ b/src/app/components/chatmanager/chatmanager.component.html @@ -0,0 +1,6 @@ +
+ +
+
+ +
diff --git a/src/app/components/chatmanager/chatmanager.component.sass b/src/app/components/chatmanager/chatmanager.component.sass new file mode 100644 index 0000000..f74a631 --- /dev/null +++ b/src/app/components/chatmanager/chatmanager.component.sass @@ -0,0 +1,6 @@ +@import '../../../styles/mixins.sass' +@import '../../../styles/vars.sass' + +div + width: 100% + height: 100% \ No newline at end of file diff --git a/src/app/components/chatmanager/chatmanager.component.spec.ts b/src/app/components/chatmanager/chatmanager.component.spec.ts new file mode 100644 index 0000000..d222640 --- /dev/null +++ b/src/app/components/chatmanager/chatmanager.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ChatmanagerComponent } from './chatmanager.component'; + +describe('ChatmanagerComponent', () => { + let component: ChatmanagerComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ChatmanagerComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ChatmanagerComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/components/chatmanager/chatmanager.component.ts b/src/app/components/chatmanager/chatmanager.component.ts new file mode 100644 index 0000000..b2db03a --- /dev/null +++ b/src/app/components/chatmanager/chatmanager.component.ts @@ -0,0 +1,33 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ChatService } from '../../services/chat/chat.service' +import { ChatComponent } from '../chat/chat.component'; +import { Chatinfo } from 'src/app/models/chatinfo'; + +@Component({ + selector: 'home-chatmanager', + templateUrl: './chatmanager.component.html', + styleUrls: ['./chatmanager.component.sass'] +}) +export class ChatmanagerComponent implements OnInit { + + showChatlist: boolean = true + showChat: boolean = false + parentSelectedChat: Chatinfo + + constructor() { } + + ngOnInit() { + } + + goBackToChatlist($event) { + this.showChatlist = $event + this.showChat = false + } + + showSpecialChat($event) { + this.parentSelectedChat = $event + this.showChatlist = false + this.showChat = true + } + +} diff --git a/src/app/components/document-list/document-list.component.html b/src/app/components/document-list/document-list.component.html new file mode 100644 index 0000000..6a57b17 --- /dev/null +++ b/src/app/components/document-list/document-list.component.html @@ -0,0 +1,4 @@ +
+ New Document + {{ docId }} +
diff --git a/src/app/components/document-list/document-list.component.scss b/src/app/components/document-list/document-list.component.scss new file mode 100644 index 0000000..506aa38 --- /dev/null +++ b/src/app/components/document-list/document-list.component.scss @@ -0,0 +1,24 @@ +.sidenav { + position: fixed; + height: 100%; + width: 220px; + top: 0; + left: 0; + background-color: #111111; + overflow-x: hidden; + padding-top: 20px; + + span { + padding: 6px 8px 6px 16px; + text-decoration: none; + font-size: 25px; + font-family: 'Roboto', Tahoma, Geneva, Verdana, sans-serif; + color: #818181; + display: block; + }.selected { + color: #e1e1e1; + }:hover { + color: #f1f1f1; + cursor: pointer; + } +} diff --git a/src/app/components/document-list/document-list.component.spec.ts b/src/app/components/document-list/document-list.component.spec.ts new file mode 100644 index 0000000..f8c7635 --- /dev/null +++ b/src/app/components/document-list/document-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DocumentListComponent } from './document-list.component'; + +describe('DocumentListComponent', () => { + let component: DocumentListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ DocumentListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DocumentListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/components/document-list/document-list.component.ts b/src/app/components/document-list/document-list.component.ts new file mode 100644 index 0000000..10faac9 --- /dev/null +++ b/src/app/components/document-list/document-list.component.ts @@ -0,0 +1,35 @@ +import { Component, OnInit, OnDestroy } from '@angular/core'; +import { Observable, Subscription } from 'rxjs'; + +import { DocumentService } from 'src/app/services/document.service'; + +@Component({ + selector: 'app-document-list', + templateUrl: './document-list.component.html', + styleUrls: ['./document-list.component.scss'] +}) +export class DocumentListComponent implements OnInit, OnDestroy { + documents: Observable; + currentDoc: string; + private _docSub: Subscription; + + constructor(private documentService: DocumentService) { } + + ngOnInit() { + this.documents = this.documentService.documents; + this._docSub = this.documentService.currentDocument.subscribe(doc => this.currentDoc = doc.id); + } + + ngOnDestroy() { + this._docSub.unsubscribe(); + } + + loadDoc(id: string) { + this.documentService.getDocument(id); + } + + newDoc() { + this.documentService.newDocument(); + } + +} diff --git a/src/app/components/document/document.component.html b/src/app/components/document/document.component.html new file mode 100644 index 0000000..093deaa --- /dev/null +++ b/src/app/components/document/document.component.html @@ -0,0 +1 @@ + diff --git a/src/app/components/document/document.component.scss b/src/app/components/document/document.component.scss new file mode 100644 index 0000000..67d5275 --- /dev/null +++ b/src/app/components/document/document.component.scss @@ -0,0 +1,12 @@ +textarea { + position: fixed; + width: calc(100% - 235px); + height: 100%; + right: 0; + top: 0; + font-size: 18pt; + padding-top: 20px; + resize: none; + border: none; + padding: 20px 0px 20px 15px; +} diff --git a/src/app/components/document/document.component.spec.ts b/src/app/components/document/document.component.spec.ts new file mode 100644 index 0000000..6780d19 --- /dev/null +++ b/src/app/components/document/document.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DocumentComponent } from './document.component'; + +describe('DocumentComponent', () => { + let component: DocumentComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ DocumentComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DocumentComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/components/document/document.component.ts b/src/app/components/document/document.component.ts new file mode 100644 index 0000000..a5c4c04 --- /dev/null +++ b/src/app/components/document/document.component.ts @@ -0,0 +1,30 @@ +import { Component, OnInit, OnDestroy } from '@angular/core'; +import { DocumentService } from 'src/app/services/document.service'; +import { Subscription } from 'rxjs'; +import { Document } from 'src/app/models/document'; +import { startWith } from 'rxjs/operators'; + +@Component({ + selector: 'app-document', + templateUrl: './document.component.html', + styleUrls: ['./document.component.scss'] +}) +export class DocumentComponent implements OnInit, OnDestroy { + document: Document; + private _docSub: Subscription; + constructor(private documentService: DocumentService) { } + + ngOnInit() { + this._docSub = this.documentService.currentDocument.pipe( + startWith({ id: '', doc: 'Select an existing document or create a new one to get started'}) + ).subscribe(document => this.document = document); + } + + ngOnDestroy() { + this._docSub.unsubscribe(); + } + + editDoc() { + this.documentService.editDocument(this.document); + } +} diff --git a/src/app/components/feed/feed.component.html b/src/app/components/feed/feed.component.html new file mode 100644 index 0000000..a2cf492 --- /dev/null +++ b/src/app/components/feed/feed.component.html @@ -0,0 +1,40 @@ +
+ + + +
+
+
+ + +
+
+
+ +
+
+ +
+ +
+
diff --git a/src/app/components/feed/feed.component.sass b/src/app/components/feed/feed.component.sass new file mode 100644 index 0000000..399e19c --- /dev/null +++ b/src/app/components/feed/feed.component.sass @@ -0,0 +1,73 @@ +@import '../../../styles/mixins.sass' +@import '../../../styles/vars.sass' + +#postinput + @include gridPosition(1, 2, 1, 2) + margin: 0.5em + display: grid + grid-template: 100% /80% 10% 10% + #input + @include gridPosition(1, 2, 1, 2) + border-radius: 0.25em + border: 1px solid $cFeedInputBorder + padding: 0.125em + resize: none + #attach + @include gridPosition(1, 2, 2, 3) + #submit + @include gridPosition(1, 2, 3, 4) + +#completeFeed + @include gridPosition(2, 3, 1, 2) + display: grid + grid-template: 5% 95% /100% + background-color: $cFeedBackground + + #feedchooser + @include gridPosition(1, 2, 1, 2) + display: grid + grid-template: 100% /50% 50% + background-color: $cFontWhite + padding: 0 + margin: 0 + button + background-color: $cFeedChooserBackground + border: none + font-size: 1.5em + color: $cFontWhite + button:hover + background-color: lighten($cFeedChooserBackground, 10%) + cursor: pointer + #new + @include gridPosition(1, 2, 1, 2) + #mostliked + @include gridPosition(1, 2, 2, 3) + + #feedlist + @include gridPosition(2, 3, 1, 2) + overflow: auto + width: 100% + height: 100% + + .feeditemPicture + background-color: $cFeedItemBackground + min-height: 2em + margin: 0.5em + padding: 0.25em + border-radius: 0.25em + .itemhead + align-items: flex-start + + .title, .handle, .date + margin: 0.125em + .title + font-weight: bold + + .handle, .date + color: $cInactiveText + .handle a + text-decoration: none + color: $cInactiveText + font-style: normal + .handle a:hover + text-decoration: underline \ No newline at end of file diff --git a/src/app/components/feed/feed.component.spec.ts b/src/app/components/feed/feed.component.spec.ts new file mode 100644 index 0000000..4101160 --- /dev/null +++ b/src/app/components/feed/feed.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { FeedComponent } from './feed.component'; + +describe('FeedComponent', () => { + let component: FeedComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ FeedComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(FeedComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/components/feed/feed.component.ts b/src/app/components/feed/feed.component.ts new file mode 100644 index 0000000..d7932a0 --- /dev/null +++ b/src/app/components/feed/feed.component.ts @@ -0,0 +1,50 @@ +import { Component, OnInit } from '@angular/core'; +import { Post } from 'src/app/models/post'; + +@Component({ + selector: 'home-feed', + templateUrl: './feed.component.html', + styleUrls: ['./feed.component.sass'] +}) +export class FeedComponent implements OnInit { + + viewNew: boolean = true + viewMostLiked: boolean = false + + feedNew: Array = [ + new Post("1", "Niklas", "@nick123", "This is a test message", "01.10.2019 10:00 Uhr", 10), + new Post("2", "Niklas", "@nick123", "This is a test message", "01.10.2019 10:00 Uhr", 10), + new Post("3", "Niklas", "@nick123", "This is a test message", "01.10.2019 10:00 Uhr", 10), + new Post("4", "Niklas", "@nick123", "This is a test message", "01.10.2019 10:00 Uhr", 10), + new Post("5", "Niklas", "@nick123", "This is a test message", "01.10.2019 10:00 Uhr", 10), + new Post("6", "Niklas", "@nick123", "This is a test message", "01.10.2019 10:00 Uhr", 10), + new Post("7", "Niklas", "@nick123", "This is a test message", "01.10.2019 10:00 Uhr", 10) + ] + feedMostLiked: Array = [ + new Post("1", "Max", "@max123", "This is a test message", "01.10.2019 10:00 Uhr", 50), + new Post("2", "Max", "@max123", "This is a test message", "01.10.2019 10:00 Uhr", 50), + new Post("3", "Max", "@max123", "This is a test message", "01.10.2019 10:00 Uhr", 50), + new Post("4", "Max", "@max123", "This is a test message", "01.10.2019 10:00 Uhr", 50), + new Post("5", "Max", "@max123", "This is a test message", "01.10.2019 10:00 Uhr", 50) + ] + + parentSelectedPostList: Array = this.feedNew + + constructor() { } + + ngOnInit() { + } + + showNew() { + this.viewNew = true + this.viewMostLiked = false + this.parentSelectedPostList = this.feedNew + } + + showMostLiked() { + this.viewNew = false + this.viewMostLiked = true + this.parentSelectedPostList = this.feedMostLiked + } + +} diff --git a/src/app/components/feed/postlist/postlist.component.html b/src/app/components/feed/postlist/postlist.component.html new file mode 100644 index 0000000..cf57aa2 --- /dev/null +++ b/src/app/components/feed/postlist/postlist.component.html @@ -0,0 +1,19 @@ +
+
+
+ {{post.username}} + {{post.handle}} +
+ {{post.date}} +
+
+
+

{{post.message}}

+
+
+ + + Votes: {{post.votes}} +
+
+
\ No newline at end of file diff --git a/src/app/components/feed/postlist/postlist.component.sass b/src/app/components/feed/postlist/postlist.component.sass new file mode 100644 index 0000000..7686625 --- /dev/null +++ b/src/app/components/feed/postlist/postlist.component.sass @@ -0,0 +1,58 @@ +@import '../../../../styles/mixins.sass' +@import '../../../../styles/vars.sass' + +.feeditem + background-color: $cFeedItemBackground + min-height: 2em + //max-heigth: 5em + margin: 0.5em + padding: 0.25em + border-radius: 0.25em + +.itemhead + display: grid + grid-template: 100% /70% 30% + .usertag + @include gridPosition(1, 2, 1, 2) + .title, .handle, .date + margin: 0.125em + .title + font-weight: bold + .date + @include gridPosition(1, 2, 2, 3) + text-align: right + .handle, .date + color: $cInactiveText + .handle a + text-decoration: none + color: $cInactiveText + font-style: normal + .handle a:hover + text-decoration: underline +.itembody + display: grid + grid-template: 100% /85% 15% + .text + @include gridPosition(1, 2, 1, 2) + .vote + @include gridPosition(1, 2, 2, 3) + display: grid + grid-template: 70% 30% /50% 50% + button + background-color: $cFeedItemBackground + border: none + button:hover + cursor: pointer + #up + @include gridPosition(1, 2, 2, 3) + color: $cFeedUpVote + #up:hover + color: darken($cFeedUpVote, 10%) + #down + @include gridPosition(1, 2, 1, 2) + color: $cFeedDownVote + #down:hover + color: darken($cFeedDownVote, 10%) + #votecounter + @include gridPosition(2, 3, 1, 3) + text-align: center \ No newline at end of file diff --git a/src/app/components/feed/postlist/postlist.component.spec.ts b/src/app/components/feed/postlist/postlist.component.spec.ts new file mode 100644 index 0000000..7218d0e --- /dev/null +++ b/src/app/components/feed/postlist/postlist.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PostlistComponent } from './postlist.component'; + +describe('PostlistComponent', () => { + let component: PostlistComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ PostlistComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PostlistComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/components/feed/postlist/postlist.component.ts b/src/app/components/feed/postlist/postlist.component.ts new file mode 100644 index 0000000..5e64f59 --- /dev/null +++ b/src/app/components/feed/postlist/postlist.component.ts @@ -0,0 +1,18 @@ +import { Component, OnInit, Input } from '@angular/core'; +import { Post } from 'src/app/models/post'; + +@Component({ + selector: 'feed-postlist', + templateUrl: './postlist.component.html', + styleUrls: ['./postlist.component.sass'] +}) +export class PostlistComponent implements OnInit { + + @Input() childPostList: Array + + constructor() { } + + ngOnInit() { + } + +} diff --git a/src/app/components/home/home.component.html b/src/app/components/home/home.component.html new file mode 100644 index 0000000..eeee9e5 --- /dev/null +++ b/src/app/components/home/home.component.html @@ -0,0 +1,6 @@ +
+ + + + +
\ No newline at end of file diff --git a/src/app/components/home/home.component.sass b/src/app/components/home/home.component.sass new file mode 100644 index 0000000..ad9fbaa --- /dev/null +++ b/src/app/components/home/home.component.sass @@ -0,0 +1,31 @@ +@import '../../../styles/mixins.sass' +@import '../../../styles/vars.sass' + +#content + grid-template: 7.5% 92.5% / 25% 50% 25% + display: grid + min-height: 100vh + max-height: 100vh + +#headerbar + @include gridPosition(1, 2, 1, 4) + display: grid + grid-template: 100% /30% 10% 10% 10% 10% 10% 15% 5% + background-color: $cHeadPrimaryBackground + color: $cHeadFontColor + +#chatcontainer + @include gridPosition(2, 3, 1, 2) + background-color: $cBoxBodyBackground + +#feedcontainer + @include gridPosition(2, 3, 2, 3) + display: grid + grid-template: 10% 90% /100% + background-color: $cSecondaryBackground + +#socialcontainer + @include gridPosition(2, 3, 3, 4) + display: grid + grid-template: 50% 50% /100% + background-color: $cBoxBodyBackground \ No newline at end of file diff --git a/src/app/components/home/home.component.spec.ts b/src/app/components/home/home.component.spec.ts new file mode 100644 index 0000000..490e81b --- /dev/null +++ b/src/app/components/home/home.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { HomeComponent } from './home.component'; + +describe('HomeComponent', () => { + let component: HomeComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ HomeComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(HomeComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/components/home/home.component.ts b/src/app/components/home/home.component.ts new file mode 100644 index 0000000..e80493b --- /dev/null +++ b/src/app/components/home/home.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-home', + templateUrl: './home.component.html', + styleUrls: ['./home.component.sass'] +}) +export class HomeComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/src/app/components/imprint/imprint.component.html b/src/app/components/imprint/imprint.component.html new file mode 100644 index 0000000..38c4af9 --- /dev/null +++ b/src/app/components/imprint/imprint.component.html @@ -0,0 +1,8 @@ +
+
+

Imprint

+

The greenvironment network is being developed by Bliblablub

+

Contact

+

Email: mailadress

+
+
\ No newline at end of file diff --git a/src/app/components/imprint/imprint.component.sass b/src/app/components/imprint/imprint.component.sass new file mode 100644 index 0000000..ee3a6be --- /dev/null +++ b/src/app/components/imprint/imprint.component.sass @@ -0,0 +1,17 @@ +@import '../../../styles/mixins.sass' +@import '../../../styles/vars.sass' + +#imprint + background-color: $cSecondaryBackground + grid-template: 15% 70% 15% / 15% 70% 15% + display: grid + min-height: 100vh + max-height: 100vh + +#imprintcontainer + @include gridPosition(2, 2,2,2) + background-color: $cPrimaryBackground +input + margin: 0.25em +#header + @include gridPosition(1, 2, 1, 2) diff --git a/src/app/components/imprint/imprint.component.spec.ts b/src/app/components/imprint/imprint.component.spec.ts new file mode 100644 index 0000000..49b68ae --- /dev/null +++ b/src/app/components/imprint/imprint.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ImprintComponent } from './imprint.component'; + +describe('ImprintComponent', () => { + let component: ImprintComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ImprintComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ImprintComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/components/imprint/imprint.component.ts b/src/app/components/imprint/imprint.component.ts new file mode 100644 index 0000000..ba755c1 --- /dev/null +++ b/src/app/components/imprint/imprint.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-imprint', + templateUrl: './imprint.component.html', + styleUrls: ['./imprint.component.sass'] +}) +export class ImprintComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/src/app/components/login/login.component.html b/src/app/components/login/login.component.html new file mode 100644 index 0000000..e71540b --- /dev/null +++ b/src/app/components/login/login.component.html @@ -0,0 +1,17 @@ +
+
+ + + + + + + + + +
username:
password:
+ +
+ You aren´t part of greenvironment yet? - join us here +
+
\ No newline at end of file diff --git a/src/app/components/login/login.component.sass b/src/app/components/login/login.component.sass new file mode 100644 index 0000000..7c5c8d8 --- /dev/null +++ b/src/app/components/login/login.component.sass @@ -0,0 +1,18 @@ +@import '../../../styles/mixins.sass' +@import '../../../styles/vars.sass' + +#login + background-color: $cSecondaryBackground + grid-template: 15% 70% 15% / 15% 70% 15% + display: grid + min-height: 100vh + max-height: 100vh + +#logincontainer + @include gridPosition(2, 2,2,2) + grid-template: 15% 15% 15% 15% 15% 15% / 100% + background-color: $cPrimaryBackground +input + margin: 0.25em +#header + @include gridPosition(1, 2, 1, 2) diff --git a/src/app/components/login/login.component.scss b/src/app/components/login/login.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/components/login/login.component.spec.ts b/src/app/components/login/login.component.spec.ts new file mode 100644 index 0000000..d6d85a8 --- /dev/null +++ b/src/app/components/login/login.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { LoginComponent } from './login.component'; + +describe('LoginComponent', () => { + let component: LoginComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ LoginComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(LoginComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/components/login/login.component.ts b/src/app/components/login/login.component.ts new file mode 100644 index 0000000..848c59b --- /dev/null +++ b/src/app/components/login/login.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-login', + templateUrl: './login.component.html', + styleUrls: ['./login.component.sass'] +}) +export class LoginComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/src/app/components/profile/profile.component.html b/src/app/components/profile/profile.component.html new file mode 100644 index 0000000..a633ef0 --- /dev/null +++ b/src/app/components/profile/profile.component.html @@ -0,0 +1,4 @@ + + + + diff --git a/src/app/components/profile/profile.component.sass b/src/app/components/profile/profile.component.sass new file mode 100644 index 0000000..402b19e --- /dev/null +++ b/src/app/components/profile/profile.component.sass @@ -0,0 +1,25 @@ +@import '../../../styles/mixins.sass' +@import '../../../styles/vars.sass' + +#headerbar + @include gridPosition(1, 2, 1, 4) + display: grid + grid-template: 100% /30% 10% 10% 10% 10% 10% 10% 10% + background-color: $cHeadPrimaryBackground + color: $cHeadFontColor + +#chatcontainer + @include gridPosition(2, 3, 1, 2) + background-color: $cBoxBodyBackground + +#feedcontainer + @include gridPosition(2, 3, 2, 3) + display: grid + grid-template: 10% 90% /100% + background-color: $cSecondaryBackground + +#socialcontainer + @include gridPosition(2, 3, 3, 4) + display: grid + grid-template: 50% 50% /100% + background-color: $cBoxBodyBackground \ No newline at end of file diff --git a/src/app/components/profile/profile.component.spec.ts b/src/app/components/profile/profile.component.spec.ts new file mode 100644 index 0000000..692b234 --- /dev/null +++ b/src/app/components/profile/profile.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ProfileComponent } from './profile.component'; + +describe('ProfileComponent', () => { + let component: ProfileComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ProfileComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ProfileComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/components/profile/profile.component.ts b/src/app/components/profile/profile.component.ts new file mode 100644 index 0000000..80073a2 --- /dev/null +++ b/src/app/components/profile/profile.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-profile', + templateUrl: './profile.component.html', + styleUrls: ['./profile.component.sass'] +}) +export class ProfileComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/src/app/components/register/register.component.html b/src/app/components/register/register.component.html new file mode 100644 index 0000000..ca7da31 --- /dev/null +++ b/src/app/components/register/register.component.html @@ -0,0 +1,25 @@ +
+
+ + + + + + + + + + + + + + + + + +
username:
email:
password:
repeat password:
+ +
+ You are already part of greenvironment? - login +
+
\ No newline at end of file diff --git a/src/app/components/register/register.component.sass b/src/app/components/register/register.component.sass new file mode 100644 index 0000000..01893ff --- /dev/null +++ b/src/app/components/register/register.component.sass @@ -0,0 +1,20 @@ +@import '../../../styles/mixins.sass' +@import '../../../styles/vars.sass' + +#register + background-color: $cSecondaryBackground + grid-template: 15% 70% 15% / 15% 70% 15% + display: grid + min-height: 100vh + max-height: 100vh + +#registercontainer + @include gridPosition(2, 2,2,2) + grid-template: 15% 15% 15% 15% 15% 15% / 100% + background-color: $cPrimaryBackground + padding: 1em +input + margin: 0.25em + +#header + @include gridPosition(1, 2, 1, 2) diff --git a/src/app/components/register/register.component.spec.ts b/src/app/components/register/register.component.spec.ts new file mode 100644 index 0000000..6c19551 --- /dev/null +++ b/src/app/components/register/register.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { RegisterComponent } from './register.component'; + +describe('RegisterComponent', () => { + let component: RegisterComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ RegisterComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(RegisterComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/components/register/register.component.ts b/src/app/components/register/register.component.ts new file mode 100644 index 0000000..1b60d8d --- /dev/null +++ b/src/app/components/register/register.component.ts @@ -0,0 +1,34 @@ +import { Component, OnInit } from '@angular/core'; +import {RegisterService} from '../../services/register/register.service'; +import {Registration} from '../../models/registration'; + +@Component({ + selector: 'registration', + templateUrl: './register.component.html', + styleUrls: ['./register.component.sass'] +}) +export class RegisterComponent implements OnInit { + registration: Registration + + constructor(private registerService: RegisterService) { + this.registration = {username: null, passwordHash: null, email: null}; + } + + onClickSubmit(pUsername: string, pEmail: string, pPasswordHash: string,pPasswordHashRepeat: string ) { + console.log('username: ' + pUsername); + console.log('email: ' + pEmail); + + if(pPasswordHash == pPasswordHashRepeat){ + console.log('password same'); + this.registration.username = pUsername + this.registration.email = pEmail + this.registration.passwordHash = pPasswordHash + + this.registerService.register(this.registration) + } else{console.log('password NOT same'); } + } + + ngOnInit() {} + +} + diff --git a/src/app/components/social/friends/friends.component.html b/src/app/components/social/friends/friends.component.html new file mode 100644 index 0000000..f3e92ff --- /dev/null +++ b/src/app/components/social/friends/friends.component.html @@ -0,0 +1,10 @@ + +
+
+
{{friend}}
+
+
diff --git a/src/app/components/social/friends/friends.component.sass b/src/app/components/social/friends/friends.component.sass new file mode 100644 index 0000000..140dee3 --- /dev/null +++ b/src/app/components/social/friends/friends.component.sass @@ -0,0 +1,24 @@ +@import '../../../../styles/mixins.sass' +@import '../../../../styles/vars.sass' +@import '../social.component.sass' + +#friendslist + overflow: auto + @include gridPosition(2, 3, 1, 2) + .frienditem + background-color: $cPrimaryBackground + height: 3em + margin: 0.2em + padding: 0.25em + border-radius: 0.25em + border: solid + display: flex; + .friendname + font-weight: bold + text-align: left + border: solid + width: 60% + padding-left: 1em + margin: auto + span + font-size: 125% \ No newline at end of file diff --git a/src/app/components/social/friends/friends.component.spec.ts b/src/app/components/social/friends/friends.component.spec.ts new file mode 100644 index 0000000..c11e515 --- /dev/null +++ b/src/app/components/social/friends/friends.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { FriendsComponent } from './friends.component'; + +describe('FriendsComponent', () => { + let component: FriendsComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ FriendsComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(FriendsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/components/social/friends/friends.component.ts b/src/app/components/social/friends/friends.component.ts new file mode 100644 index 0000000..154df3a --- /dev/null +++ b/src/app/components/social/friends/friends.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'social-friends', + templateUrl: './friends.component.html', + styleUrls: ['./friends.component.sass'] +}) +export class FriendsComponent implements OnInit { + friends: Array = ["Friend 1", "Friend 2", "Friend 3", "Friend 4", "Friend 5", "Friend 6"] + constructor() { } + + ngOnInit() { + } + +} diff --git a/src/app/components/social/groups/groups.component.html b/src/app/components/social/groups/groups.component.html new file mode 100644 index 0000000..6164f35 --- /dev/null +++ b/src/app/components/social/groups/groups.component.html @@ -0,0 +1,10 @@ + +
+
+
{{group}}
+
+
diff --git a/src/app/components/social/groups/groups.component.sass b/src/app/components/social/groups/groups.component.sass new file mode 100644 index 0000000..8530af3 --- /dev/null +++ b/src/app/components/social/groups/groups.component.sass @@ -0,0 +1,24 @@ +@import '../../../../styles/mixins.sass' +@import '../../../../styles/vars.sass' +@import '../social.component.sass' + +#groupslist + overflow: auto + @include gridPosition(2, 3, 1, 2) + .groupitem + background-color: $cPrimaryBackground + height: 3em + margin: 0.2em + padding: 0.25em + border-radius: 0.25em + border: solid + display: flex; + .groupname + font-weight: bold + text-align: left + border: solid + width: 60% + padding-left: 1em + margin: auto + span + font-size: 125% \ No newline at end of file diff --git a/src/app/components/social/groups/groups.component.spec.ts b/src/app/components/social/groups/groups.component.spec.ts new file mode 100644 index 0000000..b34cad1 --- /dev/null +++ b/src/app/components/social/groups/groups.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { GroupsComponent } from './groups.component'; + +describe('GroupsComponent', () => { + let component: GroupsComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ GroupsComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(GroupsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/components/social/groups/groups.component.ts b/src/app/components/social/groups/groups.component.ts new file mode 100644 index 0000000..5e7f8f2 --- /dev/null +++ b/src/app/components/social/groups/groups.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'social-groups', + templateUrl: './groups.component.html', + styleUrls: ['./groups.component.sass'] +}) +export class GroupsComponent implements OnInit { + groups: Array = ["Group 1", "Group 2", "Group 3", "Group 4", "Group 5", "Group 6"] + constructor() { } + + ngOnInit() { + } + +} diff --git a/src/app/components/social/social.component.html b/src/app/components/social/social.component.html new file mode 100644 index 0000000..95daf35 --- /dev/null +++ b/src/app/components/social/social.component.html @@ -0,0 +1,2 @@ + + diff --git a/src/app/components/social/social.component.sass b/src/app/components/social/social.component.sass new file mode 100644 index 0000000..7840e29 --- /dev/null +++ b/src/app/components/social/social.component.sass @@ -0,0 +1,44 @@ +@import '../../../styles/mixins.sass' +@import '../../../styles/vars.sass' + +#friendscontainer + @include gridPosition(1, 2, 1, 2) + display: grid + grid-template: 15% 85% /100% + +#groupscontainer + @include gridPosition(2, 3, 1, 2) + display: grid + grid-template: 15% 85% /100% + +#header + @include gridPosition(1, 2, 1, 2) + background-color: $cBoxHeaderBackground + display: grid + grid-template: 100% /60% 20% 20% + + span + color: $cFontWhite + span.title + @include gridPosition(1, 2, 1, 2) + margin-top: 0.25em + margin-left: 0.25em + line-height: 100% + font-size: 2em + + button + background-color: $cBoxHeaderBackground + border: none + + button:hover + background-color: lighten($cBoxHeaderBackground, 10%) + cursor: pointer + + button:active + background-color: darken($cBoxHeaderBackground, 5%) + + #new + @include gridPosition(1, 2, 2, 3) + + #invitations + @include gridPosition(1, 2, 3, 4) \ No newline at end of file diff --git a/src/app/components/social/social.component.spec.ts b/src/app/components/social/social.component.spec.ts new file mode 100644 index 0000000..8f1a812 --- /dev/null +++ b/src/app/components/social/social.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { SocialComponent } from './social.component'; + +describe('SocialComponent', () => { + let component: SocialComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ SocialComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SocialComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/components/social/social.component.ts b/src/app/components/social/social.component.ts new file mode 100644 index 0000000..88f8495 --- /dev/null +++ b/src/app/components/social/social.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'home-social', + templateUrl: './social.component.html', + styleUrls: ['./social.component.sass'] +}) +export class SocialComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/src/app/graphql.module.ts b/src/app/graphql.module.ts new file mode 100644 index 0000000..3942184 --- /dev/null +++ b/src/app/graphql.module.ts @@ -0,0 +1,25 @@ +import {NgModule} from '@angular/core'; +import {ApolloModule, APOLLO_OPTIONS} from 'apollo-angular'; +import {HttpLinkModule, HttpLink} 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/app/models/chatinfo.ts b/src/app/models/chatinfo.ts new file mode 100644 index 0000000..0670a21 --- /dev/null +++ b/src/app/models/chatinfo.ts @@ -0,0 +1,9 @@ +export class Chatinfo { + id: string; + date: string; + + constructor(pId: string, pDate: string) { + this.id = pId + this.date = pDate + } +} \ No newline at end of file diff --git a/src/app/models/chatmessage.ts b/src/app/models/chatmessage.ts new file mode 100644 index 0000000..286a2e6 --- /dev/null +++ b/src/app/models/chatmessage.ts @@ -0,0 +1,9 @@ +export class Chatmessage { + content: string; + myself: boolean; + + constructor(pContent: string, pMyself: boolean) { + this.content = pContent + this.myself = pMyself + } +} \ No newline at end of file diff --git a/src/app/models/document.ts b/src/app/models/document.ts new file mode 100644 index 0000000..4f6e928 --- /dev/null +++ b/src/app/models/document.ts @@ -0,0 +1,4 @@ +export class Document { + id: string; + doc: string; +} diff --git a/src/app/models/post.ts b/src/app/models/post.ts new file mode 100644 index 0000000..6628a63 --- /dev/null +++ b/src/app/models/post.ts @@ -0,0 +1,17 @@ +export class Post { + id: string + username: string + handle: string + message: string + date: string + votes: number + + constructor(pId: string, pUsername: string, pHandle: string, pMessage: string, pDate: string, pVotes: number) { + this.id = pId + this.username = pUsername + this.handle = pHandle + this.message = pMessage + this.date = pDate + this.votes = pVotes + } +} \ No newline at end of file diff --git a/src/app/models/registration.ts b/src/app/models/registration.ts new file mode 100644 index 0000000..ff4b1a2 --- /dev/null +++ b/src/app/models/registration.ts @@ -0,0 +1,5 @@ +export interface Registration { + username: string; + email: string; + passwordHash: string + } \ No newline at end of file diff --git a/src/app/services/chat/chat.service.spec.ts b/src/app/services/chat/chat.service.spec.ts new file mode 100644 index 0000000..f9d1b52 --- /dev/null +++ b/src/app/services/chat/chat.service.spec.ts @@ -0,0 +1,12 @@ +import { TestBed } from '@angular/core/testing'; + +import { ChatService } from './chat.service'; + +describe('ChatService', () => { + beforeEach(() => TestBed.configureTestingModule({})); + + it('should be created', () => { + const service: ChatService = TestBed.get(ChatService); + expect(service).toBeTruthy(); + }); +}); diff --git a/src/app/services/chat/chat.service.ts b/src/app/services/chat/chat.service.ts new file mode 100644 index 0000000..6856582 --- /dev/null +++ b/src/app/services/chat/chat.service.ts @@ -0,0 +1,59 @@ +import { Injectable } from '@angular/core'; +import {Http, URLSearchParams, Headers} from '@angular/http'; +import {Apollo} from 'apollo-angular'; +import gql from 'graphql-tag'; + +@Injectable({ + providedIn: 'root' +}) +export class ChatService { + + name: any + + rates: any[]; + loading = true; + error: any; + + constructor(private apollo: Apollo) { } + + public getSelfName2() { + this.apollo + .watchQuery({ + query: gql` + { + getSelf { + name + } + } + `, + }) + .valueChanges.subscribe(result => { + this.name = result.data && result.data.name; + this.loading = result.loading; + this.error = result.errors; + }); + + console.log(this.name) + } + + public getSelfName() { + this.apollo + .query({ + query: gql` + { + rates(currency: "USD") { + currency + rate + } + } + `, + }) + .subscribe(result => { + this.rates = result.data && result.data.rates; + this.loading = result.loading; + this.error = result.errors; + }); + + console.log(this.rates) + } +} diff --git a/src/app/services/document.service.spec.ts b/src/app/services/document.service.spec.ts new file mode 100644 index 0000000..186f71a --- /dev/null +++ b/src/app/services/document.service.spec.ts @@ -0,0 +1,12 @@ +import { TestBed } from '@angular/core/testing'; + +import { DocumentService } from './document.service'; + +describe('DocumentService', () => { + beforeEach(() => TestBed.configureTestingModule({})); + + it('should be created', () => { + const service: DocumentService = TestBed.get(DocumentService); + expect(service).toBeTruthy(); + }); +}); diff --git a/src/app/services/document.service.ts b/src/app/services/document.service.ts new file mode 100644 index 0000000..a511832 --- /dev/null +++ b/src/app/services/document.service.ts @@ -0,0 +1,38 @@ +import { Injectable } from '@angular/core'; + +import { Socket } from 'ngx-socket-io'; + +import { Document } from '../models/document'; + +@Injectable({ + providedIn: 'root' +}) +export class DocumentService { + currentDocument = this.socket.fromEvent('document'); + documents = this.socket.fromEvent('documents'); + + constructor(private socket: Socket) { } + + getDocument(id: string) { + this.socket.emit('getDoc', id); + } + + newDocument() { + this.socket.emit('addDoc', { id: this.docId(), doc: '' }); + } + + editDocument(document: Document) { + this.socket.emit('editDoc', document); + } + + private docId() { + let text = ''; + const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + + for (let i = 0; i < 5; i++) { + text += possible.charAt(Math.floor(Math.random() * possible.length)); + } + + return text; + } +} diff --git a/src/app/services/login/login.service.spec.ts b/src/app/services/login/login.service.spec.ts new file mode 100644 index 0000000..024e696 --- /dev/null +++ b/src/app/services/login/login.service.spec.ts @@ -0,0 +1,12 @@ +import { TestBed } from '@angular/core/testing'; + +import { LoginService } from './login.service'; + +describe('LoginService', () => { + beforeEach(() => TestBed.configureTestingModule({})); + + it('should be created', () => { + const service: LoginService = TestBed.get(LoginService); + expect(service).toBeTruthy(); + }); +}); diff --git a/src/app/services/login/login.service.ts b/src/app/services/login/login.service.ts new file mode 100644 index 0000000..92c777e --- /dev/null +++ b/src/app/services/login/login.service.ts @@ -0,0 +1,9 @@ +import { Injectable } from '@angular/core'; + +@Injectable({ + providedIn: 'root' +}) +export class LoginService { + + constructor() { } +} diff --git a/src/app/services/register/register.service.spec.ts b/src/app/services/register/register.service.spec.ts new file mode 100644 index 0000000..3df5990 --- /dev/null +++ b/src/app/services/register/register.service.spec.ts @@ -0,0 +1,12 @@ +import { TestBed } from '@angular/core/testing'; + +import { RegisterService } from './register.service'; + +describe('RegisterService', () => { + beforeEach(() => TestBed.configureTestingModule({})); + + it('should be created', () => { + const service: RegisterService = TestBed.get(RegisterService); + expect(service).toBeTruthy(); + }); +}); diff --git a/src/app/services/register/register.service.ts b/src/app/services/register/register.service.ts new file mode 100644 index 0000000..a750046 --- /dev/null +++ b/src/app/services/register/register.service.ts @@ -0,0 +1,34 @@ +import { Injectable } from '@angular/core'; +import {Http, URLSearchParams, Headers} from '@angular/http'; +import { Registration } from '../../models/registration'; + +@Injectable({ + providedIn: 'root' +}) +export class RegisterService { + + constructor(private http: Http) { } + + public register(registration: Registration) { + + //let url = './graphql' + let url = 'https://greenvironment.net/graphql' + + let headers = new Headers(); + headers.set('Content-Type', 'application/json'); + + return this.http.post(url, this.buildJson(registration)).subscribe(response => console.log(response.text())); + } + + public buildJson(registration: Registration): any { + const body = {query: `mutation($username: String, $email: String, $pwHash: String) { + register(username: $username, email: $email, passwordHash: $pwHash) {id} + }`, variables: { + email: registration.email, + pwHash: registration.passwordHash, + username: registration.username, + }}; + return body; + } +} + diff --git a/src/assets/.gitkeep b/src/assets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/src/browserslist b/src/browserslist new file mode 100644 index 0000000..37371cb --- /dev/null +++ b/src/browserslist @@ -0,0 +1,11 @@ +# This file is currently used by autoprefixer to adjust CSS to support the below specified browsers +# For additional information regarding the format and rule options, please see: +# https://github.com/browserslist/browserslist#queries +# +# For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed + +> 0.5% +last 2 versions +Firefox ESR +not dead +not IE 9-11 \ No newline at end of file diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts new file mode 100644 index 0000000..3612073 --- /dev/null +++ b/src/environments/environment.prod.ts @@ -0,0 +1,3 @@ +export const environment = { + production: true +}; diff --git a/src/environments/environment.ts b/src/environments/environment.ts new file mode 100644 index 0000000..7b4f817 --- /dev/null +++ b/src/environments/environment.ts @@ -0,0 +1,16 @@ +// This file can be replaced during build by using the `fileReplacements` array. +// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. +// The list of file replacements can be found in `angular.json`. + +export const environment = { + production: false +}; + +/* + * For easier debugging in development mode, you can import the following file + * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. + * + * This import should be commented out in production mode because it will have a negative impact + * on performance if an error is thrown. + */ +// import 'zone.js/dist/zone-error'; // Included with Angular CLI. diff --git a/src/favicon.ico b/src/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..8081c7ceaf2be08bf59010158c586170d9d2d517 GIT binary patch literal 5430 zcmc(je{54#6vvCoAI3i*G5%$U7!sA3wtMZ$fH6V9C`=eXGJb@R1%(I_{vnZtpD{6n z5Pl{DmxzBDbrB>}`90e12m8T*36WoeDLA&SD_hw{H^wM!cl_RWcVA!I+x87ee975; z@4kD^=bYPn&pmG@(+JZ`rqQEKxW<}RzhW}I!|ulN=fmjVi@x{p$cC`)5$a!)X&U+blKNvN5tg=uLvuLnuqRM;Yc*swiexsoh#XPNu{9F#c`G zQLe{yWA(Y6(;>y|-efAy11k<09(@Oo1B2@0`PtZSkqK&${ zgEY}`W@t{%?9u5rF?}Y7OL{338l*JY#P!%MVQY@oqnItpZ}?s z!r?*kwuR{A@jg2Chlf0^{q*>8n5Ir~YWf*wmsh7B5&EpHfd5@xVaj&gqsdui^spyL zB|kUoblGoO7G(MuKTfa9?pGH0@QP^b#!lM1yHWLh*2iq#`C1TdrnO-d#?Oh@XV2HK zKA{`eo{--^K&MW66Lgsktfvn#cCAc*(}qsfhrvOjMGLE?`dHVipu1J3Kgr%g?cNa8 z)pkmC8DGH~fG+dlrp(5^-QBeEvkOvv#q7MBVLtm2oD^$lJZx--_=K&Ttd=-krx(Bb zcEoKJda@S!%%@`P-##$>*u%T*mh+QjV@)Qa=Mk1?#zLk+M4tIt%}wagT{5J%!tXAE;r{@=bb%nNVxvI+C+$t?!VJ@0d@HIyMJTI{vEw0Ul ze(ha!e&qANbTL1ZneNl45t=#Ot??C0MHjjgY8%*mGisN|S6%g3;Hlx#fMNcL<87MW zZ>6moo1YD?P!fJ#Jb(4)_cc50X5n0KoDYfdPoL^iV`k&o{LPyaoqMqk92wVM#_O0l z09$(A-D+gVIlq4TA&{1T@BsUH`Bm=r#l$Z51J-U&F32+hfUP-iLo=jg7Xmy+WLq6_tWv&`wDlz#`&)Jp~iQf zZP)tu>}pIIJKuw+$&t}GQuqMd%Z>0?t%&BM&Wo^4P^Y z)c6h^f2R>X8*}q|bblAF?@;%?2>$y+cMQbN{X$)^R>vtNq_5AB|0N5U*d^T?X9{xQnJYeU{ zoZL#obI;~Pp95f1`%X3D$Mh*4^?O?IT~7HqlWguezmg?Ybq|7>qQ(@pPHbE9V?f|( z+0xo!#m@Np9PljsyxBY-UA*{U*la#8Wz2sO|48_-5t8%_!n?S$zlGe+NA%?vmxjS- zHE5O3ZarU=X}$7>;Okp(UWXJxI%G_J-@IH;%5#Rt$(WUX?6*Ux!IRd$dLP6+SmPn= z8zjm4jGjN772R{FGkXwcNv8GBcZI#@Y2m{RNF_w8(Z%^A*!bS*!}s6sh*NnURytky humW;*g7R+&|Ledvc- + + + + Greenvironment + + + + + + + + + diff --git a/src/karma.conf.js b/src/karma.conf.js new file mode 100644 index 0000000..b6e0042 --- /dev/null +++ b/src/karma.conf.js @@ -0,0 +1,31 @@ +// Karma configuration file, see link for more information +// https://karma-runner.github.io/1.0/config/configuration-file.html + +module.exports = function (config) { + config.set({ + basePath: '', + frameworks: ['jasmine', '@angular-devkit/build-angular'], + plugins: [ + require('karma-jasmine'), + require('karma-chrome-launcher'), + require('karma-jasmine-html-reporter'), + require('karma-coverage-istanbul-reporter'), + require('@angular-devkit/build-angular/plugins/karma') + ], + client: { + clearContext: false // leave Jasmine Spec Runner output visible in browser + }, + coverageIstanbulReporter: { + dir: require('path').join(__dirname, '../coverage'), + reports: ['html', 'lcovonly'], + fixWebpackSourcePaths: true + }, + reporters: ['progress', 'kjhtml'], + port: 9876, + colors: true, + logLevel: config.LOG_INFO, + autoWatch: true, + browsers: ['Chrome'], + singleRun: false + }); +}; \ No newline at end of file diff --git a/src/main.ts b/src/main.ts new file mode 100644 index 0000000..64b81cd --- /dev/null +++ b/src/main.ts @@ -0,0 +1,13 @@ +import { enableProdMode } from '@angular/core'; +import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; + +import { AppModule } from './app/app.module'; +import { environment } from './environments/environment'; +import 'rxjs'; + +if (environment.production) { + enableProdMode(); +} + +platformBrowserDynamic().bootstrapModule(AppModule) + .catch(err => console.error(err)); diff --git a/src/polyfills.ts b/src/polyfills.ts new file mode 100644 index 0000000..8179d14 --- /dev/null +++ b/src/polyfills.ts @@ -0,0 +1,82 @@ +/** + * This file includes polyfills needed by Angular and is loaded before the app. + * You can add your own extra polyfills to this file. + * + * This file is divided into 2 sections: + * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. + * 2. Application imports. Files imported after ZoneJS that should be loaded before your main + * file. + * + * The current setup is for so-called "evergreen" browsers; the last versions of browsers that + * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), + * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. + * + * Learn more in https://angular.io/guide/browser-support + */ + +/*************************************************************************************************** + * BROWSER POLYFILLS + */ + +(window as any).global = window; + +/** IE9, IE10 and IE11 requires all of the following polyfills. **/ +// import 'core-js/es6/symbol'; +// import 'core-js/es6/object'; +// import 'core-js/es6/function'; +// import 'core-js/es6/parse-int'; +// import 'core-js/es6/parse-float'; +// import 'core-js/es6/number'; +// import 'core-js/es6/math'; +// import 'core-js/es6/string'; +// import 'core-js/es6/date'; +// import 'core-js/es6/array'; +// import 'core-js/es6/regexp'; +// import 'core-js/es6/map'; +// import 'core-js/es6/weak-map'; +// import 'core-js/es6/set'; + +/** + * If the application will be indexed by Google Search, the following is required. + * Googlebot uses a renderer based on Chrome 41. + * https://developers.google.com/search/docs/guides/rendering + **/ +// import 'core-js/es6/array'; + +/** IE10 and IE11 requires the following for NgClass support on SVG elements */ +// import 'classlist.js'; // Run `npm install --save classlist.js`. + +/** IE10 and IE11 requires the following for the Reflect API. */ +// import 'core-js/es6/reflect'; + +/** + * Web Animations `@angular/platform-browser/animations` + * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. + * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). + **/ +// import 'web-animations-js'; // Run `npm install --save web-animations-js`. + +/** + * By default, zone.js will patch all possible macroTask and DomEvents + * user can disable parts of macroTask/DomEvents patch by setting following flags + */ + + // (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame + // (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick + // (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames + + /* + * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js + * with the following flag, it will bypass `zone.js` patch for IE/Edge + */ +// (window as any).__Zone_enable_cross_context_check = true; + +/*************************************************************************************************** + * Zone JS is required by default for Angular itself. + */ +import 'zone.js/dist/zone'; // Included with Angular CLI. + + +/*************************************************************************************************** + * APPLICATION IMPORTS + */ diff --git a/src/styles.sass b/src/styles.sass new file mode 100644 index 0000000..e0fdf79 --- /dev/null +++ b/src/styles.sass @@ -0,0 +1,10 @@ +@import 'styles/mixins.sass' +@import 'styles/vars.sass' + +body + font-family: Arial, serif + margin: 0 + padding: 0 + min-height: 100vh + max-height: 100vh + \ No newline at end of file diff --git a/src/styles/mixins.sass b/src/styles/mixins.sass new file mode 100644 index 0000000..14bca84 --- /dev/null +++ b/src/styles/mixins.sass @@ -0,0 +1,5 @@ +@mixin gridPosition($rowStart, $rowEnd, $columnStart, $columnEnd) + grid-row-start: $rowStart + grid-row-end: $rowEnd + grid-column-start: $columnStart + grid-column-end: $columnEnd diff --git a/src/styles/vars.sass b/src/styles/vars.sass new file mode 100644 index 0000000..5d17deb --- /dev/null +++ b/src/styles/vars.sass @@ -0,0 +1,27 @@ +$cPrimaryBackground: #fff +$cSecondaryBackground: #ddd +$cInactiveText: #555 +$cPrimarySurface: #fff + +//Headerbar +$cHeadPrimaryBackground: #0d6b14 +$cHeadFontColor: #adffc1ee + +//Home -- Feed +$cFeedPrimaryFontColor: #243dca +$cFeedSecondaryFontColor: #243dca +$cFeedInputBorder: #396d51 +$cFeedItemBackground: #b0ecb0fb +$cFeedChooserBackground: #259145 +$cFeedBackground: #36ce64 +$cFeedUpVote: #2cb149 +$cFeedDownVote: #ff5f5f + +//Home -- Chat, Friends, Groups +$cFontWhite: #adffc1ee +$cBoxHeaderBackground: #259145 +$cBoxBodyBackground: #3deb71 +$cMessageOwn: #cfe4c9 +$cMessageForeign: #baca5d + + diff --git a/src/test.ts b/src/test.ts new file mode 100644 index 0000000..1631789 --- /dev/null +++ b/src/test.ts @@ -0,0 +1,20 @@ +// This file is required by karma.conf.js and loads recursively all the .spec and framework files + +import 'zone.js/dist/zone-testing'; +import { getTestBed } from '@angular/core/testing'; +import { + BrowserDynamicTestingModule, + platformBrowserDynamicTesting +} from '@angular/platform-browser-dynamic/testing'; + +declare const require: any; + +// First, initialize the Angular testing environment. +getTestBed().initTestEnvironment( + BrowserDynamicTestingModule, + platformBrowserDynamicTesting() +); +// Then we find all the tests. +const context = require.context('./', true, /\.spec\.ts$/); +// And load the modules. +context.keys().map(context); diff --git a/src/tsconfig.app.json b/src/tsconfig.app.json new file mode 100644 index 0000000..190fd30 --- /dev/null +++ b/src/tsconfig.app.json @@ -0,0 +1,11 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "outDir": "../out-tsc/app", + "types": [] + }, + "exclude": [ + "test.ts", + "**/*.spec.ts" + ] +} diff --git a/src/tsconfig.spec.json b/src/tsconfig.spec.json new file mode 100644 index 0000000..de77336 --- /dev/null +++ b/src/tsconfig.spec.json @@ -0,0 +1,18 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "outDir": "../out-tsc/spec", + "types": [ + "jasmine", + "node" + ] + }, + "files": [ + "test.ts", + "polyfills.ts" + ], + "include": [ + "**/*.spec.ts", + "**/*.d.ts" + ] +} diff --git a/src/tslint.json b/src/tslint.json new file mode 100644 index 0000000..52e2c1a --- /dev/null +++ b/src/tslint.json @@ -0,0 +1,17 @@ +{ + "extends": "../tslint.json", + "rules": { + "directive-selector": [ + true, + "attribute", + "app", + "camelCase" + ], + "component-selector": [ + true, + "element", + "app", + "kebab-case" + ] + } +} diff --git a/tsconfig.json b/tsconfig.json index 46aeded..0d2c39a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,7 +15,8 @@ ], "lib": [ "es2018", - "dom" + "dom", + "esnext.asynciterable" ] } -} +} \ No newline at end of file