Browse Source

Shopify UI and springboot cart api's

master
Sanjith Sivapuram 4 years ago
parent
commit
f5c3c0a24e
92 changed files with 13686 additions and 1 deletions
  1. 2
      Shopify-Cart/src/main/java/com/shopify/cart/controller/CartController.java
  2. 8
      Shopify-Cart/src/main/java/com/shopify/cart/controller/ProductController.java
  3. 9
      Shopify-Cart/src/main/java/com/shopify/cart/model/Product.java
  4. 17
      ShopifyUI/.browserslistrc
  5. 16
      ShopifyUI/.editorconfig
  6. 45
      ShopifyUI/.gitignore
  7. 27
      ShopifyUI/README.md
  8. 109
      ShopifyUI/angular.json
  9. 44
      ShopifyUI/karma.conf.js
  10. 12109
      ShopifyUI/package-lock.json
  11. 41
      ShopifyUI/package.json
  12. 18
      ShopifyUI/src/app/app-routing.module.ts
  13. 0
      ShopifyUI/src/app/app.component.css
  14. 1
      ShopifyUI/src/app/app.component.html
  15. 35
      ShopifyUI/src/app/app.component.spec.ts
  16. 10
      ShopifyUI/src/app/app.component.ts
  17. 44
      ShopifyUI/src/app/app.module.ts
  18. 0
      ShopifyUI/src/app/auth/login/login.component.css
  19. 1
      ShopifyUI/src/app/auth/login/login.component.html
  20. 25
      ShopifyUI/src/app/auth/login/login.component.spec.ts
  21. 15
      ShopifyUI/src/app/auth/login/login.component.ts
  22. 16
      ShopifyUI/src/app/auth/service/auth-guard.service.spec.ts
  23. 9
      ShopifyUI/src/app/auth/service/auth-guard.service.ts
  24. 16
      ShopifyUI/src/app/auth/service/auth.service.spec.ts
  25. 9
      ShopifyUI/src/app/auth/service/auth.service.ts
  26. 0
      ShopifyUI/src/app/auth/sign-up/sign-up.component.css
  27. 1
      ShopifyUI/src/app/auth/sign-up/sign-up.component.html
  28. 25
      ShopifyUI/src/app/auth/sign-up/sign-up.component.spec.ts
  29. 15
      ShopifyUI/src/app/auth/sign-up/sign-up.component.ts
  30. 0
      ShopifyUI/src/app/components/admin/admin.component.css
  31. 1
      ShopifyUI/src/app/components/admin/admin.component.html
  32. 25
      ShopifyUI/src/app/components/admin/admin.component.spec.ts
  33. 15
      ShopifyUI/src/app/components/admin/admin.component.ts
  34. 0
      ShopifyUI/src/app/components/cart/cart.component.css
  35. 1
      ShopifyUI/src/app/components/cart/cart.component.html
  36. 25
      ShopifyUI/src/app/components/cart/cart.component.spec.ts
  37. 15
      ShopifyUI/src/app/components/cart/cart.component.ts
  38. 8
      ShopifyUI/src/app/components/home/home.component.css
  39. 29
      ShopifyUI/src/app/components/home/home.component.html
  40. 25
      ShopifyUI/src/app/components/home/home.component.spec.ts
  41. 19
      ShopifyUI/src/app/components/home/home.component.ts
  42. 0
      ShopifyUI/src/app/components/order-detail/order-detail.component.css
  43. 1
      ShopifyUI/src/app/components/order-detail/order-detail.component.html
  44. 25
      ShopifyUI/src/app/components/order-detail/order-detail.component.spec.ts
  45. 15
      ShopifyUI/src/app/components/order-detail/order-detail.component.ts
  46. 0
      ShopifyUI/src/app/components/orders/orders.component.css
  47. 1
      ShopifyUI/src/app/components/orders/orders.component.html
  48. 25
      ShopifyUI/src/app/components/orders/orders.component.spec.ts
  49. 15
      ShopifyUI/src/app/components/orders/orders.component.ts
  50. 0
      ShopifyUI/src/app/components/payments/payments.component.css
  51. 1
      ShopifyUI/src/app/components/payments/payments.component.html
  52. 25
      ShopifyUI/src/app/components/payments/payments.component.spec.ts
  53. 15
      ShopifyUI/src/app/components/payments/payments.component.ts
  54. 16
      ShopifyUI/src/app/components/product-detail/product-detail.component.css
  55. 33
      ShopifyUI/src/app/components/product-detail/product-detail.component.html
  56. 25
      ShopifyUI/src/app/components/product-detail/product-detail.component.spec.ts
  57. 25
      ShopifyUI/src/app/components/product-detail/product-detail.component.ts
  58. 41
      ShopifyUI/src/app/components/products/products.component.css
  59. 65
      ShopifyUI/src/app/components/products/products.component.html
  60. 25
      ShopifyUI/src/app/components/products/products.component.spec.ts
  61. 31
      ShopifyUI/src/app/components/products/products.component.ts
  62. 0
      ShopifyUI/src/app/components/userprofile/userprofile.component.css
  63. 1
      ShopifyUI/src/app/components/userprofile/userprofile.component.html
  64. 25
      ShopifyUI/src/app/components/userprofile/userprofile.component.spec.ts
  65. 15
      ShopifyUI/src/app/components/userprofile/userprofile.component.ts
  66. 0
      ShopifyUI/src/app/model/cart.model.ts
  67. 0
      ShopifyUI/src/app/model/order.model.ts
  68. 10
      ShopifyUI/src/app/model/product.model.ts
  69. 0
      ShopifyUI/src/app/model/review.model.ts
  70. 0
      ShopifyUI/src/app/model/user.model.ts
  71. 16
      ShopifyUI/src/app/service/cart.service.spec.ts
  72. 16
      ShopifyUI/src/app/service/cart.service.ts
  73. 16
      ShopifyUI/src/app/service/order.service.spec.ts
  74. 9
      ShopifyUI/src/app/service/order.service.ts
  75. 16
      ShopifyUI/src/app/service/product.service.spec.ts
  76. 24
      ShopifyUI/src/app/service/product.service.ts
  77. 16
      ShopifyUI/src/app/service/review.service.spec.ts
  78. 9
      ShopifyUI/src/app/service/review.service.ts
  79. 16
      ShopifyUI/src/app/service/user.service.spec.ts
  80. 9
      ShopifyUI/src/app/service/user.service.ts
  81. 0
      ShopifyUI/src/assets/.gitkeep
  82. 3
      ShopifyUI/src/environments/environment.prod.ts
  83. 16
      ShopifyUI/src/environments/environment.ts
  84. BIN
      ShopifyUI/src/favicon.ico
  85. 13
      ShopifyUI/src/index.html
  86. 12
      ShopifyUI/src/main.ts
  87. 65
      ShopifyUI/src/polyfills.ts
  88. 74
      ShopifyUI/src/styles.css
  89. 27
      ShopifyUI/src/test.ts
  90. 15
      ShopifyUI/tsconfig.app.json
  91. 32
      ShopifyUI/tsconfig.json
  92. 18
      ShopifyUI/tsconfig.spec.json

2
Shopify-Cart/src/main/java/com/shopify/cart/controller/CartController.java

@ -2,6 +2,8 @@ package com.shopify.cart.controller;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;

8
Shopify-Cart/src/main/java/com/shopify/cart/controller/ProductController.java

@ -5,6 +5,7 @@ import java.util.List;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
@ -26,7 +27,12 @@ public class ProductController {
} }
@GetMapping("/product") @GetMapping("/product")
public List<Product> getALlProducts() {
public List<Product> getAllProducts() {
return productRepository.findAll(); return productRepository.findAll();
} }
@GetMapping("/product/{pid}")
public Product getProductById(@PathVariable("pid") Long pid) {
return productRepository.getById(pid);
}
} }

9
Shopify-Cart/src/main/java/com/shopify/cart/model/Product.java

@ -12,6 +12,7 @@ public class Product {
@GeneratedValue(strategy = GenerationType.AUTO) @GeneratedValue(strategy = GenerationType.AUTO)
private Long id; private Long id;
private String name; private String name;
private String imageUrl;
private String description; private String description;
private Integer rating; private Integer rating;
private Double marketRetailPrice; private Double marketRetailPrice;
@ -30,6 +31,14 @@ public class Product {
return name; return name;
} }
public String getImageUrl() {
return imageUrl;
}
public void setImageUrl(String imageUrl) {
this.imageUrl = imageUrl;
}
public void setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
} }

17
ShopifyUI/.browserslistrc

@ -0,0 +1,17 @@
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
# For the full list of supported browsers by the Angular framework, please see:
# https://angular.io/guide/browser-support
# You can see what browsers were selected by your queries by running:
# npx browserslist
last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major versions
last 2 iOS major versions
Firefox ESR
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.

16
ShopifyUI/.editorconfig

@ -0,0 +1,16 @@
# Editor configuration, see https://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
[*.ts]
quote_type = single
[*.md]
max_line_length = off
trim_trailing_whitespace = false

45
ShopifyUI/.gitignore

