├── .editorconfig ├── .gitignore ├── README.md ├── angular.json ├── e2e ├── protractor.conf.js ├── src │ ├── app.e2e-spec.ts │ └── app.po.ts └── tsconfig.e2e.json ├── package-lock.json ├── package.json ├── src ├── app │ ├── admin │ │ ├── admin-orders │ │ │ ├── admin-orders.component.css │ │ │ ├── admin-orders.component.html │ │ │ ├── admin-orders.component.spec.ts │ │ │ └── admin-orders.component.ts │ │ └── admin-products │ │ │ ├── admin-products.component.css │ │ │ ├── admin-products.component.html │ │ │ ├── admin-products.component.spec.ts │ │ │ └── admin-products.component.ts │ ├── app-routing.module.ts │ ├── app.component.css │ ├── app.component.html │ ├── app.component.spec.ts │ ├── app.component.ts │ ├── app.module.ts │ ├── authentication.service.spec.ts │ ├── authentication.service.ts │ ├── bs-header │ │ ├── bs-header.component.css │ │ ├── bs-header.component.html │ │ ├── bs-header.component.spec.ts │ │ └── bs-header.component.ts │ ├── bs-navbar │ │ ├── bs-navbar.component.css │ │ ├── bs-navbar.component.html │ │ ├── bs-navbar.component.spec.ts │ │ └── bs-navbar.component.ts │ ├── category.service.spec.ts │ ├── category.service.ts │ ├── check-out │ │ ├── check-out.component.css │ │ ├── check-out.component.html │ │ ├── check-out.component.spec.ts │ │ └── check-out.component.ts │ ├── edit-profile │ │ ├── edit-profile.component.css │ │ ├── edit-profile.component.html │ │ ├── edit-profile.component.spec.ts │ │ └── edit-profile.component.ts │ ├── home │ │ ├── home.component.css │ │ ├── home.component.html │ │ ├── home.component.spec.ts │ │ └── home.component.ts │ ├── http.client.interceptor.ts │ ├── login-payload.ts │ ├── login │ │ ├── login.component.css │ │ ├── login.component.html │ │ ├── login.component.spec.ts │ │ └── login.component.ts │ ├── my-orders │ │ ├── my-orders.component.css │ │ ├── my-orders.component.html │ │ ├── my-orders.component.spec.ts │ │ └── my-orders.component.ts │ ├── order-success │ │ ├── order-success.component.css │ │ ├── order-success.component.html │ │ ├── order-success.component.spec.ts │ │ └── order-success.component.ts │ ├── payload │ │ └── authentication-response.payload.ts │ ├── product-page │ │ ├── ProductInformation.ts │ │ ├── ProductSearchResponseDto.ts │ │ ├── SearchQueryDto.ts │ │ ├── product-page.component.css │ │ ├── product-page.component.html │ │ ├── product-page.component.spec.ts │ │ ├── product-page.component.ts │ │ └── product-rating.ts │ ├── product.service.spec.ts │ ├── product.service.ts │ ├── products │ │ ├── products.component.css │ │ ├── products.component.html │ │ ├── products.component.spec.ts │ │ └── products.component.ts │ ├── register-payload.ts │ ├── register │ │ ├── api-response.ts │ │ ├── register.component.css │ │ ├── register.component.html │ │ ├── register.component.spec.ts │ │ └── register.component.ts │ ├── search-results │ │ ├── search-results.component.css │ │ ├── search-results.component.html │ │ ├── search-results.component.spec.ts │ │ └── search-results.component.ts │ ├── search-service.ts │ ├── search-shared-service.ts │ ├── shopping-cart │ │ ├── shopping-cart.component.css │ │ ├── shopping-cart.component.html │ │ ├── shopping-cart.component.spec.ts │ │ └── shopping-cart.component.ts │ └── wishlist │ │ ├── wishlist.component.css │ │ ├── wishlist.component.html │ │ ├── wishlist.component.spec.ts │ │ └── wishlist.component.ts ├── assets │ ├── .gitkeep │ ├── img │ │ └── cream.png │ └── photos │ │ ├── 10.png │ │ ├── 11.png │ │ ├── 12.png │ │ ├── 13.png │ │ ├── 2.png │ │ ├── 3.png │ │ ├── 4.png │ │ ├── 5.png │ │ ├── 6.png │ │ ├── 7.png │ │ ├── 8.png │ │ ├── 9.png │ │ ├── promo-1.png │ │ └── promo-2.png ├── 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 ├── 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 | -------------------------------------------------------------------------------- /.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 | 8 | # dependencies 9 | /node_modules 10 | 11 | # profiling files 12 | chrome-profiler-events.json 13 | speed-measure-plugin.json 14 | 15 | # IDEs and editors 16 | /.idea 17 | .project 18 | .classpath 19 | .c9/ 20 | *.launch 21 | .settings/ 22 | *.sublime-workspace 23 | 24 | # IDE - VSCode 25 | .vscode/* 26 | !.vscode/settings.json 27 | !.vscode/tasks.json 28 | !.vscode/launch.json 29 | !.vscode/extensions.json 30 | 31 | # misc 32 | /.sass-cache 33 | /connect.lock 34 | /coverage 35 | /libpeerconnection.log 36 | npm-debug.log 37 | yarn-error.log 38 | testem.log 39 | /typings 40 | 41 | # System Files 42 | .DS_Store 43 | Thumbs.db 44 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Ngspringshoppingstore 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 7.1.4. 4 | 5 | ## Development server 6 | 7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. 8 | 9 | ## Code scaffolding 10 | 11 | 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`. 12 | 13 | ## Build 14 | 15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. 16 | 17 | ## Running unit tests 18 | 19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 20 | 21 | ## Running end-to-end tests 22 | 23 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). 24 | 25 | ## Further help 26 | 27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). 28 | -------------------------------------------------------------------------------- /angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "newProjectRoot": "projects", 5 | "projects": { 6 | "ngspringshoppingstore": { 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/ngspringshoppingstore", 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 | ], 25 | "styles": [ 26 | "./node_modules/bootstrap/dist/css/bootstrap.min.css", 27 | "src/styles.css" 28 | ], 29 | "scripts": [] 30 | }, 31 | "configurations": { 32 | "production": { 33 | "fileReplacements": [ 34 | { 35 | "replace": "src/environments/environment.ts", 36 | "with": "src/environments/environment.prod.ts" 37 | } 38 | ], 39 | "optimization": true, 40 | "outputHashing": "all", 41 | "sourceMap": false, 42 | "extractCss": true, 43 | "namedChunks": false, 44 | "aot": true, 45 | "extractLicenses": true, 46 | "vendorChunk": false, 47 | "buildOptimizer": true, 48 | "budgets": [ 49 | { 50 | "type": "initial", 51 | "maximumWarning": "2mb", 52 | "maximumError": "5mb" 53 | } 54 | ] 55 | } 56 | } 57 | }, 58 | "serve": { 59 | "builder": "@angular-devkit/build-angular:dev-server", 60 | "options": { 61 | "browserTarget": "ngspringshoppingstore:build" 62 | }, 63 | "configurations": { 64 | "production": { 65 | "browserTarget": "ngspringshoppingstore:build:production" 66 | } 67 | } 68 | }, 69 | "extract-i18n": { 70 | "builder": "@angular-devkit/build-angular:extract-i18n", 71 | "options": { 72 | "browserTarget": "ngspringshoppingstore:build" 73 | } 74 | }, 75 | "test": { 76 | "builder": "@angular-devkit/build-angular:karma", 77 | "options": { 78 | "main": "src/test.ts", 79 | "polyfills": "src/polyfills.ts", 80 | "tsConfig": "src/tsconfig.spec.json", 81 | "karmaConfig": "src/karma.conf.js", 82 | "styles": [ 83 | "src/styles.css" 84 | ], 85 | "scripts": [], 86 | "assets": [ 87 | "src/favicon.ico", 88 | "src/assets" 89 | ] 90 | } 91 | }, 92 | "lint": { 93 | "builder": "@angular-devkit/build-angular:tslint", 94 | "options": { 95 | "tsConfig": [ 96 | "src/tsconfig.app.json", 97 | "src/tsconfig.spec.json" 98 | ], 99 | "exclude": [ 100 | "**/node_modules/**" 101 | ] 102 | } 103 | } 104 | } 105 | }, 106 | "ngspringshoppingstore-e2e": { 107 | "root": "e2e/", 108 | "projectType": "application", 109 | "prefix": "", 110 | "architect": { 111 | "e2e": { 112 | "builder": "@angular-devkit/build-angular:protractor", 113 | "options": { 114 | "protractorConfig": "e2e/protractor.conf.js", 115 | "devServerTarget": "ngspringshoppingstore:serve" 116 | }, 117 | "configurations": { 118 | "production": { 119 | "devServerTarget": "ngspringshoppingstore:serve:production" 120 | } 121 | } 122 | }, 123 | "lint": { 124 | "builder": "@angular-devkit/build-angular:tslint", 125 | "options": { 126 | "tsConfig": "e2e/tsconfig.e2e.json", 127 | "exclude": [ 128 | "**/node_modules/**" 129 | ] 130 | } 131 | } 132 | } 133 | } 134 | }, 135 | "defaultProject": "ngspringshoppingstore" 136 | } -------------------------------------------------------------------------------- /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 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './src/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | onPrepare() { 23 | require('ts-node').register({ 24 | project: require('path').join(__dirname, './tsconfig.e2e.json') 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; -------------------------------------------------------------------------------- /e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('workspace-project App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getTitleText()).toEqual('Welcome to ngspringshoppingstore!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getTitleText() { 9 | return element(by.css('app-root h1')).getText(); 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 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ngspringshoppingstore", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build", 8 | "test": "ng test", 9 | "lint": "ng lint", 10 | "e2e": "ng e2e" 11 | }, 12 | "private": true, 13 | "dependencies": { 14 | "@angular/animations": "~7.1.0", 15 | "@angular/common": "~7.1.0", 16 | "@angular/compiler": "~7.1.0", 17 | "@angular/core": "~7.1.0", 18 | "@angular/forms": "~7.1.0", 19 | "@angular/platform-browser": "~7.1.0", 20 | "@angular/platform-browser-dynamic": "~7.1.0", 21 | "@angular/router": "~7.1.0", 22 | "bootstrap": "^4.3.1", 23 | "core-js": "^2.5.4", 24 | "rxjs": "~6.3.3", 25 | "tslib": "^1.9.0", 26 | "zone.js": "~0.8.26" 27 | }, 28 | "devDependencies": { 29 | "@angular-devkit/build-angular": "~0.11.0", 30 | "@angular/cli": "~7.1.4", 31 | "@angular/compiler-cli": "~7.1.0", 32 | "@angular/language-service": "~7.1.0", 33 | "@types/node": "~8.9.4", 34 | "@types/jasmine": "~2.8.8", 35 | "@types/jasminewd2": "~2.0.3", 36 | "codelyzer": "~4.5.0", 37 | "jasmine-core": "~2.99.1", 38 | "jasmine-spec-reporter": "~4.2.1", 39 | "karma": "~3.1.1", 40 | "karma-chrome-launcher": "~2.2.0", 41 | "karma-coverage-istanbul-reporter": "~2.0.1", 42 | "karma-jasmine": "~1.1.2", 43 | "karma-jasmine-html-reporter": "^0.2.2", 44 | "protractor": "~5.4.0", 45 | "ts-node": "~7.0.0", 46 | "tslint": "~5.11.0", 47 | "ngx-webstorage": "2.0.1", 48 | "typescript": "~3.1.6", 49 | "webpack-dev-server": ">=3.1.11" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/app/admin/admin-orders/admin-orders.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SaiUpadhyayula/SpringAngularEcommerce-frontend/08769109499b0fa4e92f0c4251f2b9aeb01fb829/src/app/admin/admin-orders/admin-orders.component.css -------------------------------------------------------------------------------- /src/app/admin/admin-orders/admin-orders.component.html: -------------------------------------------------------------------------------- 1 |

