Browse Source

Integrated part

gauravfullcomponent
Krishna Nanda 4 years ago
commit
679d67da50
193 changed files with 20147 additions and 0 deletions
  1. 1
      .gitignore
  2. 17
      Angular-UrbanBazaar/.browserslistrc
  3. 16
      Angular-UrbanBazaar/.editorconfig
  4. 45
      Angular-UrbanBazaar/.gitignore
  5. 27
      Angular-UrbanBazaar/README.md
  6. 110
      Angular-UrbanBazaar/angular.json
  7. 2
      Angular-UrbanBazaar/debug.log
  8. 44
      Angular-UrbanBazaar/karma.conf.js
  9. 12155
      Angular-UrbanBazaar/package-lock.json
  10. 42
      Angular-UrbanBazaar/package.json
  11. 19
      Angular-UrbanBazaar/proxy.config.json
  12. 23
      Angular-UrbanBazaar/src/app/app-routing.module.ts
  13. 0
      Angular-UrbanBazaar/src/app/app.component.css
  14. 3
      Angular-UrbanBazaar/src/app/app.component.html
  15. 35
      Angular-UrbanBazaar/src/app/app.component.spec.ts
  16. 10
      Angular-UrbanBazaar/src/app/app.component.ts
  17. 73
      Angular-UrbanBazaar/src/app/app.module.ts
  18. 12
      Angular-UrbanBazaar/src/app/auth/login/login.component.css
  19. 43
      Angular-UrbanBazaar/src/app/auth/login/login.component.html
  20. 25
      Angular-UrbanBazaar/src/app/auth/login/login.component.spec.ts
  21. 50
      Angular-UrbanBazaar/src/app/auth/login/login.component.ts
  22. 0
      Angular-UrbanBazaar/src/app/auth/sign-up/sign-up.component.css
  23. 83
      Angular-UrbanBazaar/src/app/auth/sign-up/sign-up.component.html
  24. 25
      Angular-UrbanBazaar/src/app/auth/sign-up/sign-up.component.spec.ts
  25. 41
      Angular-UrbanBazaar/src/app/auth/sign-up/sign-up.component.ts
  26. 36
      Angular-UrbanBazaar/src/app/components/cart/cart.component.css
  27. 52
      Angular-UrbanBazaar/src/app/components/cart/cart.component.html
  28. 25
      Angular-UrbanBazaar/src/app/components/cart/cart.component.spec.ts
  29. 37
      Angular-UrbanBazaar/src/app/components/cart/cart.component.ts
  30. 43
      Angular-UrbanBazaar/src/app/components/home/home.component.css
  31. 50
      Angular-UrbanBazaar/src/app/components/home/home.component.html
  32. 25
      Angular-UrbanBazaar/src/app/components/home/home.component.spec.ts
  33. 55
      Angular-UrbanBazaar/src/app/components/home/home.component.ts
  34. 0
      Angular-UrbanBazaar/src/app/components/memberlist/memberlist.component.css
  35. 82
      Angular-UrbanBazaar/src/app/components/memberlist/memberlist.component.html
  36. 25
      Angular-UrbanBazaar/src/app/components/memberlist/memberlist.component.spec.ts
  37. 89
      Angular-UrbanBazaar/src/app/components/memberlist/memberlist.component.ts
  38. 99
      Angular-UrbanBazaar/src/app/components/page-nav-bar/page-nav-bar.component.css
  39. 29
      Angular-UrbanBazaar/src/app/components/page-nav-bar/page-nav-bar.component.html
  40. 25
      Angular-UrbanBazaar/src/app/components/page-nav-bar/page-nav-bar.component.spec.ts
  41. 31
      Angular-UrbanBazaar/src/app/components/page-nav-bar/page-nav-bar.component.ts
  42. 0
      Angular-UrbanBazaar/src/app/components/user-add/user-add.component.css
  43. 1
      Angular-UrbanBazaar/src/app/components/user-add/user-add.component.html
  44. 25
      Angular-UrbanBazaar/src/app/components/user-add/user-add.component.spec.ts
  45. 15
      Angular-UrbanBazaar/src/app/components/user-add/user-add.component.ts
  46. 22
      Angular-UrbanBazaar/src/app/components/user-profile-details/user-profile-details.component.css
  47. 95
      Angular-UrbanBazaar/src/app/components/user-profile-details/user-profile-details.component.html
  48. 25
      Angular-UrbanBazaar/src/app/components/user-profile-details/user-profile-details.component.spec.ts
  49. 49
      Angular-UrbanBazaar/src/app/components/user-profile-details/user-profile-details.component.ts
  50. 0
      Angular-UrbanBazaar/src/app/components/user-search/user-search.component.css
  51. 1
      Angular-UrbanBazaar/src/app/components/user-search/user-search.component.html
  52. 25
      Angular-UrbanBazaar/src/app/components/user-search/user-search.component.spec.ts
  53. 15
      Angular-UrbanBazaar/src/app/components/user-search/user-search.component.ts
  54. 3
      Angular-UrbanBazaar/src/app/components/user-show/user-show.component.css
  55. 29
      Angular-UrbanBazaar/src/app/components/user-show/user-show.component.html
  56. 25
      Angular-UrbanBazaar/src/app/components/user-show/user-show.component.spec.ts
  57. 22
      Angular-UrbanBazaar/src/app/components/user-show/user-show.component.ts
  58. 7
      Angular-UrbanBazaar/src/app/models/cart.spec.ts
  59. 10
      Angular-UrbanBazaar/src/app/models/cart.ts
  60. 7
      Angular-UrbanBazaar/src/app/models/login.spec.ts
  61. 6
      Angular-UrbanBazaar/src/app/models/login.ts
  62. 7
      Angular-UrbanBazaar/src/app/models/member-user.spec.ts
  63. 10
      Angular-UrbanBazaar/src/app/models/member-user.ts
  64. 7
      Angular-UrbanBazaar/src/app/models/orders.spec.ts
  65. 21
      Angular-UrbanBazaar/src/app/models/orders.ts
  66. 7
      Angular-UrbanBazaar/src/app/models/product-category.spec.ts
  67. 7
      Angular-UrbanBazaar/src/app/models/product-category.ts
  68. 7
      Angular-UrbanBazaar/src/app/models/product.spec.ts
  69. 13
      Angular-UrbanBazaar/src/app/models/product.ts
  70. 7
      Angular-UrbanBazaar/src/app/models/user.spec.ts
  71. 15
      Angular-UrbanBazaar/src/app/models/user.ts
  72. 16
      Angular-UrbanBazaar/src/app/services/cart.service.spec.ts
  73. 78
      Angular-UrbanBazaar/src/app/services/cart.service.ts
  74. 16
      Angular-UrbanBazaar/src/app/services/member-user.service.spec.ts
  75. 64
      Angular-UrbanBazaar/src/app/services/member-user.service.ts
  76. 16
      Angular-UrbanBazaar/src/app/services/orders.service.spec.ts
  77. 27
      Angular-UrbanBazaar/src/app/services/orders.service.ts
  78. 16
      Angular-UrbanBazaar/src/app/services/product-category.service.spec.ts
  79. 18
      Angular-UrbanBazaar/src/app/services/product-category.service.ts
  80. 16
      Angular-UrbanBazaar/src/app/services/product.service.spec.ts
  81. 27
      Angular-UrbanBazaar/src/app/services/product.service.ts
  82. 16
      Angular-UrbanBazaar/src/app/services/user.service.spec.ts
  83. 81
      Angular-UrbanBazaar/src/app/services/user.service.ts
  84. 0
      Angular-UrbanBazaar/src/assets/.gitkeep
  85. BIN
      Angular-UrbanBazaar/src/assets/Images/Logo.png
  86. BIN
      Angular-UrbanBazaar/src/assets/Images/download.jpg
  87. 3
      Angular-UrbanBazaar/src/environments/environment.prod.ts
  88. 16
      Angular-UrbanBazaar/src/environments/environment.ts
  89. BIN
      Angular-UrbanBazaar/src/favicon.ico
  90. 18
      Angular-UrbanBazaar/src/index.html
  91. 12
      Angular-UrbanBazaar/src/main.ts
  92. 65
      Angular-UrbanBazaar/src/polyfills.ts
  93. 4
      Angular-UrbanBazaar/src/styles.css
  94. 25
      Angular-UrbanBazaar/src/test.ts
  95. 15
      Angular-UrbanBazaar/tsconfig.app.json
  96. 31
      Angular-UrbanBazaar/tsconfig.json
  97. 18
      Angular-UrbanBazaar/tsconfig.spec.json
  98. 3
      README.md
  99. 33
      UB_CartServiceProxy/.gitignore
  100. 117
      UB_CartServiceProxy/.mvn/wrapper/MavenWrapperDownloader.java

