Compare commits

...

8 Commits

80 changed files with 13900 additions and 0 deletions
Split View
  1. 17
      Angular-UrbanBazaar/.browserslistrc
  2. 16
      Angular-UrbanBazaar/.editorconfig
  3. 45
      Angular-UrbanBazaar/.gitignore
  4. 27
      Angular-UrbanBazaar/README.md
  5. 106
      Angular-UrbanBazaar/angular.json
  6. 44
      Angular-UrbanBazaar/karma.conf.js
  7. 12142
      Angular-UrbanBazaar/package-lock.json
  8. 41
      Angular-UrbanBazaar/package.json
  9. 15
      Angular-UrbanBazaar/src/app/app-routing.module.ts
  10. 0
      Angular-UrbanBazaar/src/app/app.component.css
  11. 5
      Angular-UrbanBazaar/src/app/app.component.html
  12. 35
      Angular-UrbanBazaar/src/app/app.component.spec.ts
  13. 10
      Angular-UrbanBazaar/src/app/app.component.ts
  14. 46
      Angular-UrbanBazaar/src/app/app.module.ts
  15. 0
      Angular-UrbanBazaar/src/app/components/login/login.component.css
  16. 33
      Angular-UrbanBazaar/src/app/components/login/login.component.html
  17. 25
      Angular-UrbanBazaar/src/app/components/login/login.component.spec.ts
  18. 35
      Angular-UrbanBazaar/src/app/components/login/login.component.ts
  19. 99
      Angular-UrbanBazaar/src/app/components/page-nav-bar/page-nav-bar.component.css
  20. 72
      Angular-UrbanBazaar/src/app/components/page-nav-bar/page-nav-bar.component.html
  21. 25
      Angular-UrbanBazaar/src/app/components/page-nav-bar/page-nav-bar.component.spec.ts
  22. 15
      Angular-UrbanBazaar/src/app/components/page-nav-bar/page-nav-bar.component.ts
  23. 0
      Angular-UrbanBazaar/src/app/components/signup/signup.component.css
  24. 77
      Angular-UrbanBazaar/src/app/components/signup/signup.component.html
  25. 25
      Angular-UrbanBazaar/src/app/components/signup/signup.component.spec.ts
  26. 38
      Angular-UrbanBazaar/src/app/components/signup/signup.component.ts
  27. 0
      Angular-UrbanBazaar/src/app/components/user-add/user-add.component.css
  28. 1
      Angular-UrbanBazaar/src/app/components/user-add/user-add.component.html
  29. 25
      Angular-UrbanBazaar/src/app/components/user-add/user-add.component.spec.ts
  30. 15
      Angular-UrbanBazaar/src/app/components/user-add/user-add.component.ts
  31. 22
      Angular-UrbanBazaar/src/app/components/user-profile-details/user-profile-details.component.css
  32. 36
      Angular-UrbanBazaar/src/app/components/user-profile-details/user-profile-details.component.html
  33. 25
      Angular-UrbanBazaar/src/app/components/user-profile-details/user-profile-details.component.spec.ts
  34. 39
      Angular-UrbanBazaar/src/app/components/user-profile-details/user-profile-details.component.ts
  35. 0
      Angular-UrbanBazaar/src/app/components/user-search/user-search.component.css
  36. 1
      Angular-UrbanBazaar/src/app/components/user-search/user-search.component.html
  37. 25
      Angular-UrbanBazaar/src/app/components/user-search/user-search.component.spec.ts
  38. 15
      Angular-UrbanBazaar/src/app/components/user-search/user-search.component.ts
  39. 3
      Angular-UrbanBazaar/src/app/components/user-show/user-show.component.css
  40. 29
      Angular-UrbanBazaar/src/app/components/user-show/user-show.component.html
  41. 25
      Angular-UrbanBazaar/src/app/components/user-show/user-show.component.spec.ts
  42. 22
      Angular-UrbanBazaar/src/app/components/user-show/user-show.component.ts
  43. 7
      Angular-UrbanBazaar/src/app/models/member-user.spec.ts
  44. 10
      Angular-UrbanBazaar/src/app/models/member-user.ts
  45. 7
      Angular-UrbanBazaar/src/app/models/orders.spec.ts
  46. 21
      Angular-UrbanBazaar/src/app/models/orders.ts
  47. 7
      Angular-UrbanBazaar/src/app/models/product-category.spec.ts
  48. 7
      Angular-UrbanBazaar/src/app/models/product-category.ts
  49. 7
      Angular-UrbanBazaar/src/app/models/product.spec.ts
  50. 13
      Angular-UrbanBazaar/src/app/models/product.ts
  51. 7
      Angular-UrbanBazaar/src/app/models/user.spec.ts
  52. 15
      Angular-UrbanBazaar/src/app/models/user.ts
  53. 16
      Angular-UrbanBazaar/src/app/services/member-user.service.spec.ts
  54. 23
      Angular-UrbanBazaar/src/app/services/member-user.service.ts
  55. 16
      Angular-UrbanBazaar/src/app/services/orders.service.spec.ts
  56. 27
      Angular-UrbanBazaar/src/app/services/orders.service.ts
  57. 16
      Angular-UrbanBazaar/src/app/services/product-category.service.spec.ts
  58. 18
      Angular-UrbanBazaar/src/app/services/product-category.service.ts
  59. 16
      Angular-UrbanBazaar/src/app/services/product.service.spec.ts
  60. 22
      Angular-UrbanBazaar/src/app/services/product.service.ts
  61. 16
      Angular-UrbanBazaar/src/app/services/user.service.spec.ts
  62. 45
      Angular-UrbanBazaar/src/app/services/user.service.ts
  63. 0
      Angular-UrbanBazaar/src/assets/.gitkeep
  64. BIN
      Angular-UrbanBazaar/src/assets/Images/Logo.png
  65. 3
      Angular-UrbanBazaar/src/environments/environment.prod.ts
  66. 16
      Angular-UrbanBazaar/src/environments/environment.ts
  67. BIN
      Angular-UrbanBazaar/src/favicon.ico
  68. 14
      Angular-UrbanBazaar/src/index.html
  69. 12
      Angular-UrbanBazaar/src/main.ts
  70. 65
      Angular-UrbanBazaar/src/polyfills.ts
  71. 1
      Angular-UrbanBazaar/src/styles.css
  72. 25
      Angular-UrbanBazaar/src/test.ts
  73. 15
      Angular-UrbanBazaar/tsconfig.app.json
  74. 31
      Angular-UrbanBazaar/tsconfig.json
  75. 18
      Angular-UrbanBazaar/tsconfig.spec.json
  76. 1
      Spring-UrbanBazaar
  77. 3
      login/login.component.css
  78. 36
      login/login.component.html
  79. 25
      login/login.component.spec.ts
  80. 43
      login/login.component.ts

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.

106
Angular-UrbanBazaar/angular.json

@ -0,0 +1,106 @@
{
"$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": [
"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"
},
"development": {
"browserTarget": "Angular-UrbanBazaar:build:development"
}
},
"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": [
"src/styles.css"
],
"scripts": []
}
}
}
}
},
"defaultProject": "Angular-UrbanBazaar"
}

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
});
};

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

41
Angular-UrbanBazaar/package.json

@ -0,0 +1,41 @@
{
"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/common": "~12.1.1",
"@angular/compiler": "~12.1.1",
"@angular/core": "~12.1.1",
"@angular/forms": "~12.1.1",
"@angular/http": "^7.2.16",
"@angular/platform-browser": "~12.1.1",
"@angular/platform-browser-dynamic": "~12.1.1",
"@angular/router": "~12.1.1",
"rxjs": "~6.6.0",
"rxjs-compat": "^6.6.7",
"tslib": "^2.2.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "~12.1.1",
"@angular/cli": "^12.1.4",
"@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"
}
}

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

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

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

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

@ -0,0 +1,5 @@
<app-page-nav-bar></app-page-nav-bar>
<!-- <app-login></app-login> -->
<!-- <app-signup></app-signup> -->
<router-outlet></router-outlet>
<!-- <app-user-show></app-user-show> -->

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';
}

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