2 | admin-orders works! 3 |

4 | -------------------------------------------------------------------------------- /src/app/admin/admin-orders/admin-orders.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { AdminOrdersComponent } from './admin-orders.component'; 4 | 5 | describe('AdminOrdersComponent', () => { 6 | let component: AdminOrdersComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ AdminOrdersComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(AdminOrdersComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/admin/admin-orders/admin-orders.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-admin-orders', 5 | templateUrl: './admin-orders.component.html', 6 | styleUrls: ['./admin-orders.component.css'] 7 | }) 8 | export class AdminOrdersComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/app/admin/admin-products/admin-products.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SaiUpadhyayula/SpringAngularEcommerce-frontend/08769109499b0fa4e92f0c4251f2b9aeb01fb829/src/app/admin/admin-products/admin-products.component.css -------------------------------------------------------------------------------- /src/app/admin/admin-products/admin-products.component.html: -------------------------------------------------------------------------------- 1 |

2 | admin-products works! 3 |

4 | -------------------------------------------------------------------------------- /src/app/admin/admin-products/admin-products.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { AdminProductsComponent } from './admin-products.component'; 4 | 5 | describe('AdminProductsComponent', () => { 6 | let component: AdminProductsComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ AdminProductsComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(AdminProductsComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/admin/admin-products/admin-products.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-admin-products', 5 | templateUrl: './admin-products.component.html', 6 | styleUrls: ['./admin-products.component.css'] 7 | }) 8 | export class AdminProductsComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | 4 | const routes: Routes = []; 5 | 6 | @NgModule({ 7 | imports: [RouterModule.forRoot(routes)], 8 | exports: [RouterModule] 9 | }) 10 | export class AppRoutingModule { } 11 | -------------------------------------------------------------------------------- /src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SaiUpadhyayula/SpringAngularEcommerce-frontend/08769109499b0fa4e92f0c4251f2b9aeb01fb829/src/app/app.component.css -------------------------------------------------------------------------------- /src/app/app.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 |
-------------------------------------------------------------------------------- /src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async } from '@angular/core/testing'; 2 | import { RouterTestingModule } from '@angular/router/testing'; 3 | import { AppComponent } from './app.component'; 4 | 5 | describe('AppComponent', () => { 6 | beforeEach(async(() => { 7 | TestBed.configureTestingModule({ 8 | imports: [ 9 | RouterTestingModule 10 | ], 11 | declarations: [ 12 | AppComponent 13 | ], 14 | }).compileComponents(); 15 | })); 16 | 17 | it('should create the app', () => { 18 | const fixture = TestBed.createComponent(AppComponent); 19 | const app = fixture.debugElement.componentInstance; 20 | expect(app).toBeTruthy(); 21 | }); 22 | 23 | it(`should have as title 'ngspringshoppingstore'`, () => { 24 | const fixture = TestBed.createComponent(AppComponent); 25 | const app = fixture.debugElement.componentInstance; 26 | expect(app.title).toEqual('ngspringshoppingstore'); 27 | }); 28 | 29 | it('should render title in a h1 tag', () => { 30 | const fixture = TestBed.createComponent(AppComponent); 31 | fixture.detectChanges(); 32 | const compiled = fixture.debugElement.nativeElement; 33 | expect(compiled.querySelector('h1').textContent).toContain('Welcome to ngspringshoppingstore!'); 34 | }); 35 | }); 36 | -------------------------------------------------------------------------------- /src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = 'ngspringshoppingstore'; 10 | } 11 | -------------------------------------------------------------------------------- /src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | 4 | import { AppRoutingModule } from './app-routing.module'; 5 | import { AppComponent } from './app.component'; 6 | import { BsNavbarComponent } from './bs-navbar/bs-navbar.component'; 7 | import { BsHeaderComponent } from './bs-header/bs-header.component'; 8 | import { HomeComponent } from './home/home.component'; 9 | import { ProductsComponent } from './products/products.component'; 10 | import { ShoppingCartComponent } from './shopping-cart/shopping-cart.component'; 11 | import { CheckOutComponent } from './check-out/check-out.component'; 12 | import { OrderSuccessComponent } from './order-success/order-success.component'; 13 | import { MyOrdersComponent } from './my-orders/my-orders.component'; 14 | import { WishlistComponent } from './wishlist/wishlist.component'; 15 | import { EditProfileComponent } from './edit-profile/edit-profile.component'; 16 | import { LoginComponent } from './login/login.component'; 17 | import { RegisterComponent } from './register/register.component'; 18 | import { ProductPageComponent } from './product-page/product-page.component'; 19 | import { AdminProductsComponent } from './admin/admin-products/admin-products.component'; 20 | import { AdminOrdersComponent } from './admin/admin-orders/admin-orders.component'; 21 | import { RouterModule } from '@angular/router'; 22 | import { CategoryService } from './category.service'; 23 | import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http' 24 | import { FormsModule, ReactiveFormsModule } from '@angular/forms'; 25 | import { AuthenticationService } from './authentication.service'; 26 | import { LocalStorageService } from 'ngx-webstorage'; 27 | import { HttpClientInterceptor } from './http.client.interceptor'; 28 | import { SearchResultsComponent } from './search-results/search-results.component'; 29 | import { SearchSharedService } from './search-shared-service'; 30 | 31 | @NgModule({ 32 | declarations: [ 33 | AppComponent, 34 | BsNavbarComponent, 35 | BsHeaderComponent, 36 | HomeComponent, 37 | ProductsComponent, 38 | ShoppingCartComponent, 39 | CheckOutComponent, 40 | OrderSuccessComponent, 41 | MyOrdersComponent, 42 | WishlistComponent, 43 | EditProfileComponent, 44 | LoginComponent, 45 | RegisterComponent, 46 | ProductPageComponent, 47 | AdminProductsComponent, 48 | AdminOrdersComponent, 49 | SearchResultsComponent, 50 | ], 51 | imports: [ 52 | BrowserModule, 53 | AppRoutingModule, 54 | RouterModule.forRoot([ 55 | {path:'', component: HomeComponent}, 56 | {path:'products/category/:categoryName', component: ProductsComponent}, 57 | {path:'product-page', component: ProductPageComponent}, 58 | {path:'shopping-cart', component:ShoppingCartComponent}, 59 | {path:'check-out', component:CheckOutComponent}, 60 | {path:'order-success', component:OrderSuccessComponent}, 61 | {path:'login', component:LoginComponent}, 62 | {path:'register', component:RegisterComponent}, 63 | {path:'admin/products', component:AdminProductsComponent}, 64 | {path:'admin/orders', component:AdminOrdersComponent}, 65 | {path:'search/:searchTerm', component: SearchResultsComponent} 66 | ]), 67 | HttpClientModule, 68 | FormsModule, 69 | ReactiveFormsModule 70 | ], 71 | providers: [CategoryService, AuthenticationService, LocalStorageService, SearchSharedService, 72 | { provide: HTTP_INTERCEPTORS, useClass: HttpClientInterceptor, multi: true }], 73 | bootstrap: [AppComponent] 74 | }) 75 | export class AppModule { } 76 | -------------------------------------------------------------------------------- /src/app/authentication.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { AuthenticationService } from './authentication.service'; 4 | 5 | describe('AuthenticationService', () => { 6 | beforeEach(() => TestBed.configureTestingModule({})); 7 | 8 | it('should be created', () => { 9 | const service: AuthenticationService = TestBed.get(AuthenticationService); 10 | expect(service).toBeTruthy(); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /src/app/authentication.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { HttpClient } from '@angular/common/http'; 3 | import { LocalStorageService } from 'ngx-webstorage'; 4 | import { Observable } from 'rxjs'; 5 | import { map } from 'rxjs/operators'; 6 | import { LoginPayload } from './login-payload'; 7 | import { JwtAuthResponsePayload } from './payload/authentication-response.payload'; 8 | import { RegisterPayload } from './register-payload'; 9 | import { ApiResponse } from './register/api-response'; 10 | 11 | @Injectable({ 12 | providedIn: 'root' 13 | }) 14 | export class AuthenticationService { 15 | constructor(private http: HttpClient, private $localStorage: LocalStorageService) { } 16 | 17 | login(loginPayload: LoginPayload): Observable { 18 | return this.http.post('http://localhost:8080/api/auth/login', loginPayload).pipe(map(data => { 19 | this.$localStorage.store('authenticationToken', data.accessToken); 20 | this.$localStorage.store('user', data.username); 21 | return true; 22 | })); 23 | } 24 | 25 | register(registerPayload: RegisterPayload): Observable { 26 | return this.http.post('http://localhost:8080/api/auth/register', registerPayload).pipe(map(data => { 27 | return data; 28 | })); 29 | } 30 | 31 | logout(): Observable { 32 | return new Observable(observer => { 33 | this.$localStorage.clear('authenticationToken'); 34 | this.$localStorage.clear('user'); 35 | observer.complete(); 36 | }); 37 | } 38 | 39 | getUserName(): string{ 40 | return this.$localStorage.retrieve('user'); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/app/bs-header/bs-header.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SaiUpadhyayula/SpringAngularEcommerce-frontend/08769109499b0fa4e92f0c4251f2b9aeb01fb829/src/app/bs-header/bs-header.component.css -------------------------------------------------------------------------------- /src/app/bs-header/bs-header.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 | 6 | 9 |
10 |
11 | 12 |
13 | 21 |
22 |
23 | 34 |
35 |
36 |
-------------------------------------------------------------------------------- /src/app/bs-header/bs-header.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { BsHeaderComponent } from './bs-header.component'; 4 | 5 | describe('BsHeaderComponent', () => { 6 | let component: BsHeaderComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ BsHeaderComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(BsHeaderComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/bs-header/bs-header.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { AuthenticationService } from '../authentication.service'; 3 | import { IfStmt } from '@angular/compiler'; 4 | import { SearchQueryDto } from '../product-page/SearchQueryDto'; 5 | import { SearchSharedService } from '../search-shared-service'; 6 | import { ProductService } from '../product.service'; 7 | import { Route } from '@angular/compiler/src/core'; 8 | import { Router } from '@angular/router'; 9 | import { SearchResultsComponent } from '../search-results/search-results.component'; 10 | 11 | @Component({ 12 | selector: 'bs-header', 13 | templateUrl: './bs-header.component.html', 14 | styleUrls: ['./bs-header.component.css'] 15 | }) 16 | export class BsHeaderComponent implements OnInit { 17 | 18 | userAccount: string; 19 | showLoginButton: boolean; 20 | searchQueryDto: SearchQueryDto; 21 | 22 | constructor(private authenticationService: AuthenticationService, private productService: ProductService, private searchSharedService: SearchSharedService, private router: Router) { 23 | this.setUserName(); 24 | this.searchQueryDto = { 25 | "textQuery": '', 26 | "filters": [] 27 | } 28 | } 29 | 30 | ngOnInit() { 31 | } 32 | 33 | private setUserName() { 34 | if (this.authenticationService.getUserName() != null) { 35 | this.userAccount = this.authenticationService.getUserName(); 36 | this.showLoginButton = false; 37 | } else { 38 | this.showLoginButton = true; 39 | } 40 | } 41 | 42 | search() { 43 | this.productService.search(this.searchQueryDto).toPromise().then(res => { 44 | console.log(res); 45 | this.searchSharedService.sendSearchData(res); 46 | this.router.navigateByUrl("/search/"); 47 | }); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/app/bs-navbar/bs-navbar.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SaiUpadhyayula/SpringAngularEcommerce-frontend/08769109499b0fa4e92f0c4251f2b9aeb01fb829/src/app/bs-navbar/bs-navbar.component.css -------------------------------------------------------------------------------- /src/app/bs-navbar/bs-navbar.component.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/bs-navbar/bs-navbar.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { BsNavbarComponent } from './bs-navbar.component'; 4 | 5 | describe('BsNavbarComponent', () => { 6 | let component: BsNavbarComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ BsNavbarComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(BsNavbarComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/bs-navbar/bs-navbar.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { CategoryService } from '../category.service'; 3 | 4 | @Component({ 5 | selector: 'bs-navbar', 6 | templateUrl: './bs-navbar.component.html', 7 | styleUrls: ['./bs-navbar.component.css'] 8 | }) 9 | export class BsNavbarComponent implements OnInit { 10 | 11 | categories$; 12 | 13 | constructor(categoryService: CategoryService) { 14 | this.categories$ = categoryService.getCategories(); 15 | } 16 | 17 | ngOnInit() { 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/app/category.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { CategoryService } from './category.service'; 4 | 5 | describe('CategoryService', () => { 6 | beforeEach(() => TestBed.configureTestingModule({})); 7 | 8 | it('should be created', () => { 9 | const service: CategoryService = TestBed.get(CategoryService); 10 | expect(service).toBeTruthy(); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /src/app/category.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { HttpClient } from '@angular/common/http'; 3 | 4 | @Injectable() 5 | export class CategoryService { 6 | 7 | constructor(private http: HttpClient) {} 8 | 9 | getCategories(){ 10 | return this.http.get('http://localhost:8080/api/store/catalog/categories/'); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/app/check-out/check-out.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SaiUpadhyayula/SpringAngularEcommerce-frontend/08769109499b0fa4e92f0c4251f2b9aeb01fb829/src/app/check-out/check-out.component.css -------------------------------------------------------------------------------- /src/app/check-out/check-out.component.html: -------------------------------------------------------------------------------- 1 |

2 | check-out works! 3 |

4 | -------------------------------------------------------------------------------- /src/app/check-out/check-out.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { CheckOutComponent } from './check-out.component'; 4 | 5 | describe('CheckOutComponent', () => { 6 | let component: CheckOutComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ CheckOutComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(CheckOutComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/check-out/check-out.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-check-out', 5 | templateUrl: './check-out.component.html', 6 | styleUrls: ['./check-out.component.css'] 7 | }) 8 | export class CheckOutComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/app/edit-profile/edit-profile.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SaiUpadhyayula/SpringAngularEcommerce-frontend/08769109499b0fa4e92f0c4251f2b9aeb01fb829/src/app/edit-profile/edit-profile.component.css -------------------------------------------------------------------------------- /src/app/edit-profile/edit-profile.component.html: -------------------------------------------------------------------------------- 1 |

2 | edit-profile works! 3 |

4 | -------------------------------------------------------------------------------- /src/app/edit-profile/edit-profile.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { EditProfileComponent } from './edit-profile.component'; 4 | 5 | describe('EditProfileComponent', () => { 6 | let component: EditProfileComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ EditProfileComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(EditProfileComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/edit-profile/edit-profile.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-edit-profile', 5 | templateUrl: './edit-profile.component.html', 6 | styleUrls: ['./edit-profile.component.css'] 7 | }) 8 | export class EditProfileComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/app/home/home.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SaiUpadhyayula/SpringAngularEcommerce-frontend/08769109499b0fa4e92f0c4251f2b9aeb01fb829/src/app/home/home.component.css -------------------------------------------------------------------------------- /src/app/home/home.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |
5 |
6 |

Popular Deals

7 |
8 | 9 |
10 |
11 | 12 |
{{p.productName}}
13 |
14 |
${{p.price}}
15 | 16 |
17 |
18 |
19 |
20 |
21 | -------------------------------------------------------------------------------- /src/app/home/home.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HomeComponent } from './home.component'; 4 | 5 | describe('HomeComponent', () => { 6 | let component: HomeComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ HomeComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(HomeComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/home/home.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { ProductService } from '../product.service'; 3 | 4 | @Component({ 5 | selector: 'app-home', 6 | templateUrl: './home.component.html', 7 | styleUrls: ['./home.component.css'] 8 | }) 9 | export class HomeComponent implements OnInit { 10 | 11 | $products; 12 | 13 | constructor(productService: ProductService) { 14 | this.$products = productService.getFeaturedProducts(); 15 | } 16 | 17 | ngOnInit() { 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/app/http.client.interceptor.ts: -------------------------------------------------------------------------------- 1 | import { Injectable, Injector } from "@angular/core"; 2 | import { HttpInterceptor, HttpRequest, HttpHandler, HttpEvent, HttpEventType, HttpResponse, HttpErrorResponse } from '@angular/common/http'; 3 | import { Router } from '@angular/router'; 4 | import { Observable } from 'rxjs'; 5 | import { LocalStorageService } from 'ngx-webstorage'; 6 | 7 | @Injectable({ 8 | providedIn: 'root' 9 | }) 10 | export class HttpClientInterceptor implements HttpInterceptor { 11 | 12 | constructor(private injector: Injector, private $localStorage: LocalStorageService) { 13 | 14 | } 15 | 16 | intercept(req: HttpRequest, 17 | next: HttpHandler): Observable> { 18 | 19 | const jwtToken = this.$localStorage.retrieve("authenticationToken"); 20 | console.log('jwt token ' + jwtToken); 21 | if (jwtToken) { 22 | const cloned = req.clone({ 23 | headers: req.headers.set("Authorization", 24 | "Bearer " + jwtToken) 25 | }); 26 | 27 | return next.handle(cloned); 28 | } 29 | else { 30 | return next.handle(req); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /src/app/login-payload.ts: -------------------------------------------------------------------------------- 1 | export interface LoginPayload{ 2 | username:string, 3 | password:string 4 | } -------------------------------------------------------------------------------- /src/app/login/login.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SaiUpadhyayula/SpringAngularEcommerce-frontend/08769109499b0fa4e92f0c4251f2b9aeb01fb829/src/app/login/login.component.css -------------------------------------------------------------------------------- /src/app/login/login.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 | 7 |
8 | 9 | 10 |
11 | 12 |
13 | 14 |
15 | 16 |
17 |
18 | 19 |
20 | 21 |
22 | 23 |
24 |
25 | 26 |
27 | 28 |
29 | 30 | 31 |
32 |
33 |
34 | Invalid Credentials. Please Check and retry. 35 |
36 |
37 |
38 |
New Account
39 | Don't have an Account? Register 40 |
41 |
42 | 43 |
44 |
45 |
46 |
-------------------------------------------------------------------------------- /src/app/login/login.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { LoginComponent } from './login.component'; 4 | 5 | describe('LoginComponent', () => { 6 | let component: LoginComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ LoginComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(LoginComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/login/login.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { AuthenticationService } from '../authentication.service'; 3 | import { LoginPayload } from '../login-payload'; 4 | import { FormBuilder, FormGroup, Validators } from '@angular/forms'; 5 | import { Router } from '@angular/router'; 6 | 7 | @Component({ 8 | selector: 'app-login', 9 | templateUrl: './login.component.html', 10 | styleUrls: ['./login.component.css'] 11 | }) 12 | export class LoginComponent implements OnInit { 13 | 14 | loginForm: FormGroup; 15 | loginPayload: LoginPayload; 16 | isError: boolean; 17 | 18 | constructor(private formBuilder: FormBuilder, private authenticationService: AuthenticationService, private router: Router) { 19 | this.loginPayload = { 20 | username: '', 21 | password: '' 22 | }; 23 | } 24 | 25 | ngOnInit() { 26 | this.loginForm = this.formBuilder.group({ 27 | username: ['', Validators.required], 28 | password: ['', Validators.required] 29 | }); 30 | } 31 | 32 | login() { 33 | this.authenticationService.login(this.loginPayload).toPromise().then((result) => { 34 | if (result) { 35 | this.isError = false; 36 | this.router.navigateByUrl('/'); 37 | } else { 38 | this.isError = true; 39 | } 40 | },()=>{ 41 | this.isError = true; 42 | }) 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/app/my-orders/my-orders.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SaiUpadhyayula/SpringAngularEcommerce-frontend/08769109499b0fa4e92f0c4251f2b9aeb01fb829/src/app/my-orders/my-orders.component.css -------------------------------------------------------------------------------- /src/app/my-orders/my-orders.component.html: -------------------------------------------------------------------------------- 1 |

2 | my-orders works! 3 |

4 | -------------------------------------------------------------------------------- /src/app/my-orders/my-orders.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { MyOrdersComponent } from './my-orders.component'; 4 | 5 | describe('MyOrdersComponent', () => { 6 | let component: MyOrdersComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ MyOrdersComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(MyOrdersComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/my-orders/my-orders.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-my-orders', 5 | templateUrl: './my-orders.component.html', 6 | styleUrls: ['./my-orders.component.css'] 7 | }) 8 | export class MyOrdersComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/app/order-success/order-success.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SaiUpadhyayula/SpringAngularEcommerce-frontend/08769109499b0fa4e92f0c4251f2b9aeb01fb829/src/app/order-success/order-success.component.css -------------------------------------------------------------------------------- /src/app/order-success/order-success.component.html: -------------------------------------------------------------------------------- 1 |

2 | order-success works! 3 |

4 | -------------------------------------------------------------------------------- /src/app/order-success/order-success.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { OrderSuccessComponent } from './order-success.component'; 4 | 5 | describe('OrderSuccessComponent', () => { 6 | let component: OrderSuccessComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ OrderSuccessComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(OrderSuccessComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/order-success/order-success.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-order-success', 5 | templateUrl: './order-success.component.html', 6 | styleUrls: ['./order-success.component.css'] 7 | }) 8 | export class OrderSuccessComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/app/payload/authentication-response.payload.ts: -------------------------------------------------------------------------------- 1 | export class JwtAuthResponsePayload{ 2 | accessToken:string; 3 | username:string; 4 | } -------------------------------------------------------------------------------- /src/app/product-page/ProductInformation.ts: -------------------------------------------------------------------------------- 1 | import { ProductRating } from './product-rating'; 2 | 3 | export class ProductInformation { 4 | productName: string; 5 | imageUrl: string; 6 | price: BigInteger; 7 | description: string; 8 | manufacturer: string; 9 | availability: ProductAvailabilityInformation; 10 | attributeList: Array; 11 | productRatingDtoList: Array; 12 | } 13 | 14 | class ProductAvailabilityInformation{ 15 | availability: string; 16 | color: string; 17 | } 18 | 19 | class ProductAttributeInformation { 20 | attributeName: string; 21 | attributeValue: string; 22 | } -------------------------------------------------------------------------------- /src/app/product-page/ProductSearchResponseDto.ts: -------------------------------------------------------------------------------- 1 | import { ProductInformation } from './ProductInformation'; 2 | 3 | export class ProductSearchResponseDto { 4 | products: Array; 5 | minPrice: Number; 6 | maxPrice: Number; 7 | facetDtos: Array; 8 | } 9 | 10 | export class FacetDto { 11 | facetName: String; 12 | facetValueDtos: FacetValueDto; 13 | } 14 | 15 | export class FacetValueDto { 16 | facetValueName: String; 17 | count: Number; 18 | checked: Boolean; 19 | } -------------------------------------------------------------------------------- /src/app/product-page/SearchQueryDto.ts: -------------------------------------------------------------------------------- 1 | export class SearchQueryDto{ 2 | textQuery: String; 3 | filters: Array 4 | } 5 | 6 | export class Filter { 7 | key: String; 8 | value: String; 9 | from?: String; 10 | to?: String; 11 | } -------------------------------------------------------------------------------- /src/app/product-page/product-page.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SaiUpadhyayula/SpringAngularEcommerce-frontend/08769109499b0fa4e92f0c4251f2b9aeb01fb829/src/app/product-page/product-page.component.css -------------------------------------------------------------------------------- /src/app/product-page/product-page.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 | 6 | 7 | 14 |
15 |
16 |
17 |
18 | 19 |
20 |
21 |
{{product.productName}}
22 |
23 |
Price: ${{product.price}}
24 |
Brand: {{product.manufacturer}}
25 |
Availability: {{product.availability.availability}}
27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 |
36 |
37 | 38 | 39 | 40 |
41 |
42 |
43 |
44 |
45 | 55 |
56 |
57 |
58 |
59 |
60 | 61 |
62 |
{{product.productName}}
63 |
64 |

{{product.description}}

65 |
66 |
Product Specs
67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 |
{{p.attributeName}}
75 |
76 | 77 | 78 |
79 |
Write a Review
80 | 81 |
82 | 83 |
84 | 85 |
86 | 87 |
88 | 89 |
90 |
91 | 92 |
93 | 94 |
95 | 103 |
104 |
105 | 106 | 107 |
108 | 109 |
110 | 111 |
112 |
113 | 114 |
115 | 116 |
117 | 118 | 119 |
120 |
121 |
122 |
123 | 124 |
Product Reviews
125 |
126 |
{{rating.userName}} - {{rating.ratingStars}}/5
127 |

27/1/2012

128 |

{{rating.review}}

129 |
130 | 131 |
132 | 133 |
134 | 135 |
136 |
137 |
138 | 139 |
140 |
-------------------------------------------------------------------------------- /src/app/product-page/product-page.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ProductPageComponent } from './product-page.component'; 4 | 5 | describe('ProductPageComponent', () => { 6 | let component: ProductPageComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ ProductPageComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(ProductPageComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/product-page/product-page.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { ProductInformation } from './ProductInformation'; 3 | import { ProductService } from '../product.service'; 4 | import { ActivatedRoute } from '@angular/router'; 5 | 6 | @Component({ 7 | selector: 'app-product-page', 8 | templateUrl: './product-page.component.html', 9 | styleUrls: ['./product-page.component.css'] 10 | }) 11 | export class ProductPageComponent implements OnInit { 12 | 13 | product:ProductInformation; 14 | 15 | constructor(productService: ProductService, private route: ActivatedRoute) { 16 | 17 | let sku = route.snapshot.queryParams.sku; 18 | if(sku) 19 | productService.getSku(sku).subscribe(p => this.product = p); 20 | } 21 | 22 | ngOnInit() { 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/app/product-page/product-rating.ts: -------------------------------------------------------------------------------- 1 | export class ProductRating { 2 | ratingId: string; 3 | ratingStars: Number; 4 | reveiw: string; 5 | userName: string; 6 | sku: string; 7 | } -------------------------------------------------------------------------------- /src/app/product.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { ProductService } from './product.service'; 4 | 5 | describe('ProductService', () => { 6 | beforeEach(() => TestBed.configureTestingModule({})); 7 | 8 | it('should be created', () => { 9 | const service: ProductService = TestBed.get(ProductService); 10 | expect(service).toBeTruthy(); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /src/app/product.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { HttpClient } from '@angular/common/http'; 3 | import { ProductInformation } from './product-page/ProductInformation'; 4 | import { ProductSearchResponseDto } from './product-page/ProductSearchResponseDto'; 5 | import { SearchQueryDto } from './product-page/SearchQueryDto'; 6 | import { map } from 'rxjs/operators'; 7 | 8 | @Injectable({ 9 | providedIn: 'root' 10 | }) 11 | export class ProductService { 12 | constructor(private http: HttpClient) { } 13 | 14 | getProductsByCategory(categoryName: string) { 15 | return this.http.get('http://localhost:8080/api/store/catalog/products/category/'+categoryName); 16 | } 17 | 18 | getProducts() { 19 | return this.http.get('http://localhost:8080/api/store/catalog/products/'); 20 | } 21 | 22 | getFeaturedProducts(): any { 23 | return this.http.get('http://localhost:8080/api/store/catalog/products/featured'); 24 | } 25 | 26 | getSku(productName: string) { 27 | return this.http.get('http://localhost:8080/api/store/catalog/products/' + productName); 28 | } 29 | 30 | getFacets(categoryName:String, searchQueryDto: SearchQueryDto) { 31 | 32 | return this.http.post('http://localhost:8080/api/store/catalog/'+categoryName + "/facets/filter", searchQueryDto).pipe(map(data => { 33 | return data; 34 | })); 35 | } 36 | 37 | search(searchQueryDto: SearchQueryDto){ 38 | return this.http.post('http://localhost:8080/api/store/catalog/search', searchQueryDto).pipe(map(data => { 39 | return data; 40 | })); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/app/products/products.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SaiUpadhyayula/SpringAngularEcommerce-frontend/08769109499b0fa4e92f0c4251f2b9aeb01fb829/src/app/products/products.component.css -------------------------------------------------------------------------------- /src/app/products/products.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 |
7 | 34 |
35 | 36 | 42 | 43 |

{{categoryName}}

44 | 45 |
46 | 54 |
55 | 56 |
57 |
58 | 59 |
60 |
61 | 63 |
{{p.productName}}
64 |
65 |
${{p.price}}
66 | 67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
-------------------------------------------------------------------------------- /src/app/products/products.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ProductsComponent } from './products.component'; 4 | 5 | describe('ProductsComponent', () => { 6 | let component: ProductsComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ ProductsComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(ProductsComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/products/products.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { ProductService } from '../product.service'; 3 | import { ActivatedRoute } from '@angular/router'; 4 | import { SearchQueryDto, Filter } from '../product-page/SearchQueryDto'; 5 | import { ProductInformation } from '../product-page/ProductInformation'; 6 | import { FacetDto } from '../product-page/ProductSearchResponseDto'; 7 | 8 | @Component({ 9 | selector: 'app-products', 10 | templateUrl: './products.component.html', 11 | styleUrls: ['./products.component.css'] 12 | }) 13 | export class ProductsComponent implements OnInit { 14 | categoryName: string; 15 | searchQueryDto: SearchQueryDto; 16 | products$: ProductInformation[]; 17 | facetDtos$: Array; 18 | filter: Filter; 19 | filters: Array; 20 | checkedValues: Array; 21 | 22 | constructor(private route: ActivatedRoute, private productService: ProductService) { 23 | this.categoryName = route.snapshot.params.categoryName; 24 | this.filters = []; 25 | this.checkedValues = []; 26 | 27 | this.initSearchQueryDto(); 28 | this.getFacets(); 29 | } 30 | 31 | ngOnInit() { 32 | } 33 | 34 | check(facetName: String, facetNameValue: String, event: Event) { 35 | this.filter = { 36 | "key": facetName, 37 | "value": facetNameValue 38 | }; 39 | this.filters.push(this.filter); 40 | this.get(); 41 | this.checkedValues.push(facetNameValue); 42 | document.body.scrollTop = document.documentElement.scrollTop = 0; 43 | } 44 | 45 | isChecked(facetValueName: String): Boolean { 46 | return this.checkedValues.indexOf(facetValueName) >= 0; 47 | } 48 | 49 | existsAny(checkedValues: Array) { 50 | return checkedValues.length > 0; 51 | } 52 | 53 | clearAllFilters() { 54 | this.checkedValues = []; 55 | this.filters = []; 56 | this.searchQueryDto.filters = this.filters; 57 | this.getFacets(); 58 | } 59 | 60 | removeFilter(value: String) { 61 | this.checkedValues.splice(this.checkedValues.indexOf(value), 1); 62 | this.filters = this.filters.filter(el => el.value !== value); 63 | this.get(); 64 | } 65 | 66 | private initSearchQueryDto() { 67 | this.searchQueryDto = { 68 | textQuery: "", 69 | filters: this.filters 70 | }; 71 | } 72 | 73 | private getFacets() { 74 | this.productService.getFacets(this.categoryName, this.searchQueryDto).subscribe((res) => { 75 | console.log(res); 76 | this.products$ = res.products; 77 | this.facetDtos$ = res.facetDtos; 78 | }); 79 | } 80 | 81 | private get() { 82 | this.searchQueryDto = { 83 | textQuery: "", 84 | filters: this.filters 85 | }; 86 | this.productService.getFacets(this.categoryName, this.searchQueryDto).subscribe((res) => { 87 | console.log(res); 88 | this.products$ = res.products; 89 | this.facetDtos$ = res.facetDtos; 90 | }); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /src/app/register-payload.ts: -------------------------------------------------------------------------------- 1 | export interface RegisterPayload{ 2 | email: string, 3 | username: string, 4 | name: string, 5 | password: string, 6 | confirmPassword: string 7 | } -------------------------------------------------------------------------------- /src/app/register/api-response.ts: -------------------------------------------------------------------------------- 1 | export class ApiResponse { 2 | status: Number; 3 | message: String; 4 | } -------------------------------------------------------------------------------- /src/app/register/register.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SaiUpadhyayula/SpringAngularEcommerce-frontend/08769109499b0fa4e92f0c4251f2b9aeb01fb829/src/app/register/register.component.css -------------------------------------------------------------------------------- /src/app/register/register.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 |

Register for New Account

7 |
8 | 9 |
10 | 11 | 12 |
13 | 14 |
15 | 17 |
18 |
19 | 20 |
21 | 22 |
23 | 25 |
26 |
27 | 28 |
29 | 30 |
31 | 33 |
34 |
35 | 36 |
37 | 38 |
39 | 41 |
42 |
43 |
44 | 45 |
46 | 48 |
49 |
50 | 51 | 52 |
53 | 54 |
55 | 56 | 57 |
58 |
59 |
60 | {{errorMessage}} 61 |
62 |
63 |
64 |
65 |

Already have an Account? Login

66 |
67 |
68 | 69 |
70 |
71 |
72 |
-------------------------------------------------------------------------------- /src/app/register/register.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { RegisterComponent } from './register.component'; 4 | 5 | describe('RegisterComponent', () => { 6 | let component: RegisterComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ RegisterComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(RegisterComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/register/register.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { FormBuilder, FormGroup, Validators } from '@angular/forms'; 3 | import { AuthenticationService } from '../authentication.service'; 4 | import { Router } from '@angular/router'; 5 | import { RegisterPayload } from '../register-payload'; 6 | 7 | @Component({ 8 | selector: 'app-register', 9 | templateUrl: './register.component.html', 10 | styleUrls: ['./register.component.css'] 11 | }) 12 | export class RegisterComponent implements OnInit { 13 | 14 | registerForm: FormGroup; 15 | registerPayload: RegisterPayload; 16 | isError: boolean; 17 | errorMessage: String; 18 | 19 | constructor(private formBuilder: FormBuilder, private authenticationService: AuthenticationService, private router: Router) { 20 | this.registerPayload = { 21 | email: '', 22 | username: '', 23 | name: '', 24 | password: '', 25 | confirmPassword: '' 26 | }; 27 | } 28 | 29 | ngOnInit() { 30 | this.registerForm = this.formBuilder.group({ 31 | email: ['', Validators.required], 32 | username: ['', Validators.required], 33 | name: ['', Validators.required], 34 | password: ['', Validators.required], 35 | confirmPassword: ['', Validators.required] 36 | }); 37 | } 38 | 39 | register() { 40 | this.authenticationService.register(this.registerPayload).toPromise().then((result) => { 41 | if (result.status === 200) { 42 | this.isError = false; 43 | this.router.navigateByUrl('/login'); 44 | } else { 45 | this.isError = true; 46 | this.errorMessage = result.message; 47 | } 48 | },()=>{ 49 | this.isError = true; 50 | }) 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/app/search-results/search-results.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SaiUpadhyayula/SpringAngularEcommerce-frontend/08769109499b0fa4e92f0c4251f2b9aeb01fb829/src/app/search-results/search-results.component.css -------------------------------------------------------------------------------- /src/app/search-results/search-results.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 |
7 | 34 |
35 |
36 |

Search Page

37 |
38 | 39 |

{{categoryName}}

40 | 41 |
42 | 50 |
51 | 52 |
53 |
54 | 55 |
56 |
57 | 59 |
{{p.productName}}
60 |
61 |
${{p.price}}
62 | 63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
-------------------------------------------------------------------------------- /src/app/search-results/search-results.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { SearchResultsComponent } from './search-results.component'; 4 | 5 | describe('SearchResultsComponent', () => { 6 | let component: SearchResultsComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ SearchResultsComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(SearchResultsComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/search-results/search-results.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { SearchSharedService } from '../search-shared-service'; 3 | import { ProductSearchResponseDto, FacetDto } from '../product-page/ProductSearchResponseDto'; 4 | import { ProductInformation } from '../product-page/ProductInformation'; 5 | import { ActivatedRoute, Router } from '@angular/router'; 6 | import { Filter, SearchQueryDto } from '../product-page/SearchQueryDto'; 7 | import { ProductService } from '../product.service'; 8 | 9 | @Component({ 10 | selector: 'app-search-results', 11 | templateUrl: './search-results.component.html', 12 | styleUrls: ['./search-results.component.css'] 13 | }) 14 | export class SearchResultsComponent implements OnInit { 15 | 16 | searchResponse: ProductSearchResponseDto; 17 | searchQueryDto: SearchQueryDto; 18 | products$:Array; 19 | facetsDtos$:Array; 20 | filter: Filter; 21 | filters: Array; 22 | checkedValues: Array; 23 | 24 | constructor(private searchSharedService: SearchSharedService, private productService: ProductService, private router: Router) {} 25 | 26 | ngOnInit() { 27 | this.checkedValues = []; 28 | this.filters = []; 29 | this.searchSharedService.currentMessage.subscribe(searchResponse => this.searchResponse = searchResponse); 30 | if(this.searchResponse) { 31 | this.products$ = this.searchResponse.products; 32 | this.facetsDtos$ = this.searchResponse.facetDtos; 33 | } else { 34 | this.router.navigateByUrl('/'); 35 | } 36 | } 37 | 38 | check(facetName: String, facetNameValue: String, event: Event) { 39 | this.filter = { 40 | "key": facetName, 41 | "value": facetNameValue 42 | }; 43 | this.filters.push(this.filter); 44 | this.get(); 45 | this.checkedValues.push(facetNameValue); 46 | document.body.scrollTop = document.documentElement.scrollTop = 0; 47 | } 48 | 49 | isChecked(facetValueName: String): Boolean { 50 | return this.checkedValues.indexOf(facetValueName) >= 0; 51 | } 52 | 53 | existsAny(checkedValues: Array) { 54 | return checkedValues.length > 0; 55 | } 56 | 57 | clearAllFilters() { 58 | this.checkedValues = []; 59 | this.filters = []; 60 | this.searchQueryDto.filters = this.filters; 61 | this.get(); 62 | } 63 | 64 | removeFilter(value: String) { 65 | this.checkedValues.splice(this.checkedValues.indexOf(value), 1); 66 | this.filters = this.filters.filter(el => el.value !== value); 67 | this.get(); 68 | } 69 | 70 | private initSearchQueryDto() { 71 | this.searchQueryDto = { 72 | textQuery: "", 73 | filters: this.filters 74 | }; 75 | } 76 | 77 | private get() { 78 | this.searchQueryDto = { 79 | textQuery: "", 80 | filters: this.filters 81 | }; 82 | this.productService.search(this.searchQueryDto).subscribe((res) => { 83 | console.log(res); 84 | this.products$ = res.products; 85 | this.facetsDtos$ = res.facetDtos; 86 | }); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /src/app/search-service.ts: -------------------------------------------------------------------------------- 1 | export class SearchService{ 2 | 3 | } -------------------------------------------------------------------------------- /src/app/search-shared-service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { BehaviorSubject } from 'rxjs'; 3 | import { ProductSearchResponseDto } from './product-page/ProductSearchResponseDto'; 4 | 5 | @Injectable() 6 | export class SearchSharedService{ 7 | private messageSource = new BehaviorSubject(new ProductSearchResponseDto()); 8 | currentMessage = this.messageSource.asObservable(); 9 | 10 | constructor(){} 11 | 12 | sendSearchData(productSearchResponseDto: ProductSearchResponseDto){ 13 | this.messageSource.next(productSearchResponseDto) 14 | } 15 | 16 | } -------------------------------------------------------------------------------- /src/app/shopping-cart/shopping-cart.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SaiUpadhyayula/SpringAngularEcommerce-frontend/08769109499b0fa4e92f0c4251f2b9aeb01fb829/src/app/shopping-cart/shopping-cart.component.css -------------------------------------------------------------------------------- /src/app/shopping-cart/shopping-cart.component.html: -------------------------------------------------------------------------------- 1 |

2 | shopping-cart works! 3 |

4 | -------------------------------------------------------------------------------- /src/app/shopping-cart/shopping-cart.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ShoppingCartComponent } from './shopping-cart.component'; 4 | 5 | describe('ShoppingCartComponent', () => { 6 | let component: ShoppingCartComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ ShoppingCartComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(ShoppingCartComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/shopping-cart/shopping-cart.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-shopping-cart', 5 | templateUrl: './shopping-cart.component.html', 6 | styleUrls: ['./shopping-cart.component.css'] 7 | }) 8 | export class ShoppingCartComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/app/wishlist/wishlist.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SaiUpadhyayula/SpringAngularEcommerce-frontend/08769109499b0fa4e92f0c4251f2b9aeb01fb829/src/app/wishlist/wishlist.component.css -------------------------------------------------------------------------------- /src/app/wishlist/wishlist.component.html: -------------------------------------------------------------------------------- 1 |

2 | wishlist works! 3 |

4 | -------------------------------------------------------------------------------- /src/app/wishlist/wishlist.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { WishlistComponent } from './wishlist.component'; 4 | 5 | describe('WishlistComponent', () => { 6 | let component: WishlistComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ WishlistComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(WishlistComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/wishlist/wishlist.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-wishlist', 5 | templateUrl: './wishlist.component.html', 6 | styleUrls: ['./wishlist.component.css'] 7 | }) 8 | export class WishlistComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SaiUpadhyayula/SpringAngularEcommerce-frontend/08769109499b0fa4e92f0c4251f2b9aeb01fb829/src/assets/.gitkeep -------------------------------------------------------------------------------- /src/assets/img/cream.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SaiUpadhyayula/SpringAngularEcommerce-frontend/08769109499b0fa4e92f0c4251f2b9aeb01fb829/src/assets/img/cream.png -------------------------------------------------------------------------------- /src/assets/photos/10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SaiUpadhyayula/SpringAngularEcommerce-frontend/08769109499b0fa4e92f0c4251f2b9aeb01fb829/src/assets/photos/10.png -------------------------------------------------------------------------------- /src/assets/photos/11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SaiUpadhyayula/SpringAngularEcommerce-frontend/08769109499b0fa4e92f0c4251f2b9aeb01fb829/src/assets/photos/11.png -------------------------------------------------------------------------------- /src/assets/photos/12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SaiUpadhyayula/SpringAngularEcommerce-frontend/08769109499b0fa4e92f0c4251f2b9aeb01fb829/src/assets/photos/12.png -------------------------------------------------------------------------------- /src/assets/photos/13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SaiUpadhyayula/SpringAngularEcommerce-frontend/08769109499b0fa4e92f0c4251f2b9aeb01fb829/src/assets/photos/13.png -------------------------------------------------------------------------------- /src/assets/photos/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SaiUpadhyayula/SpringAngularEcommerce-frontend/08769109499b0fa4e92f0c4251f2b9aeb01fb829/src/assets/photos/2.png -------------------------------------------------------------------------------- /src/assets/photos/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SaiUpadhyayula/SpringAngularEcommerce-frontend/08769109499b0fa4e92f0c4251f2b9aeb01fb829/src/assets/photos/3.png -------------------------------------------------------------------------------- /src/assets/photos/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SaiUpadhyayula/SpringAngularEcommerce-frontend/08769109499b0fa4e92f0c4251f2b9aeb01fb829/src/assets/photos/4.png -------------------------------------------------------------------------------- /src/assets/photos/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SaiUpadhyayula/SpringAngularEcommerce-frontend/08769109499b0fa4e92f0c4251f2b9aeb01fb829/src/assets/photos/5.png -------------------------------------------------------------------------------- /src/assets/photos/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SaiUpadhyayula/SpringAngularEcommerce-frontend/08769109499b0fa4e92f0c4251f2b9aeb01fb829/src/assets/photos/6.png -------------------------------------------------------------------------------- /src/assets/photos/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SaiUpadhyayula/SpringAngularEcommerce-frontend/08769109499b0fa4e92f0c4251f2b9aeb01fb829/src/assets/photos/7.png -------------------------------------------------------------------------------- /src/assets/photos/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SaiUpadhyayula/SpringAngularEcommerce-frontend/08769109499b0fa4e92f0c4251f2b9aeb01fb829/src/assets/photos/8.png -------------------------------------------------------------------------------- /src/assets/photos/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SaiUpadhyayula/SpringAngularEcommerce-frontend/08769109499b0fa4e92f0c4251f2b9aeb01fb829/src/assets/photos/9.png -------------------------------------------------------------------------------- /src/assets/photos/promo-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SaiUpadhyayula/SpringAngularEcommerce-frontend/08769109499b0fa4e92f0c4251f2b9aeb01fb829/src/assets/photos/promo-1.png -------------------------------------------------------------------------------- /src/assets/photos/promo-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SaiUpadhyayula/SpringAngularEcommerce-frontend/08769109499b0fa4e92f0c4251f2b9aeb01fb829/src/assets/photos/promo-2.png -------------------------------------------------------------------------------- /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 | apiUrl: '' 4 | }; 5 | -------------------------------------------------------------------------------- /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 | apiUrl: 'http://localhost:8080' 8 | }; 9 | 10 | /* 11 | * For easier debugging in development mode, you can import the following file 12 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 13 | * 14 | * This import should be commented out in production mode because it will have a negative impact 15 | * on performance if an error is thrown. 16 | */ 17 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 18 | -------------------------------------------------------------------------------- /src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SaiUpadhyayula/SpringAngularEcommerce-frontend/08769109499b0fa4e92f0c4251f2b9aeb01fb829/src/favicon.ico -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Ngspringshoppingstore 8 | 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 22 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /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 | ], 15 | client: { 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | dir: require('path').join(__dirname, '../coverage'), 20 | reports: ['html', 'lcovonly', 'text-summary'], 21 | fixWebpackSourcePaths: true 22 | }, 23 | reporters: ['progress', 'kjhtml'], 24 | port: 9876, 25 | colors: true, 26 | logLevel: config.LOG_INFO, 27 | autoWatch: true, 28 | browsers: ['Chrome'], 29 | singleRun: false 30 | }); 31 | }; -------------------------------------------------------------------------------- /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 | /** IE9, IE10, IE11, and Chrome <55 requires all of the following polyfills. 22 | * This also includes Android Emulators with older versions of Chrome and Google Search/Googlebot 23 | */ 24 | 25 | // import 'core-js/es6/symbol'; 26 | // import 'core-js/es6/object'; 27 | // import 'core-js/es6/function'; 28 | // import 'core-js/es6/parse-int'; 29 | // import 'core-js/es6/parse-float'; 30 | // import 'core-js/es6/number'; 31 | // import 'core-js/es6/math'; 32 | // import 'core-js/es6/string'; 33 | // import 'core-js/es6/date'; 34 | // import 'core-js/es6/array'; 35 | // import 'core-js/es6/regexp'; 36 | // import 'core-js/es6/map'; 37 | // import 'core-js/es6/weak-map'; 38 | // import 'core-js/es6/set'; 39 | 40 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 41 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 42 | 43 | /** IE10 and IE11 requires the following for the Reflect API. */ 44 | // import 'core-js/es6/reflect'; 45 | 46 | /** 47 | * Web Animations `@angular/platform-browser/animations` 48 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 49 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 50 | */ 51 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 52 | 53 | /** 54 | * By default, zone.js will patch all possible macroTask and DomEvents 55 | * user can disable parts of macroTask/DomEvents patch by setting following flags 56 | * because those flags need to be set before `zone.js` being loaded, and webpack 57 | * will put import in the top of bundle, so user need to create a separate file 58 | * in this directory (for example: zone-flags.ts), and put the following flags 59 | * into that file, and then add the following code before importing zone.js. 60 | * import './zone-flags.ts'; 61 | * 62 | * The flags allowed in zone-flags.ts are listed here. 63 | * 64 | * The following flags will work for all browsers. 65 | * 66 | * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 67 | * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 68 | * (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 69 | * 70 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 71 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 72 | * 73 | * (window as any).__Zone_enable_cross_context_check = true; 74 | * 75 | */ 76 | 77 | /*************************************************************************************************** 78 | * Zone JS is required by default for Angular itself. 79 | */ 80 | import 'zone.js/dist/zone'; // Included with Angular CLI. 81 | 82 | 83 | /*************************************************************************************************** 84 | * APPLICATION IMPORTS 85 | */ 86 | -------------------------------------------------------------------------------- /src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | * { 3 | margin: 0; 4 | padding: 0; 5 | box-sizing: border-box; 6 | } 7 | 8 | html { 9 | background-color: #fff; 10 | color: #555; 11 | border-top: 3px solid #eee; 12 | font-family: 'Lato', 'Arial', sans-serif; 13 | font-weight: 400; 14 | font-size: 20px; 15 | text-rendering: optimizeLegibility; 16 | } 17 | 18 | header{ 19 | color: rgb(126, 66, 66); 20 | padding: 8px 0px 20px 0px; 21 | background: #fafafa url("assets/img/cream.png") repeat; 22 | } 23 | 24 | h1,h2,h3,h4,h5,h6{ 25 | font-family: 'Lato', Arial, Helvetica, sans-serif; 26 | padding: 1px 0px; 27 | margin: 1px 0px; 28 | font-weight: 400; 29 | color: #666; 30 | } 31 | 32 | h2{ 33 | font-size: 25px; 34 | line-height: 35px; 35 | } 36 | 37 | h3{ 38 | font-size: 25px; 39 | line-height: 30px; 40 | } 41 | 42 | p{ 43 | padding: 0px; 44 | margin: 0px; 45 | } 46 | 47 | .login{ 48 | margin-top:10px; 49 | } 50 | 51 | .login .btn { 52 | font-size: 15px; 53 | } 54 | 55 | header .logo .login .search{ 56 | padding: 0px; 57 | padding-top: 10px; 58 | } 59 | 60 | .login .btn, .items .btn, .item-input .btn{ 61 | background-color: #8c03a7; 62 | color: #f0f8ff 63 | } 64 | 65 | .login a { 66 | text-decoration: none; 67 | } 68 | 69 | .btn-search{ 70 | background-color: #8c03a7; 71 | } 72 | 73 | .fa-search{ 74 | color:aliceblue; 75 | } 76 | 77 | .search{ 78 | padding: 0px; 79 | padding-top: 10px; 80 | } 81 | 82 | .cart-icon{ 83 | color: #8c03a7; 84 | font-size: 40px; 85 | } 86 | 87 | .badge { 88 | padding-left: 9px; 89 | padding-right: 9px; 90 | -webkit-border-radius: 9px; 91 | -moz-border-radius: 9px; 92 | border-radius: 9px; 93 | } 94 | 95 | .label-warning[href],.badge-warning[href] { 96 | background-color: #c67605; 97 | } 98 | #lblCartCount { 99 | font-size: 12px; 100 | background: #8c03a7; 101 | color: #fff; 102 | padding: 0 5px; 103 | vertical-align: top; 104 | margin-left: -10px; 105 | } 106 | 107 | header .logo .color, .title{ 108 | color: #8c03a7; 109 | } 110 | 111 | header .logo h1 a { 112 | font-size: 35px; 113 | color: #8c03a7; 114 | text-decoration: none; 115 | font-weight: 400; 116 | } 117 | 118 | .nav-bar { 119 | background-color: #8c03a7; 120 | min-height: 50px; 121 | } 122 | 123 | .category { 124 | font-size: 18px; 125 | } 126 | 127 | .category-drop-down{ 128 | background-color: #8c03a7; 129 | color: aliceblue; 130 | } 131 | 132 | nav ul li a, li a:hover{ 133 | color: aliceblue 134 | } 135 | 136 | .navbar-toggler{ 137 | background-color: aliceblue; 138 | } 139 | 140 | .items { 141 | margin: 20px 0px; 142 | } 143 | 144 | .item { 145 | min-height: 240px; 146 | max-height: 260px; 147 | max-width: 250px; 148 | margin: 10px auto; 149 | padding: 10px 10px; 150 | border-radius:4px; 151 | border: 1px solid #f3f3f3; 152 | box-shadow: inset 0px 0px 1px #ddd; 153 | -webkit-transition:box-shadow 1s ease; 154 | -moz-transition:box-shadow 1s ease; 155 | -o-transition:box-shadow 1s ease; 156 | transition:box-shadow 1s ease; 157 | } 158 | 159 | .item hr { 160 | margin: 5px 0px; 161 | } 162 | 163 | .item h6 { 164 | padding-top: 5px; 165 | text-align: center; 166 | } 167 | 168 | .item h6 a{ 169 | color: #8c03a7; 170 | } 171 | 172 | .item h6 a:hover{ 173 | text-decoration: none; 174 | } 175 | 176 | .item p { 177 | line-height: 20px; 178 | padding-top: 10px; 179 | padding-bottom: 5px; 180 | font-size: 10 px; 181 | text-align: center; 182 | } 183 | 184 | .item .item-price { 185 | margin: 7px 0px; 186 | display: inline-block; 187 | padding: 2px 5px; 188 | line-height: 20px; 189 | border-radius: 5px; 190 | font-size: 14px; 191 | font-weight: bold; 192 | background: #f3f3f3; 193 | border: 1px solid #eee 194 | } 195 | 196 | .item .btn { 197 | font-size: 13px; 198 | } 199 | 200 | .item-image { 201 | max-height: 150px; 202 | padding: 5px 0px; 203 | height: 140px; 204 | width: auto; 205 | display: block; 206 | margin: 0 auto; 207 | } 208 | 209 | .featured-item-image{ 210 | max-height: 100px; 211 | padding: 5px 0px; 212 | height: 140px; 213 | width: auto; 214 | display: block; 215 | margin: 0 auto; 216 | } 217 | 218 | .featured-items p { 219 | padding-top: 5px; 220 | font-weight: 100; 221 | font-size:15px; 222 | font-family: 'Lato', 'Arial', sans-serif; 223 | } 224 | 225 | .featured-items a { 226 | text-decoration: none; 227 | color: #8c03a7; 228 | } 229 | 230 | .breadcrumb-item a{ 231 | text-decoration: none; 232 | color: #8c03a7; 233 | } 234 | 235 | .category-title{ 236 | color: #8c03a7; 237 | } 238 | 239 | .clearfix{ 240 | padding-top: 0px; 241 | } 242 | 243 | .sidebar h6{ 244 | color: #8c03a7; 245 | } 246 | 247 | .single-item-availability{ 248 | border-radius: 5px; 249 | font-size: 14px; 250 | font-weight: bold; 251 | border: 1px solid #eee 252 | } 253 | 254 | .single-item-image { 255 | width: auto; 256 | display: block; 257 | margin: 0 auto; 258 | } 259 | 260 | .single-item-tab-list{ 261 | width: 100%; 262 | } 263 | 264 | .single-item-tab-list li a { 265 | text-decoration: none; 266 | color: #8c03a7 !important; 267 | } 268 | 269 | .single-item-tab-list li a:hover { 270 | background-color: #8c03a7 !important; 271 | color: aliceblue !important; 272 | } 273 | 274 | .tab-pane h5 { 275 | padding-top: 15px; 276 | } 277 | 278 | .item-review{ 279 | background: #fafafa; 280 | margin: 10px 0px; 281 | border-radius: 5px; 282 | border: 1px solid #eee; 283 | padding: 10px; 284 | } 285 | 286 | .item-review .rmeta{ 287 | font-style: italic; 288 | } 289 | 290 | #navi{ 291 | margin: 0px; 292 | padding: 0px; 293 | } 294 | 295 | #navi li { 296 | margin: 0px; 297 | padding: 0px; 298 | list-style-type: none; 299 | } 300 | 301 | #navi > li > a { 302 | display: block; 303 | padding: 10px 10px; 304 | color: #8c03a7; 305 | text-decoration: none; 306 | border-bottom: 1px solid #eee; 307 | background-color: #fafafa; 308 | } 309 | 310 | #navi > li > a:hover{ 311 | color: #8c03a7; 312 | background-color: #f3f3f3; 313 | border-bottom: 1px solid #ddd; 314 | } 315 | 316 | .wishlist-table .btn, .wishlist-table a, .wishlist-table td { 317 | font-size: 15px; 318 | } 319 | 320 | .wishlist-table a{ 321 | text-decoration: none; 322 | color: #8c03a7; 323 | } 324 | 325 | .cart-title { 326 | padding-top: 15px; 327 | color: #8c03a7; 328 | } 329 | 330 | .cart{ 331 | margin: 20px 0px; 332 | } 333 | 334 | .cart .tcart img{ 335 | max-height: 50px; 336 | } 337 | 338 | .cart .tcart a{ 339 | color: #8c03a7; 340 | } 341 | 342 | .cart .cart-quantity input{ 343 | max-width: 25px; 344 | } 345 | 346 | .cart td.item-input{ 347 | width:15%; 348 | } 349 | 350 | .cart-continue-shopping .btn{ 351 | background-color: #8c03a7; 352 | color: aliceblue; 353 | } 354 | 355 | .checkout{ 356 | margin: 20px 0px; 357 | } 358 | 359 | .confirm-order{ 360 | background-color: #8c03a7; 361 | } 362 | 363 | .confirm-order a{ 364 | color: aliceblue; 365 | } 366 | 367 | .checkout-sub-title{ 368 | padding-top: 15px; 369 | color: #8c03a7; 370 | } 371 | 372 | .login-title{ 373 | padding-top: 15px; 374 | } 375 | 376 | .register-btn, .login-btn, .reset-btn{ 377 | background-color: #8c03a7; 378 | color: aliceblue; 379 | } 380 | 381 | .badge { 382 | margin-right: .3rem; 383 | background-color: #8c03a7; 384 | } 385 | 386 | 387 | /***** REQUIRED STYLES *****/ 388 | .badge-labeled { 389 | padding-top: 0; 390 | padding-bottom: 0; 391 | padding-right: 0.2rem; 392 | } 393 | .badge-labeled i { 394 | padding: 0.25em 0.3rem; 395 | cursor: pointer; 396 | position: relative; 397 | display: inline-block; 398 | right: -0.2em; 399 | background-color: #000000; 400 | background-color: rgba(0,0,0,0.2); 401 | border-left: solid 1px rgba(255,255,255,.5); 402 | border-radius: 0 0.25rem 0.25rem 0; 403 | } -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | "rulesDirectory": [ 3 | "codelyzer" 4 | ], 5 | "rules": { 6 | "arrow-return-shorthand": true, 7 | "callable-types": true, 8 | "class-name": true, 9 | "comment-format": [ 10 | true, 11 | "check-space" 12 | ], 13 | "curly": true, 14 | "deprecation": { 15 | "severity": "warn" 16 | }, 17 | "eofline": true, 18 | "forin": true, 19 | "import-blacklist": [ 20 | true, 21 | "rxjs/Rx" 22 | ], 23 | "import-spacing": true, 24 | "indent": [ 25 | true, 26 | "spaces" 27 | ], 28 | "interface-over-type-literal": true, 29 | "label-position": true, 30 | "max-line-length": [ 31 | true, 32 | 140 33 | ], 34 | "member-access": false, 35 | "member-ordering": [ 36 | true, 37 | { 38 | "order": [ 39 | "static-field", 40 | "instance-field", 41 | "static-method", 42 | "instance-method" 43 | ] 44 | } 45 | ], 46 | "no-arg": true, 47 | "no-bitwise": true, 48 | "no-console": [ 49 | true, 50 | "debug", 51 | "info", 52 | "time", 53 | "timeEnd", 54 | "trace" 55 | ], 56 | "no-construct": true, 57 | "no-debugger": true, 58 | "no-duplicate-super": true, 59 | "no-empty": false, 60 | "no-empty-interface": true, 61 | "no-eval": true, 62 | "no-inferrable-types": [ 63 | true, 64 | "ignore-params" 65 | ], 66 | "no-misused-new": true, 67 | "no-non-null-assertion": true, 68 | "no-redundant-jsdoc": true, 69 | "no-shadowed-variable": true, 70 | "no-string-literal": false, 71 | "no-string-throw": true, 72 | "no-switch-case-fall-through": true, 73 | "no-trailing-whitespace": true, 74 | "no-unnecessary-initializer": true, 75 | "no-unused-expression": true, 76 | "no-use-before-declare": true, 77 | "no-var-keyword": true, 78 | "object-literal-sort-keys": false, 79 | "one-line": [ 80 | true, 81 | "check-open-brace", 82 | "check-catch", 83 | "check-else", 84 | "check-whitespace" 85 | ], 86 | "prefer-const": true, 87 | "quotemark": [ 88 | true, 89 | "single" 90 | ], 91 | "radix": true, 92 | "semicolon": [ 93 | true, 94 | "always" 95 | ], 96 | "triple-equals": [ 97 | true, 98 | "allow-null-check" 99 | ], 100 | "typedef-whitespace": [ 101 | true, 102 | { 103 | "call-signature": "nospace", 104 | "index-signature": "nospace", 105 | "parameter": "nospace", 106 | "property-declaration": "nospace", 107 | "variable-declaration": "nospace" 108 | } 109 | ], 110 | "unified-signatures": true, 111 | "variable-name": false, 112 | "whitespace": [ 113 | true, 114 | "check-branch", 115 | "check-decl", 116 | "check-operator", 117 | "check-separator", 118 | "check-type" 119 | ], 120 | "no-output-on-prefix": true, 121 | "use-input-property-decorator": true, 122 | "use-output-property-decorator": true, 123 | "use-host-property-decorator": true, 124 | "no-input-rename": true, 125 | "no-output-rename": true, 126 | "use-life-cycle-interface": true, 127 | "use-pipe-transform-interface": true, 128 | "component-class-suffix": true, 129 | "directive-class-suffix": true 130 | } 131 | } 132 | --------------------------------------------------------------------------------