1
.gitignore

@ -0,0 +1 @@
/.metadata/

17
Angular-UrbanBazaar/.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
Angular-UrbanBazaar/.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
Angular-UrbanBazaar/.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
Angular-UrbanBazaar/README.md

@ -0,0 +1,27 @@
# AngularUrbanBazaar
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 12.1.1.
## 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.

110
Angular-UrbanBazaar/angular.json

@ -0,0 +1,110 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"Angular-UrbanBazaar": {
"projectType": "application",
"schematics": {
"@schematics/angular:application": {
"strict": true
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/Angular-UrbanBazaar",
"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/@angular/material/prebuilt-themes/deeppurple-amber.css",
"src/styles.css"
],
"scripts": []
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"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": "Angular-UrbanBazaar:build:production",
"proxyConfig": "proxy.config.json"
},
"development": {
"browserTarget": "Angular-UrbanBazaar:build:development",
"proxyConfig": "proxy.config.json"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "Angular-UrbanBazaar: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": [
"./node_modules/@angular/material/prebuilt-themes/deeppurple-amber.css",
"src/styles.css"
],
"scripts": []
}
}
}
}
},
"defaultProject": "Angular-UrbanBazaar"
}

2
Angular-UrbanBazaar/debug.log

@ -0,0 +1,2 @@
[0919/155655.703:ERROR:registration_protocol_win.cc(102)] CreateFile: The system cannot find the file specified. (0x2)
[0919/155714.431:ERROR:registration_protocol_win.cc(102)] CreateFile: The system cannot find the file specified. (0x2)

44
Angular-UrbanBazaar/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/Angular-UrbanBazaar'),
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
});
};

12155
Angular-UrbanBazaar/package-lock.json
File diff suppressed because it is too large
View File

42
Angular-UrbanBazaar/package.json

@ -0,0 +1,42 @@
{
"name": "angular-urban-bazaar",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
},
"private": true,
"dependencies": {
"@angular/animations": "~12.1.1",
"@angular/cdk": "^12.2.6",
"@angular/common": "~12.1.1",
"@angular/compiler": "~12.1.1",
"@angular/core": "~12.1.1",
"@angular/flex-layout": "^12.0.0-beta.35",
"@angular/forms": "~12.1.1",
"@angular/material": "^12.2.6",
"@angular/platform-browser": "~12.1.1",
"@angular/platform-browser-dynamic": "~12.1.1",
"@angular/router": "~12.1.1",
"rxjs": "~6.6.0",
"tslib": "^2.2.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "^12.1.4",
"@angular/cli": "~12.1.1",
"@angular/compiler-cli": "~12.1.1",
"@types/jasmine": "~3.6.0",
"@types/node": "^12.11.1",
"jasmine-core": "~3.7.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.5.0",
"typescript": "~4.3.2"
}
}

19
Angular-UrbanBazaar/proxy.config.json

@ -0,0 +1,19 @@
{
"/products":{
"target":"http://10.3.117.7:8007",
"secure":false
},
"/user":{
"target":"http://10.3.117.7:8008",
"secure":false
},
"/orders":{
"target":"http://10.3.117.7:8009",
"secure":false
},
"/cart":{
"target":"http://10.3.117.7:8010",
"secure":false
}
}

23
Angular-UrbanBazaar/src/app/app-routing.module.ts

@ -0,0 +1,23 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { LoginComponent } from './auth/login/login.component';
import { CartComponent } from './components/cart/cart.component';
import { HomeComponent } from './components/home/home.component';
import { UserProfileDetailsComponent } from './components/user-profile-details/user-profile-details.component';
import { UserShowComponent } from './components/user-show/user-show.component';
const routes: Routes = [
{path: '', component: LoginComponent},
{path: 'home', component: HomeComponent},
{path: 'showAllUsers', component: UserShowComponent},
{path: 'profile', component: UserProfileDetailsComponent},
{path: 'showCart', component: CartComponent},
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }

0
Angular-UrbanBazaar/src/app/app.component.css

3
Angular-UrbanBazaar/src/app/app.component.html

@ -0,0 +1,3 @@
<app-page-nav-bar></app-page-nav-bar>
<!-- <app-home></app-home> -->
<router-outlet></router-outlet>

35
Angular-UrbanBazaar/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 'Angular-UrbanBazaar'`, () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app.title).toEqual('Angular-UrbanBazaar');
});
it('should render title', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.nativeElement;
expect(compiled.querySelector('.content span').textContent).toContain('Angular-UrbanBazaar app is running!');
});
});

10
Angular-UrbanBazaar/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 = 'Angular-UrbanBazaar';
}

73
Angular-UrbanBazaar/src/app/app.module.ts

@ -0,0 +1,73 @@
import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { BrowserModule } from '@angular/platform-browser';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { HttpClientModule } from '@angular/common/http';
import { UserShowComponent } from './components/user-show/user-show.component';
import { UserProfileDetailsComponent } from './components/user-profile-details/user-profile-details.component';
import { PageNavBarComponent } from './components/page-nav-bar/page-nav-bar.component';
import { HomeComponent } from './components/home/home.component';
import { CartComponent } from './components/cart/cart.component';
import { MatInputModule } from '@angular/material/input';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatCardModule } from '@angular/material/card';
import { MatButtonModule } from '@angular/material/button';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { FlexLayoutModule } from '@angular/flex-layout';
import { LoginComponent } from './auth/login/login.component';
import { SignUpComponent } from './auth/sign-up/sign-up.component';
import { RouterModule, Routes } from '@angular/router';
import { HttpModule } from '@angular/http';
import { MemberlistComponent } from './components/memberlist/memberlist.component';
const appRoutes : Routes =
[
{path:'',component:LoginComponent},
{path:'login',component:LoginComponent},
{path:'signup',component:SignUpComponent},
{path:'user-profile-details',component:UserProfileDetailsComponent},
{path:'memberlist',component:MemberlistComponent},
{path:'home',component:HomeComponent,
children: [
{path:'user-profile-details',component:UserProfileDetailsComponent,outlet:'user'},
{path:'memberlist',component:MemberlistComponent,outlet:'member'}
]
}
]
@NgModule({
declarations: [
AppComponent,
UserShowComponent,
UserProfileDetailsComponent,
PageNavBarComponent,
HomeComponent,
CartComponent,
LoginComponent,
SignUpComponent,
MemberlistComponent,
],
imports: [
BrowserModule,
AppRoutingModule,
FormsModule,
ReactiveFormsModule,
FlexLayoutModule,
HttpClientModule,
MatFormFieldModule,
MatInputModule,
MatCardModule,
MatButtonModule,
BrowserAnimationsModule,AppRoutingModule,
RouterModule.forRoot(appRoutes,{ useHash: true }),
FormsModule,
HttpModule,
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }

12
Angular-UrbanBazaar/src/app/auth/login/login.component.css

@ -0,0 +1,12 @@
body {
background-color: beige;
padding: 10px 10px 10px 10px;
}
.login-main{
margin-top: 10%;
}
mat-card{
min-width: 30%;
max-width: 50%;
}

43
Angular-UrbanBazaar/src/app/auth/login/login.component.html

@ -0,0 +1,43 @@
<body>
<div fxLayout="column" fxLayoutAlign="space-around center" class="login-main">
<mat-card >
&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;
<h2 style="color:darkblue;">
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; Welcome to Urban Bazaar !!!
</h2>
<div style="text-align:center;"><img src="/assets/Images/Logo.png" alt="Logo"></div>
<mat-card-header>
<mat-card-title>Login Page</mat-card-title>
</mat-card-header>
<mat-card-content fxLayout="column">
<mat-form-field>
<input matInput placeholder="Username"
[formControl]="username">
</mat-form-field>
<mat-form-field>
<input type="password" matInput placeholder="password"
[formControl]="password">
</mat-form-field>
</mat-card-content>
<!-- <div style="text-align:left;">
<a [routerLink]="['signup']">SignUp</a>
</div> -->
<mat-card-actions align="end">
<button mat-raised-button color="primary" (click)="signup()">Signup</button>
<p style="color: darkblue;" >OR &nbsp;</p>
<button mat-raised-button color="primary" (click)="userLogin()">Login</button>
</mat-card-actions>
</mat-card>
<!-- </div>
<div style="text-align:center;">
<a [routerLink]="['signup']">SignUp</a>
</div> -->
<!-- <div style="text-align:center;">
<a [routerLink]="['user-profile-details']">user details</a>
</div>
<div style="text-align:center;">
<a [routerLink]="['memberlist']">memberlist</a>
</div>
</body> -->

25
Angular-UrbanBazaar/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();
});
});

50
Angular-UrbanBazaar/src/app/auth/login/login.component.ts

@ -0,0 +1,50 @@
import { Route } from '@angular/compiler/src/core';
import { Component, OnInit } from '@angular/core';
import { FormControl, FormGroup } from '@angular/forms';
import { Router } from '@angular/router';
import { Observable } from 'rxjs';
import { Login } from 'src/app/models/login';
import { User } from 'src/app/models/user';
import { UserService } from 'src/app/services/user.service';
@Component({
selector: 'app-login',
templateUrl: './login.component.html',
styleUrls: ['./login.component.css']
})
export class LoginComponent implements OnInit {
username = new FormControl();
password = new FormControl();
responseMessage : string = "";
temp : Observable<User>;
// temp : User;
// temps : Observable<string>;
// userList : Observable<User[]>;
signup(){
this.router.navigateByUrl('/signup')
}
constructor(private _userService : UserService, private router : Router) {}
userLogin() {
// alert(this.username.value+" | "+this.password.value);
let user : Login = {
userfirstname: this.username.value,
userpassword: this.password.value
}
this.temp = this._userService.findUserByUsername(this.username.value);
this.temp.subscribe(v => {
if(v.userpassword == this.password.value)
{ this.temp.subscribe(v => this._userService.currentUser = v);
this.router.navigateByUrl('/home');
alert("Login Successfull !!")}
else
alert("Login falied !!");
});
}
ngOnInit(): void {
}
}

0
Angular-UrbanBazaar/src/app/auth/sign-up/sign-up.component.css

83
Angular-UrbanBazaar/src/app/auth/sign-up/sign-up.component.html

@ -0,0 +1,83 @@
<!-- <div >
<app-page-nav-bar></app-page-nav-bar>
</div> -->
<p style="text-align:center;">Please provide your details to signup with Urban Bazaar</p>
<form #signupForm="ngForm" style="text-align:center;" (ngSubmit)="signup(signupForm)">
User UserEmail:
<input type="text" name="useremail" [(ngModel)]="user.useremail" required #useremail="ngModel" />
<br/><br/>
<div *ngIf="useremail.invalid && signupForm.submitted && !isFormSubmitted">
<h6 style="color: red">Please Enter User Email Id...</h6>
</div>
<br/>
User Password :
<input type="password" name="userpassword" [(ngModel)]="user.userpassword" required #userpassword="ngModel" />
<br/><br/>
<div *ngIf="userpassword.invalid && signupForm.submitted && !isFormSubmitted">
<h6 style="color: red">Please Enter User Password...</h6>
</div>
<br/>
User First Name :
<input type="text" name="userfirstname" [(ngModel)]="user.userfirstname" required #userfirstname="ngModel" />
<br/><br/>
<div *ngIf="userfirstname.invalid && signupForm.submitted && !isFormSubmitted">
<h6 style="color: red">Please Enter User First Name...</h6>
</div>
<br/>
User Last Name :
<input type="text" name="userlastname" [(ngModel)]="user.userlastname"
required #userlastname="ngModel" />
<br/><br/>
<div *ngIf="userlastname.invalid && signupForm.submitted && !isFormSubmitted">
<h6 style="color: red">Please Enter User Last Name...</h6>
</div>
<br/>
User City :
<input type="text" name="usercity" [(ngModel)]="user.usercity" required #usercity="ngModel" />
<br/><br/>
<div *ngIf="usercity.invalid && signupForm.submitted && !isFormSubmitted">
<h6 style="color: red">Please Enter UserCity...</h6>
</div>
<br/>
User State :
<input type="text" name="userstate" [(ngModel)]="user.userstate" required #userstate="ngModel" />
<br/><br/>
<div *ngIf="userstate.invalid && signupForm.submitted && !isFormSubmitted">
<h6 style="color: red">Please Enter UserState...</h6>
</div>
<br/>
User Zip :
<input type="text" name="userzip" [(ngModel)]="user.userzip" required #userzip="ngModel" />
<br/><br/>
<div *ngIf="userzip.invalid && signupForm.submitted && !isFormSubmitted">
<h6 style="color: red">Please Enter User Zip...</h6>
</div>
<br/>
User Phone Number :
<input type="text" name="userphone" [(ngModel)]="user.userphone" required #userphone="ngModel" />
<br/><br/>
<div *ngIf="userphone.invalid && signupForm.submitted && !isFormSubmitted">
<h6 style="color: red">Please Enter User Number...</h6>
</div>
<br/>
User Address :
<input type="text" name="useraddress" [(ngModel)]="user.useraddress" required #useraddress="ngModel" />
<br/><br/>
<div *ngIf="useraddress.invalid && signupForm.submitted && !isFormSubmitted">
<h6 style="color: red">Please Enter User Address...</h6>
</div>
<br/>
User Address2 :
<input type="text" name="useraddress2" [(ngModel)]="user.useraddress2" required #useraddress2="ngModel" />
<br/><br/>
<div *ngIf="useraddress2.invalid && signupForm.submitted && !isFormSubmitted">
<h6 style="color: red">Please Enter User Address2...</h6>
</div>
<br/>
<input type="Submit" value="Submit" />
</form>
<!-- <div style="text-align:center;">
<a [routerLink]="['user-show']">UserDetails</a>
</div> -->

25
Angular-UrbanBazaar/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();
});
});

41
Angular-UrbanBazaar/src/app/auth/sign-up/sign-up.component.ts

@ -0,0 +1,41 @@
import { Component, OnInit } from '@angular/core';
import { NgForm } from '@angular/forms';
import { Observable } from 'rxjs';
import { User } from 'src/app/models/user';
import { UserService } from 'src/app/services/user.service';
@Component({
selector: 'app-sign-up',
templateUrl: './sign-up.component.html',
styleUrls: ['./sign-up.component.css']
})
export class SignUpComponent implements OnInit {
user :User;
tys :string="t"
temp : Observable<User>;
isFormSubmitted : boolean;
public signup(signupForm : NgForm) {
if (signupForm.invalid) {
alert("Kindly enter all details")
return;
}
this.isFormSubmitted=true;
this._userservice.addUser(this.user).subscribe(x => { this.tys="y"; alert("Signup Successful")
if(this.tys=="t")
alert("not")});
}
constructor(private _userservice:UserService) {
this.user=new User();
this.isFormSubmitted=false;
}
ngOnInit(): void {
}
}

36
Angular-UrbanBazaar/src/app/components/cart/cart.component.css

@ -0,0 +1,36 @@
.card
{
height: 60vh;
margin: 25px;
padding: 25px;
}
.center{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
text-align: center;
}
h4,h6{
font-weight: 400;
}
.shopNow{
padding: 5%;
background-color: rgb(79 79 243);
color: aliceblue;
border-radius: 15px;
border-color: white;
}
.card-table{
position: relative;
display: flex;
flex-direction: column;
align-items: center;
}
.CartButtons{
border-radius: 15px;
border-color:antiquewhite ;
background-color: beige;
}

52
Angular-UrbanBazaar/src/app/components/cart/cart.component.html

@ -0,0 +1,52 @@
<ng-container *ngIf="cartdetails.length !=0">
<div class="container">
<div class="card-table">
<div class="card-product">
<div class="table tabe-responsive">
<thead>
<tr>
<th>S.No</th>
<th>ProductName</th>
<th>ProductPrice</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let c of cartdetails; let i = index">
<td>{{i+1}}</td>
<td>{{c.productname}}</td>
<td>{{c.productprice}}</td>
<td>
<button class="CartButtons" (click)="removeItem(c)">Delete</button>
</td>
</tr>
<tr>
<td colspan="4"></td>
<td><button (click)=emptyCart() class="CartButtons">Empty Cart</button></td>
<td><button routerLink='/home' class="CartButtons">Shop More</button></td>
<td><button class="CartButtons">Checkout</button></td>
<td><strong>Grand Total : Rs.{{grandTotal}}</strong></td>
</tr>
</tbody>
</div>
</div>
</div>
</div>
</ng-container>
<ng-container *ngIf="cartdetails.length==0">
<div class="container">
<div class="card">
<h5 class="card-title">My Cart</h5>
</div>
<div class="center">
<img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT9q9U7YaUc27iaqP1bbyD3g6GSLqlRmAFbeQ&usqp=CAU"
alt="">
<h4>Your cart is empty!</h4>
<h6>Add item to it now</h6>
<button class="shopNow" routerLink='/home'>Shop Now</button>
</div>
</div>
</ng-container>

25
Angular-UrbanBazaar/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();
});
});

37
Angular-UrbanBazaar/src/app/components/cart/cart.component.ts

@ -0,0 +1,37 @@
import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs';
import { Cart } from 'src/app/models/cart';
import { User } from 'src/app/models/user';
import { CartService } from 'src/app/services/cart.service';
@Component({
selector: 'app-cart',
templateUrl: './cart.component.html',
styleUrls: ['./cart.component.css']
})
export class CartComponent implements OnInit {
public cartdetails:any =[];
public grandTotal!: number;
constructor(private cartservice:CartService) {
// this.cartdetails = this.cartservice.showAllOrder();
}
ngOnInit(): void {
this.cartservice.getProducts()
.subscribe(res=>{
this.cartdetails = res;
this.grandTotal = this.cartservice.getTotalPrice();
})
}
removeItem(item:any){
this.cartservice.removeCartItem(item);
}
emptyCart()
{
this.cartservice.removeAllCart();
}
}

43
Angular-UrbanBazaar/src/app/components/home/home.component.css

@ -0,0 +1,43 @@
body {
padding-top: 10px;
padding-left: 10px;
padding-right: 10px;
padding-bottom: 10px;
}
.showCart{
margin-left: 1250px;
border-radius: 15px;
padding: 10px;
margin-top: 10px;
border-color: antiquewhite;
}
.AddToCart{
border-radius: 10px;
border-color: antiquewhite;
color: rgb(0, 0, 0);
background-color: rgb(248, 229, 247);
font-weight: 600;
}
.card{
max-width: 300px;
border-width: 1px;
border-color:antiquewhite;
text-align: center;
margin-top: 12px;
font-family: Arial, Helvetica, sans-serif;
border-radius: 12px;
box-shadow: 0.5em;
}
.price {
color: grey;
font-size: 16px;
}
.cardParent{
display: flex;
justify-content: space-between;
flex-grow:1;
flex-wrap: wrap;
}

50
Angular-UrbanBazaar/src/app/components/home/home.component.html

@ -0,0 +1,50 @@
<body>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;
<button style="shape-outside: circle();color:forestgreen; background-color: white; border-color: forestgreen;" class="EditProfile" (click)=EditProfile()>Edit Profile</button>
&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;
<button style="shape-outside: circle();color: forestgreen; background-color: white; border-color: forestgreen;" class="Members List of Curent User" (click)=Members()>Members List of Curent User</button>
<br/><br/>
<form class="form-inline my-2 my-lg-0">
<input class="form-control mr-sm-2" type="text"
[(ngModel)]="searchValue" id="searchValue" [ngModelOptions]="{standalone: true}"
placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success my-2 my-sm-0"
type="submit" (click)="searchProduct()">Search</button>
</form>
<button class="showCart" (click)="showCart()">Show Cart</button>
<div class="cardParent">
<div class="card" *ngFor="let i of Searchedproducts">
<img src="{{i.productimage}}" style="width:85%">
<h5>{{i.productname}}</h5>
<p class="price">Rs. {{i.productprice}} <br>
Weight: {{i.productweight}} Kg</p>
<p><button class="AddToCart" (click)=addCart(i)>Add to Cart</button></p>
</div>
</div>
</body>
<!-- <div >
<app-page-nav-bar></app-page-nav-bar>
</div> -->
<!-- <button type="button" style="text-align:center;background-color:dimgray;" cls="btn" (click)="btnClick();">EditProfile</button> -->
<!-- <div style="text-align:center;">
<a [routerLink]="['/home', {outlets: {'member': ['memberlist']}}]">Members List of Curent User</a>
</div>
<router-outlet name="member"></router-outlet> -->
<!--
<div style="text-align:center;">
<a [routerLink]="['/home', {outlets: {'user': ['user-profile-details']}}]">EditProfile</a>
</div>
<router-outlet name="user"></router-outlet> -->

25
Angular-UrbanBazaar/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();
});
});

55
Angular-UrbanBazaar/src/app/components/home/home.component.ts

@ -0,0 +1,55 @@
import { Component, OnInit } from '@angular/core';
import { ProductService } from './../../services/product.service';
import { Observable } from 'rxjs';
import { Product } from './../../models/product';
import { ActivatedRoute, Router } from '@angular/router';
import { CartService } from 'src/app/services/cart.service';
import { Cart } from 'src/app/models/cart';
import { ThrowStmt } from '@angular/compiler';
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.css']
})
export class HomeComponent implements OnInit {
public products: Product[];
public Searchedproducts: Product[];
searchValue : string = "";
constructor(private productservice: ProductService,
private router: Router,
private cartservice: CartService,
) {}
public showCart(){
this.router.navigateByUrl('/showCart');
}
addCart(item:any){
this.cartservice.addtoCart(item);
}
searchProduct() {
if(this.searchValue=="") {
this.Searchedproducts = this.products;
} else {
// this.productservice.searchProduct(this.searchValue).subscribe(
// res => {this.Searchedproducts = res;}
// );
this.Searchedproducts = this.products.filter(p => p.productname.toLocaleLowerCase().includes(this.searchValue));
}
}
EditProfile(){
this.router.navigateByUrl('/user-profile-details')
}
Members(){
this.router.navigateByUrl('/memberlist')
}
ngOnInit(): void {
this.productservice.showAllProduct().subscribe(res=>{
this.products = res;
this.Searchedproducts = res;
})
}}

0
Angular-UrbanBazaar/src/app/components/memberlist/memberlist.component.css

82
Angular-UrbanBazaar/src/app/components/memberlist/memberlist.component.html

@ -0,0 +1,82 @@
<form #addmemForm="ngForm" style="text-align:center;" (ngSubmit)="add(addmemForm)">
<br/>
UserId:
<input type="text" name="userid"[(ngModel)]="userid" value="{{userid}}" [disabled]=true>
<br/>
<br/>
Member Name:&nbsp;&nbsp;
<input type="text" name="membername"[(ngModel)]="mem.membername" required #membername="ngModel" />
<br/><br/>
<div *ngIf="membername.invalid && addmemForm.submitted && !isFormSubmitted">
<h6 style="color: red">Please Enter Membername...</h6>
</div>
<br/>
Member Door Number :&nbsp;&nbsp;
<input type="text" name="memberdoornumber"[(ngModel)]="mem.memberdoornumber" required #memberdoornumber="ngModel" />
<br/><br/>
<div *ngIf="membername.invalid && addmemForm.submitted && !isFormSubmitted">
<h6 style="color: red">Please Enter MemberDoorNumber...</h6>
</div>
<br/>
Member Phone Number:&nbsp;&nbsp;
<input type="text" name="memberphone"[(ngModel)]="mem.memberphone" required #memberphone="ngModel" />
<br/><br/>
<div *ngIf="memberphone.invalid && addmemForm.submitted && !isFormSubmitted">
<h6 style="color: red">Please Enter Mobile number...</h6>
</div>
<br/>
<!-- Flat No/House No:&nbsp;&nbsp;
<input type="text" name="address"[(ngModel)]="mem.address" required #address="ngModel"/>
<br/><br/>
<div *ngIf="address.invalid && addmemForm.submitted && !isFormSubmitted">
<h6 style="color: red">Please Enter User Flat No/House No..</h6>
</div>
<br/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -->
<input type="submit" style="text-align:center;background-color:dimgray;"name="Submit"/>
</form>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button style="text-align:center;background-color:dimgray;"class="btn" (click)="enable()">Edit</button> <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Members Information
<div style="text-align:center;" *ngFor="let v of currentUser | async">
<form #updateForm="ngForm" style="text-align:center;" (ngSubmit)="update(updateForm,v)" >
<br/>
Member Name:&nbsp;&nbsp;
<input type="text" name="membername"[(ngModel)]="v.membername" value="{{v.membername}}" [disabled]='toggleButton'>
<br/><br/>
Mobile Number:&nbsp;&nbsp;
<input type="text" name="memberphone"[(ngModel)]="v.memberphone" value="{{v.memberphone}}" [disabled]='toggleButton'>
<br/><br/>
<!-- Flat No/House No:&nbsp;&nbsp;
<input type="text" name="address"[(ngModel)]="v.address" value="{{v.address}}" [disabled]='toggleButton'>
<br/><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -->
<input type="submit" style="text-align:center;background-color:dimgray;"name="Save"/>
<br/> <br/>
<button type="button" style="text-align:center;background-color:dimgray;" cls="btn" (click)="delete(updateForm,v)">Delete
</button> <!-- <button style="text-align:center;background-color:dimgray;"class="btn" (onclick)="delete(updateForm,v)">Delete</button> <br> -->
</form>
</div>
<!-- </body>
<table border="3" align="center">
<tr>
<th>Vendor Id</th>
<th>Vendor Name</th>
<th>Phone Number</th>
</tr>
<tr *ngFor="let v of currentUser | async">
<td>{{v.memberid}}</td>
<td>{{v.membername}} </td>
<td>{{v.memberphone}} </td>
</tr>
</table> -->

25
Angular-UrbanBazaar/src/app/components/memberlist/memberlist.component.spec.ts

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

89
Angular-UrbanBazaar/src/app/components/memberlist/memberlist.component.ts

@ -0,0 +1,89 @@
import { Component, OnInit } from '@angular/core';
import { NgForm } from '@angular/forms';
import { Observable } from 'rxjs';
import { MemberUser } from 'src/app/models/member-user';
import { MemberUserService } from 'src/app/services/member-user.service';
import { UserService } from 'src/app/services/user.service';
@Component({
selector: 'app-memberlist',
templateUrl: './memberlist.component.html',
styleUrls: ['./memberlist.component.css']
})
export class MemberlistComponent implements OnInit {
currentUser : Observable<MemberUser[]>;
member : MemberUser;
userid :number =this._userservice.currentUser.userid
public toggleButton: boolean ;
mem :MemberUser
isFormSubmitted : boolean;
public add(addmemForm : NgForm) {
this.mem.userid=this._userservice.currentUser.userid
if (addmemForm.invalid) {
alert("Kindly enter all details")
return;
}
this.isFormSubmitted=true;
this._memberService.addMemberUser(this.mem).subscribe(x => { alert("Member added Successfuly")
})
// .subscribe(x => {alert("Sign up Successfull")});
}
public delete(updateForm : NgForm,v: MemberUser) {
this._memberService.deleteMemberUser(v.memberid).subscribe(x => { alert("Member deleted Successfuly")
})
}
constructor(private _memberService : MemberUserService,private _userservice:UserService) {
this.member=new MemberUser()
this.mem=new MemberUser();
this.isFormSubmitted=false;
this.toggleButton=true
this.currentUser = this._memberService.searchMembersbyUser(this._userservice.currentUser.userid);
this.currentUser.subscribe();
}
update(updateForm : NgForm ,v:MemberUser) {
if (updateForm.invalid) {
return;
}
// console.log(v)
this._memberService.updateMemberUser(v).subscribe(x=>{
alert("Member Id: "+v.memberid+" with MemberName "+v.membername+" is updated") })
// alert("Record Updated")})
}
// addMember(updateForm : NgForm ,v:MemberUser) {
// if (updateForm.invalid) {
// return;
// }
// // console.log(v)
// this._memberService.addMemberUser(v).subscribe(x=>{
// alert("Member Id: "+v.memberid+" with MemberName "+v.membername+" is updated") })
// // alert("Record Updated")})
// }
enable(){
this.toggleButton = false
}
disable(){
this.toggleButton = true
}
ngOnInit(): void {
}
}

99
Angular-UrbanBazaar/src/app/components/page-nav-bar/page-nav-bar.component.css

@ -0,0 +1,99 @@
@import url("//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css");
.navbar-icon-top .navbar-nav .nav-link > .fa {
position: relative;
width: 36px;
font-size: 24px;
}
.navbar-icon-top .navbar-nav .nav-link > .fa > .badge {
font-size: 0.75rem;
position: absolute;
right: 0;
font-family: sans-serif;
}
.navbar-icon-top .navbar-nav .nav-link > .fa {
top: 3px;
line-height: 12px;
}
.navbar-icon-top .navbar-nav .nav-link > .fa > .badge {
top: -10px;
}
@media (min-width: 576px) {
.navbar-icon-top.navbar-expand-sm .navbar-nav .nav-link {
text-align: center;
display: table-cell;
height: 70px;
vertical-align: middle;
padding-top: 0;
padding-bottom: 0;
}
.navbar-icon-top.navbar-expand-sm .navbar-nav .nav-link > .fa {
display: block;
width: 48px;
margin: 2px auto 4px auto;
top: 0;
line-height: 24px;
}
.navbar-icon-top.navbar-expand-sm .navbar-nav .nav-link > .fa > .badge {
top: -7px;
}
}
@media (min-width: 768px) {
.navbar-icon-top.navbar-expand-md .navbar-nav .nav-link {
text-align: center;
display: table-cell;
height: 70px;
vertical-align: middle;
padding-top: 0;
padding-bottom: 0;
}
.navbar-icon-top.navbar-expand-md .navbar-nav .nav-link > .fa {
display: block;
width: 48px;
margin: 2px auto 4px auto;
top: 0;
line-height: 24px;
}
.navbar-icon-top.navbar-expand-md .navbar-nav .nav-link > .fa > .badge {
top: -7px;
}
}
@media (min-width: 992px) {
.navbar-icon-top.navbar-expand-lg .navbar-nav .nav-link {
text-align: center;
display: table-cell;
height: 70px;
vertical-align: middle;
padding-top: 0;
padding-bottom: 0;
}
.navbar-icon-top.navbar-expand-lg .navbar-nav .nav-link > .fa {
display: block;
width: 48px;
margin: 2px auto 4px auto;
top: 0;
line-height: 24px;
}
.navbar-icon-top.navbar-expand-lg .navbar-nav .nav-link > .fa > .badge {
top: -7px;
}
}
@media (min-width: 1200px) {
.navbar-icon-top.navbar-expand-xl .navbar-nav .nav-link {
text-align: center;
display: table-cell;
height: 70px;
vertical-align: middle;
padding-top: 0;
padding-bottom: 0;
}
.navbar-icon-top.navbar-expand-xl .navbar-nav .nav-link > .fa {
display: block;
width: 48px;
margin: 2px auto 4px auto;
top: 0;
line-height: 24px;
}
.navbar-icon-top.navbar-expand-xl .navbar-nav .nav-link > .fa > .badge {
top: -7px;
}
}

29
Angular-UrbanBazaar/src/app/components/page-nav-bar/page-nav-bar.component.html

@ -0,0 +1,29 @@
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#">Urban Bazaar</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="/home">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item active">
<a class="nav-link" href="/profile"> Profile <span class="sr-only">(current)</span></a>
</li>
<!-- Dropdown -->
<!-- <li class="nav-item dropdown" dropdown>
<a dropdownToggle mdbWavesEffect type="button" class="nav-link dropdown-toggle waves-light" mdbWavesEffect>
Profile<span class="caret"></span></a>
<div *dropdownMenu class="dropdown-menu dropdown-menu-right dropdown dropdown-primary" role="menu">
<a class="dropdown-item waves-light" mdbWavesEffect href="#">My account</a>
<a class="dropdown-item waves-light" mdbWavesEffect href="#">Log out</a>
</div>
</li> -->
</ul>
</div>
</nav>

25
Angular-UrbanBazaar/src/app/components/page-nav-bar/page-nav-bar.component.spec.ts

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

31
Angular-UrbanBazaar/src/app/components/page-nav-bar/page-nav-bar.component.ts

@ -0,0 +1,31 @@
import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs';
import { ProductService } from 'src/app/services/product.service';
import { Product } from 'src/app/models/product';
import { Router } from '@angular/router';
import { UserService } from 'src/app/services/user.service';
@Component({
selector: 'app-page-nav-bar',
templateUrl: './page-nav-bar.component.html',
styleUrls: ['./page-nav-bar.component.css']
})
export class PageNavBarComponent implements OnInit {
searchValue: string = "";
products : Observable<Product[]>
constructor(private _productService : ProductService, private router: Router) { }
clickme() {
alert('searchValue: '+this.searchValue);
this.products = this._productService.searchProduct(this.searchValue);
this._productService.search = this.searchValue;
// this.router.navigate(["/search", {search: this.searchValue}]);
}
ngOnInit(): void {
}
}

0
Angular-UrbanBazaar/src/app/components/user-add/user-add.component.css

1
Angular-UrbanBazaar/src/app/components/user-add/user-add.component.html

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

25
Angular-UrbanBazaar/src/app/components/user-add/user-add.component.spec.ts

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

15
Angular-UrbanBazaar/src/app/components/user-add/user-add.component.ts

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

22
Angular-UrbanBazaar/src/app/components/user-profile-details/user-profile-details.component.css

@ -0,0 +1,22 @@
body {
padding-left: 10px;
color: #212121;
}
div {
padding: 24px 32px 0;
box-sizing: border-box;
margin: 0;
}
._3E8aIl {
background-color: #fff;
border-radius: 2px;
box-shadow: 0 2px 4px 0 rgba(0,0,0,.08);
}
._3X2gOt {
vertical-align: middle;
width: 50px;
height: 50px;
}

95
Angular-UrbanBazaar/src/app/components/user-profile-details/user-profile-details.component.html

@ -0,0 +1,95 @@
<!-- <p>user-profile-details works!</p>
<body>
<div>
<p>
Personal Information
<button class="btn" (click)="editUserName()">Edit</button> <br>
<input name="firstName" value="{{user.userfirstname}}" disabled=""> &nbsp;
<input name="lastName" value="{{user.userlastname}}" disabled="">
</p>
<p>
Email Address
<button class="btn" (click)="editEmail()">Edit</button>
<button class="btn" (click)="editPassword()">Change Password</button> <br>
<input name="firstName" value="{{user.useremail}}" disabled="">
</p>
<p>
Mobile Number
<button class="btn" (click)="editPhone()">Edit</button> <br>
<input type="number" name="firstName" value="{{user.userphone}}" disabled="">
</p>
<br>
<h4>FAQs</h4>
<b>What happens when I update my email address (or mobile number)?</b> <br>
Your login email id (or mobile number) changes, likewise. You'll receive all your account related communication on your updated email address (or mobile number). <br><br>
<b>When will my UrbanBazaar account be updated with the new email address (or mobile number)?</b> <br>
It happens as soon as you confirm the verification code sent to your email (or mobile) and save the changes. <br><br>
<b>What happens to my existing UrbanBazaar account when I update my email address (or mobile number)?</b> <br>
Updating your email address (or mobile number) doesn't invalidate your account. Your account remains fully functional.
You'll continue seeing your Order history, saved information and personal details. <br><br>
<b>Does my Seller account get affected when I update my email address?</b> <br>
UrbanBazaar has a 'single sign-on' policy.
Any changes will reflect in your Seller account also.
</div>
<br><br><br>
</body> -->
<body>
<!-- <div style="text-align:center;">
<a [routerLink]="['changepass']">Change Password</a> <br/>
<br/> -->
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button style="text-align:center;background-color:dimgray;"class="btn" (click)="enable()">Edit</button> <br>
<form #updateForm="ngForm" style="text-align:center;" (ngSubmit)="update(updateForm)">
Personal Information
<br/>
Name:&nbsp;&nbsp;
<input type="text" name="userfirstName" [(ngModel)]="user.userfirstname" value="{{user.userfirstname}}" [disabled]='toggleButton'> &nbsp;&nbsp;
<input type="text" name="userlastName"[(ngModel)]="user.userlastname" value="{{user.userlastname}}" [disabled]='toggleButton'>
<br/><br/>
Mobile Number:&nbsp;&nbsp;
<input type="number" name="userphone"[(ngModel)]="user.userphone" value="{{user.userphone}}" [disabled]='toggleButton'>
<br/><br/>
Address1:&nbsp;&nbsp;
<input type="text"name="useraddress"[(ngModel)]="user.useraddress" value="{{user.useraddress}}"[disabled]='toggleButton'>
<br/><br/>
Address2:&nbsp;&nbsp;
<input type="text"name="useraddress2"[(ngModel)]="user.useraddress2" value="{{user.useraddress2}}"[disabled]='toggleButton'>
<br/><br/>
City:&nbsp;&nbsp;
<input type="text"name="usercity"[(ngModel)]="user.usercity" value="{{user.usercity}}"[disabled]='toggleButton'>
<br/><br/>
State:&nbsp;&nbsp;
<input type="text"name="userstate" [(ngModel)]="user.userstate" value="{{user.userstate}}"[disabled]='toggleButton'>
<br/><br/>
Zip:&nbsp;&nbsp;
<input type="text"name="userzip" [(ngModel)]="user.userzip" value="{{user.userzip}}"[disabled]='toggleButton'>
<br/><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="submit" style="text-align:center;background-color:dimgray;"name="Save"/>
</form>
<br>
<h4>FAQs</h4>
<b>What happens when I update my email address (or mobile number)?</b> <br>
Your login email id (or mobile number) changes, likewise. You'll receive all your account related communication on your updated email address (or mobile number). <br><br>
<b>When will my UrbanBazaar account be updated with the new email address (or mobile number)?</b> <br>
It happens as soon as you confirm the verification code sent to your email (or mobile) and save the changes. <br><br>
<b>What happens to my existing UrbanBazaar account when I update my email address (or mobile number)?</b> <br>
Updating your email address (or mobile number) doesn't invalidate your account. Your account remains fully functional.
You'll continue seeing your Order history, saved information and personal details. <br><br>
<b>Does my Seller account get affected when I update my email address?</b> <br>
UrbanBazaar has a 'single sign-on' policy.
Any changes will reflect in your Seller account also.
<!-- </div> -->
<br><br><br>
</body>

25
Angular-UrbanBazaar/src/app/components/user-profile-details/user-profile-details.component.spec.ts

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

49
Angular-UrbanBazaar/src/app/components/user-profile-details/user-profile-details.component.ts

@ -0,0 +1,49 @@
import { Component, OnInit } from '@angular/core';
import { NgForm } from '@angular/forms';
import { Observable } from 'rxjs';
import { User } from 'src/app/models/user';
import { UserService } from 'src/app/services/user.service';
@Component({
selector: 'app-user-profile-details',
templateUrl: './user-profile-details.component.html',
styleUrls: ['./user-profile-details.component.css']
})
export class UserProfileDetailsComponent implements OnInit {
currentUser : Observable<User>;
user : User;
public toggleButton: boolean ;
// /isFormSubmitted : boolean;
constructor(private _userService : UserService) {
this.user=new User()
this.toggleButton=true
this.currentUser = this._userService.searchUser(this._userService.currentUser.userid);
this.currentUser.subscribe((userold: User)=> this.user = userold);
}
update(vendorForm : NgForm) {
if (vendorForm.invalid) {
return;
}
// this.isFormSubmitted=true;
this._userService.updateUser(this.user).subscribe(x => { })
alert("Record Updated")
}
enable(){
this.toggleButton = false
}
disable(){
this.toggleButton = true
}
ngOnInit(): void {
}
}

0
Angular-UrbanBazaar/src/app/components/user-search/user-search.component.css

1
Angular-UrbanBazaar/src/app/components/user-search/user-search.component.html

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

25
Angular-UrbanBazaar/src/app/components/user-search/user-search.component.spec.ts

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

15
Angular-UrbanBazaar/src/app/components/user-search/user-search.component.ts

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

3
Angular-UrbanBazaar/src/app/components/user-show/user-show.component.css

@ -0,0 +1,3 @@
body {
padding-left: 10px;
}

29
Angular-UrbanBazaar/src/app/components/user-show/user-show.component.html

@ -0,0 +1,29 @@
<p>user-show works!</p>
<body>
<h3>All User Details</h3>
<table class="table table-hover">
<tr>
<th>User Id</th>
<th>User Email</th>
<th>First Name</th>
<th>City</th>
<th>Zipcode</th>
<th>Phone</th>
<th>Address Line 1</th>
<th>Address Line 2</th>
</tr>
<tr *ngFor="let user of userList | async">
<td>{{user.userid}}</td>
<td>{{user.useremail}}</td>
<td>{{user.userfirstname}}</td>
<td>{{user.usercity}}</td>
<td>{{user.userzip}}</td>
<td>{{user.userphone}}</td>
<td>{{user.useraddress}}</td>
<td>{{user.useraddress2}}</td>
</tr>
</table>
</body>

25
Angular-UrbanBazaar/src/app/components/user-show/user-show.component.spec.ts

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

22
Angular-UrbanBazaar/src/app/components/user-show/user-show.component.ts

@ -0,0 +1,22 @@
import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs';
import { User } from 'src/app/models/user';
import { UserService } from 'src/app/services/user.service';
@Component({
selector: 'app-user-show',
templateUrl: './user-show.component.html',
styleUrls: ['./user-show.component.css']
})
export class UserShowComponent implements OnInit {
userList : Observable<User[]>;
constructor(private _userService : UserService) {
this.userList = this._userService.showAllUsers();
}
ngOnInit(): void {
}
}

7
Angular-UrbanBazaar/src/app/models/cart.spec.ts

@ -0,0 +1,7 @@
import { Cart } from './cart';
describe('Cart', () => {
it('should create an instance', () => {
expect(new Cart()).toBeTruthy();
});
});

10
Angular-UrbanBazaar/src/app/models/cart.ts

@ -0,0 +1,10 @@
export class Cart {
public cartid : number;
public userid : number;
public orderid : number;
public productname : string;
public productprice : number;
public quantity : number;
constructor() {}
}

7
Angular-UrbanBazaar/src/app/models/login.spec.ts

@ -0,0 +1,7 @@
import { Login } from './login';
describe('Login', () => {
it('should create an instance', () => {
expect(new Login()).toBeTruthy();
});
});

6
Angular-UrbanBazaar/src/app/models/login.ts

@ -0,0 +1,6 @@
export class Login {
public userfirstname : string;
public userpassword : string;
constructor() {}
}

7
Angular-UrbanBazaar/src/app/models/member-user.spec.ts

@ -0,0 +1,7 @@
import { MemberUser } from './member-user';
describe('MemberUser', () => {
it('should create an instance', () => {
expect(new MemberUser()).toBeTruthy();
});
});

10
Angular-UrbanBazaar/src/app/models/member-user.ts

@ -0,0 +1,10 @@
export class MemberUser {
public userid : number;
public memberid : number;
public membername : string;
public totalitems : number;
public memberphone : string;
public membertotalamount : number;
public memberdoornumber: number;
constructor() {}
}

7
Angular-UrbanBazaar/src/app/models/orders.spec.ts

@ -0,0 +1,7 @@
import { Orders } from './orders';
describe('Orders', () => {
it('should create an instance', () => {
expect(new Orders()).toBeTruthy();
});
});

21
Angular-UrbanBazaar/src/app/models/orders.ts

@ -0,0 +1,21 @@
export class Orders {
public orderid : number;
public orderuserid : number;
public orderamount : number;
public ordershipaddress : string;
public ordershipaddress2 : string;
public ordercity : string;
public orderzip : string;
public orderstate : string;
public ordercountry : string;
public orderphone : string;
public ordershippingcost : number;
public ordertax : number;
public orderemail : string;
public orderdate : Date;
public ordershipped : string;
public ordertrackingnumber : string;
constructor() {}
}

7
Angular-UrbanBazaar/src/app/models/product-category.spec.ts

@ -0,0 +1,7 @@
import { ProductCategory } from './product-category';
describe('ProductCategory', () => {
it('should create an instance', () => {
expect(new ProductCategory()).toBeTruthy();
});
});

7
Angular-UrbanBazaar/src/app/models/product-category.ts

@ -0,0 +1,7 @@
export class ProductCategory {
public categoryid : number;
public categoryname : string;
constructor() {}
}

7
Angular-UrbanBazaar/src/app/models/product.spec.ts

@ -0,0 +1,7 @@
import { Product } from './product';
describe('Product', () => {
it('should create an instance', () => {
expect(new Product()).toBeTruthy();
});
});

13
Angular-UrbanBazaar/src/app/models/product.ts

@ -0,0 +1,13 @@
export class Product {
public productid : number;
public productname : string;
public productprice : number;
public productweight : number;
public productshortdesc : string;
public productlongdesc : string;
public productimage : string;
public productcategoryid : number;
constructor() {}
}

7
Angular-UrbanBazaar/src/app/models/user.spec.ts

@ -0,0 +1,7 @@
import { User } from './user';
describe('User', () => {
it('should create an instance', () => {
expect(new User()).toBeTruthy();
});
});

15
Angular-UrbanBazaar/src/app/models/user.ts

@ -0,0 +1,15 @@
export class User {
public userid : number;
public useremail : string;
public userpassword : string;
public userfirstname : string;
public userlastname : string;
public usercity: string;
public userstate : string;
public userzip : string;
public userphone : string;
public useraddress : string;
public useraddress2 : string;
constructor() {}
}

16
Angular-UrbanBazaar/src/app/services/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();
});
});

78
Angular-UrbanBazaar/src/app/services/cart.service.ts

@ -0,0 +1,78 @@
import { HttpClient } from '@angular/common/http';
import { THIS_EXPR } from '@angular/compiler/src/output/output_ast';
import { Injectable } from '@angular/core';
import { BehaviorSubject, Observable } from 'rxjs';
import { Cart } from '../models/cart';
@Injectable({
providedIn: 'root'
})
export class CartService {
private _url : String = "http://localhost:4405/cart";
constructor(private _http : HttpClient) { }
// public showAllOrder():Observable<Cart[]>
// {
// return this._http.get<Cart[]>(this._url+"/showCart");
// }
public cartListItem: any=[]
public productList = new BehaviorSubject<any>([])
// public addOrder(cart:Cart)
// {
// this._http.post(this._url+"/addCart",cart)
// }
getProducts()
{
return this.productList.asObservable();
}
setProduct(product:any)
{
this.cartListItem.push(...product);
this.productList.next(product);
}
addtoCart(product:any)
{
this.cartListItem.push(product);
this.productList.next(this.cartListItem)
this.getTotalPrice();
// console.log(this.cartListItem);
}
getTotalPrice():number{
let grandTotal=0;
this.cartListItem.map((a:any)=>{
grandTotal+=a.productprice;
})
return grandTotal;
}
removeCartItem(product:any)
{
this.cartListItem.map((a:any,index:any)=>{
if(product.productid === a.productid)
{
this.cartListItem.splice(index,1);
}
})
this.productList.next(this.cartListItem);
}
removeAllCart()
{
this.cartListItem=[]
this.productList.next(this.cartListItem);
}
}

16
Angular-UrbanBazaar/src/app/services/member-user.service.spec.ts

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

64
Angular-UrbanBazaar/src/app/services/member-user.service.ts

@ -0,0 +1,64 @@
// import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { MemberUser } from '../models/member-user';
import 'rxjs/add/operator/map';
import { Http ,Response} from '@angular/http';
@Injectable({
providedIn: 'root'
})
export class MemberUserService {
private _url : String = "http://localhost:8008/user/";
constructor(private _http : Http) { }
// public showMembersByUser(id : number) : Observable<MemberUser[]> {
// return this._http.get<MemberUser[]>(this._url+"/showUserMembers/"+id);
// }
// public addMemberToUser(member : MemberUser) {
// this._http.post(this._url+"/addMember", member);
// }
showAllMemberUsers() : Observable<MemberUser[]> {
return this._http.get(this._url+"showAllMembers").map((res : Response) => res.json());
}
addMemberUser(member: MemberUser) : Observable<any> {
return this._http.post(this._url+"addMember/",member).map((res: Response)=> null);
}
searchMemberUser(memberid : number) : Observable<MemberUser> {
return this._http.get(this._url+"showAllMembers/" +memberid).map((res : Response) => res.json());
}
searchMembersbyUser(userid : number) : Observable<MemberUser[]> {
return this._http.get(this._url+"showUserMembers/" +userid).map((res : Response) => res.json());
}
deleteMemberUser(memberid : number) : Observable<any> {
return this._http.delete(this._url+"deleteMember/" +memberid).map((res : Response) => null);
}
updateMemberUser(member :MemberUser) : Observable<any> {
return this._http.put(this._url+"updateMember/",member).map((res: Response)=> null);
}
// private _url : String = "http://localhost:8001/user";
// constructor(private _http : HttpClient) { }
// public showMembersByUser(id : number) : Observable<MemberUser[]> {
// return this._http.get<MemberUser[]>(this._url+"/showUserMembers/"+id);
// }
// public addMemberToUser(member : MemberUser) {
// this._http.post(this._url+"/addMember", member);
// }
}

16
Angular-UrbanBazaar/src/app/services/orders.service.spec.ts

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

27
Angular-UrbanBazaar/src/app/services/orders.service.ts

@ -0,0 +1,27 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { Orders } from '../models/orders';
@Injectable({
providedIn: 'root'
})
export class OrdersService {
private _url : String = "http://localhost:8009/orders";
constructor(private _http : HttpClient) { }
public addOrder(order : Orders) {
this._http.post(this._url+"/addOrder", order);
}
public findOrder(id : number) : Observable<Orders> {
return this._http.get<Orders>(this._url+"/findOrder"+id);
}
public findOrdersByUser(id : number) : Observable<Orders[]> {
return this._http.get<Orders[]>(this._url+"/findOrdersByUser"+id);
}
}

16
Angular-UrbanBazaar/src/app/services/product-category.service.spec.ts

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

18
Angular-UrbanBazaar/src/app/services/product-category.service.ts

@ -0,0 +1,18 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { ProductCategory } from '../models/product-category';
@Injectable({
providedIn: 'root'
})
export class ProductCategoryService {
private _url : String = "http://localhost:8007/products";
constructor(private _http : HttpClient) { }
public showAllCategory() : Observable<ProductCategory[]> {
return this._http.get<ProductCategory[]>(this._url+"/showProductCategory");
}
}

16
Angular-UrbanBazaar/src/app/services/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();
});
});

27
Angular-UrbanBazaar/src/app/services/product.service.ts

@ -0,0 +1,27 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { Product } from '../models/product';
import {map} from 'rxjs/operators';
@Injectable({
providedIn: 'root'
})
export class ProductService {
private _url : String = "http://localhost:8007/products";
search : string;
constructor(private _http : HttpClient) { }
public showAllProduct(){
return this._http.get<any>(this._url+"/showAllProducts")
.pipe(map((res:any)=>{
return res;
}))
}
public searchProduct(name : string) : Observable<Product[]> {
return this._http.get<Product[]>(this._url+"/searchProduct/"+name);
}
}

16
Angular-UrbanBazaar/src/app/services/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();
});
});

81
Angular-UrbanBazaar/src/app/services/user.service.ts

@ -0,0 +1,81 @@
// import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Http,Response } from '@angular/http';
// import { Observable } from 'rxjs';
import { Login } from '../models/login';
import { User } from '../models/user';
import 'rxjs/add/operator/map';
import { Observable } from 'rxjs';
@Injectable({
providedIn: 'root'
})
export class UserService {
// private _url : string = "http://localhost:9000";
constructor(private _http : Http) { }
// public showAllUsers() : Observable<User[]> {
// return this._http.get<User[]>(this._url + "/showAllUsers");
// }
// public searchUser(id : number) : Observable<User> {
// return this._http.get<User>(this._url+"/findUserById/"+id);
// }
// public addUser(user : User) {
// this._http.post(this._url+"/addUser/", user);
currentUser:User
private _url:string ="http://localhost:8008/user/"
showAllUsers() : Observable<User[]> {
return this._http.get(this._url+"showAllUsers").map((res : Response) => res.json());
}
addUser(user: User) : Observable<any> {
return this._http.post(this._url+"addUser/",user).map((res: Response)=> null).pipe();
}
// loginUser (user:User):Observable<any>{
// return this._http.post("http://localhost:8006/user/login/",user).map((res: Response)=>null);
// }
searchUser(userid : number) : Observable<User> {
return this._http.get(this._url+"findUserById/" +userid).map((res : Response) => res.json());
}
updateUser(user : User) : Observable<any> {
return this._http.put(this._url+"update/",user).map((res: Response)=> null);
}
// findUserByUsername(name : string) : Observable<User> {
// return this._http.get("http://localhost:8006/user/findUserByName/"+name).map((res : Response) => res.json());
// }
public loginUser(user : Login) : Observable<string> {
return this._http.post(this._url+"login/",user).map((res: Response)=>null);
}
public findUserByUsername(name : string) : Observable<User> {
return this._http.get(this._url+"findUserByName/"+name).map((res : Response) => res.json());
}
// private _url : String = "http://localhost:8001/user";
// currentUser : User;
// constructor(private _http : HttpClient) { }
// public showAllUsers() : Observable<User[]> {
// return this._http.get<User[]>(this._url + "/showAllUsers");
// }
// public searchUser(id : number) : Observable<User> {
// return this._http.get<User>(this._url+"/findUserById/"+id);
// }
// public addUser(user : User) {
// this._http.post(this._url+"/addUser", user);
// }
}

0
Angular-UrbanBazaar/src/assets/.gitkeep

BIN
Angular-UrbanBazaar/src/assets/Images/Logo.png

Before After
Width: 200  |  Height: 200  |  Size: 8.3 KiB

BIN
Angular-UrbanBazaar/src/assets/Images/download.jpg

Before After
Width: 265  |  Height: 190  |  Size: 12 KiB

3
Angular-UrbanBazaar/src/environments/environment.prod.ts

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

16
Angular-UrbanBazaar/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
Angular-UrbanBazaar/src/favicon.ico

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

18
Angular-UrbanBazaar/src/index.html

@ -0,0 +1,18 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>AngularUrbanBazaar</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head>
<body class="mat-typography">
<app-root></app-root>
</body>
</html>

12
Angular-UrbanBazaar/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
Angular-UrbanBazaar/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
*/

4
Angular-UrbanBazaar/src/styles.css

@ -0,0 +1,4 @@
/* You can add global styles to this file, and also import other style files */
html, body { height: 100%; }
body { margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif; }

25
Angular-UrbanBazaar/src/test.ts

@ -0,0 +1,25 @@
// 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()
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);

15
Angular-UrbanBazaar/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"
]
}

31
Angular-UrbanBazaar/tsconfig.json

@ -0,0 +1,31 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"forceConsistentCasingInFileNames": true,
"strict": true,
"strictNullChecks": false,
"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
}
}

18
Angular-UrbanBazaar/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"
]
}

3
README.md

@ -0,0 +1,3 @@
# ub_m2
Urban Bazaar with proxy servers.

33
UB_CartServiceProxy/.gitignore

@ -0,0 +1,33 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/

117
UB_CartServiceProxy/.mvn/wrapper/MavenWrapperDownloader.java

@ -0,0 +1,117 @@
/*
* Copyright 2007-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.net.*;
import java.io.*;
import java.nio.channels.*;
import java.util.Properties;
public class MavenWrapperDownloader {
private static final String WRAPPER_VERSION = "0.5.6";
/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
* use instead of the default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
".mvn/wrapper/maven-wrapper.properties";
/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH =
".mvn/wrapper/maven-wrapper.jar";
/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
public static void main(String args[]) {
System.out.println("- Downloader started");
File baseDirectory = new File(args[0]);
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
String url = DEFAULT_DOWNLOAD_URL;
if(mavenWrapperPropertyFile.exists()) {
FileInputStream mavenWrapperPropertyFileInputStream = null;
try {
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
} catch (IOException e) {
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
} finally {
try {
if(mavenWrapperPropertyFileInputStream != null) {
mavenWrapperPropertyFileInputStream.close();
}
} catch (IOException e) {
// Ignore ...
}
}
}
System.out.println("- Downloading from: " + url);
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
if(!outputFile.getParentFile().exists()) {
if(!outputFile.getParentFile().mkdirs()) {
System.out.println(
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
}
}
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
try {
downloadFileFromURL(url, outputFile);
System.out.println("Done");
System.exit(0);
} catch (Throwable e) {
System.out.println("- Error downloading");
e.printStackTrace();
System.exit(1);
}
}
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
String username = System.getenv("MVNW_USERNAME");
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
}
URL website = new URL(urlString);
ReadableByteChannel rbc;
rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream(destination);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
rbc.close();
}
}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save