@ -0,0 +1,45 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
# compiled output
/dist
/tmp
/out-tsc
# Only exists if Bazel was run
/bazel-out
# dependencies
/node_modules
# profiling files
chrome-profiler-events*.json
# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*
# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings
# System Files
.DS_Store
Thumbs.db

27
ShopifyUI/README.md

@ -0,0 +1,27 @@
# ShopifyUI
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 12.2.0.
## Development server
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.
## Code scaffolding
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
## Build
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
## Running unit tests
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
## Running end-to-end tests
Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
## Further help
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.

109
ShopifyUI/angular.json

@ -0,0 +1,109 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"ShopifyUI": {
"projectType": "application",
"schematics": {
"@schematics/angular:application": {
"strict": true
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/ShopifyUI",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"node_modules/bootstrap/dist/css/bootstrap.min.css",
"src/styles.css"
],
"scripts": [
"node_modules/bootstrap/dist/js/bootstrap.min.js"
]
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"outputHashing": "all"
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "ShopifyUI:build:production"
},
"development": {
"browserTarget": "ShopifyUI:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "ShopifyUI:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css"
],
"scripts": []
}
}
}
}
},
"defaultProject": "ShopifyUI"
}

44
ShopifyUI/karma.conf.js

@ -0,0 +1,44 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
jasmine: {
// you can add configuration options for Jasmine here
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
// for example, you can disable the random execution with `random: false`
// or set a specific seed with `seed: 4321`
},
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
jasmineHtmlReporter: {
suppressAll: true // removes the duplicated traces
},
coverageReporter: {
dir: require('path').join(__dirname, './coverage/ShopifyUI'),
subdir: '.',
reporters: [
{ type: 'html' },
{ type: 'text-summary' }
]
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true
});
};

12109
ShopifyUI/package-lock.json
File diff suppressed because it is too large
View File

41
ShopifyUI/package.json

@ -0,0 +1,41 @@
{
"name": "shopify-ui",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve --port 59279",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
},
"private": true,
"dependencies": {
"@angular/animations": "~12.2.0",
"@angular/common": "~12.2.0",
"@angular/compiler": "~12.2.0",
"@angular/core": "~12.2.0",
"@angular/forms": "~12.2.0",
"@angular/platform-browser": "~12.2.0",
"@angular/platform-browser-dynamic": "~12.2.0",
"@angular/router": "~12.2.0",
"bootstrap": "^5.1.1",
"bootstrap-icons": "^1.5.0",
"rxjs": "~6.6.0",
"tslib": "^2.3.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "~12.2.0",
"@angular/cli": "~12.2.0",
"@angular/compiler-cli": "~12.2.0",
"@types/jasmine": "~3.8.0",
"@types/node": "^12.11.1",
"jasmine-core": "~3.8.0",
"karma": "~6.3.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.0.3",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "~1.7.0",
"typescript": "~4.3.5"
}
}

18
ShopifyUI/src/app/app-routing.module.ts

@ -0,0 +1,18 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { HomeComponent } from './components/home/home.component';
import { ProductDetailComponent } from './components/product-detail/product-detail.component';
import { ProductsComponent } from './components/products/products.component';
const routes: Routes = [
{ path: '', redirectTo: '/home', pathMatch: 'full' },
{ path: 'home', component: HomeComponent },
{ path: 'products', component: ProductsComponent},
{ path: 'products/:product_id', component: ProductDetailComponent},
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }

0
ShopifyUI/src/app/app.component.css

1
ShopifyUI/src/app/app.component.html

@ -0,0 +1 @@
<router-outlet></router-outlet>

35
ShopifyUI/src/app/app.component.spec.ts

@ -0,0 +1,35 @@
import { TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { AppComponent } from './app.component';
describe('AppComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [
RouterTestingModule
],
declarations: [
AppComponent
],
}).compileComponents();
});
it('should create the app', () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app).toBeTruthy();
});
it(`should have as title 'ShopifyUI'`, () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app.title).toEqual('ShopifyUI');
});
it('should render title', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.nativeElement as HTMLElement;
expect(compiled.querySelector('.content span')?.textContent).toContain('ShopifyUI app is running!');
});
});

10
ShopifyUI/src/app/app.component.ts

@ -0,0 +1,10 @@
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'ShopifyUI';
}

44
ShopifyUI/src/app/app.module.ts

