Commit a9417761 authored by prumde's avatar prumde

Updated


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@174270 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 6cb16f83
......@@ -70,7 +70,7 @@ import { HostUrlService } from './host-url.service';
import reducer from './ecm-store/reducers';
import {CartActions, CategoryActions, SubCategoryActions, ItemActions, LocationActions, WishListActions, MenuActions,ProfileActions, AdressAction, ReviewAction, SavedCardAction} from './ecm-store/actions';
import {CartEffects, CategoryEffects, SubCategoryEffects, ItemEffects, WishlistEffects, MenuEffects,ProfileEffects, AddressEffects, ReviewsEffects, SavedCardEffects} from './ecm-store/effects';
import { EcmPanelComponent, ECMDialog } from './ecm-view/ecm-panel/ecm-panel.component';
import { EcmPanelComponent } from './ecm-view/ecm-panel/ecm-panel.component';
import { UserProfileComponent, ProfileEditor, ProfileScreenComponent } from './user-profile';
import { UserAddressComponent, AddressEditor, AddressScreenComponent } from './user-address';
......@@ -146,7 +146,6 @@ const appRoutes: Routes = [
RatingComponent,
EcmWishListComponent,
EcmPanelComponent,
ECMDialog,
UserProfileComponent,
UserAddressComponent,
UserCardComponent,
......@@ -221,8 +220,8 @@ const appRoutes: Routes = [
EcmHandicraftComponent,
EcmCelebrationComponent,
EcmTrainingComponent,
ECMConfirmDialog,
ECMDialog
ECMConfirmDialog
],
schemas:[CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA],
bootstrap: [AppComponent]
......
......@@ -258,6 +258,7 @@ md-card {
color: #fff;
font-weight: 700;
margin: 0 12px;
margin-left: 0px;
}
.save-button {
......@@ -412,6 +413,7 @@ md-card {
box-shadow: 0 3px 1px -2px rgba(0,0,0,.2), 0 2px 2px 0 rgba(0,0,0,.14), 0 1px 5px 0 rgba(0,0,0,.12);
background: white;
margin: 10px;
height: 50px;
}
.mat-vertical-content-container.mat-stepper-vertical-line::BEFORE {
......@@ -444,9 +446,17 @@ md-card {
.cod-order {
padding-left: 45px;
}
.email-data {
padding-left: 200px;
/* margin-left: 232px; */
color: rgba(68, 61, 61, 0.88);
font-size: 15px;
}
.mat-vertical-content-container {
display: none !important;
}
......
......@@ -5,17 +5,18 @@
<div class="medium-8 columns">
<md-vertical-stepper #stepper [linear]="true">
<md-vertical-stepper #stepper >
<md-step [stepControl]="loginFormGroup">
<ng-template mdStepLabel class="panel-selected">
Login
Login <span *ngIf="userData" class = "email-data"> {{userData?.EMAIL_ID}}</span>
</ng-template>
<ng-container *ngTemplateOutlet="loginPage"></ng-container>
<div>
<button style="float: right;margin: 10px;" md-button mdStepperNext>Next</button>
</div>
<!-- <button style="float: right;margin: 10px;" md-button mdStepperNext>Next</button>-->
<form [formGroup]="loginFormGroup">
<input required type="hidden" formControlName="userData" [(ngModel)]="userData">
</form>
</md-step>
<md-step [stepControl]="addressFormGroup">
......@@ -99,24 +100,11 @@
</div>
<ng-template #loginPage>
<form [formGroup]="loginFormGroup">
<div class="username-field">
<md-form-field>
<input mdInput required formControlName="username" id="username" name="username" [placeholder]="'User Name'" [required]="true" type="text">
</md-form-field>
</div>
<div class="password-field">
<md-form-field>
<input mdInput required formControlName="password" id="password" name="password" [placeholder]="'Password'" [required]="true" type="text">
</md-form-field>
</div>
<button md-button class="login-button">
Login
</button>
</form>
<ng-template #loginPage >
<button *ngIf = "!userData" md-button class="login-button" (click)="userAction();">
Login to continue
</button>
</ng-template>
<ng-template #reviewOrder>
......@@ -234,4 +222,6 @@
</button>
</ng-template>
<ecm-panel #ecmPanel>
</ecm-panel>
import { Component, OnInit, ViewChild, ElementRef, Input, Output, EventEmitter } from '@angular/core';
import { Component, OnInit, ViewChild, ElementRef, Input, Output, EventEmitter ,DoCheck ,AfterViewInit, AfterViewChecked} from '@angular/core';
import { FormBuilder, Validators,NgForm,NgModel,FormGroup } from '@angular/forms';
import { ItemDetail } from '../../ecm-model/product-detail-model';
import { Observable } from 'rxjs/Observable';
......@@ -18,6 +18,7 @@ import { Address } from '../../user-address/address-manager/address.model';
import { Item } from '../../ecm-model/product-model';
import { CardScreenComponent } from '../../user-card/card-manager/card-screen/card-screen.component';
import { AddressScreenComponent } from '../../user-address/address-manager/address-screen/address-screen.component';
import { EcmPanelComponent } from '../ecm-panel/ecm-panel.component';
@Component( {
selector: 'ecm-checkout',
......@@ -26,7 +27,7 @@ import { AddressScreenComponent } from '../../user-address/address-manager/addre
providers:[EcmCheckoutService]
})
export class EcmCheckoutComponent implements OnInit {
export class EcmCheckoutComponent implements OnInit ,DoCheck {
@ViewChild('userForm') currentForm: NgForm;
@Input() unAuthorized: boolean = false;
......@@ -39,6 +40,9 @@ export class EcmCheckoutComponent implements OnInit {
@ViewChild( 'cardScreen' ) child: CardScreenComponent;
@ViewChild('addrAddScreen') addScreen: AddressScreenComponent;
@ViewChild('stepper') stepper: MatVerticalStepper;
@ViewChild( 'ecmPanel' ) ecmPanel: EcmPanelComponent;
redirect : boolean = false;
cardList;
newCard: Card = new Card();
selectedPaymntOpt;
......@@ -61,6 +65,8 @@ export class EcmCheckoutComponent implements OnInit {
}
ngOnInit() {
this.store.dispatch(this.addressActions.loadAddress());
this.store.dispatch(this.cardActions.loadSavedCards());
window.scrollTo(0,0);
this.createUserData();
this.getCartItems();
......@@ -84,12 +90,12 @@ export class EcmCheckoutComponent implements OnInit {
this.stepper.selectionChange.subscribe(
selected => {
this.selectedStep = selected;
console.log("selected step",selected);
}
);
this.loginFormGroup = this._formBuilder.group({
username: ['', Validators.required],
password: ['', Validators.required]
userData: ['', Validators.required]
});
this.addressFormGroup = this._formBuilder.group({
address: ['', Validators.required]
......@@ -220,7 +226,9 @@ export class EcmCheckoutComponent implements OnInit {
if ( userInfo !== 'undefined' && userInfo !== null && userInfo !== 'null' )
{
this.userData = JSON.parse( userInfo );
this.selectedStep = 1;
this.store.dispatch(this.addressActions.loadAddress());
this.store.dispatch(this.cardActions.loadSavedCards());
}
else
{
......@@ -229,26 +237,6 @@ export class EcmCheckoutComponent implements OnInit {
console.log( 'ECMHeaderComponent getUserInfo ::' + userInfo + ' \n this.userData :: ' + this.userData );
}
step;
setStep(index: number) {
this.step = index;
}
resetStep(index: number){
if(this.step == index){
this.step = undefined;
}
}
checkStep(index: number){
if(index == this.step){
return true;
}else {
return false;
}
}
onAddNew(address: Address)
{
let lineNo = this.getMaxLineNo();
......@@ -275,7 +263,53 @@ export class EcmCheckoutComponent implements OnInit {
console.log('maxLineno--',maxLineNo);
return maxLineNo + 1;
}
userAction() {
//show overlay with user-option
if ( this.userData )
{
this.ecmPanel.open({ type: 'overlay', option: 'USER_OPT', top:'0px', left: '0px', width:'100%', height: '100%' });
}
else
{
this.ecmPanel.open({ type: 'overlay', option: 'SIGNIN_OPT', top:'0px', left: '0px', width:'100%', height: '100%' });
}
if ( this.userData )
{
//show sidepanel with user-option
this.ecmPanel.open({ type: 'inplace', option: 'USER_OPT', top:'65px', left: '', right: '20px', width:'300px', height: '400px' });
}
else
{
//show overlay with sign-in-option
this.ecmPanel.open({ type: 'overlay', option: 'SIGNIN_OPT', top:'100px', left: 'calc( 50% - 375px / 2 )', width:'375px', height: '535px' });
}
}
ngDoCheck()
{
console.log("Checking ecm-checkout" ,this.redirect,this.userData ,this.stepper);
//already logged in
if( this.userData && !this.redirect)
{
console.log('stepper--',this.stepper._steps,this.stepper.selectedIndex);
if(this.stepper._steps && this.stepper.selectedIndex == 0)
{
this.stepper.next();
console.log('stepper-- ATFER SET',this.stepper , this.stepper.selectedIndex);
this.redirect = true;
}
}
//already not logged in
else if(!this.userData){
this.createUserData();
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment