From 6b97c687d60e3006e38c8dc347f9c1b69ddd45fd Mon Sep 17 00:00:00 2001 From: Daniel Scheidle Date: Wed, 9 Nov 2022 01:06:40 +0100 Subject: [PATCH] Pushed new version. --- .browserslistrc | 16 ++++ .editorconfig | 16 ++++ .gitignore | 42 +++++++++ .vscode/extensions.json | 4 + .vscode/launch.json | 20 ++++ .vscode/tasks.json | 42 +++++++++ README.md | 28 +++++- angular.json | 87 +++++++++--------- ...ification mini-project - Stock tracker.pdf | Bin 0 -> 446898 bytes karma.conf.js | 44 +++++++++ package.json | 41 +++++---- src/app/app-routing.module.ts | 17 ++++ src/app/app.component.css | 3 - src/app/app.component.html | 5 +- src/app/app.component.spec.ts | 35 +++++++ src/app/app.component.ts | 10 +- src/app/app.module.ts | 53 +++++++++-- .../stock-card/stock-card.component.css | 16 ++++ .../stock-card/stock-card.component.html | 27 ++++++ .../stock-card/stock-card.component.spec.ts | 23 +++++ .../stock-card/stock-card.component.ts | 40 ++++++++ src/app/hello.component.ts | 10 -- src/app/model/company-data.ts | 21 +++++ .../landing-page/landing-page.component.css | 7 ++ .../landing-page/landing-page.component.html | 26 ++++++ .../landing-page.component.spec.ts | 23 +++++ .../landing-page/landing-page.component.ts | 52 +++++++++++ .../pages/sentiment/sentiment.component.css | 0 .../pages/sentiment/sentiment.component.html | 1 + .../sentiment/sentiment.component.spec.ts | 23 +++++ .../pages/sentiment/sentiment.component.ts | 16 ++++ src/app/services/finnhub.service.spec.ts | 16 ++++ src/app/services/finnhub.service.ts | 29 ++++++ src/app/services/storage.service.spec.ts | 16 ++++ src/app/services/storage.service.ts | 41 +++++++++ src/assets/.gitkeep | 0 src/environments/environment.prod.ts | 3 + src/environments/environment.ts | 16 ++++ src/favicon.ico | Bin 0 -> 948 bytes src/index.html | 17 +++- src/main.ts | 16 ++-- src/polyfills.ts | 70 ++++++-------- src/styles.css | 5 +- src/test.ts | 26 ++++++ tsconfig.app.json | 15 +++ tsconfig.json | 25 +++-- tsconfig.spec.json | 18 ++++ 47 files changed, 900 insertions(+), 161 deletions(-) create mode 100644 .browserslistrc create mode 100644 .editorconfig create mode 100644 .gitignore create mode 100644 .vscode/extensions.json create mode 100644 .vscode/launch.json create mode 100644 .vscode/tasks.json create mode 100644 doc/Angular Level 2 certification mini-project - Stock tracker.pdf create mode 100644 karma.conf.js create mode 100644 src/app/app-routing.module.ts create mode 100644 src/app/app.component.spec.ts create mode 100644 src/app/components/stock-card/stock-card.component.css create mode 100644 src/app/components/stock-card/stock-card.component.html create mode 100644 src/app/components/stock-card/stock-card.component.spec.ts create mode 100644 src/app/components/stock-card/stock-card.component.ts delete mode 100644 src/app/hello.component.ts create mode 100644 src/app/model/company-data.ts create mode 100644 src/app/pages/landing-page/landing-page.component.css create mode 100644 src/app/pages/landing-page/landing-page.component.html create mode 100644 src/app/pages/landing-page/landing-page.component.spec.ts create mode 100644 src/app/pages/landing-page/landing-page.component.ts create mode 100644 src/app/pages/sentiment/sentiment.component.css create mode 100644 src/app/pages/sentiment/sentiment.component.html create mode 100644 src/app/pages/sentiment/sentiment.component.spec.ts create mode 100644 src/app/pages/sentiment/sentiment.component.ts create mode 100644 src/app/services/finnhub.service.spec.ts create mode 100644 src/app/services/finnhub.service.ts create mode 100644 src/app/services/storage.service.spec.ts create mode 100644 src/app/services/storage.service.ts create mode 100644 src/assets/.gitkeep 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/test.ts create mode 100644 tsconfig.app.json create mode 100644 tsconfig.spec.json diff --git a/.browserslistrc b/.browserslistrc new file mode 100644 index 0000000..4f9ac26 --- /dev/null +++ b/.browserslistrc @@ -0,0 +1,16 @@ +# This file is used by the build system to adjust CSS and JS output to support the specified browsers below. +# For additional information regarding the format and rule options, please see: +# https://github.com/browserslist/browserslist#queries + +# For the full list of supported browsers by the Angular framework, please see: +# https://angular.io/guide/browser-support + +# You can see what browsers were selected by your queries by running: +# npx browserslist + +last 1 Chrome version +last 1 Firefox version +last 2 Edge major versions +last 2 Safari major versions +last 2 iOS major versions +Firefox ESR diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..59d9a3a --- /dev/null +++ b/.editorconfig @@ -0,0 +1,16 @@ +# Editor configuration, see https://editorconfig.org +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +insert_final_newline = true +trim_trailing_whitespace = true + +[*.ts] +quote_type = single + +[*.md] +max_line_length = off +trim_trailing_whitespace = false diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1624286 --- /dev/null +++ b/.gitignore @@ -0,0 +1,42 @@ +# See http://help.github.com/ignore-files/ for more about ignoring files. + +# Compiled output +/dist +/tmp +/out-tsc +/bazel-out +nng +# Node +/node_modules +npm-debug.log +yarn-error.log + +# IDEs and editors +.idea/ +.project +.classpath +.c9/ +*.launch +.settings/ +*.sublime-workspace + +# Visual Studio Code +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +.history/* + +# Miscellaneous +/.angular/cache +.sass-cache/ +/connect.lock +/coverage +/libpeerconnection.log +testem.log +/typings + +# System files +.DS_Store +Thumbs.db diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..77b3745 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,4 @@ +{ + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846 + "recommendations": ["angular.ng-template"] +} diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..740e35a --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,20 @@ +{ + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "ng serve", + "type": "pwa-chrome", + "request": "launch", + "preLaunchTask": "npm: start", + "url": "http://localhost:4200/" + }, + { + "name": "ng test", + "type": "chrome", + "request": "launch", + "preLaunchTask": "npm: test", + "url": "http://localhost:9876/debug.html" + } + ] +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..a298b5b --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,42 @@ +{ + // For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558 + "version": "2.0.0", + "tasks": [ + { + "type": "npm", + "script": "start", + "isBackground": true, + "problemMatcher": { + "owner": "typescript", + "pattern": "$tsc", + "background": { + "activeOnStart": true, + "beginsPattern": { + "regexp": "(.*?)" + }, + "endsPattern": { + "regexp": "bundle generation complete" + } + } + } + }, + { + "type": "npm", + "script": "test", + "isBackground": true, + "problemMatcher": { + "owner": "typescript", + "pattern": "$tsc", + "background": { + "activeOnStart": true, + "beginsPattern": { + "regexp": "(.*?)" + }, + "endsPattern": { + "regexp": "bundle generation complete" + } + } + } + } + ] +} diff --git a/README.md b/README.md index 3eaa156..2fb9bed 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,27 @@ -# at-certification-stock +# AtCertificationStock -[Edit on StackBlitz ⚡️](https://stackblitz.com/edit/angular-ivy-2c4mp6) \ No newline at end of file +This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 14.2.8. + +## Development server + +Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files. + +## Code scaffolding + +Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. + +## Build + +Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. + +## Running unit tests + +Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). + +## Running end-to-end tests + +Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities. + +## Further help + +To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page. diff --git a/angular.json b/angular.json index 7a03df9..648098f 100644 --- a/angular.json +++ b/angular.json @@ -3,65 +3,80 @@ "version": 1, "newProjectRoot": "projects", "projects": { - "demo": { + "at-certification-stock": { + "projectType": "application", + "schematics": {}, "root": "", "sourceRoot": "src", - "projectType": "application", "prefix": "app", - "schematics": {}, "architect": { "build": { "builder": "@angular-devkit/build-angular:browser", "options": { - "outputPath": "dist/demo", + "outputPath": "dist/at-certification-stock", "index": "src/index.html", "main": "src/main.ts", "polyfills": "src/polyfills.ts", - "tsConfig": "src/tsconfig.app.json", + "tsConfig": "tsconfig.app.json", "assets": [ "src/favicon.ico", "src/assets" ], "styles": [ + "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css", "src/styles.css" ], "scripts": [] }, "configurations": { "production": { + "budgets": [ + { + "type": "initial", + "maximumWarning": "500kb", + "maximumError": "1mb" + }, + { + "type": "anyComponentStyle", + "maximumWarning": "2kb", + "maximumError": "4kb" + } + ], "fileReplacements": [ { "replace": "src/environments/environment.ts", "with": "src/environments/environment.prod.ts" } ], - "optimization": true, - "outputHashing": "all", - "sourceMap": false, - "extractCss": true, - "namedChunks": false, - "aot": true, - "extractLicenses": true, - "vendorChunk": false, - "buildOptimizer": true + "outputHashing": "all" + }, + "development": { + "buildOptimizer": false, + "optimization": false, + "vendorChunk": true, + "extractLicenses": false, + "sourceMap": true, + "namedChunks": true } - } + }, + "defaultConfiguration": "production" }, "serve": { "builder": "@angular-devkit/build-angular:dev-server", - "options": { - "browserTarget": "demo:build" - }, "configurations": { "production": { - "browserTarget": "demo:build:production" + "browserTarget": "at-certification-stock:build:production" + }, + "development": { + "browserTarget": "at-certification-stock:build:development" } - } + }, + "defaultConfiguration": "development" }, "extract-i18n": { "builder": "@angular-devkit/build-angular:extract-i18n", "options": { - "browserTarget": "demo:build" + "browserTarget": "at-certification-stock:build" } }, "test": { @@ -69,32 +84,20 @@ "options": { "main": "src/test.ts", "polyfills": "src/polyfills.ts", - "tsConfig": "src/tsconfig.spec.json", - "karmaConfig": "src/karma.conf.js", - "styles": [ - "styles.css" - ], - "scripts": [], + "tsConfig": "tsconfig.spec.json", + "karmaConfig": "karma.conf.js", "assets": [ "src/favicon.ico", "src/assets" - ] - } - }, - "lint": { - "builder": "@angular-devkit/build-angular:tslint", - "options": { - "tsConfig": [ - "src/tsconfig.app.json", - "src/tsconfig.spec.json" ], - "exclude": [ - "**/node_modules/**" - ] + "styles": [ + "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css", + "src/styles.css" + ], + "scripts": [] } } } } - }, - "defaultProject": "demo" -} \ No newline at end of file + } +} diff --git a/doc/Angular Level 2 certification mini-project - Stock tracker.pdf b/doc/Angular Level 2 certification mini-project - Stock tracker.pdf new file mode 100644 index 0000000000000000000000000000000000000000..701c48fcee24169d8538c467a8d67bfb193c3f16 GIT binary patch literal 446898 zcmeFY`9IX(`#&y{5RxSOR`#9j`oseZHYZ#=m4TecZWJwG% z*0Ckq=Zv1u_v`h&eLtVu?ehnG{Lrmi&f}cxoa?&o*Zo?$c~4zaP*g~Q?B*!;*BqHB zn+Thiy&IXlys(k0?;|HR9u-e#=%WV^HXSEFr$=mJYz|HkU)P7O4i9`?y*$}GTs>U{ zA49y{oE&`F1lbIIy&T-xd?61U+?^o2WWx6#UXD=k1sji{yXymCa2A_~sE7=kmY0_^ z*j(Mq!H4a>lc%E-1T0rnBm;lNpDz9%DI6ZKiINGc>aq#zc|klLJo?WfssAieQ^7C# zyHrPwO@vHX=g!%mrfgzDl4n0sWWu^SY@*;-hAKcnsMG&`Q|bS!O+|&o|Ni`6?ke-2 zU5x@CJFy9y>D%L93gwgf$;M@O4sma`18l$LKhDI)ihh#BWJTDk`%1_(Gf>c#s9;uD1KC`BBL)3o zL6#ZDw%YuzjZQ1b!EDIGohQRGZT0nX7Vg7HnM3~V&`!nSkf9Jyj=MgS8wyLg8_qqK z2>##C|M>-CU)(P>;V~x1xOEr_nz&V-%Klw@Ir)Xg)G8f{0CD5A$*c{oRDYz|Z|D#Q2F|y%fwn z`KU9VAbzS8H$!q@E5P>8k`Fi61mnKzx?+%>M3t>X`;}#xU=_<^cM8gg|GMASK0Y{w#7puER#MK z^3HYIMnfO}>yyzFk(ZT6#71GPf0x9tn_!IGicL!_G7Gry0+wTh*}{?rH$|?gQ=Kib zWBu9)&cvB3@_cP=kF`N=w`rpI+5eH9A{Ig0>t=nQ8