@ -0,0 +1,44 @@
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { HomeComponent } from './components/home/home.component';
import { LoginComponent } from './auth/login/login.component';
import { SignUpComponent } from './auth/sign-up/sign-up.component';
import { CartComponent } from './components/cart/cart.component';
import { PaymentsComponent } from './components/payments/payments.component';
import { ProductsComponent } from './components/products/products.component';
import { OrdersComponent } from './components/orders/orders.component';
import { HttpClientModule } from '@angular/common/http';
import { AdminComponent } from './components/admin/admin.component';
import { UserprofileComponent } from './components/userprofile/userprofile.component';
import { ReactiveFormsModule } from '@angular/forms';
import { OrderDetailComponent } from './components/order-detail/order-detail.component';
import { ProductDetailComponent } from './components/product-detail/product-detail.component';
@NgModule({
declarations: [
AppComponent,
HomeComponent,
LoginComponent,
SignUpComponent,
CartComponent,
PaymentsComponent,
ProductsComponent,
OrdersComponent,
AdminComponent,
UserprofileComponent,
OrderDetailComponent,
ProductDetailComponent
],
imports: [
BrowserModule,
AppRoutingModule,
ReactiveFormsModule,
HttpClientModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }

0
ShopifyUI/src/app/auth/login/login.component.css

1
ShopifyUI/src/app/auth/login/login.component.html

@ -0,0 +1 @@
<p>login works!</p>

25
ShopifyUI/src/app/auth/login/login.component.spec.ts

@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { LoginComponent } from './login.component';
describe('LoginComponent', () => {
let component: LoginComponent;
let fixture: ComponentFixture<LoginComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ LoginComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(LoginComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

15
ShopifyUI/src/app/auth/login/login.component.ts

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-login',
templateUrl: './login.component.html',
styleUrls: ['./login.component.css']
})
export class LoginComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}

16
ShopifyUI/src/app/auth/service/auth-guard.service.spec.ts

@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { AuthGuardService } from './auth-guard.service';
describe('AuthGuardService', () => {
let service: AuthGuardService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(AuthGuardService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});

9
ShopifyUI/src/app/auth/service/auth-guard.service.ts

@ -0,0 +1,9 @@
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class AuthGuardService {
constructor() { }
}

16
ShopifyUI/src/app/auth/service/auth.service.spec.ts

@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { AuthService } from './auth.service';
describe('AuthService', () => {
let service: AuthService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(AuthService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});

9
ShopifyUI/src/app/auth/service/auth.service.ts

@ -0,0 +1,9 @@
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class AuthService {
constructor() { }
}

0
ShopifyUI/src/app/auth/sign-up/sign-up.component.css

1
ShopifyUI/src/app/auth/sign-up/sign-up.component.html

@ -0,0 +1 @@
<p>sign-up works!</p>

25
ShopifyUI/src/app/auth/sign-up/sign-up.component.spec.ts

@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { SignUpComponent } from './sign-up.component';
describe('SignUpComponent', () => {
let component: SignUpComponent;
let fixture: ComponentFixture<SignUpComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ SignUpComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(SignUpComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

15
ShopifyUI/src/app/auth/sign-up/sign-up.component.ts

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-sign-up',
templateUrl: './sign-up.component.html',
styleUrls: ['./sign-up.component.css']
})
export class SignUpComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}

0
ShopifyUI/src/app/components/admin/admin.component.css

1
ShopifyUI/src/app/components/admin/admin.component.html

@ -0,0 +1 @@
<p>admin works!</p>

25
ShopifyUI/src/app/components/admin/admin.component.spec.ts

@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { AdminComponent } from './admin.component';
describe('AdminComponent', () => {
let component: AdminComponent;
let fixture: ComponentFixture<AdminComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ AdminComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(AdminComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

15
ShopifyUI/src/app/components/admin/admin.component.ts

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-admin',
templateUrl: './admin.component.html',
styleUrls: ['./admin.component.css']
})
export class AdminComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}

0
ShopifyUI/src/app/components/cart/cart.component.css

1
ShopifyUI/src/app/components/cart/cart.component.html

@ -0,0 +1 @@
<p>cart works!</p>

25
ShopifyUI/src/app/components/cart/cart.component.spec.ts

@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { CartComponent } from './cart.component';
describe('CartComponent', () => {
let component: CartComponent;
let fixture: ComponentFixture<CartComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ CartComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(CartComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

15
ShopifyUI/src/app/components/cart/cart.component.ts

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-cart',
templateUrl: './cart.component.html',
styleUrls: ['./cart.component.css']
})
export class CartComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}

8
ShopifyUI/src/app/components/home/home.component.css

@ -0,0 +1,8 @@
.allProductsBtn button {
border: 1px solid transparent;
padding: 12px 14px;
border-radius: 20px;
color: white;
background-color: #2E86C1;
width: 95%;
}

29
ShopifyUI/src/app/components/home/home.component.html

@ -0,0 +1,29 @@
<div class="row navbar">
<div class="col-8">
<a routerLink="/home"><h2>Shopify</h2></a>
</div>
<div class="col-1 active">
<a routerLink="/home">Home</a>
</div>
<div class="col-1">
<a routerLink="/products">Products</a>
</div>
<div class="col-1">
<a routerLink="/home"><i class="bi bi-cart3"></i>Cart</a>
</div>
<div class="col-1 loginbtn">
<a routerLink="/login">Login</a>
</div>
</div>
<br>
<div class="row">
<div class="col-12 searchBar text-center">
<input #box (keyup.enter)="onSearchEnter(box.value)" placeholder="Search for the Product Here">
</div>
</div>
<p>{{searchValue}}</p>
<div class="row">
<div class="col-12 text-center allProductsBtn">
<button routerLink="/products">Browse For All Products</button>
</div>
</div>

25
ShopifyUI/src/app/components/home/home.component.spec.ts

@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { HomeComponent } from './home.component';
describe('HomeComponent', () => {
let component: HomeComponent;
let fixture: ComponentFixture<HomeComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ HomeComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(HomeComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

19
ShopifyUI/src/app/components/home/home.component.ts

@ -0,0 +1,19 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.css']
})
export class HomeComponent implements OnInit {
searchValue: string = '';
constructor() { }
ngOnInit(): void {
}
onSearchEnter(value: string) {
this.searchValue = value;
}
}

0
ShopifyUI/src/app/components/order-detail/order-detail.component.css

1
ShopifyUI/src/app/components/order-detail/order-detail.component.html

@ -0,0 +1 @@
<p>order-detail works!</p>

25
ShopifyUI/src/app/components/order-detail/order-detail.component.spec.ts

@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { OrderDetailComponent } from './order-detail.component';
describe('OrderDetailComponent', () => {
let component: OrderDetailComponent;
let fixture: ComponentFixture<OrderDetailComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ OrderDetailComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(OrderDetailComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

15
ShopifyUI/src/app/components/order-detail/order-detail.component.ts

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-order-detail',
templateUrl: './order-detail.component.html',
styleUrls: ['./order-detail.component.css']
})
export class OrderDetailComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}

0
ShopifyUI/src/app/components/orders/orders.component.css

1
ShopifyUI/src/app/components/orders/orders.component.html

@ -0,0 +1 @@
<p>orders works!</p>

25
ShopifyUI/src/app/components/orders/orders.component.spec.ts

@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { OrdersComponent } from './orders.component';
describe('OrdersComponent', () => {
let component: OrdersComponent;
let fixture: ComponentFixture<OrdersComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ OrdersComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(OrdersComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

15
ShopifyUI/src/app/components/orders/orders.component.ts

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-orders',
templateUrl: './orders.component.html',
styleUrls: ['./orders.component.css']
})
export class OrdersComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}

0
ShopifyUI/src/app/components/payments/payments.component.css

1
ShopifyUI/src/app/components/payments/payments.component.html

@ -0,0 +1 @@
<p>payments works!</p>

25
ShopifyUI/src/app/components/payments/payments.component.spec.ts

@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { PaymentsComponent } from './payments.component';
describe('PaymentsComponent', () => {
let component: PaymentsComponent;
let fixture: ComponentFixture<PaymentsComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ PaymentsComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(PaymentsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

15
ShopifyUI/src/app/components/payments/payments.component.ts

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-payments',
templateUrl: './payments.component.html',
styleUrls: ['./payments.component.css']
})
export class PaymentsComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}

16
ShopifyUI/src/app/components/product-detail/product-detail.component.css

@ -0,0 +1,16 @@
.productBody {
color: #1B4F72;
}
.heading {
padding-left: 50px;
}
.rating p{
float: right;
padding-right: 50px;
}
.image img {
transform: translate(0px,-150px);
}

33
ShopifyUI/src/app/components/product-detail/product-detail.component.html

@ -0,0 +1,33 @@
<div class="row navbar">
<div class="col-8">
<h2>Shopify</h2>
</div>
<div class="col-1">
<a routerLink="/home">Home</a>
</div>
<div class="col-1 active">
<a routerLink="/products">Products</a>
</div>
<div class="col-1">
<a routerLink="/home"><i class="bi bi-cart3"></i>Cart</a>
</div>
<div class="col-1 loginbtn">
<a routerLink="/login">Login</a>
</div>
</div>
<br>
<div class="productBody">
<div class="row">
<div class="col-6 heading">
<h4>{{product.name}}</h4>
</div>
<div class="col-6 rating">
<p>{{product.rating}} of 5</p>
</div>
</div>
<div class="row text-center">
<div class="col-12 image">
<img src={{product.imageUrl}} alt={{product.name}} width="50%">
</div>
</div>
</div>

25
ShopifyUI/src/app/components/product-detail/product-detail.component.spec.ts

@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ProductDetailComponent } from './product-detail.component';
describe('ProductDetailComponent', () => {
let component: ProductDetailComponent;
let fixture: ComponentFixture<ProductDetailComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ ProductDetailComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(ProductDetailComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

25
ShopifyUI/src/app/components/product-detail/product-detail.component.ts

@ -0,0 +1,25 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { Product } from 'src/app/model/product.model';
import { ProductService } from 'src/app/service/product.service';
@Component({
selector: 'app-product-detail',
templateUrl: './product-detail.component.html',
styleUrls: ['./product-detail.component.css']
})
export class ProductDetailComponent implements OnInit {
pid:string;
product:Product;
constructor(private actRouter:ActivatedRoute, private productService:ProductService) { }
ngOnInit(): void {
this.actRouter.paramMap.subscribe(params => {
this.pid = params.get("product_id");
})
this.productService.getProductById(this.pid).subscribe(data => {
this.product = data;
})
}
}

41
ShopifyUI/src/app/components/products/products.component.css

@ -0,0 +1,41 @@
.productBody {
background-color: white;
height: 1000px;
}
.product {
box-shadow: 10px 10px 19px 0px rgba(0,0,0,0.69);
margin: 0px auto;
border-radius: 20px;
width: 95%;
padding: 14px 16px;
color: #1B4F72;
}
.pDetails h4,p {
float: left;
}
.ProductBtn button {
border: 1px solid transparent;
padding: 12px 14px;
border-radius: 20px;
color: white;
background-color: transparent
}
.ProductBtn i {
color: #1B4F72;
font-size: 30px;
}
.discountBtn {
background-color: #E74C3C;
color: white;
font-weight: 900;
border: 1px transparent;
border-radius: 50%;
padding: 16px 12px;
float: right;
}

65
ShopifyUI/src/app/components/products/products.component.html

@ -0,0 +1,65 @@
<div class="row navbar">
<div class="col-8">
<h2>Shopify</h2>
</div>
<div class="col-1">
<a routerLink="/home">Home</a>
</div>
<div class="col-1 active">
<a routerLink="/products">Products</a>
</div>
<div class="col-1">
<a routerLink="/home"><i class="bi bi-cart3"></i>Cart</a>
</div>
<div class="col-1 loginbtn">
<a routerLink="/login">Login</a>
</div>
</div>
<br>
<div class="row">
<div class="col-12 searchBar text-center">
<input #box (keyup.enter)="onSearchEnter(box.value)" placeholder="Search for the Product Here">
</div>
</div>
<br><br>
<div class="row">
<div class="col-12 text-center">
<div *ngFor='let p of products'>
<div class="row product pDetails">
<div class="row">
<div class="col-12">
<button disabled class="discountBtn mt-3">{{p.discount}}%</button>
</div>
</div>
<div class="row">
<div class="col-12">
<img src={{p.imageUrl}} alt={{p.name}} width="30%">
</div>
</div>
<div class="row align-items-center">
<div class="col-6">
<h4>{{p.name}}</h4>
</div>
<div class="col-6">
<p style="float: right;">Price : Rs {{p.marketRetailPrice}}</p>
</div>
</div>
<div class="row pDetails">
<div class="col-12">
<p style="float: right;">Discount Price : Rs {{p.discountedPrice}}</p>
</div>
</div>
<div class="row align-items-center">
<div class="col-6">
<p style="float: left;">Qty :&nbsp;&nbsp;</p>
<input style="float: left;" type="number" value="1" min="1" max="5" #box2 (keyup.enter)="onQuantityEnter(box2.value)">
</div>
<div class="col-6 ProductBtn">
<button style="float: right;" routerLink="/products/{{p.id}}"><i class="bi bi-arrow-right-square-fill"></i></button>
</div>
</div>
</div>
<br>
</div>
</div>
</div>

25
ShopifyUI/src/app/components/products/products.component.spec.ts

@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ProductsComponent } from './products.component';
describe('ProductsComponent', () => {
let component: ProductsComponent;
let fixture: ComponentFixture<ProductsComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ ProductsComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(ProductsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

31
ShopifyUI/src/app/components/products/products.component.ts

@ -0,0 +1,31 @@
import { Component, OnInit } from '@angular/core';
import { Product } from 'src/app/model/product.model';
import { ProductService } from 'src/app/service/product.service';
@Component({
selector: 'app-products',
templateUrl: './products.component.html',
styleUrls: ['./products.component.css']
})
export class ProductsComponent implements OnInit {
searchValue: string = '';
quantity:number;
products: Product[] = [];
constructor(private productService: ProductService) { }
ngOnInit(): void {
this.productService.getAllProducts().subscribe(data => {
this.products = data;
console.log(this.products)
})
}
onSearchEnter(value: string) {
this.searchValue = value;
}
onQuantityEnter(value: string) {
this.quantity = +value;
}
}

0
ShopifyUI/src/app/components/userprofile/userprofile.component.css

1
ShopifyUI/src/app/components/userprofile/userprofile.component.html

@ -0,0 +1 @@
<p>userprofile works!</p>

25
ShopifyUI/src/app/components/userprofile/userprofile.component.spec.ts

@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { UserprofileComponent } from './userprofile.component';
describe('UserprofileComponent', () => {
let component: UserprofileComponent;
let fixture: ComponentFixture<UserprofileComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ UserprofileComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(UserprofileComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

15
ShopifyUI/src/app/components/userprofile/userprofile.component.ts

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-userprofile',
templateUrl: './userprofile.component.html',
styleUrls: ['./userprofile.component.css']
})
export class UserprofileComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}

0
ShopifyUI/src/app/model/cart.model.ts

0
ShopifyUI/src/app/model/order.model.ts

10
ShopifyUI/src/app/model/product.model.ts

@ -0,0 +1,10 @@
export class Product {
id?:Number;
name:String;
imageUrl:string;
description:String;
rating:Number;
marketRetailPrice:DoubleRange;
discount:Number;
discountedPrice:DoubleRange;
}

0
ShopifyUI/src/app/model/review.model.ts

0
ShopifyUI/src/app/model/user.model.ts

16
ShopifyUI/src/app/service/cart.service.spec.ts

@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { CartService } from './cart.service';
describe('CartService', () => {
let service: CartService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(CartService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});

16
ShopifyUI/src/app/service/cart.service.ts

@ -0,0 +1,16 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class CartService {
path:String = "http://localhost:9999";
constructor(private httpClent:HttpClient) { }
public postCart() {
}
}

16
ShopifyUI/src/app/service/order.service.spec.ts

@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { OrderService } from './order.service';
describe('OrderService', () => {
let service: OrderService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(OrderService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});

9
ShopifyUI/src/app/service/order.service.ts

@ -0,0 +1,9 @@
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class OrderService {
constructor() { }
}

16
ShopifyUI/src/app/service/product.service.spec.ts

@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { ProductService } from './product.service';
describe('ProductService', () => {
let service: ProductService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(ProductService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});

24
ShopifyUI/src/app/service/product.service.ts

@ -0,0 +1,24 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { Product } from '../model/product.model';
@Injectable({
providedIn: 'root'
})
export class ProductService {
path:String = "http://localhost:9999";
constructor(private httpClient:HttpClient) { }
public getAllProducts(): Observable<Product[]> {
let product_get_api = this.path + '/product';
return this.httpClient.get<Product[]>(product_get_api);
}
public getProductById(pid:string): Observable<Product> {
let product_get_api = this.path + '/product/' + pid;
return this.httpClient.get<Product>(product_get_api);
}
}

16
ShopifyUI/src/app/service/review.service.spec.ts

@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { ReviewService } from './review.service';
describe('ReviewService', () => {
let service: ReviewService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(ReviewService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});

9
ShopifyUI/src/app/service/review.service.ts

@ -0,0 +1,9 @@
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class ReviewService {
constructor() { }
}

16
ShopifyUI/src/app/service/user.service.spec.ts

@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { UserService } from './user.service';
describe('UserService', () => {
let service: UserService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(UserService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});

9
ShopifyUI/src/app/service/user.service.ts

@ -0,0 +1,9 @@
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class UserService {
constructor() { }
}

0
ShopifyUI/src/assets/.gitkeep

3
ShopifyUI/src/environments/environment.prod.ts

@ -0,0 +1,3 @@
export const environment = {
production: true
};

16
ShopifyUI/src/environments/environment.ts

@ -0,0 +1,16 @@
// This file can be replaced during build by using the `fileReplacements` array.
// `ng build` replaces `environment.ts` with `environment.prod.ts`.
// The list of file replacements can be found in `angular.json`.
export const environment = {
production: false
};
/*
* For easier debugging in development mode, you can import the following file
* to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
*
* This import should be commented out in production mode because it will have a negative impact
* on performance if an error is thrown.
*/
// import 'zone.js/plugins/zone-error'; // Included with Angular CLI.

BIN
ShopifyUI/src/favicon.ico

Before After
Width: 28  |  Height: 30  |  Size: 948 B

13
ShopifyUI/src/index.html

@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>ShopifyUI</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<app-root></app-root>
</body>
</html>

12
ShopifyUI/src/main.ts

@ -0,0 +1,12 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));

65
ShopifyUI/src/polyfills.ts

@ -0,0 +1,65 @@
/**
* This file includes polyfills needed by Angular and is loaded before the app.
* You can add your own extra polyfills to this file.
*
* This file is divided into 2 sections:
* 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
* 2. Application imports. Files imported after ZoneJS that should be loaded before your main
* file.
*
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that
* automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
* Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
*
* Learn more in https://angular.io/guide/browser-support
*/
/***************************************************************************************************
* BROWSER POLYFILLS
*/
/**
* IE11 requires the following for NgClass support on SVG elements
*/
// import 'classlist.js'; // Run `npm install --save classlist.js`.
/**
* Web Animations `@angular/platform-browser/animations`
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
* Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
*/
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
/**
* By default, zone.js will patch all possible macroTask and DomEvents
* user can disable parts of macroTask/DomEvents patch by setting following flags
* because those flags need to be set before `zone.js` being loaded, and webpack
* will put import in the top of bundle, so user need to create a separate file
* in this directory (for example: zone-flags.ts), and put the following flags
* into that file, and then add the following code before importing zone.js.
* import './zone-flags';
*
* The flags allowed in zone-flags.ts are listed here.
*
* The following flags will work for all browsers.
*
* (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
* (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
* (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
*
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
* with the following flag, it will bypass `zone.js` patch for IE/Edge
*
* (window as any).__Zone_enable_cross_context_check = true;
*
*/
/***************************************************************************************************
* Zone JS is required by default for Angular itself.
*/
import 'zone.js'; // Included with Angular CLI.
/***************************************************************************************************
* APPLICATION IMPORTS
*/

74
ShopifyUI/src/styles.css

@ -0,0 +1,74 @@
@import "~bootstrap-icons/font/bootstrap-icons.css";
body {
color: white !important;
margin: 0px;
padding: 0px;
overflow-x: hidden !important;
}
.navbar {
padding-left: 45px;
background-color: #1B4F72 !important;
z-index: 100;
}
.navbar a {
padding: 12px 20px;
margin: 0px;
text-decoration: none;
color: white;
border-bottom: transparent;
vertical-align: middle;
transition: 0.2s all linear;
}
.navbar a:hover {
border-bottom: 1px solid white;
color: white;
}
.active a {
border-bottom: 1px solid white;
}
.loginmsg p {
margin: 0px;
padding: 8px;
border-radius: 10px;
float: right;
background-color: white;
color: #1B4F72;
}
.loginbtn a {
border: 1px solid white;
border-radius: 20px;
}
.loginbtn a:hover {
color: #1B4F72;
background-color: white;
}
.loginlink a {
text-decoration: none;
float: right;
color: white;
border: 2px solid transparent;
border-radius: 20px;
margin: 0px;
padding: 8px 16px;
transition: 0.2s all linear;
}
.loginlink a:hover {
border: 2px solid white;
}
.searchBar input {
width: 95%;
height: 45px;
padding: 12px;
border-radius: 20px;
}

27
ShopifyUI/src/test.ts

@ -0,0 +1,27 @@
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import {
BrowserDynamicTestingModule,
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';
declare const require: {
context(path: string, deep?: boolean, filter?: RegExp): {
keys(): string[];
<T>(id: string): T;
};
};
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting(),
{ teardown: { destroyAfterEach: true }},
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);

15
ShopifyUI/tsconfig.app.json

@ -0,0 +1,15 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
"types": []
},
"files": [
"src/main.ts",
"src/polyfills.ts"
],
"include": [
"src/**/*.d.ts"
]
}

32
ShopifyUI/tsconfig.json

@ -0,0 +1,32 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"importHelpers": true,
"target": "es2017",
"module": "es2020",
"lib": [
"es2018",
"dom"
]
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true,
"strictPropertyInitialization":false,
"strictNullChecks": false
}
}

18
ShopifyUI/tsconfig.spec.json

@ -0,0 +1,18 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/spec",
"types": [
"jasmine"
]
},
"files": [
"src/test.ts",
"src/polyfills.ts"
],
"include": [
"src/**/*.spec.ts",
"src/**/*.d.ts"
]
}
Loading…
Cancel
Save