├── .editorconfig ├── .github └── workflows │ └── angular.yml ├── .gitignore ├── README.md ├── angular.json ├── e2e ├── protractor.conf.js ├── src │ ├── app.e2e-spec.ts │ └── app.po.ts └── tsconfig.e2e.json ├── junit └── TESTS-HeadlessChrome_73.0.3683_(Windows_10.0.0).xml ├── package-lock.json ├── package.json ├── src ├── app │ ├── app.component.css │ ├── app.component.html │ ├── app.component.spec.ts │ ├── app.component.ts │ └── app.module.ts ├── assets │ └── .gitkeep ├── browserslist ├── environments │ ├── environment.prod.ts │ └── environment.ts ├── favicon.ico ├── index.html ├── karma.conf.js ├── main.ts ├── polyfills.ts ├── styles.css ├── test.ts ├── tsconfig.app.json ├── tsconfig.spec.json ├── tslint.json └── web.config ├── tsconfig.json └── tslint.json /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /.github/workflows/angular.yml: -------------------------------------------------------------------------------- 1 | name: Deploy to Azure 2 | on: 3 | push: 4 | branches: 5 | - master 6 | env: 7 | AZURE_WEBAPP_NAME: github-actions-spa 8 | AZURE_WEBAPP_PACKAGE_PATH: './dist/angulargithubaction' 9 | NODE_VERSION: '10.x' 10 | 11 | jobs: 12 | build-and-deploy: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - name: Checkout 16 | uses: actions/checkout@master 17 | - name: Use Node.js ${{ env.NODE_VERSION }} 18 | uses: actions/setup-node@v1 19 | with: 20 | node-version: ${{ env.NODE_VERSION }} 21 | - name: Install dependencies 22 | run: npm install 23 | - name: Build 24 | run: npm run build -- --prod 25 | - name: 'Deploy to Azure WebApp' 26 | uses: azure/webapps-deploy@v1 27 | with: 28 | app-name: ${{ env.AZURE_WEBAPP_NAME }} 29 | publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} 30 | package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} 31 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | # Only exists if Bazel was run 8 | /bazel-out 9 | 10 | # dependencies 11 | /node_modules 12 | 13 | # profiling files 14 | chrome-profiler-events.json 15 | speed-measure-plugin.json 16 | 17 | # IDEs and editors 18 | /.idea 19 | .project 20 | .classpath 21 | .c9/ 22 | *.launch 23 | .settings/ 24 | *.sublime-workspace 25 | 26 | # IDE - VSCode 27 | .vscode/* 28 | !.vscode/settings.json 29 | !.vscode/tasks.json 30 | !.vscode/launch.json 31 | !.vscode/extensions.json 32 | .history/* 33 | 34 | # misc 35 | /.sass-cache 36 | /connect.lock 37 | /coverage 38 | /libpeerconnection.log 39 | npm-debug.log 40 | yarn-error.log 41 | testem.log 42 | /typings 43 | 44 | # System Files 45 | .DS_Store 46 | Thumbs.db 47 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # github_action_angular Kathmandu 2 | -------------------------------------------------------------------------------- /angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "newProjectRoot": "projects", 5 | "projects": { 6 | "angulargithubaction": { 7 | "root": "", 8 | "sourceRoot": "src", 9 | "projectType": "application", 10 | "prefix": "app", 11 | "schematics": {}, 12 | "architect": { 13 | "build": { 14 | "builder": "@angular-devkit/build-angular:browser", 15 | "options": { 16 | "outputPath": "dist/angulargithubaction", 17 | "index": "src/index.html", 18 | "main": "src/main.ts", 19 | "polyfills": "src/polyfills.ts", 20 | "tsConfig": "src/tsconfig.app.json", 21 | "assets": [ 22 | "src/favicon.ico", 23 | "src/assets", 24 | "src/web.config" 25 | ], 26 | "styles": [ 27 | "src/styles.css" 28 | ], 29 | "scripts": [], 30 | "es5BrowserSupport": true 31 | }, 32 | "configurations": { 33 | "production": { 34 | "fileReplacements": [ 35 | { 36 | "replace": "src/environments/environment.ts", 37 | "with": "src/environments/environment.prod.ts" 38 | } 39 | ], 40 | "optimization": true, 41 | "outputHashing": "all", 42 | "sourceMap": false, 43 | "extractCss": true, 44 | "namedChunks": false, 45 | "aot": true, 46 | "extractLicenses": true, 47 | "vendorChunk": false, 48 | "buildOptimizer": true, 49 | "budgets": [ 50 | { 51 | "type": "initial", 52 | "maximumWarning": "2mb", 53 | "maximumError": "5mb" 54 | } 55 | ] 56 | } 57 | } 58 | }, 59 | "serve": { 60 | "builder": "@angular-devkit/build-angular:dev-server", 61 | "options": { 62 | "browserTarget": "angulargithubaction:build" 63 | }, 64 | "configurations": { 65 | "production": { 66 | "browserTarget": "angulargithubaction:build:production" 67 | } 68 | } 69 | }, 70 | "extract-i18n": { 71 | "builder": "@angular-devkit/build-angular:extract-i18n", 72 | "options": { 73 | "browserTarget": "angulargithubaction:build" 74 | } 75 | }, 76 | "test": { 77 | "builder": "@angular-devkit/build-angular:karma", 78 | "options": { 79 | "main": "src/test.ts", 80 | "polyfills": "src/polyfills.ts", 81 | "tsConfig": "src/tsconfig.spec.json", 82 | "karmaConfig": "src/karma.conf.js", 83 | "styles": [ 84 | "src/styles.css" 85 | ], 86 | "scripts": [], 87 | "assets": [ 88 | "src/favicon.ico", 89 | "src/assets" 90 | ] 91 | } 92 | }, 93 | "lint": { 94 | "builder": "@angular-devkit/build-angular:tslint", 95 | "options": { 96 | "tsConfig": [ 97 | "src/tsconfig.app.json", 98 | "src/tsconfig.spec.json" 99 | ], 100 | "exclude": [ 101 | "**/node_modules/**" 102 | ] 103 | } 104 | } 105 | } 106 | }, 107 | "angulargithubaction-e2e": { 108 | "root": "e2e/", 109 | "projectType": "application", 110 | "prefix": "", 111 | "architect": { 112 | "e2e": { 113 | "builder": "@angular-devkit/build-angular:protractor", 114 | "options": { 115 | "protractorConfig": "e2e/protractor.conf.js", 116 | "devServerTarget": "angulargithubaction:serve" 117 | }, 118 | "configurations": { 119 | "production": { 120 | "devServerTarget": ":serve:production" 121 | } 122 | } 123 | }, 124 | "lint": { 125 | "builder": "@angular-devkit/build-angular:tslint", 126 | "options": { 127 | "tsConfig": "e2e/tsconfig.e2e.json", 128 | "exclude": [ 129 | "**/node_modules/**" 130 | ] 131 | } 132 | } 133 | } 134 | } 135 | }, 136 | "defaultProject": "ng" 137 | } -------------------------------------------------------------------------------- /e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | const { JUnitXmlReporter } = require('jasmine-reporters'); 6 | 7 | exports.config = { 8 | allScriptsTimeout: 11000, 9 | specs: [ 10 | './src/**/*.e2e-spec.ts' 11 | ], 12 | capabilities: { 13 | 'browserName': 'chrome', 14 | chromeOptions: { 15 | args: ["--headless", "--disable-gpu", "--window-size=1200,900"], 16 | binary: process.env.CHROME_BIN 17 | } 18 | }, 19 | directConnect: true, 20 | baseUrl: 'http://localhost:4200/', 21 | framework: 'jasmine', 22 | jasmineNodeOpts: { 23 | showColors: true, 24 | defaultTimeoutInterval: 30000, 25 | print: function() {} 26 | }, 27 | onPrepare() { 28 | require('ts-node').register({ 29 | project: require('path').join(__dirname, './tsconfig.e2e.json') 30 | }); 31 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 32 | var junitReporter = new JUnitXmlReporter({ 33 | savePath: require('path').join(__dirname, './junit'), 34 | consolidateAll: true 35 | }); 36 | jasmine.getEnv().addReporter(junitReporter); 37 | } 38 | }; -------------------------------------------------------------------------------- /e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | import { browser, logging } from 'protractor'; 3 | 4 | describe('workspace-project App', () => { 5 | let page: AppPage; 6 | 7 | beforeEach(() => { 8 | page = new AppPage(); 9 | }); 10 | 11 | it('should display welcome message', () => { 12 | page.navigateTo(); 13 | expect(page.getTitleText()).toEqual('Welcome to angulargithubaction!'); 14 | }); 15 | 16 | afterEach(async () => { 17 | // Assert that there are no errors emitted from the browser 18 | const logs = await browser.manage().logs().get(logging.Type.BROWSER); 19 | expect(logs).not.toContain(jasmine.objectContaining({ 20 | level: logging.Level.SEVERE, 21 | } as logging.Entry)); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get(browser.baseUrl) as Promise; 6 | } 7 | 8 | getTitleText() { 9 | return element(by.css('app-root h1')).getText() as Promise; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /junit/TESTS-HeadlessChrome_73.0.3683_(Windows_10.0.0).xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Error: StaticInjectorError(DynamicTestModule)[AppComponent -> HttpClient]: 8 | StaticInjectorError(Platform: core)[AppComponent -> HttpClient]: 9 | NullInjectorError: No provider for HttpClient! 10 | at NullInjector.push../node_modules/@angular/core/fesm5/core.js.NullInjector.get (node_modules/@angular/core/fesm5/core.js:8895:1) 11 | at resolveToken (node_modules/@angular/core/fesm5/core.js:9140:1) 12 | at tryResolveToken (node_modules/@angular/core/fesm5/core.js:9084:1) 13 | at StaticInjector.push../node_modules/@angular/core/fesm5/core.js.StaticInjector.get (node_modules/@angular/core/fesm5/core.js:8981:1) 14 | at resolveToken (node_modules/@angular/core/fesm5/core.js:9140:1) 15 | at tryResolveToken (node_modules/@angular/core/fesm5/core.js:9084:1) 16 | at StaticInjector.push../node_modules/@angular/core/fesm5/core.js.StaticInjector.get (node_modules/@angular/core/fesm5/core.js:8981:1) 17 | at resolveNgModuleDep (node_modules/@angular/core/fesm5/core.js:21217:1) 18 | at NgModuleRef_.push../node_modules/@angular/core/fesm5/core.js.NgModuleRef_.get (node_modules/@angular/core/fesm5/core.js:21906:1) 19 | at resolveDep (node_modules/@angular/core/fesm5/core.js:22277:1) 20 | 21 | 22 | 23 | Error: StaticInjectorError(DynamicTestModule)[AppComponent -> HttpClient]: 24 | StaticInjectorError(Platform: core)[AppComponent -> HttpClient]: 25 | NullInjectorError: No provider for HttpClient! 26 | at NullInjector.push../node_modules/@angular/core/fesm5/core.js.NullInjector.get (node_modules/@angular/core/fesm5/core.js:8895:1) 27 | at resolveToken (node_modules/@angular/core/fesm5/core.js:9140:1) 28 | at tryResolveToken (node_modules/@angular/core/fesm5/core.js:9084:1) 29 | at StaticInjector.push../node_modules/@angular/core/fesm5/core.js.StaticInjector.get (node_modules/@angular/core/fesm5/core.js:8981:1) 30 | at resolveToken (node_modules/@angular/core/fesm5/core.js:9140:1) 31 | at tryResolveToken (node_modules/@angular/core/fesm5/core.js:9084:1) 32 | at StaticInjector.push../node_modules/@angular/core/fesm5/core.js.StaticInjector.get (node_modules/@angular/core/fesm5/core.js:8981:1) 33 | at resolveNgModuleDep (node_modules/@angular/core/fesm5/core.js:21217:1) 34 | at NgModuleRef_.push../node_modules/@angular/core/fesm5/core.js.NgModuleRef_.get (node_modules/@angular/core/fesm5/core.js:21906:1) 35 | at resolveDep (node_modules/@angular/core/fesm5/core.js:22277:1) 36 | 37 | 38 | 39 | Error: StaticInjectorError(DynamicTestModule)[AppComponent -> HttpClient]: 40 | StaticInjectorError(Platform: core)[AppComponent -> HttpClient]: 41 | NullInjectorError: No provider for HttpClient! 42 | at NullInjector.push../node_modules/@angular/core/fesm5/core.js.NullInjector.get (node_modules/@angular/core/fesm5/core.js:8895:1) 43 | at resolveToken (node_modules/@angular/core/fesm5/core.js:9140:1) 44 | at tryResolveToken (node_modules/@angular/core/fesm5/core.js:9084:1) 45 | at StaticInjector.push../node_modules/@angular/core/fesm5/core.js.StaticInjector.get (node_modules/@angular/core/fesm5/core.js:8981:1) 46 | at resolveToken (node_modules/@angular/core/fesm5/core.js:9140:1) 47 | at tryResolveToken (node_modules/@angular/core/fesm5/core.js:9084:1) 48 | at StaticInjector.push../node_modules/@angular/core/fesm5/core.js.StaticInjector.get (node_modules/@angular/core/fesm5/core.js:8981:1) 49 | at resolveNgModuleDep (node_modules/@angular/core/fesm5/core.js:21217:1) 50 | at NgModuleRef_.push../node_modules/@angular/core/fesm5/core.js.NgModuleRef_.get (node_modules/@angular/core/fesm5/core.js:21906:1) 51 | at resolveDep (node_modules/@angular/core/fesm5/core.js:22277:1) 52 | 53 | 54 | 55 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-github-action", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "deploy": "node --version", 7 | "start": "ng serve", 8 | "build": "ng build", 9 | "test": "ng test", 10 | "lint": "ng lint", 11 | "e2e": "ng e2e" 12 | }, 13 | "private": true, 14 | "dependencies": { 15 | "@angular/animations": "~7.2.0", 16 | "@angular/common": "~7.2.0", 17 | "@angular/compiler": "~7.2.0", 18 | "@angular/core": "~7.2.0", 19 | "@angular/forms": "~7.2.0", 20 | "@angular/platform-browser": "~7.2.0", 21 | "@angular/platform-browser-dynamic": "~7.2.0", 22 | "@angular/router": "~7.2.0", 23 | "@azure/ng-deploy": "~0.2.3", 24 | "core-js": "^2.5.4", 25 | "rxjs": "~6.3.3", 26 | "tslib": "^1.9.0", 27 | "zone.js": "~0.8.26" 28 | }, 29 | "devDependencies": { 30 | "@angular-devkit/build-angular": "~0.13.0", 31 | "@angular/cli": "~7.3.5", 32 | "@angular/compiler-cli": "~7.2.0", 33 | "@angular/language-service": "~7.2.0", 34 | "@types/jasmine": "~2.8.8", 35 | "@types/jasminewd2": "~2.0.3", 36 | "@types/node": "~8.9.4", 37 | "codelyzer": "~4.5.0", 38 | "jasmine-core": "~2.99.1", 39 | "jasmine-reporters": "^2.3.2", 40 | "jasmine-spec-reporter": "~4.2.1", 41 | "karma": "~4.0.0", 42 | "karma-chrome-launcher": "~2.2.0", 43 | "karma-coverage-istanbul-reporter": "~2.0.1", 44 | "karma-jasmine": "~1.1.2", 45 | "karma-jasmine-html-reporter": "^0.2.2", 46 | "karma-junit-reporter": "^1.2.0", 47 | "protractor": "~5.4.0", 48 | "puppeteer": "^1.13.0", 49 | "ts-node": "~7.0.0", 50 | "tslint": "~5.11.0", 51 | "typescript": "~3.2.2" 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajeetharan/github_action_angular/aafd05eeb49fb00b76bd00a6d1f10edd15631e6a/src/app/app.component.css -------------------------------------------------------------------------------- /src/app/app.component.html: -------------------------------------------------------------------------------- 1 |
2 | 56 |
-------------------------------------------------------------------------------- /src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async } from '@angular/core/testing'; 2 | import { AppComponent } from './app.component'; 3 | 4 | describe('AppComponent', () => { 5 | beforeEach(async(() => { 6 | TestBed.configureTestingModule({ 7 | declarations: [ 8 | AppComponent 9 | ], 10 | }).compileComponents(); 11 | })); 12 | 13 | it('should create the app', () => { 14 | const fixture = TestBed.createComponent(AppComponent); 15 | const app = fixture.debugElement.componentInstance; 16 | expect(app).toBeTruthy(); 17 | }); 18 | 19 | it(`should have as title 'angulargithubaction'`, () => { 20 | const fixture = TestBed.createComponent(AppComponent); 21 | const app = fixture.debugElement.componentInstance; 22 | expect(app.title).toEqual('angulargithubaction'); 23 | }); 24 | 25 | it('should render title in a h1 tag', () => { 26 | const fixture = TestBed.createComponent(AppComponent); 27 | fixture.detectChanges(); 28 | const compiled = fixture.debugElement.nativeElement; 29 | expect(compiled.querySelector('h1').textContent).toContain('Welcome to angulargithubaction!'); 30 | }); 31 | }); 32 | -------------------------------------------------------------------------------- /src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { HttpClient, HttpHeaders } from '@angular/common/http'; 2 | import { Component } from '@angular/core'; 3 | 4 | @Component({ 5 | selector: 'my-app', 6 | templateUrl: './app.component.html', 7 | styleUrls: ['./app.component.css'] 8 | }) 9 | export class AppComponent { 10 | name = 'Angular Colombo'; 11 | image; 12 | noFace; 13 | thing; 14 | result; 15 | fileToUpload: File; 16 | output : any; 17 | constructor(private http: HttpClient) {} 18 | 19 | removeImage() { 20 | this.image = ''; 21 | this.noFace = false; 22 | this.thing = {}; 23 | this.result = ''; 24 | this.fileToUpload = undefined; 25 | } 26 | 27 | fileUpload(fileList: FileList) { 28 | if (fileList.length <= 0) return; 29 | 30 | this.fileToUpload = fileList.item(0); 31 | this.createImage(); 32 | } 33 | 34 | makeRequest() { 35 | let data, contentType; 36 | if (typeof this.image === 'string' && !this.image.startsWith('data')) { 37 | data = { url: this.image }; 38 | contentType = 'application/json'; 39 | } else { 40 | data = this.fileToUpload; 41 | contentType = 'application/octet-stream'; 42 | } 43 | 44 | const httpOptions = { 45 | headers: new HttpHeaders({ 46 | 'Content-Type': contentType, 47 | 'Ocp-Apim-Subscription-Key': 'eb491c18bd874d2f9d410eedde346366' 48 | }) 49 | }; 50 | 51 | this.http 52 | .post( 53 | 'https://eastus.api.cognitive.microsoft.com/face/v1.0/detect?returnFaceId=true&returnFaceLandmarks=false&returnFaceAttributes=emotion', 54 | data, 55 | httpOptions 56 | ) 57 | .subscribe(body => { 58 | if (body && body[0]) { 59 | console.log(body); 60 | this.output = body; 61 | this.thing = body[0].faceAttributes.emotion; 62 | this.result = this.getTop(); 63 | this.noFace = false; 64 | } else { 65 | this.noFace = true; 66 | } 67 | }); 68 | } 69 | 70 | createImage() { 71 | var reader = new FileReader(); 72 | reader.onload = e => { 73 | this.image = reader.result; 74 | this.makeRequest(); 75 | }; 76 | reader.readAsDataURL(this.fileToUpload); 77 | } 78 | 79 | getTop() { 80 | let max = 0; 81 | let maxkey = ''; 82 | for (var key in this.thing) { 83 | if (this.thing[key] > max) { 84 | max = this.thing[key]; 85 | maxkey = key; 86 | } 87 | } 88 | return maxkey; 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | 4 | import { AppComponent } from './app.component'; 5 | import { HttpClientModule } from '@angular/common/http'; 6 | 7 | @NgModule({ 8 | declarations: [ 9 | AppComponent 10 | ], 11 | imports: [ 12 | BrowserModule, 13 | HttpClientModule 14 | 15 | ], 16 | providers: [], 17 | bootstrap: [AppComponent] 18 | }) 19 | export class AppModule { } 20 | -------------------------------------------------------------------------------- /src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajeetharan/github_action_angular/aafd05eeb49fb00b76bd00a6d1f10edd15631e6a/src/assets/.gitkeep -------------------------------------------------------------------------------- /src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # 5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed 6 | 7 | > 0.5% 8 | last 2 versions 9 | Firefox ESR 10 | not dead 11 | not IE 9-11 -------------------------------------------------------------------------------- /src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajeetharan/github_action_angular/aafd05eeb49fb00b76bd00a6d1f10edd15631e6a/src/favicon.ico -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | GitHub Universe Viewing Party Sri Lanka 2019 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular-devkit/build-angular/plugins/karma'), 14 | require('karma-junit-reporter') 15 | ], 16 | client: { 17 | clearContext: false // leave Jasmine Spec Runner output visible in browser 18 | }, 19 | coverageIstanbulReporter: { 20 | dir: require('path').join(__dirname, '../coverage/angulargithubaction'), 21 | reports: ['html', 'lcovonly', 'text-summary','cobertura'], 22 | fixWebpackSourcePaths: true 23 | }, 24 | reporters: ['progress', 'kjhtml','junit'], 25 | junitReporter: { 26 | outputDir: '../junit' 27 | }, 28 | port: 9876, 29 | colors: true, 30 | logLevel: config.LOG_INFO, 31 | autoWatch: true, 32 | browsers: ['ChromeHeadless'], 33 | singleRun: false, 34 | restartOnFileChange: true 35 | }); 36 | }; 37 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/guide/browser-support 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 22 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 23 | 24 | /** 25 | * Web Animations `@angular/platform-browser/animations` 26 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 27 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 28 | */ 29 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 30 | 31 | /** 32 | * By default, zone.js will patch all possible macroTask and DomEvents 33 | * user can disable parts of macroTask/DomEvents patch by setting following flags 34 | * because those flags need to be set before `zone.js` being loaded, and webpack 35 | * will put import in the top of bundle, so user need to create a separate file 36 | * in this directory (for example: zone-flags.ts), and put the following flags 37 | * into that file, and then add the following code before importing zone.js. 38 | * import './zone-flags.ts'; 39 | * 40 | * The flags allowed in zone-flags.ts are listed here. 41 | * 42 | * The following flags will work for all browsers. 43 | * 44 | * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 45 | * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 46 | * (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 47 | * 48 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 49 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 50 | * 51 | * (window as any).__Zone_enable_cross_context_check = true; 52 | * 53 | */ 54 | 55 | /*************************************************************************************************** 56 | * Zone JS is required by default for Angular itself. 57 | */ 58 | import 'zone.js/dist/zone'; // Included with Angular CLI. 59 | 60 | 61 | /*************************************************************************************************** 62 | * APPLICATION IMPORTS 63 | */ 64 | -------------------------------------------------------------------------------- /src/styles.css: -------------------------------------------------------------------------------- 1 | /* Add application styles & imports to this file! */ 2 | 3 | /* 4 | Code has been adapted (with permission) for Angular from Sarah Drasner's Vue.js Azure Emotion API on CodePen 5 | Sarah: https://twitter.com/sarah_edo 6 | CodePen: https://codepen.io/sdras/details/dZOdpv 7 | */ 8 | 9 | body { 10 | background: rgb(0, 2, 95); 11 | color: white; 12 | padding: 20px; 13 | } 14 | 15 | * { 16 | font-family: 'Lato', helvetica, sans-serif; 17 | } 18 | 19 | button { 20 | background: #AB081E; 21 | color: white; 22 | border: none; 23 | border-radius: 3px; 24 | padding: 5px 10px; 25 | cursor: pointer; 26 | font-style: italic; 27 | font-weight: 300; 28 | font-family: 'Lato', sans-serif; 29 | margin: 10px 0; 30 | } 31 | 32 | p, h3 { 33 | margin: 5px 0 0; 34 | } 35 | 36 | h2 { 37 | font-weight: 300; 38 | } 39 | 40 | hr { 41 | opacity: 0.2; 42 | width: 100%; 43 | margin-top: 25px; 44 | } 45 | 46 | a { 47 | text-decoration: none; 48 | color: #ef9d0e; 49 | } 50 | 51 | #canvas { 52 | width: 95%; 53 | height: 100%; 54 | max-width: 1000px; 55 | max-height: 700px; 56 | margin-left: 30px; 57 | margin-top: 0; 58 | } 59 | 60 | /* base layout start */ 61 | #app { 62 | display: flex; 63 | } 64 | 65 | aside { 66 | width: 300px; 67 | display: flex; 68 | flex-direction: column; 69 | } 70 | 71 | @media (min-width: 600px) { 72 | aside { 73 | height: 100vh; 74 | } 75 | main { 76 | height: 100vh; 77 | } 78 | } 79 | 80 | @media (max-width: 600px) { 81 | #app { 82 | display: block; 83 | } 84 | aside { 85 | width: 100vw; 86 | } 87 | main { 88 | width: 100vw; 89 | height: 300px; 90 | } 91 | #canvas { 92 | width: 85%; 93 | margin-left: 0; 94 | margin-top: 20px; 95 | } 96 | .nomobile { 97 | display: none; 98 | } 99 | } 100 | 101 | /* base layout end */ 102 | 103 | img { 104 | width: 300px; 105 | border: 1px solid #777; 106 | margin: 15px 0; 107 | } 108 | 109 | .inputfile { 110 | width: 0.1px; 111 | height: 0.1px; 112 | opacity: 0; 113 | overflow: hidden; 114 | position: absolute; 115 | z-index: -1; 116 | } 117 | 118 | .inputfile + label { 119 | margin: 0 10px; 120 | font-size: 20px; 121 | font-weight: 300; 122 | color: white; 123 | background-color: #222; 124 | padding: 14px 20px; 125 | border-radius: 50%; 126 | display: inline-block; 127 | border: 1px solid #666; 128 | transition: 0.3s all ease-out; 129 | } 130 | 131 | .inputfile:focus + label, 132 | .inputfile + label:hover { 133 | background-color: teal; 134 | } 135 | 136 | .inputfile + label { 137 | cursor: pointer; /* "hand" cursor */ 138 | } 139 | 140 | .inputfile:focus + label { 141 | outline: 1px dotted #000; 142 | outline: -webkit-focus-ring-color auto 5px; 143 | } 144 | 145 | .inputfile + label * { 146 | pointer-events: none; 147 | } 148 | 149 | .nobottom { 150 | margin-bottom: 0; 151 | } 152 | 153 | .bottom10 { 154 | margin-bottom: 10px; 155 | } 156 | 157 | .nomargin { 158 | margin: 10px 0; 159 | } 160 | 161 | .useone { 162 | margin-top: -18px; 163 | cursor: pointer; 164 | color: #efdabf; 165 | transition: 0.25s all ease; 166 | /* &:hover { 167 | color: #ef9d0e; 168 | } */ 169 | } 170 | 171 | .useone :hover { 172 | color: #ef9d0e; 173 | } 174 | 175 | .loading { 176 | animation: load 1s infinite both; 177 | transform-origin: 50% 50%; 178 | } 179 | 180 | @keyframes load { 181 | 35% { 182 | opacity: 0.35; 183 | } 184 | 100% { 185 | transform: rotate(360deg); 186 | } 187 | } -------------------------------------------------------------------------------- /src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | "**/*.spec.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "test.ts", 12 | "polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/web.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "module": "es2015", 9 | "moduleResolution": "node", 10 | "emitDecoratorMetadata": true, 11 | "experimentalDecorators": true, 12 | "importHelpers": true, 13 | "target": "es5", 14 | "typeRoots": [ 15 | "node_modules/@types" 16 | ], 17 | "lib": [ 18 | "es2018", 19 | "dom" 20 | ] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "tslint:recommended", 3 | "rulesDirectory": [ 4 | "codelyzer" 5 | ], 6 | "rules": { 7 | "array-type": false, 8 | "arrow-parens": false, 9 | "deprecation": { 10 | "severity": "warn" 11 | }, 12 | "import-blacklist": [ 13 | true, 14 | "rxjs/Rx" 15 | ], 16 | "interface-name": false, 17 | "max-classes-per-file": false, 18 | "max-line-length": [ 19 | true, 20 | 140 21 | ], 22 | "member-access": false, 23 | "member-ordering": [ 24 | true, 25 | { 26 | "order": [ 27 | "static-field", 28 | "instance-field", 29 | "static-method", 30 | "instance-method" 31 | ] 32 | } 33 | ], 34 | "no-consecutive-blank-lines": false, 35 | "no-console": [ 36 | true, 37 | "debug", 38 | "info", 39 | "time", 40 | "timeEnd", 41 | "trace" 42 | ], 43 | "no-empty": false, 44 | "no-inferrable-types": [ 45 | true, 46 | "ignore-params" 47 | ], 48 | "no-non-null-assertion": true, 49 | "no-redundant-jsdoc": true, 50 | "no-switch-case-fall-through": true, 51 | "no-use-before-declare": true, 52 | "no-var-requires": false, 53 | "object-literal-key-quotes": [ 54 | true, 55 | "as-needed" 56 | ], 57 | "object-literal-sort-keys": false, 58 | "ordered-imports": false, 59 | "quotemark": [ 60 | true, 61 | "single" 62 | ], 63 | "trailing-comma": false, 64 | "no-output-on-prefix": true, 65 | "use-input-property-decorator": true, 66 | "use-output-property-decorator": true, 67 | "use-host-property-decorator": true, 68 | "no-input-rename": true, 69 | "no-output-rename": true, 70 | "use-life-cycle-interface": true, 71 | "use-pipe-transform-interface": true, 72 | "component-class-suffix": true, 73 | "directive-class-suffix": true 74 | } 75 | } 76 | --------------------------------------------------------------------------------