Commit b2cd0fb0 by Adarsh K

404

parent c945647f
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { InvalidComponent } from './';
const routes: Routes = [
{
path: '',
redirectTo: 'start/login',
pathMatch: 'full'
},
{
path: '404',
redirectTo: 'start/invalid',
pathMatch: 'full'
}
// {path: '**', redirectTo: '/start/login'}
];
......
......@@ -3,10 +3,11 @@
.login_inner{
text-align: center;
width:100%;
padding-top:3%;
padding-top:1%;
img{
margin-bottom: 20px;
margin-bottom:0px;
width:150px;
}
hr{
border:5px solid #f69d1b;
......@@ -18,11 +19,11 @@
padding-bottom: 10px;
font-weight: 600;
width: 65%;
padding-top: 3%;
padding-top: 2%;
margin: 0 auto;
}
.login_inner_content{
padding-top:35px;
padding-top:10px;
width:325px;
margin: 0 auto;
......@@ -78,7 +79,7 @@
.login_btn_bay{
width: 65%;
margin: 0 auto;
padding-top:5%;
padding-top:2%;
.login_btn{
background: #cd3d3d;
color: #fff;
......
......@@ -40,7 +40,7 @@ const ModuleRoutes: Routes = [
{ path: 'currency_add', component: CurrencyAddComponent},
{ path: 'currency_edit/:id', component: CurrencyEditComponent},
{ path: 'currency_list', component: CurrencyListComponent}
]
], data: {role: 1}
}
];
......
......@@ -54,8 +54,12 @@
</div>
<div class="col">
<div class="provider_data_content">
<p>flag</p>
<input class="provider_input" placeholder="" type="file" formControlName="flag" (change)="onFileChange($event)">
<p>Flag</p>
<input class="borderNone" placeholder="" type="file" formControlName="flag" (change)="onFileChange($event)">
</div>
<div class="s_error" *ngIf="!currencyForm.controls['flag'].valid && currencySubmit">
<div class="s_validation" *ngIf="currencyForm.controls['flag'].hasError('required')">{{error_msg.required}} </div>
......@@ -75,7 +79,7 @@
<div class="col">
<div class="provider_data_content">
<p>Forex amount Start From</p>
<p>Forex Amount Start From</p>
<input class="provider_input" placeholder="" type="number" formControlName="start_from">
</div>
<div class="s_error" *ngIf="!currencyForm.controls['start_from'].valid && currencySubmit">
......
......@@ -59,6 +59,29 @@
outline: none;
}
}
.provider_choose_btn{
width:150px;
display: inline-block;
background: #1a5c7c;
position: relative;
color: #fff;
height:40px;
border-radius: 20px;
text-align: center;
padding:8px;
input{
position: absolute;
top:0px;
bottom:0px;
left:0px;
right:0px;
border: 1px solid #b4b4b4;
}
}
.provider_pin{
border:1px solid #b4b4b4;
height:40px;
......
......@@ -53,11 +53,12 @@
</div>
</div>
<div class="col">
<img [src]="getImage()" width="100" height="100" *ngIf="image_url" />
<div class="provider_data_content">
<p>Flag</p>
<img [src]="getImage()" *ngIf="image_url" />
<div class="provider_choose_btn">
Choose Flag
<input class="" placeholder="" type="file" formControlName="flag" (change)="onFileChange($event)">
</div>
</div>
......@@ -79,7 +80,7 @@
<div class="col">
<div class="provider_data_content">
<p>Forex amount Start From</p>
<p>Forex Amount Start From</p>
<input class="provider_input" placeholder="" type="number" formControlName="start_from">
</div>
<div class="s_error" *ngIf="!currencyForm.controls['start_from'].valid && currencySubmit">
......
......@@ -59,9 +59,33 @@
outline: none;
}
}
img{
display: inline-block;
width: 40px;
height: 40px;
border-radius: 50%;
border:2px solid #b4b4b4;
object-fit: cover;
margin-right: 10px;
}
.provider_choose_btn{
width:150px;
display: inline-block;
background: #1a5c7c;
position: relative;
color: #fff;
height:40px;
border-radius: 20px;
text-align: center;
padding:8px;
input{
position: absolute;
top:0px;
bottom:0px;
left:0px;
right:0px;
border: 1px solid #b4b4b4;
opacity: 0;
}
}
......
......@@ -35,9 +35,9 @@
<thead>
<tr>
<th>Name</th>
<th>symbol</th>
<th>Symbol</th>
<th>Rate</th>
<th>Start from</th>
<th>Forex Start from</th>
<th class="textRight">
<button class="add" (click)="goToPage('checker/currency_add')">+</button>
</th>
......
......@@ -3,10 +3,11 @@
.login_inner{
text-align: center;
width:100%;
padding-top:3%;
padding-top:1%;
img{
margin-bottom: 20px;
margin-bottom:0px;
width:150px;
}
hr{
border:5px solid #f69d1b;
......@@ -18,11 +19,11 @@
padding-bottom: 10px;
font-weight: 600;
width: 65%;
padding-top: 3%;
padding-top: 2%;
margin: 0 auto;
}
.login_inner_content{
padding-top:35px;
padding-top:10px;
width:325px;
margin: 0 auto;
......@@ -78,7 +79,7 @@
.login_btn_bay{
width: 65%;
margin: 0 auto;
padding-top:5%;
padding-top:2%;
.login_btn{
background: #cd3d3d;
color: #fff;
......
......@@ -28,7 +28,7 @@ const ModuleRoutes: Routes = [
{ path: 'driveradd', component: AddDriverComponent },
{ path: 'driverlist', component: ListDriverComponent },
{ path: 'driveredit/:id', component: EditDriverComponent },
]
], data: {role: 3}
}
];
......
......@@ -55,7 +55,7 @@ export class EditproviderComponent implements OnInit {
}
cancelClick() {
this.router.navigate(['/checker/forex']);
this.router.navigate(['/delivery']);
}
editProcess() {
......
......@@ -3,10 +3,11 @@
.login_inner{
text-align: center;
width:100%;
padding-top:3%;
padding-top:1%;
img{
margin-bottom: 20px;
margin-bottom:0px;
width:150px;
}
hr{
border:5px solid #f69d1b;
......@@ -18,11 +19,11 @@
padding-bottom: 10px;
font-weight: 600;
width: 65%;
padding-top: 3%;
padding-top: 2%;
margin: 0 auto;
}
.login_inner_content{
padding-top:35px;
padding-top:10px;
width:325px;
margin: 0 auto;
......@@ -78,7 +79,7 @@
.login_btn_bay{
width: 65%;
margin: 0 auto;
padding-top:5%;
padding-top:2%;
.login_btn{
background: #cd3d3d;
color: #fff;
......
......@@ -14,7 +14,6 @@
<img src="assets/images/asset_logout.png">
Logout</button>
<img src="assets/images/asset_logo1.png">
<span (click)="goToPage('delivery/changepin')">Change PIN</span>
</div>
</div>
</header>
......@@ -41,7 +40,7 @@
<div class="col-md-4">
<div class="currency_div">
<ul *ngIf="currencyList">
<li *ngFor="let currency of avaliableList" (click)="currency_add(currency)">{{currency.name}}</li>
<li *ngFor="let currency of avaliableList" (click)="currency_add(currency)" [ngClass]="{active:CheckClass(currency.id, 'add')}">{{currency.name}}</li>
</ul>
</div>
</div>
......@@ -52,7 +51,7 @@
<div class="col-md-4">
<div class="currency_div">
<ul *ngIf="selectedList">
<li *ngFor="let currency of selectedList" (click)="currency_remove(currency)">{{currency.name}}</li>
<li *ngFor="let currency of selectedList" (click)="currency_remove(currency)" [ngClass]="{active:CheckClass(currency.id, 'remove')}">{{currency.name}}</li>
</ul>
</div>
</div>
......@@ -90,18 +89,17 @@
<input class="" type="number">
</div>
</div> -->
</form>
</div>
</div>
<div class="row" *ngIf="selectedList.length > 0">
<div class="col">
<div class="add_provider_btn_bay">
<button class="save_btn floatRight">Save</button>
<button class="cancel_btn floatRight" (click)="cancelClick()" type="button">Cancel</button>
<div class="clear"></div>
</div>
<div class="col">
<div class="add_provider_btn_bay textCenter">
<button class="save_btn ">Save</button>
<button class="cancel_btn" (click)="cancelClick()" type="button">Cancel</button>
<div class="clear"></div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
......
.provider_header{
background: #1a5c7c;
padding: 4px;
h4{
margin:0px;
color: #fff;
padding: 20px;
font-weight: 400;
font-size:20px;
}
span{
position: absolute;
bottom:-30px;
right:15px;
font-size: 14px;
cursor: pointer;
z-index: 999;
}
}
.provider_content{
width:100%;
......@@ -102,7 +82,6 @@
.add_provider_btn_bay{
width:100%;
padding-top:10%;
text-align: right;
.save_btn{
background: #cd3d3d;
color: #fff;
......
......@@ -112,12 +112,20 @@ export class CurrencyComponent implements OnInit {
}
currency_add(curr: any) {
this.buffer.push(curr);
if (!this.buffer.filter(function(elem) {
return elem.id === curr.id;
}).length) {
this.buffer.push(curr);
}
console.log(this.buffer);
}
currency_remove(curr: any) {
this.packet.push(curr);
if (!this.packet.filter(function(elem) {
return elem.id === curr.id;
}).length) {
this.packet.push(curr);
}
console.log(this.packet);
}
......@@ -224,6 +232,30 @@ export class CurrencyComponent implements OnInit {
this.router.navigate(['/forex']);
}
CheckClass(id, type: any) {
let state = false;
if (type === 'add') {
for (let i = 0, len = this.buffer.length; i < len; i++) {
console.log(this.buffer[i].id);
if (this.buffer[i].id === id) {
state = true;
}
}
return state;
}
if (type === 'remove') {
for (let i = 0, len = this.packet.length; i < len; i++) {
console.log(this.packet[i].id);
if (this.packet[i].id === id) {
state = true;
}
}
return state;
}
}
}
......@@ -82,7 +82,7 @@ export class EditproviderComponent implements OnInit {
}
cancelClick() {
this.router.navigate(['/checker/forex']);
this.router.navigate(['/forex']);
}
editProcess() {
......
......@@ -22,7 +22,7 @@ const ModuleRoutes: Routes = [{
{path: 'editprovider', component: EditproviderComponent},
{path: 'currency', component: CurrencyComponent },
{path: '', component: TransactionComponent }
]
], data: {role: 2}
}
];
......
......@@ -3,18 +3,23 @@ import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angul
import { Observable } from 'rxjs';
import { AuthService } from './auth.service';
import {Router} from '@angular/router';
import { WebService } from './web.service';
@Injectable({
providedIn: 'root'
})
export class AuthGuard implements CanActivate {
constructor(private auth: AuthService, private myRoute: Router) {
constructor(private auth: AuthService, private myRoute: Router, public service: WebService) {
}
canActivate(
next: ActivatedRouteSnapshot,
state: RouterStateSnapshot): Observable<boolean> | Promise<boolean> | boolean {
if (this.auth.isLoggednIn()) {
const userData = JSON.parse(this.service.getLocalStorageItem('userData'));
if (next.data.role !== userData.user_type) {
this.myRoute.navigate(['/404']);
}
return true;
} else {
this.myRoute.navigate(['/start/login']);
......
......@@ -3,7 +3,7 @@
.login_inner{
text-align: center;
width:100%;
padding-top:8%;
padding-top:5%;
img{
margin-bottom: 40px;
......
<div class="login_wrapper">
<div class="container">
<div class="row">
<div class="login_inner">
<img src="assets/images/asset_logo.png">
<hr>
<div class="login_inner_content">
Page not found. <span (click)="back_fun()" style="color: blue;cursor: pointer;">Back</span>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
.login_wrapper{
width:100%;
.login_inner{
text-align: center;
width:100%;
padding-top:5%;
img{
margin-bottom: 40px;
}
hr{
border:5px solid #f69d1b;
width: 65%;
margin: 0 auto;
}
.login_inner_content{
padding-top: 50px;
width:325px;
margin: 0 auto;
.login_row{
margin-bottom: 40px;
input{
width:100%;
height:50px;
border:none;
font-weight: 600;
font-size: 18px;
border-bottom: 2px solid #636363;
&::placeholder{
color: #454545;
font-weight: 600;
}
&:focus{
outline: none;
}
}
p{
font-weight: 600;
font-size: 18px;
color: #454545;
text-align: left;
margin:0px;
}
.login_pin{
width:100%;
text-align: left;
padding-top: 15px;
padding-bottom: 10%;
.log_pin{
border:1px solid #d8d8d8;
display: inline-block;
width:30px;
border-radius:8px;
color: #cc3d3f;
font-size: 60px !important;
height: 60px;
text-align: center;
margin-right:8.5%;
&::placeholder{
color: #cc3d3f;
font-size:40px !important;
}
}
}
.login_btn{
background: #cd3d3d;
color: #fff;
border-radius: 10px;
height:40px;
border:none;
width: 60%;
&:hover{
outline: none;
}
&:focus{
outline:none;
}
}
h6{
cursor: pointer;
}
}
}
}
.translation{
border: 1px solid #d8d8d8;
height: 40px;
padding-left: 10px;
padding-right: 10px;
}
}
\ No newline at end of file
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { InvalidComponent } from './invalid.component';
describe('InvalidComponent', () => {
let component: InvalidComponent;
let fixture: ComponentFixture<InvalidComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ InvalidComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(InvalidComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
import {Location} from '@angular/common';
@Component({
selector: 'app-invalid',
templateUrl: './invalid.component.html',
styleUrls: ['./invalid.component.scss']
})
export class InvalidComponent implements OnInit {
constructor(public location: Location) { }
ngOnInit() {
}
back_fun() {
this.location.back();
}
}
......@@ -3,7 +3,7 @@
.login_inner{
text-align: center;
width:100%;
padding-top:8%;
padding-top:5%;
img{
margin-bottom: 40px;
......
......@@ -6,9 +6,10 @@ import { ForgotComponent } from './forgot/forgot.component';
import { moduleRouting } from './start.routing';
import { NewpinComponent } from './newpin/newpin.component';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { InvalidComponent } from './invalid/invalid.component';
@NgModule({
declarations: [IndexComponent, LoginComponent, ForgotComponent, NewpinComponent],
declarations: [IndexComponent, LoginComponent, ForgotComponent, NewpinComponent, InvalidComponent],
imports: [
CommonModule,
moduleRouting,
......
......@@ -12,10 +12,7 @@ import { IndexComponent } from './index/index.component';
import { LoginComponent } from './login/login.component';
import { ForgotComponent } from './forgot/forgot.component';
import { NewpinComponent } from './newpin/newpin.component';
import { InvalidComponent } from './invalid/invalid.component';
const ModuleRoutes: Routes = [
{
......@@ -33,6 +30,10 @@ const ModuleRoutes: Routes = [
{
path: "newpin",
component: NewpinComponent,
},
{
path: "invalid",
component: InvalidComponent,
}
]
}
......
......@@ -30,9 +30,15 @@
--------------------------------*/
@import url('https://fonts.googleapis.com/css?family=Roboto:100,100i,300,300i,400,400i,500,500i,700,700i,900,900i');
@font-face {
font-family:'MyriadPro';
src: url("./assets/fonts/MyriadProRegular.ttf");
}
* {
font-family: 'Roboto', sans-serif;
font-family:'MyriadPro';
-webkit-font-smoothing: antialiased;
}
......@@ -56,7 +62,7 @@ input[type=number]::-webkit-outer-spin-button {
html,
body {
font-family: 'Lato', sans-serif !important;
font-family:'MyriadPro' !important;
margin:0px;
}
......@@ -711,13 +717,51 @@ section.module.parallax {
.provider_content{
.provider_inner_content{
table{
thead{
tr{
th{
padding:15px !important;
text-align: center !important;
}
}
}
tbody{
tr{
td{
padding-left: 25px;
padding:10px !important;
text-align: center !important;
}
}
}
}
}
}
.provider_header{
background: #1a5c7c;
padding: 4px;
h4{
margin:0px;
color: #fff;
padding: 20px;
font-weight: 400;
font-size:20px;
}
span{
position: absolute;
bottom:-40px !important;
right:15px;
font-size: 14px;
cursor: pointer;
z-index: 999;
}
}
.delivery_provider_content{
width:90% !important;
margin:0 auto;
}
\ No newline at end of file
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