@ -0,0 +1,46 @@
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 { UserAddComponent } from './components/user-add/user-add.component';
import { UserProfileDetailsComponent } from './components/user-profile-details/user-profile-details.component';
import { PageNavBarComponent } from './components/page-nav-bar/page-nav-bar.component';
import { LoginComponent } from './components/login/login.component';
import { SignupComponent } from './components/signup/signup.component';
import { RouterModule, Routes } from '@angular/router';
import { HttpModule } from '@angular/http';
const appRoutes : Routes =
[
{path:'',component:LoginComponent},
{path:'login',component:LoginComponent},
{path:'signup',component:SignupComponent},
]
@NgModule({
declarations: [
AppComponent,
UserShowComponent,
UserAddComponent,
UserProfileDetailsComponent,
PageNavBarComponent,
LoginComponent,
SignupComponent,
],
imports: [
BrowserModule,
AppRoutingModule,
RouterModule.forRoot(appRoutes),
FormsModule,
HttpModule,
HttpClientModule,
ReactiveFormsModule,
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }

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

33
Angular-UrbanBazaar/src/app/components/login/login.component.html

@ -0,0 +1,33 @@
<h1 style="text-align:center;color:darkblue;">
Welcome to Urban Bazaar !!!
</h1>
<div style="text-align:center;"><img src="/assets/Images/Logo.png" alt="Logo"></div>
<p style="text-align:center;color:darkblue;">Kindly please login/signup to experience our service</p>
<form #loginForm="ngForm" (ngSubmit)="login(loginForm)" style="text-align:center;color:forestgreen">
User Name :
<input type="text" name="user.emailid" placeholder="EmailId"[(ngModel)]="emailid" required />
<br/><br/>
Password :
<input type="password" name="user.passWord"placeholder="Password" [(ngModel)]="passWord" required />
<br/><br/>
<!-- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -->
<input type="submit" value="Login" />
<div *ngIf="loginForm.submitted && !isFormSubmitted">
<p style="color:red">
Please Enter UserName and Password...
</p>
</div>
</form>
<p style="text-align:center;">OR</p>
<div style="text-align:center;">
<a [routerLink]="['signup']">SignUp</a>
</div>
<!-- ['/menu',{outlets: {'hexaware': ['first']}}] -->

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

35
Angular-UrbanBazaar/src/app/components/login/login.component.ts

@ -0,0 +1,35 @@
import { Component, OnInit } from '@angular/core';
import { NgForm } from '@angular/forms';
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 {
emailid: string;
passWord: String;
isFormSubmitted : boolean;
login(loginForm : NgForm) {
if (loginForm.invalid) {
return;
}
this.isFormSubmitted=true;
if (this.emailid=="sooraj@mail.com" && this.passWord=="1234") {
alert("Correct Credentials...");
} else {
alert("Invalid Credentials...")
}
}
constructor(private _userService:UserService) {
this.isFormSubmitted=false;
}
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;
}
}

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

@ -0,0 +1,72 @@
<!-- <p>page-nav-bar works!</p> -->
<nav class="navbar navbar-icon-top navbar-expand-lg navbar-dark bg-dark">
<a class="navbar-brand" href="#">Navbar</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="#">
<i class="fa fa-home"></i>
Home
<span class="sr-only">(current)</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">
<i class="fa fa-envelope-o">
<span class="badge badge-danger">11</span>
</i>
Link
</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">
<i class="fa fa-envelope-o">
<span class="badge badge-warning">11</span>
</i>
Disabled
</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-envelope-o">
<span class="badge badge-primary">11</span>
</i>
Dropdown
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</li>
</ul>
<ul class="navbar-nav ">
<li class="nav-item">
<a class="nav-link" href="#">
<i class="fa fa-bell">
<span class="badge badge-info">11</span>
</i>
Test
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">
<i class="fa fa-globe">
<span class="badge badge-success">11</span>
</i>
Test
</a>
</li>
</ul>
<form class="form-inline my-2 my-lg-0">
<input class="form-control mr-sm-2" type="text" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
</form>
</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();
});
});

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

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

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

77
Angular-UrbanBazaar/src/app/components/signup/signup.component.html

@ -0,0 +1,77 @@
<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 EmailId:
<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>

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

@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { SignupComponent } from './signup.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();
});
});

38
Angular-UrbanBazaar/src/app/components/signup/signup.component.ts

@ -0,0 +1,38 @@
import { Component, OnInit } from '@angular/core';
import { NgForm } from '@angular/forms';
import { User } from 'src/app/models/user';
import { UserService } from 'src/app/services/user.service';
@Component({
selector: 'app-signup',
templateUrl: './signup.component.html',
styleUrls: ['./signup.component.css']
})
export class SignupComponent implements OnInit {
user :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 => { alert("Signup Successful")
})
// .subscribe(x => {alert("Sign up Successfull")});
}
constructor(private _userservice:UserService) {
this.user=new User();
this.isFormSubmitted=false;
}
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;
}

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

@ -0,0 +1,36 @@
<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>

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();
});
});

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

@ -0,0 +1,39 @@
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-profile-details',
templateUrl: './user-profile-details.component.html',
styleUrls: ['./user-profile-details.component.css']
})
export class UserProfileDetailsComponent implements OnInit {
currentUser : Observable<User>;
user : User;
constructor(private _userService : UserService) {
// this.currentUser = this._userService.searchUser(100);
this.currentUser.subscribe((user: User)=> this.user = user);
}
public editUserName() {
alert("editUserName pressed !");
}
public editEmail() {
alert("editEmail pressed !");
}
public editPassword() {
alert("editPassword pressed !");
}
public editPhone() {
alert("editPhone pressed !");
}
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/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;
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/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();
});
});

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

@ -0,0 +1,23 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { MemberUser } from '../models/member-user';
@Injectable({
providedIn: 'root'
})
export class MemberUserService {
private _url : String = "http://localhost:9000";
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:9000";
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:9000";
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();
});
});

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

@ -0,0 +1,22 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { Product } from '../models/product';
@Injectable({
providedIn: 'root'
})
export class ProductService {
private _url : String = "http://localhost:9000";
constructor(private _http : HttpClient) { }
public showAllProduct() : Observable<Product[]> {
return this._http.get<Product[]>(this._url+"/showAllProducts");
}
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();
});
});

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

@ -0,0 +1,45 @@
// import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { User } from '../models/user';
import 'rxjs/add/operator/map';
import { Http ,Response} from '@angular/http';
import { HttpClient } from '@angular/common/http';
@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);
showAllUsers() : Observable<User[]> {
return this._http.get("http://localhost:9000/showAllUsers").map((res : Response) => res.json());
}
addUser(user: User) : Observable<any> {
return this._http.post("http://localhost:9000/addUser/",user).map((res: Response)=> null);
}
searchUser(userid : number) : Observable<User> {
return this._http.get("http://localhost:9000" +userid).map((res : Response) => res.json());
}
// updateUser(vendor : Vendor) : Observable<any> {
// return this._http.put("http://localhost:8282/vendor/vendorUpdate",vendor)
// .map((res: Response)=> null);
// }
}

0
Angular-UrbanBazaar/src/assets/.gitkeep

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

Before After
Width: 200  |  Height: 200  |  Size: 8.3 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 Width: 28  |  Height: 30  |  Size: 948 B

14
Angular-UrbanBazaar/src/index.html

@ -0,0 +1,14 @@
<!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">
</head>
<body>
<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
*/

1
Angular-UrbanBazaar/src/styles.css

@ -0,0 +1 @@
/* You can add global styles to this file, and also import other style files */

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"
]
}

1
Spring-UrbanBazaar

@ -0,0 +1 @@
Subproject commit 632a1a0d47f0ffb951fbb9af2c5d049eac08c172

3
login/login.component.css

@ -0,0 +1,3 @@
.descriptionModal{
background-image: url("/assets/Images/download.jpg");
}

36
login/login.component.html

@ -0,0 +1,36 @@
<h1 style="text-align:center;color:darkblue;">
Welcome to Urban Bazaar !!!
</h1>
<div style="text-align:center;"><img src="/assets/Images/Logo.png" alt="Logo"></div>
<p style="text-align:center;color:darkblue;">Kindly please login/signup to experience our service</p>
<form #loginForm="ngForm" (ngSubmit)="login(loginForm)" style="text-align:center;color:forestgreen">
User Name :
<input type="text" name="user.username" placeholder="User Name"[(ngModel)]="user.username" required #username="ngModel" />
<br/><br/>
Password :
<input type="password" name="user.userpassword"placeholder="Password" [(ngModel)]="user.userpassword" required #userpassword="ngModel" />
<br/><br/>
<!-- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -->
<input type="submit" value="Login" />
<div *ngIf="loginForm.submitted && !isFormSubmitted">
<p style="color:red">
Please Enter UserName and Password...
</p>
</div>
</form>
<p style="text-align:center;">OR</p>
<div style="text-align:center;">
<a [routerLink]="['signup']">SignUp</a>
</div>
<!-- <div style="text-align:center;">
<a [routerLink]="['user-profile-details']">EditProfile</a>
</div> -->

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

43
login/login.component.ts

@ -0,0 +1,43 @@
import { Component, OnInit } from '@angular/core';
import { NgForm } from '@angular/forms';
import { Router } from '@angular/router';
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 {
// logindata={ emailid: '',
// passWord: ''}
user:User
isFormSubmitted : boolean;
login(loginForm : NgForm) {
// console.log(this.logindata)
console.log(this.user)
if (loginForm.invalid) {
return;
}
// this.isFormSubmitted=true;
// this._userService.loginUser(this.user).subscribe(x => { alert("Signup Successful")})
if (this.user.username=="shawn@mail.com" && this.user.userpassword=="1234") {
alert("Correct Credentials...");
this._router.navigate(['home'])
} else {
alert("Invalid Credentials...")
}
}
constructor(private _userService:UserService,private _router:Router) {
this.user =new User()
this.isFormSubmitted=false;
}
ngOnInit(): void {
}
}
Loading…
Cancel
Save