From a744ede597988894a4556eb85b21a81292a9bc76 Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Tue, 31 Oct 2017 18:19:55 -0400 Subject: [PATCH 1/2] feat(companies): initial work, added firebase for companies list --- package.json | 2 + src/app/companies/companies.component.html | 23 +++++++++ src/app/companies/companies.component.scss | 29 ++++++++++++ src/app/companies/companies.component.ts | 46 +++++++++++++++++- src/app/companies/companies.module.ts | 23 +++++++-- src/app/companies/company.service.spec.ts | 26 ++++++++++ src/app/companies/company.service.ts | 21 +++++++++ src/app/companies/test.js | 0 .../company-dialog.component.html | 23 +++++++++ .../company-dialog.component.scss | 0 .../company-dialog.component.spec.ts | 47 +++++++++++++++++++ .../company-dialog.component.ts | 41 ++++++++++++++++ src/app/material/material.module.ts | 21 ++++++--- src/environments/environment.prod.ts | 10 +++- src/environments/environment.ts | 11 ++++- 15 files changed, 309 insertions(+), 14 deletions(-) create mode 100644 src/app/companies/company.service.spec.ts create mode 100644 src/app/companies/company.service.ts create mode 100644 src/app/companies/test.js create mode 100644 src/app/company-dialog/company-dialog.component.html create mode 100644 src/app/company-dialog/company-dialog.component.scss create mode 100644 src/app/company-dialog/company-dialog.component.spec.ts create mode 100644 src/app/company-dialog/company-dialog.component.ts diff --git a/package.json b/package.json index 5225b37a..c0c01e59 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,9 @@ "@angular/router": "5.1.1", "@angular/service-worker": "5.1.1", "@types/hammerjs": "2.0.35", + "angularfire2": "5.0.0-rc.3", "core-js": "2.4.1", + "firebase": "4.6.2", "hammerjs": "2.0.8", "rxjs": "5.5.5", "ts-loader": "3.1.1", diff --git a/src/app/companies/companies.component.html b/src/app/companies/companies.component.html index 8b137891..59aae7cf 100644 --- a/src/app/companies/companies.component.html +++ b/src/app/companies/companies.component.html @@ -1 +1,24 @@ +
+ + + +
+ +
+ {{company.Name}} + + {{company.Location}} + + +
+ + +
+
\ No newline at end of file diff --git a/src/app/companies/companies.component.scss b/src/app/companies/companies.component.scss index e69de29b..ff65ed6c 100644 --- a/src/app/companies/companies.component.scss +++ b/src/app/companies/companies.component.scss @@ -0,0 +1,29 @@ +.example-header-image { + background-image: url('../../assets/img/Rx_Logo-96-96.png'); + background-size: cover; +} + +.companies-container { + margin: 0 15px; +} + +.website-button { + position: absolute; + right: 0; + top: 0; +} + +mat-card { + margin-top: 15px; +} + +.company-add-button { + position: absolute; + z-index: 99; + right: 0; + top: 5px; +} + +.company-logo{ + height: 40px; +} \ No newline at end of file diff --git a/src/app/companies/companies.component.ts b/src/app/companies/companies.component.ts index cb729f61..64f050cb 100644 --- a/src/app/companies/companies.component.ts +++ b/src/app/companies/companies.component.ts @@ -1,4 +1,14 @@ -import { Component } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; +import { Observable } from 'rxjs/Observable'; +import { + AngularFirestore, + AngularFirestoreCollection +} from 'angularfire2/firestore'; +import * as firebase from 'firebase'; +import { MatDialog } from '@angular/material'; + +import { CompanyDialogComponent } from '../company-dialog/company-dialog.component'; +import { CompanyService } from './company.service'; @Component({ selector: 'app-companies', @@ -6,5 +16,37 @@ import { Component } from '@angular/core'; styleUrls: ['./companies.component.scss'] }) export class CompaniesComponent { - constructor() {} + companies: Observable; + private uploadTask: firebase.storage.UploadTask; + private companiesCollection: AngularFirestoreCollection; + constructor( + db: AngularFirestore, + private dialog: MatDialog, + private companyService: CompanyService + ) { + this.companiesCollection = db.collection('companies'); + this.companies = this.companiesCollection.valueChanges(); + } + + uploadSingle(file: any) { + return this.companyService.pushUpload(file); + } + + addCompany() { + const dialogRef = this.dialog.open(CompanyDialogComponent, {}); + dialogRef.afterClosed().subscribe(company => { + if (company) { + const file = this.uploadSingle(company.File).then((fileResult: any) => { + company.File = fileResult.downloadURL; + this.companiesCollection.add(company).then(result => { + console.log(result); + }); + }); + } + }); + } + + openWindow(url: string) { + window.open(url, '_blank'); + } } diff --git a/src/app/companies/companies.module.ts b/src/app/companies/companies.module.ts index af95e2c1..8720e879 100644 --- a/src/app/companies/companies.module.ts +++ b/src/app/companies/companies.module.ts @@ -1,9 +1,26 @@ +import { CommonModule } from '@angular/common'; +import { MaterialModule } from './../material/material.module'; import { NgModule } from '@angular/core'; +import { AngularFireModule } from 'angularfire2'; +import { AngularFirestoreModule } from 'angularfire2/firestore'; + import { CompaniesComponent } from './companies.component'; import { CompaniesRoutingModule } from './companies-routing.module'; - +import { environment } from '../../environments/environment'; +import { CompanyDialogComponent } from '../company-dialog/company-dialog.component'; +import { MatDialogRef } from '@angular/material'; +import { CompanyService } from './company.service'; +import { AngularFireDatabase } from 'angularfire2/database'; @NgModule({ - imports: [CompaniesRoutingModule], - declarations: [CompaniesComponent] + imports: [ + CommonModule, + CompaniesRoutingModule, + MaterialModule, + AngularFirestoreModule, + AngularFireModule.initializeApp(environment.firebase) + ], + declarations: [CompaniesComponent, CompanyDialogComponent], + entryComponents: [CompanyDialogComponent], + providers: [CompanyService, AngularFireDatabase] }) export class CompaniesModule {} diff --git a/src/app/companies/company.service.spec.ts b/src/app/companies/company.service.spec.ts new file mode 100644 index 00000000..f73d9a69 --- /dev/null +++ b/src/app/companies/company.service.spec.ts @@ -0,0 +1,26 @@ +import { TestBed, inject } from '@angular/core/testing'; + +import { CompanyService } from './company.service'; +import { AngularFireDatabase } from 'angularfire2/database'; +import { AngularFirestoreModule } from 'angularfire2/firestore'; +import { AngularFireModule } from 'angularfire2'; +import { environment } from '../../environments/environment'; + +describe('CompanyService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + imports: [ + AngularFirestoreModule, + AngularFireModule.initializeApp(environment.firebase) + ], + providers: [CompanyService, AngularFireDatabase] + }); + }); + + it( + 'should be created', + inject([CompanyService, AngularFireDatabase], (service: CompanyService) => { + expect(service).toBeTruthy(); + }) + ); +}); diff --git a/src/app/companies/company.service.ts b/src/app/companies/company.service.ts new file mode 100644 index 00000000..93877ed0 --- /dev/null +++ b/src/app/companies/company.service.ts @@ -0,0 +1,21 @@ +import { Injectable } from "@angular/core"; +import { AngularFireDatabase, AngularFireList } from "angularfire2/database"; +import * as firebase from "firebase"; +import { Observable } from "rxjs/Observable"; + +@Injectable() +export class CompanyService { + constructor(private db: AngularFireDatabase) {} + basePath = "uploads"; + uploadsRef: AngularFireList; + uploads: Observable; + // Executes the file uploading to firebase https://firebase.google.com/docs/storage/web/upload-files + + pushUpload(upload: any) { + const storageRef = firebase.storage().ref(); + const uploadTask = storageRef + .child(`${this.basePath}/${upload.name}`) + .put(upload); + return uploadTask; + } +} diff --git a/src/app/companies/test.js b/src/app/companies/test.js new file mode 100644 index 00000000..e69de29b diff --git a/src/app/company-dialog/company-dialog.component.html b/src/app/company-dialog/company-dialog.component.html new file mode 100644 index 00000000..59573ded --- /dev/null +++ b/src/app/company-dialog/company-dialog.component.html @@ -0,0 +1,23 @@ +

New Company Form

+ +
+ + + + + + + + + http://reactivex.io + + + + + +
+
+ + + + \ No newline at end of file diff --git a/src/app/company-dialog/company-dialog.component.scss b/src/app/company-dialog/company-dialog.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/app/company-dialog/company-dialog.component.spec.ts b/src/app/company-dialog/company-dialog.component.spec.ts new file mode 100644 index 00000000..57e25f84 --- /dev/null +++ b/src/app/company-dialog/company-dialog.component.spec.ts @@ -0,0 +1,47 @@ +// import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +// import { CompanyDialogComponent } from './company-dialog.component'; +// import { NgModule } from '@angular/core'; +// import { MatDialogModule, MatDialog } from '@angular/material'; +// import { NoopAnimationsModule } from '@angular/platform-browser/animations'; +// import { FormBuilder, FormsModule, ReactiveFormsModule } from '@angular/forms'; + +// import { SharedModule } from '../shared.module'; +// import { inject } from '@angular/core/testing'; +// import { CompaniesModule } from '../companies/companies.module'; +// import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing'; +// import { CommonModule } from '@angular/common'; + +// describe('CompanyDialogComponent', () => { +// let component: CompanyDialogComponent; +// let fixture: ComponentFixture; +// let dialog: MatDialog; + +// beforeEach( +// async(() => { +// TestBed.configureTestingModule({ +// imports: [SharedModule, NoopAnimationsModule], +// declarations: [CompanyDialogComponent], +// providers: [], +// }).overrideModule(BrowserDynamicTestingModule, { +// set: { +// entryComponents: [CompanyDialogComponent] +// } +// }).compileComponents(); +// }) +// ); + +// beforeEach(() => { +// fixture = TestBed.createComponent(CompanyDialogComponent); +// component = fixture.componentInstance; +// fixture.detectChanges(); + +// dialog = TestBed.get(MatDialog); +// let dialogRef = dialog.open(CompanyDialogComponent); +// component = dialogRef.componentInstance; +// }); + +// it('should create', () => { +// expect(component).toBeTruthy(); +// }); +// }); diff --git a/src/app/company-dialog/company-dialog.component.ts b/src/app/company-dialog/company-dialog.component.ts new file mode 100644 index 00000000..9ee46757 --- /dev/null +++ b/src/app/company-dialog/company-dialog.component.ts @@ -0,0 +1,41 @@ +import { Component, OnInit } from '@angular/core'; +import { FormGroup, FormBuilder, Validators } from '@angular/forms'; +import { CompanyService } from '../companies/company.service'; + +@Component({ + selector: 'app-company-dialog', + templateUrl: './company-dialog.component.html', + styleUrls: ['./company-dialog.component.scss'] +}) +export class CompanyDialogComponent { + companyForm: FormGroup; + selectedFile: File; + + constructor(private formBuilder: FormBuilder) { + this.createCompanyForm(); + } + + detectFiles(event) { + const fileControl = this.companyForm.get('File'); + this.selectedFile = event.target.files.item(0).name; + fileControl.setValue(event.target.files.item(0)); + } + + private createCompanyForm() { + this.companyForm = this.formBuilder.group({ + Name: ['', Validators.required], + Location: ['', Validators.required], + Website: ['', Validators.required], + File: '' + }); + } + + private subscribeToForm() { + const nameControl = this.companyForm.get('Name'); + nameControl.valueChanges.forEach((value: string) => console.log(value)); + const locationControl = this.companyForm.get('Location'); + nameControl.valueChanges.forEach((value: string) => console.log(value)); + const websiteControl = this.companyForm.get('Website'); + nameControl.valueChanges.forEach((value: string) => console.log(value)); + } +} diff --git a/src/app/material/material.module.ts b/src/app/material/material.module.ts index d762a596..78be3a4c 100644 --- a/src/app/material/material.module.ts +++ b/src/app/material/material.module.ts @@ -4,44 +4,51 @@ import { FlexLayoutModule } from '@angular/flex-layout'; import { MatToolbarModule, MatIconModule, + MatButtonModule, + MatDialogModule, MatListModule, MatSidenavModule, - MatButtonModule, MatExpansionModule, MatCardModule, MatInputModule, MatMenuModule, - MatTooltipModule, - MatSnackBarModule + MatTooltipModule } from '@angular/material'; +import { ReactiveFormsModule, FormsModule } from '@angular/forms'; @NgModule({ declarations: [], imports: [ MatToolbarModule, MatIconModule, + MatButtonModule, + MatDialogModule, MatListModule, MatSidenavModule, - MatButtonModule, MatExpansionModule, MatCardModule, MatInputModule, MatMenuModule, MatTooltipModule, - MatSnackBarModule + FlexLayoutModule, + ReactiveFormsModule, + FormsModule ], exports: [ MatToolbarModule, MatIconModule, + MatButtonModule, + MatDialogModule, MatListModule, MatSidenavModule, - MatButtonModule, MatExpansionModule, MatCardModule, MatInputModule, MatMenuModule, MatTooltipModule, - MatSnackBarModule + FlexLayoutModule, + ReactiveFormsModule, + FormsModule ] }) export class MaterialModule {} diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index 3612073b..7b57ba02 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -1,3 +1,11 @@ export const environment = { - production: true + production: true, + firebase: { + apiKey: '', + authDomain: '', + databaseURL: '', + projectId: '', + storageBucket: '', + messagingSenderId: '' + } }; diff --git a/src/environments/environment.ts b/src/environments/environment.ts index b7f639ae..9decac33 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -3,6 +3,15 @@ // `ng build --env=prod` then `environment.prod.ts` will be used instead. // The list of which env maps to which file can be found in `.angular-cli.json`. +// rxjsdemo@gmail.com //rxjsdemo1234 export const environment = { - production: false + production: false, + firebase: { + apiKey: "", + authDomain: "", + databaseURL: "", + projectId: "", + storageBucket: "", + messagingSenderId: "" + } }; From 8c5164cbdeb2bcffad59784e620f49eaace43f40 Mon Sep 17 00:00:00 2001 From: Ashwin Sureshkumar Date: Fri, 22 Dec 2017 11:23:39 -0500 Subject: [PATCH 2/2] feat(companies): Implement showcase of companies from list in the repo - Showcase list of companies using RxJS - Remove firebase implementation temporarily to move forward - Added a temporary list of companies to test Close #10 --- package.json | 2 - src/app/companies/companies-list.ts | 16 ++++++ src/app/companies/companies.component.html | 15 +++--- src/app/companies/companies.component.scss | 10 ++-- src/app/companies/companies.component.ts | 43 ++-------------- src/app/companies/companies.model.ts | 6 +++ src/app/companies/companies.module.ts | 18 ++----- src/app/companies/company.service.spec.ts | 12 ++--- src/app/companies/company.service.ts | 23 +++------ src/app/companies/test.js | 0 .../company-dialog.component.html | 23 --------- .../company-dialog.component.scss | 0 .../company-dialog.component.spec.ts | 47 ------------------ .../company-dialog.component.ts | 41 --------------- src/app/material/material.module.ts | 13 ++--- src/assets/companies/google.png | Bin 0 -> 7844 bytes src/assets/companies/microsoft.png | Bin 0 -> 5598 bytes src/environments/environment.prod.ts | 10 +--- src/environments/environment.ts | 11 +--- 19 files changed, 56 insertions(+), 234 deletions(-) create mode 100644 src/app/companies/companies-list.ts create mode 100644 src/app/companies/companies.model.ts delete mode 100644 src/app/companies/test.js delete mode 100644 src/app/company-dialog/company-dialog.component.html delete mode 100644 src/app/company-dialog/company-dialog.component.scss delete mode 100644 src/app/company-dialog/company-dialog.component.spec.ts delete mode 100644 src/app/company-dialog/company-dialog.component.ts create mode 100644 src/assets/companies/google.png create mode 100644 src/assets/companies/microsoft.png diff --git a/package.json b/package.json index c0c01e59..5225b37a 100644 --- a/package.json +++ b/package.json @@ -41,9 +41,7 @@ "@angular/router": "5.1.1", "@angular/service-worker": "5.1.1", "@types/hammerjs": "2.0.35", - "angularfire2": "5.0.0-rc.3", "core-js": "2.4.1", - "firebase": "4.6.2", "hammerjs": "2.0.8", "rxjs": "5.5.5", "ts-loader": "3.1.1", diff --git a/src/app/companies/companies-list.ts b/src/app/companies/companies-list.ts new file mode 100644 index 00000000..6fca3190 --- /dev/null +++ b/src/app/companies/companies-list.ts @@ -0,0 +1,16 @@ +import { Company } from './companies.model'; + +export const COMPANIES_LIST: Company[] = [ + { + name: 'Google', + location: 'California', + logo: '../../assets/companies/google.png', + website: 'http://google.com' + }, + { + name: 'Microsoft', + location: 'Seattle', + logo: '../../assets/companies/microsoft.png', + website: 'http://microsoft.com' + } +]; diff --git a/src/app/companies/companies.component.html b/src/app/companies/companies.component.html index 59aae7cf..9f180b6a 100644 --- a/src/app/companies/companies.component.html +++ b/src/app/companies/companies.component.html @@ -1,24 +1,21 @@
-
- +
- {{company.Name}} + {{company.name}} - {{company.Location}} - +
-
\ No newline at end of file + diff --git a/src/app/companies/companies.component.scss b/src/app/companies/companies.component.scss index ff65ed6c..c87f968a 100644 --- a/src/app/companies/companies.component.scss +++ b/src/app/companies/companies.component.scss @@ -17,13 +17,11 @@ mat-card { margin-top: 15px; } -.company-add-button { - position: absolute; - z-index: 99; - right: 0; - top: 5px; +mat-card-avatar { + margin-right: 10px; } .company-logo{ height: 40px; -} \ No newline at end of file + width: 40px; +} diff --git a/src/app/companies/companies.component.ts b/src/app/companies/companies.component.ts index 64f050cb..e82514c8 100644 --- a/src/app/companies/companies.component.ts +++ b/src/app/companies/companies.component.ts @@ -1,14 +1,10 @@ +import { COMPANIES_LIST } from './companies-list'; import { Component, OnInit } from '@angular/core'; import { Observable } from 'rxjs/Observable'; -import { - AngularFirestore, - AngularFirestoreCollection -} from 'angularfire2/firestore'; -import * as firebase from 'firebase'; import { MatDialog } from '@angular/material'; -import { CompanyDialogComponent } from '../company-dialog/company-dialog.component'; import { CompanyService } from './company.service'; +import { Company } from './companies.model'; @Component({ selector: 'app-companies', @@ -16,37 +12,8 @@ import { CompanyService } from './company.service'; styleUrls: ['./companies.component.scss'] }) export class CompaniesComponent { - companies: Observable; - private uploadTask: firebase.storage.UploadTask; - private companiesCollection: AngularFirestoreCollection; - constructor( - db: AngularFirestore, - private dialog: MatDialog, - private companyService: CompanyService - ) { - this.companiesCollection = db.collection('companies'); - this.companies = this.companiesCollection.valueChanges(); - } - - uploadSingle(file: any) { - return this.companyService.pushUpload(file); - } - - addCompany() { - const dialogRef = this.dialog.open(CompanyDialogComponent, {}); - dialogRef.afterClosed().subscribe(company => { - if (company) { - const file = this.uploadSingle(company.File).then((fileResult: any) => { - company.File = fileResult.downloadURL; - this.companiesCollection.add(company).then(result => { - console.log(result); - }); - }); - } - }); - } - - openWindow(url: string) { - window.open(url, '_blank'); + companies: Observable; + constructor(private companyService: CompanyService) { + this.companies = this.companyService.getCompanies(); } } diff --git a/src/app/companies/companies.model.ts b/src/app/companies/companies.model.ts new file mode 100644 index 00000000..b848225c --- /dev/null +++ b/src/app/companies/companies.model.ts @@ -0,0 +1,6 @@ +export interface Company { + name: string; + location: string; + website: string; + logo: string; +} diff --git a/src/app/companies/companies.module.ts b/src/app/companies/companies.module.ts index 8720e879..23faea80 100644 --- a/src/app/companies/companies.module.ts +++ b/src/app/companies/companies.module.ts @@ -1,26 +1,14 @@ import { CommonModule } from '@angular/common'; import { MaterialModule } from './../material/material.module'; import { NgModule } from '@angular/core'; -import { AngularFireModule } from 'angularfire2'; -import { AngularFirestoreModule } from 'angularfire2/firestore'; import { CompaniesComponent } from './companies.component'; import { CompaniesRoutingModule } from './companies-routing.module'; import { environment } from '../../environments/environment'; -import { CompanyDialogComponent } from '../company-dialog/company-dialog.component'; -import { MatDialogRef } from '@angular/material'; import { CompanyService } from './company.service'; -import { AngularFireDatabase } from 'angularfire2/database'; @NgModule({ - imports: [ - CommonModule, - CompaniesRoutingModule, - MaterialModule, - AngularFirestoreModule, - AngularFireModule.initializeApp(environment.firebase) - ], - declarations: [CompaniesComponent, CompanyDialogComponent], - entryComponents: [CompanyDialogComponent], - providers: [CompanyService, AngularFireDatabase] + imports: [CommonModule, CompaniesRoutingModule, MaterialModule], + declarations: [CompaniesComponent], + providers: [CompanyService] }) export class CompaniesModule {} diff --git a/src/app/companies/company.service.spec.ts b/src/app/companies/company.service.spec.ts index f73d9a69..72389aad 100644 --- a/src/app/companies/company.service.spec.ts +++ b/src/app/companies/company.service.spec.ts @@ -1,25 +1,19 @@ import { TestBed, inject } from '@angular/core/testing'; import { CompanyService } from './company.service'; -import { AngularFireDatabase } from 'angularfire2/database'; -import { AngularFirestoreModule } from 'angularfire2/firestore'; -import { AngularFireModule } from 'angularfire2'; import { environment } from '../../environments/environment'; describe('CompanyService', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [ - AngularFirestoreModule, - AngularFireModule.initializeApp(environment.firebase) - ], - providers: [CompanyService, AngularFireDatabase] + imports: [], + providers: [CompanyService] }); }); it( 'should be created', - inject([CompanyService, AngularFireDatabase], (service: CompanyService) => { + inject([CompanyService], (service: CompanyService) => { expect(service).toBeTruthy(); }) ); diff --git a/src/app/companies/company.service.ts b/src/app/companies/company.service.ts index 93877ed0..62f000a0 100644 --- a/src/app/companies/company.service.ts +++ b/src/app/companies/company.service.ts @@ -1,21 +1,12 @@ -import { Injectable } from "@angular/core"; -import { AngularFireDatabase, AngularFireList } from "angularfire2/database"; -import * as firebase from "firebase"; -import { Observable } from "rxjs/Observable"; +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs/Observable'; +import { of } from 'rxjs/observable/of'; +import { COMPANIES_LIST } from './companies-list'; +import { Company } from './companies.model'; @Injectable() export class CompanyService { - constructor(private db: AngularFireDatabase) {} - basePath = "uploads"; - uploadsRef: AngularFireList; - uploads: Observable; - // Executes the file uploading to firebase https://firebase.google.com/docs/storage/web/upload-files - - pushUpload(upload: any) { - const storageRef = firebase.storage().ref(); - const uploadTask = storageRef - .child(`${this.basePath}/${upload.name}`) - .put(upload); - return uploadTask; + getCompanies(): Observable { + return of(COMPANIES_LIST); } } diff --git a/src/app/companies/test.js b/src/app/companies/test.js deleted file mode 100644 index e69de29b..00000000 diff --git a/src/app/company-dialog/company-dialog.component.html b/src/app/company-dialog/company-dialog.component.html deleted file mode 100644 index 59573ded..00000000 --- a/src/app/company-dialog/company-dialog.component.html +++ /dev/null @@ -1,23 +0,0 @@ -

New Company Form

- -
- - - - - - - - - http://reactivex.io - - - - - -
-
- - - - \ No newline at end of file diff --git a/src/app/company-dialog/company-dialog.component.scss b/src/app/company-dialog/company-dialog.component.scss deleted file mode 100644 index e69de29b..00000000 diff --git a/src/app/company-dialog/company-dialog.component.spec.ts b/src/app/company-dialog/company-dialog.component.spec.ts deleted file mode 100644 index 57e25f84..00000000 --- a/src/app/company-dialog/company-dialog.component.spec.ts +++ /dev/null @@ -1,47 +0,0 @@ -// import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -// import { CompanyDialogComponent } from './company-dialog.component'; -// import { NgModule } from '@angular/core'; -// import { MatDialogModule, MatDialog } from '@angular/material'; -// import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -// import { FormBuilder, FormsModule, ReactiveFormsModule } from '@angular/forms'; - -// import { SharedModule } from '../shared.module'; -// import { inject } from '@angular/core/testing'; -// import { CompaniesModule } from '../companies/companies.module'; -// import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing'; -// import { CommonModule } from '@angular/common'; - -// describe('CompanyDialogComponent', () => { -// let component: CompanyDialogComponent; -// let fixture: ComponentFixture; -// let dialog: MatDialog; - -// beforeEach( -// async(() => { -// TestBed.configureTestingModule({ -// imports: [SharedModule, NoopAnimationsModule], -// declarations: [CompanyDialogComponent], -// providers: [], -// }).overrideModule(BrowserDynamicTestingModule, { -// set: { -// entryComponents: [CompanyDialogComponent] -// } -// }).compileComponents(); -// }) -// ); - -// beforeEach(() => { -// fixture = TestBed.createComponent(CompanyDialogComponent); -// component = fixture.componentInstance; -// fixture.detectChanges(); - -// dialog = TestBed.get(MatDialog); -// let dialogRef = dialog.open(CompanyDialogComponent); -// component = dialogRef.componentInstance; -// }); - -// it('should create', () => { -// expect(component).toBeTruthy(); -// }); -// }); diff --git a/src/app/company-dialog/company-dialog.component.ts b/src/app/company-dialog/company-dialog.component.ts deleted file mode 100644 index 9ee46757..00000000 --- a/src/app/company-dialog/company-dialog.component.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { FormGroup, FormBuilder, Validators } from '@angular/forms'; -import { CompanyService } from '../companies/company.service'; - -@Component({ - selector: 'app-company-dialog', - templateUrl: './company-dialog.component.html', - styleUrls: ['./company-dialog.component.scss'] -}) -export class CompanyDialogComponent { - companyForm: FormGroup; - selectedFile: File; - - constructor(private formBuilder: FormBuilder) { - this.createCompanyForm(); - } - - detectFiles(event) { - const fileControl = this.companyForm.get('File'); - this.selectedFile = event.target.files.item(0).name; - fileControl.setValue(event.target.files.item(0)); - } - - private createCompanyForm() { - this.companyForm = this.formBuilder.group({ - Name: ['', Validators.required], - Location: ['', Validators.required], - Website: ['', Validators.required], - File: '' - }); - } - - private subscribeToForm() { - const nameControl = this.companyForm.get('Name'); - nameControl.valueChanges.forEach((value: string) => console.log(value)); - const locationControl = this.companyForm.get('Location'); - nameControl.valueChanges.forEach((value: string) => console.log(value)); - const websiteControl = this.companyForm.get('Website'); - nameControl.valueChanges.forEach((value: string) => console.log(value)); - } -} diff --git a/src/app/material/material.module.ts b/src/app/material/material.module.ts index 78be3a4c..20fbe321 100644 --- a/src/app/material/material.module.ts +++ b/src/app/material/material.module.ts @@ -5,16 +5,15 @@ import { MatToolbarModule, MatIconModule, MatButtonModule, - MatDialogModule, MatListModule, MatSidenavModule, MatExpansionModule, MatCardModule, MatInputModule, MatMenuModule, - MatTooltipModule + MatTooltipModule, + MatSnackBarModule } from '@angular/material'; -import { ReactiveFormsModule, FormsModule } from '@angular/forms'; @NgModule({ declarations: [], @@ -22,7 +21,6 @@ import { ReactiveFormsModule, FormsModule } from '@angular/forms'; MatToolbarModule, MatIconModule, MatButtonModule, - MatDialogModule, MatListModule, MatSidenavModule, MatExpansionModule, @@ -31,14 +29,12 @@ import { ReactiveFormsModule, FormsModule } from '@angular/forms'; MatMenuModule, MatTooltipModule, FlexLayoutModule, - ReactiveFormsModule, - FormsModule + MatSnackBarModule ], exports: [ MatToolbarModule, MatIconModule, MatButtonModule, - MatDialogModule, MatListModule, MatSidenavModule, MatExpansionModule, @@ -47,8 +43,7 @@ import { ReactiveFormsModule, FormsModule } from '@angular/forms'; MatMenuModule, MatTooltipModule, FlexLayoutModule, - ReactiveFormsModule, - FormsModule + MatSnackBarModule ] }) export class MaterialModule {} diff --git a/src/assets/companies/google.png b/src/assets/companies/google.png new file mode 100644 index 0000000000000000000000000000000000000000..0a02a7b97c447fa934a3ed7e7784ebeb0dd7e010 GIT binary patch literal 7844 zcmZ{pcQ9Px_y4z9tlqoTlIT|NtQMk0MA;ys_imL$TV04CqDPD9o#@1BQ4>T<)J3GI zs|&(cKJ)wI^ZU+x=gxDVInQ~W_qpdh&)k_i_ql<-CK-$w1^@ua?rEtT-puJYBZ~-n zbN^)8Cw((P998sG0D$@=l1poX8yo0rsHqC5`ONzJ#^A8kGSmYAp4|ojFi`-&`OOmM z7XaXg001_v006m60D!^kP5T3d8wb=zM^hbe{qHL1DowpvA@EnMo2K0l!G^-k^qvZ zUpuq(Ia|`zp}n-Yr#TwOyCmh}njkSR6Hi9`2_qLD2jS%80fIQo-yM``cfn7WeLpCM z1^>KFH&j$%cxo&gRNdiYTH%rF+r1ZXvb=J2vJCI1)&Z)oamsMWGqh6?pX1f{HM9U9 zFts?oK;F0lE?(_2N+L*Wn6GsV!hK>koUv+M`$SSTvezRLuG&P!Z0xL(N&Frp1o{L! zMv^6iUSTLQoyKVEWD0zcP(~_7gI~ZCVl*&_wjJ`UA3k^yFKpN%l;We}W)>*MIcGiasat$!vDdX4l( zbcv$uxpVcb$dnL-8|df&U@5RMd~@iK!?O8fY=D zLZVJNJ1Krj8*6mi2%J3~c5MWFB~}m^Nd>WNo-=J`0S^NPt@N_CYob$V&w$2^>72nt zG8CDzAIJEnbaanA;doFTboDfH>1gItRI{QeDm6(+GJ=`1cm(DM%mDucBu>$ma68vi z;ckU%Qiig`9Q{#xZF}~%s%O&)$Pw)W#n)@8&A>I0Y~*zha0IVo3GyC{dIdcpoozJ< zWY2t4hg#*waTWZQfo^(X$UyhO6i;Pm%{kq+l6szXe5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ji swRW@h^m_V4)WOc)#z9uX#=*``Nc7(>_HfEM--HA1Y3Qrhs9Ht*4`fM2bN~PV literal 0 HcmV?d00001 diff --git a/src/assets/companies/microsoft.png b/src/assets/companies/microsoft.png new file mode 100644 index 0000000000000000000000000000000000000000..11feffc1d82cf95f4fcf7eaf9ad39991d5d99056 GIT binary patch literal 5598 zcmeAS@N?(olHy`uVBq!ia0y~yV15C@9Be=l-^Ev+04d25*NBqf{Irtt#G+IN$CUh} zR0Yr6#Prml)Wnp^!jq{s3=E>p*LBuuCJx2Rl0&`xhM^LkCL_=*v zqw5W)l83jr);Ml#$j=f;obldLA(AbwZ36eSju}8p7)nJO`G6FYERYZYx`9FA0wa(d z6(lP_)&hfWG%Tr|j$#)uGcYtbumi)E#R^DplmH2b5iNMw{NC@W&b(Vz&7UtfUCP|< z-mbhoJaUW|79CF02vcZY$q5S~NNNNJ8#rf!gKbohoB$au6lqaQfHO0=#DL^*aLqF+ z2&#(750H^vI8wQ`5Qay^u&;d_;*5nS1mrU<2>gEP`?r5A4P9O?5sfkJyF`>382$+Q zHaoBb^CvJ}Hu8bWg2ujK$1k5D2+VpMB?2!#e0Hv_D+^ylMU(QQ0S95^PV+ICKS3j3^P6