master changes

This commit is contained in:
venbatechnologies@gmail.com 2018-09-21 18:56:13 +05:30
parent 554bd2639e
commit c9f63b7425
766 changed files with 3290 additions and 8866 deletions

2
README.md Normal file
View File

@ -0,0 +1,2 @@
# sparqsineedge

2
sineedge/angular.json → ng6-seed/angular.json Executable file → Normal file
View File

@ -43,8 +43,6 @@
"node_modules/sortablejs/Sortable.js",
"node_modules/chart.js/dist/Chart.bundle.min.js",
"src/assets/cropper/cropper.js"
]
},
"configurations": {

View File

0
sineedge/e2e/app.po.ts → ng6-seed/e2e/app.po.ts Executable file → Normal file
View File

View File

0
sineedge/karma.conf.js → ng6-seed/karma.conf.js Executable file → Normal file
View File

1864
sineedge/package-lock.json → ng6-seed/package-lock.json generated Executable file → Normal file

File diff suppressed because it is too large Load Diff

25
sineedge/package.json → ng6-seed/package.json Executable file → Normal file
View File

@ -18,21 +18,22 @@
"@angular/common": "^6.0.0-rc.5",
"@angular/compiler": "^6.0.0-rc.5",
"@angular/core": "^6.0.0-rc.5",
"@angular/flex-layout": "2.0.0-beta.10",
"@angular/flex-layout": "^6.0.0-beta.18",
"@angular/forms": "^6.0.0-rc.5",
"@angular/http": "^6.0.0-rc.5",
"@angular/material": "^6.0.0-rc.5",
"@angular/platform-browser": "^6.0.0-rc.5",
"@angular/platform-browser-dynamic": "^6.0.0-rc.5",
"@angular/router": "^6.0.0-rc.5",
"@ngx-translate/core": "^10.0.2",
"@ngx-translate/http-loader": "^3.0.1",
"@swimlane/ngx-charts": "^7.0.1",
"@swimlane/ngx-datatable": "11.1.5",
"@types/aws-sdk": "^2.7.0",
"amazon-cognito-identity-js": "^2.0.21",
"amazon-cognito-identity-js": "^2.0.27",
"angular-calendar": "0.23.3",
"angular-sortablejs": "^2.0.6",
"angular-tree-component": "6.1.0",
"aws-sdk": "^2.300.0",
"aws-sdk": "^2.318.0",
"chart.js": "2.6.0",
"core-js": "^2.5.5",
"d3": "^4.9.1",
@ -47,16 +48,14 @@
"ng2-charts": "1.6.0",
"ng2-dragula": "1.3.1",
"ng2-file-upload": "1.2.1",
"ng2-translate": "5.0.0",
"ng2-validation": "4.2.0",
"ngx-color-picker": "^4.0.3",
"ngx-mat-select-search": "^1.3.1",
"ngx-perfect-scrollbar": "5.0.0-7",
"node-sass": "^4.9.3",
"perfect-scrollbar": "^1.3.0",
"quill": "^1.2.0",
"rxjs": "^6.0.0-uncanny-rc.7",
"rxjs-compat": "^6.0.0-uncanny-rc.7",
"rxjs": "^6.3.1",
"rxjs-compat": "^6.3.1",
"screenfull": "^3.2.2",
"simple-line-icons": "^2.4.1",
"sortablejs": "^1.6.0",
@ -65,23 +64,23 @@
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.6.1",
"@angular/cli": "^6.1.5",
"@angular/cli": "^6.0.0-rc.5",
"@angular/compiler-cli": "^6.0.0-rc.5",
"@types/node": "~8.9.4",
"codelyzer": "~4.1.0",
"@types/jasmine": "2.5.52",
"@types/jquery": "3.2.0",
"@types/node": "^8.10.27",
"codelyzer": "~4.1.0",
"jasmine-core": "2.6.3",
"jasmine-spec-reporter": "4.1.0",
"karma": "1.7.0",
"karma-chrome-launcher": "2.1.1",
"karma-cli": "1.0.1",
"karma-coverage-istanbul-reporter": "1.3.0",
"karma-jasmine": "1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"karma-coverage-istanbul-reporter": "1.3.0",
"protractor": "5.1.2",
"ts-node": "~5.0.0",
"tslint": "~5.9.1",
"typescript": "2.7.2"
"typescript": "^2.7.2"
}
}

View File

View File

View File

@ -0,0 +1,165 @@
import { Injectable } from "@angular/core";
import {
AuthenticationDetails,
CognitoUserPool,
CognitoUser,
CognitoUserAttribute,
ICognitoUserAttributeData,
ISignUpResult,
CognitoUserSession
} from "amazon-cognito-identity-js";
import { Observable } from "rxjs/Observable";
import "rxjs/add/operator/map";
import * as AWS from "aws-sdk";
//environment
import { environment } from '../../environments/environment';
import { Http, Headers, RequestOptions } from '@angular/http';
import { HttpClient } from '@angular/common/http';
import 'rxjs/add/operator/map';
const sineedge_poolData = {
UserPoolId: "ap-south-1_y7dt3iEaX", //ap-south-1_qQ85yQZJO UserName :SPARQ_SINEEDGE_DEV
ClientId: "291qt4smn5pql6o8cc2hi201lj" // ClientName: SINEEDGE_DEV_WEB
};
const sineedgedev_poolData = {
UserPoolId: environment.UserPoolId, // UserName :SPARQ_SINEEDGE_DEV
ClientId: environment.ClientId// ClientName: SINEEDGE_DEV_WEB
}
const lender_poolData = {
UserPoolId: "ap-south-1_hFiGyr1Gw", // Username :SPARQ_LENDER_DEV
ClientId: "6egsdssf0i7h2o9mscqgqbn788" // ClientName:LENDER_DEV_WEB
};
const vendor_poolData = {
UserPoolId: "",
ClientId: ""
}
const sineedgeUserPool = new CognitoUserPool(sineedge_poolData);
const lenderUserPool = new CognitoUserPool(lender_poolData);
const sineedgedevUserpool = new CognitoUserPool(sineedgedev_poolData);
/**
* Identity PoolID
*/
const sineedgeIdentity = "ap-south-1:9a551eab-97cf-4991-b677-2f9bcd058961";//"ap-south-1:9a551eab-97cf-4991-b677-2f9bcd058961";
const lenderIdentity = "ap-south-1:ca22dabc-db59-4af5-9bb8-265f7ec95907";
const vendorIdenttiy = "";
// serviceProvider
const apiurl = "http://localhost/sineedge/sparqapi/api/";
const currentdate = new Date().toJSON().slice(0,19).replace('T',' ');
@Injectable({
providedIn: "root"
})
export class AwsService {
public static _REGION = environment.region;
mySecData: any;
cognitoUser: any;
jwttoken: any;
cognitousers: any;
localUserId:any = '';
constructor(public http: Http, public RequestOptions: RequestOptions) { }
/**
* Login Function
* @param authenticationData inside of(email and password for login user)
* By sriram
*/
dologin(authenticationData) {
//(authenticationData);
const authenticationDetails = new AuthenticationDetails(authenticationData);
let Newpassword = authenticationData.newpassword;
let attributesData = [];
const userData = {
Username: authenticationData.Username, // User email id
Pool: sineedgedevUserpool // user Pool ID
};
let cognitoUser = new CognitoUser(userData);
return Observable.create(observer => {
cognitoUser.authenticateUser(authenticationDetails, {
newPasswordRequired: (userAttributes, requiredAttributes) => { // new password set
cognitoUser.completeNewPasswordChallenge(
Newpassword,
attributesData,
{
onSuccess: function (result) {
observer.next(result);
observer.complete();
},
onFailure: function (err) {
//(err);
observer.error(err);
//LoginComponent.prototype.open();
}
}
);
},
onSuccess: function (result) { // success user login
// let accessToken = result.getAccessToken().getJwtToken();
////(result);
//window.localStorage.setItem('Currentuser', '1');
observer.next(result);
observer.complete();
},
onFailure: function (err) { // error user login
alert(err.message);
observer.error(err);
}
});
});
}
/**
* End of the login function
*/
/**
* User forget password
*/
userforgotpass(auth) {
////(auth);
const userData = {
Username: auth.Username,
Pool: sineedgedevUserpool
};
let cognitoUser = new CognitoUser(userData);
return Observable.create(observe => {
cognitoUser.forgotPassword({
onSuccess: function (data) {
// successfully initiated reset password request
//('CodeDeliveryData from forgotPassword: ' + data);
observe.next(data);
},
onFailure: function (err) {
alert(err.message || JSON.stringify(err));
},
//Optional automatic callback
inputVerificationCode: function (data) {
//('Code sent to: ' + data);
var verificationCode = prompt('Please input verification code ', '');
var newPassword = prompt('Enter new password ', '');
cognitoUser.confirmPassword(verificationCode, newPassword, {
onSuccess() {
//('Password confirmed!');
},
onFailure(err) {
//('Password not confirmed!');
}
});
}
});
});
}
/**
* End of the function
*/
}

View File

@ -0,0 +1,130 @@
import { Injectable } from '@angular/core';
import * as AWS from "aws-sdk";
import {
AuthenticationDetails,
CognitoUserPool,
CognitoUser,
CognitoUserAttribute,
ICognitoUserAttributeData,
ISignUpResult,
CognitoUserSession
} from "amazon-cognito-identity-js";
import { environment } from '../../environments/environment';
export interface Callback {
callback(): void;
callbackWithParam(result: any): void;
}
@Injectable({
providedIn: 'root'
})
export class CognitoService {
public static _REGION = environment.region;
public static _IDENTITY_POOL_ID = environment.identityPoolId;
public static _USER_POOL_ID = environment.UserPoolId;
public static _CLIENT_ID = environment.ClientId;
public static _POOL_DATA: any = {
UserPoolId: CognitoService._USER_POOL_ID,
ClientId: CognitoService._CLIENT_ID
};
public cognitoCreds: AWS.CognitoIdentityCredentials;
isloggin:boolean = false;
getUserPool() {
if (environment.cognito_idp_endpoint) {
CognitoService._POOL_DATA.endpoint = environment.cognito_idp_endpoint;
}
return new CognitoUserPool(CognitoService._POOL_DATA);
}
getCurrentUser() {
return this.getUserPool().getCurrentUser();
}
constructor() { }
// getAccessToken(callback: Callback): void {
// if (callback == null) {
// throw("CognitoUtil: callback in getAccessToken is null...returning");
// }
// if (this.getCurrentUser() != null) {
// this.getCurrentUser().getSession(function (err, session) {
// if (err) {
// console.log("CognitoUtil: Can't set the credentials:" + err);
// callback.callbackWithParam(null);
// }
// else {
// if (session.isValid()) {
// console.log("62");
// callback.callbackWithParam(session.getAccessToken().getJwtToken());
// }
// }
// });
// }
// else {
// callback.callbackWithParam(null);
// }
// }
getAccessToken(){
let jwttoken = '';
if (this.getCurrentUser() != null) {
//console.log(JSON.stringify(this.getCurrentUser()));
console.log('76 if');
this.getCurrentUser().getSession(function (err, session) {
if (err) {
console.log("CognitoUtil: Can't set the credentials:" + err);
jwttoken ='';
console.log('81 if')
}
else {
if (session.isValid()) {
console.log('85 else if');
jwttoken = session;
} else {
}
}
});
}
else {
console.log("else");
}
return jwttoken;
}
getToken():boolean {
let isloggin = false;
if (this.getCurrentUser() != null) {
//console.log(JSON.stringify(this.getCurrentUser()));
console.log('76 if');
this.getCurrentUser().getSession(function (err, session) {
if (err) {
console.log("CognitoUtil: Can't set the credentials:" + err);
isloggin = false;
console.log('81 if')
}
else {
if (session.isValid()) {
console.log('85 else if');
isloggin = true;
} else {
isloggin = false;
}
}
});
}
else {
console.log("else");
isloggin = false;
}
return isloggin;
}
}

View File

@ -0,0 +1,54 @@
// import { Injectable } from '@angular/core';
// import { Router, CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, CanActivateChild } from '@angular/router';
// import { Observable , of } from 'rxjs';
// @Injectable()
// export class AuthGuard implements CanActivate, CanActivateChild {
// constructor(private router: Router) { }
// canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
// if (localStorage.getItem('token') != null) {
// // this.router.navigate(['']);
// return true
// } else {
// this.router.navigate(['/login']);
// return false;
// }
// }
// canActivateChild(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean {
// if (this.loginService.loggedIn()) {
// let roles = route.data["role"] as Array<string>;
// console.log("dataRole: " +roles);
// if(roles.length > -1){
// var match = this.loginService.roleMatch(roles);
// if(match){
// // this.router.navigate(['./dashboard']);
// return this.loginService.loggedIn()
// }
// else {
// this.router.navigate(['./404']);
// return this.loginService.loggedIn();
// }
// } else {
// this.router.navigate(['/login']);
// return this.loginService.loggedIn();
// }
// } else {
// this.router.navigate(['/login']);
// return this.loginService.loggedIn();
// }
// }
// public getToken(): string {
// return localStorage.getItem('token');
// }
// public logOut() {
// localStorage.clear();
// if(localStorage.getItem('token') === null){
// this.router.navigate(['/login']);
// }
// }
// }

View File

@ -0,0 +1,52 @@
import { Injectable } from '@angular/core';
import {
HttpRequest,
HttpHandler,
HttpEvent,
HttpInterceptor,
HttpHeaders
} from '@angular/common/http';
// import { AuthGuard } from './auth.guard';
import { Observable, of } from 'rxjs';
import { Router } from '@angular/router';
import { catchError, map, tap } from 'rxjs/operators';
import { HttpErrorResponse } from "@angular/common/http";
import { CognitoService } from '../AwsService/cognito.service';
@Injectable()
export class TokenInterceptor implements HttpInterceptor{
constructor( private router: Router,public shared:CognitoService) {}
intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
// request = request.clone({
// setHeaders: {
// Authorization: `${this.auth.getToken()}`
// }
// });
let token:any = this.shared.getAccessToken() ||"";
console.log(token);
let requests = request.clone({
headers:new HttpHeaders({
'Authorization': 'sparqvenba2018',
'Token': token.getIdToken().getJwtToken()
})
});
return next.handle(requests).pipe(
catchError(this.handleError<any>('role', []))
)
}
private handleError<T> (operation = 'operation', result?: T) {
return (error: any): Observable<T> => {
if(error instanceof HttpErrorResponse){
console.error("Error: " + error.status);
if(error.status == 401 || error.status == 500){
localStorage.clear();
this.router.navigate(['/login']);
}
return of(result as T);
}
};
}
}

View File

@ -0,0 +1,3 @@
<h1>
{{title}}
</h1>

View File

@ -0,0 +1,16 @@
import { Component } from '@angular/core';
import { TranslateService} from '@ngx-translate/core';
@Component({
selector: 'app-root',
template: '<router-outlet></router-outlet>'
})
export class AppComponent {
constructor(translate: TranslateService) {
translate.addLangs(['en', 'fr']);
translate.setDefaultLang('en');
const browserLang: string = translate.getBrowserLang();
translate.use(browserLang.match(/en|fr/) ? browserLang : 'en');
}
}

View File

@ -3,17 +3,19 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { RouterModule } from '@angular/router';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { ReactiveFormsModule } from '@angular/forms';
import { Http } from '@angular/http';
import { HTTP_INTERCEPTORS } from '@angular/common/http';
import { HttpModule, Http } from '@angular/http';
import { HttpClientModule, HttpClient, HTTP_INTERCEPTORS} from '@angular/common/http';
import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar';
import { PERFECT_SCROLLBAR_CONFIG } from 'ngx-perfect-scrollbar';
import { PerfectScrollbarConfigInterface } from 'ngx-perfect-scrollbar';
import { TokenInterceptor } from './_guard/token.interceptor';
import { TranslateModule, TranslateLoader, TranslateStaticLoader } from 'ng2-translate/ng2-translate';
import {TranslateModule, TranslateLoader} from '@ngx-translate/core';
import {TranslateHttpLoader} from '@ngx-translate/http-loader';
import {TranslateService} from '@ngx-translate/core';
import { FlexLayoutModule } from '@angular/flex-layout';
import { DemoMaterialModule } from './shared/demo.module';
import {MatSidenavModule} from '@angular/material/sidenav';
import {MatInputModule} from '@angular/material/input';
@ -22,28 +24,24 @@ import {MatListModule} from '@angular/material/list';
import {MatMenuModule} from '@angular/material/menu';
import {MatToolbarModule} from '@angular/material/toolbar';
import {MatTabsModule} from '@angular/material/tabs';
import {MatTableModule} from '@angular/material';
import {MatCheckboxModule} from '@angular/material/checkbox';
import {MatProgressBarModule} from '@angular/material/progress-bar';
import {MatSelectModule} from '@angular/material/select';
import {MatCardModule} from '@angular/material/card';
import { HttpClientModule } from '@angular/common/http';
import { JazzDialogComponent } from './material/dialog/dialog.component';
import { NewPasswordDialog } from './session/login/login.component';
import { ForgotPass } from './session/login/login.component';
import { ChangePasswordDialog } from './user-pages/user-profile/user-profile.component';
import { AppRoutes } from './app.routing';
import { AppComponent } from './app.component';
import { AdminLayoutComponent } from './layouts/admin/admin-layout.component';
import { AuthLayoutComponent } from './layouts/auth/auth-layout.component';
import { SharedModule } from './shared/shared.module';
import { AwsService } from './AwsService/aws.service';
import { TokenInterceptor } from './_guard/token.interceptor';
export function HttpLoaderFactory(http: HttpClient) {
return new TranslateHttpLoader(http);
}
import { AwsService } from './aws.service';
import { SharedService } from './shared.service';
export function createTranslateLoader(http: Http) {
return new TranslateStaticLoader(http, './assets/i18n', '.json');
export function createTranslateLoader(http: HttpClient) {
return new TranslateHttpLoader(http, './assets/i18n/', '.json');
}
const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = {
@ -54,23 +52,15 @@ const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = {
declarations: [
AppComponent,
AdminLayoutComponent,
AuthLayoutComponent,
JazzDialogComponent,
NewPasswordDialog,ForgotPass,ChangePasswordDialog,
AuthLayoutComponent
],
imports: [
BrowserModule,
BrowserAnimationsModule,
SharedModule,
RouterModule.forRoot(AppRoutes,{
onSameUrlNavigation: 'reload'
}),
RouterModule.forRoot(AppRoutes),
FormsModule,
ReactiveFormsModule,
// HttpModule,
HttpClientModule,
HttpModule,
MatSidenavModule,
MatInputModule,
MatIconModule,
@ -83,29 +73,30 @@ const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = {
MatSelectModule,
MatCardModule,
DemoMaterialModule,
HttpClientModule,
TranslateModule.forRoot({
provide: TranslateLoader,
useFactory: (createTranslateLoader),
deps: [Http]
loader: {
provide: TranslateLoader,
useFactory: (createTranslateLoader),
deps: [HttpClient]
}
}),
FlexLayoutModule,
],
providers: [
AwsService,
TranslateService,
// {
// provide: [{PERFECT_SCROLLBAR_CONFIG,AwsService,SharedService, HTTP_INTERCEPTORS}],
// useValue: DEFAULT_PERFECT_SCROLLBAR_CONFIG,
// useClass:[{AwsService,SharedService,TokenInterceptor}],
// multi: true
// provide: PERFECT_SCROLLBAR_CONFIG,
// useValue: DEFAULT_PERFECT_SCROLLBAR_CONFIG
// },
SharedService,
{
provide:HTTP_INTERCEPTORS,
useClass: TokenInterceptor,
multi: true
}
],
entryComponents: [JazzDialogComponent, NewPasswordDialog,ForgotPass,ChangePasswordDialog],
entryComponents: [],
bootstrap: [AppComponent]
})
export class AppModule { }

View File

@ -2,7 +2,7 @@ import { Routes } from '@angular/router';
import { AdminLayoutComponent } from './layouts/admin/admin-layout.component';
import { AuthLayoutComponent } from './layouts/auth/auth-layout.component';
import { SharedService } from './shared.service';
export const AppRoutes: Routes = [{
path: '',
redirectTo: 'home',
@ -10,19 +10,12 @@ export const AppRoutes: Routes = [{
}, {
path: '',
component: AdminLayoutComponent,
canActivateChild: [SharedService],
children: [{
path: 'home',
loadChildren: './dashboard/dashboard.module#DashboardModule'
},{
path: 'user-pages',
loadChildren: './user-pages/users.module#UsersModule'
},{
path:'settings',
path:'setting',
loadChildren:'./settings/settings.module#SettingsModule'
},{
path:'pdtrigger',
loadChildren:'./pd-trigger/pd-trigger.module#PdTriggerModule'
}
]
}, {
@ -34,7 +27,7 @@ export const AppRoutes: Routes = [{
},{
path: 'error',
loadChildren: './error/error.module#ErrorModule'
}]
},]
}, {
path: '**',
redirectTo: 'session/404'

View File

@ -1,232 +1,232 @@
export const single = [
{
name: 'Germany',
value: 40632
},
{
name: 'USA',
value: 49737
},
{
name: 'France',
value: 36745
},
{
name: 'UK',
value: 36240
},
{
name: 'Spain',
value: 33000
},
{
name: 'Italy',
value: 35800
}
];
export const multi = [
{
name: 'Germany',
series: [
{
name: '2017',
value: 71632
},
{
name: '2010',
value: 40632
},
{
name: '2000',
value: 76953
},
{
name: '1990',
value: 31476
}
]
},
{
name: 'USA',
series: [
{
name: '2017',
value: 82632
},
{
name: '2010',
value: 49737
},
{
name: '2000',
value: 55986
},
{
name: '1990',
value: 37060
}
]
},
{
name: 'France',
series: [
{
name: '2017',
value: 51732
},
{
name: '2010',
value: 36745
},
{
name: '2000',
value: 34774
},
{
name: '1990',
value: 29476
}
]
},
{
name: 'UK',
series: [
{
name: '2017',
value: 95652
},
{
name: '2010',
value: 36240
},
{
name: '2000',
value: 32543
},
{
name: '1990',
value: 26424
}
]
}
];
export const bubble = [
{
name: 'Germany',
series: [
{
name: '2009',
x: new Date(2009, 0, 1),
y: 80.3,
r: 80.4
},
{
name: '2006',
x: new Date(2006, 0, 1),
y: 80.3,
r: 78
},
{
name: '1995',
x: new Date(1995, 0, 1),
y: 77.7,
r: 58.1
},
{
name: '1990',
x: new Date(1990, 0, 1),
y: 75.4,
r: 79
}
]
},
{
name: 'USA',
series: [
{
name: '2010',
x: new Date(2010, 0, 1),
y: 78.8,
r: 310
},
{
name: '2005',
x: new Date(2005, 0, 1),
y: 76.9,
r: 283
},
{
name: '1996',
x: new Date(1996, 0, 1),
y: 78.7,
r: 59.1
},
{
name: '1990',
x: new Date(1990, 0, 1),
y: 75.4,
r: 253
}
]
},
{
name: 'France',
series: [
{
name: '2008',
x: new Date(2008, 0, 1),
y: 81.4,
r: 63
},
{
name: '2000',
x: new Date(2000, 0, 1),
y: 79.1,
r: 59.4
},
{
name: '1994',
x: new Date(1994, 0, 1),
y: 76.7,
r: 58.1
},
{
name: '1990',
x: new Date(1990, 0, 1),
y: 77.2,
r: 56.9
}
]
},
{
name: 'UK',
series: [
{
name: '2007',
x: new Date(2007, 0, 1),
y: 80.2,
r: 62.7
},
{
name: '2003',
x: new Date(2003, 0, 1),
y: 77.8,
r: 58.9
},
{
name: '1995',
x: new Date(1995, 0, 1),
y: 78.7,
r: 59.1
},
{
name: '1990',
x: new Date(1990, 0, 1),
y: 75.7,
r: 57.1
}
]
}
export const single = [
{
name: 'Germany',
value: 40632
},
{
name: 'USA',
value: 49737
},
{
name: 'France',
value: 36745
},
{
name: 'UK',
value: 36240
},
{
name: 'Spain',
value: 33000
},
{
name: 'Italy',
value: 35800
}
];
export const multi = [
{
name: 'Germany',
series: [
{
name: '2017',
value: 71632
},
{
name: '2010',
value: 40632
},
{
name: '2000',
value: 76953
},
{
name: '1990',
value: 31476
}
]
},
{
name: 'USA',
series: [
{
name: '2017',
value: 82632
},
{
name: '2010',
value: 49737
},
{
name: '2000',
value: 55986
},
{
name: '1990',
value: 37060
}
]
},
{
name: 'France',
series: [
{
name: '2017',
value: 51732
},
{
name: '2010',
value: 36745
},
{
name: '2000',
value: 34774
},
{
name: '1990',
value: 29476
}
]
},
{
name: 'UK',
series: [
{
name: '2017',
value: 95652
},
{
name: '2010',
value: 36240
},
{
name: '2000',
value: 32543
},
{
name: '1990',
value: 26424
}
]
}
];
export const bubble = [
{
name: 'Germany',
series: [
{
name: '2009',
x: new Date(2009, 0, 1),
y: 80.3,
r: 80.4
},
{
name: '2006',
x: new Date(2006, 0, 1),
y: 80.3,
r: 78
},
{
name: '1995',
x: new Date(1995, 0, 1),
y: 77.7,
r: 58.1
},
{
name: '1990',
x: new Date(1990, 0, 1),
y: 75.4,
r: 79
}
]
},
{
name: 'USA',
series: [
{
name: '2010',
x: new Date(2010, 0, 1),
y: 78.8,
r: 310
},
{
name: '2005',
x: new Date(2005, 0, 1),
y: 76.9,
r: 283
},
{
name: '1996',
x: new Date(1996, 0, 1),
y: 78.7,
r: 59.1
},
{
name: '1990',
x: new Date(1990, 0, 1),
y: 75.4,
r: 253
}
]
},
{
name: 'France',
series: [
{
name: '2008',
x: new Date(2008, 0, 1),
y: 81.4,
r: 63
},
{
name: '2000',
x: new Date(2000, 0, 1),
y: 79.1,
r: 59.4
},
{
name: '1994',
x: new Date(1994, 0, 1),
y: 76.7,
r: 58.1
},
{
name: '1990',
x: new Date(1990, 0, 1),
y: 77.2,
r: 56.9
}
]
},
{
name: 'UK',
series: [
{
name: '2007',
x: new Date(2007, 0, 1),
y: 80.2,
r: 62.7
},
{
name: '2003',
x: new Date(2003, 0, 1),
y: 77.8,
r: 58.9
},
{
name: '1995',
x: new Date(1995, 0, 1),
y: 78.7,
r: 59.1
},
{
name: '1990',
x: new Date(1990, 0, 1),
y: 75.7,
r: 57.1
}
]
}
];

View File

@ -0,0 +1,5 @@
<div class="pad-wrap">
<p>
Dashboard!
</p>
</div>

View File

@ -0,0 +1,12 @@
import { Component } from '@angular/core';
@Component({
selector: 'app-dashboard',
templateUrl: './dashboard.component.html',
styleUrls: ['./dashboard.component.scss']
})
export class DashboardComponent {
constructor() {
}
}

View File

@ -1,17 +1,17 @@
<div class="relative">
<div class="form-bg">
<div class="relative error-wrapper">
<h1>
Oops!</h1>
<span class="error-text">404</span>
<h2>
Not Found</h2>
<div class="error-details">
<p> Sorry, an error has occured, Requested page not found!</p>
</div>
<div class="error-actions">
<button class="mat-blue" mat-raised-button>Take me to home</button>
</div>
</div>
</div>
<div class="relative">
<div class="form-bg">
<div class="relative error-wrapper">
<h1>
Oops!</h1>
<span class="error-text">404</span>
<h2>
Not Found</h2>
<div class="error-details">
<p> Sorry, an error has occured, Requested page not found!</p>
</div>
<div class="error-actions">
<button class="mat-blue" mat-raised-button>Take me to home</button>
</div>
</div>
</div>
</div>

View File

@ -1,17 +1,17 @@
<div class="relative">
<div class="form-bg">
<div class="relative error-wrapper">
<h1>
Error!</h1>
<span class="error-text">505</span>
<h2>
Service is currently unavailbale</h2>
<div class="error-details">
<p>Sorry, but the page you were trying to view does not exist</p>
</div>
<div class="error-actions">
<button class="mat-blue" mat-raised-button>Take me to home</button>
</div>
</div>
</div>
<div class="relative">
<div class="form-bg">
<div class="relative error-wrapper">
<h1>
Error!</h1>
<span class="error-text">505</span>
<h2>
Service is currently unavailbale</h2>
<div class="error-details">
<p>Sorry, but the page you were trying to view does not exist</p>
</div>
<div class="error-actions">
<button class="mat-blue" mat-raised-button>Take me to home</button>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,524 @@
<div class="app search-i" [dir]="layoutDir" [ngClass]="[ menuLayout, selectedSidebarImage, selectedSidebarColor, selectedHeaderColor, collapsedClass]" [class.app-dark]="dark" [class.boxed]="boxed" [class.collapsed-sidebar]="collapseSidebar" [class.compact-sidebar]="compactSidebar" [class.bg-img-disable]="!sidebarBg">
<mat-sidenav-container class="app-inner">
<mat-sidenav #sidemenu class="sidebar-panel" id="sidebar-panel" [mode]="isOver() ? 'over' : 'side'" [opened]="!isOver()" (mouseover)="menuMouseOver()" (mouseout)="menuMouseOut()">
<div class="opt-side relative ">
<div class="sidebar-container ">
<div class="branding text-center">
<h2><i class="fa fa-superpowers" aria-hidden="true"></i> <span> OPTIMA</span>
</h2>
</div>
<div class="main-nav">
<div class="user-pro-wrap">
<div class="user-profile-thumb text-center">
<div class="user-i">
<img src="assets/images/userpic.jpg" class="rad-full mb-1" width="100" height="100" alt="">
<div> <span>John Doe</span></div>
</div>
</div>
<div class="most-used text-center">
<a class="most-link" color="primary">
<mat-icon>home</mat-icon>
</a>
<a class="most-link" color="primary">
<mat-icon>person</mat-icon>
</a>
<a class="most-link" color="primary">
<mat-icon>settings</mat-icon>
</a>
</div>
</div>
<mat-nav-list appAccordion class="navigation relative">
<mat-list-item appAccordionLink *ngFor="let menuitem of menuItems.getAll()">
<a appAccordionToggle class="relative" mat-ripple [routerLink]="['/', menuitem.state]" *ngIf="menuitem.type === 'link'">
<mat-icon>{{ menuitem.icon }}</mat-icon>
<span>{{ menuitem.name | translate }}</span>
<span fxFlex></span>
<span class="menu-badge mat-{{ badge.type }}" *ngFor="let badge of menuitem.badge">{{ badge.value }}</span>
</a>
<a appAccordionToggle class="relative" mat-ripple href="{{menuitem.state}}" *ngIf="menuitem.type === 'extLink'">
<mat-icon>{{ menuitem.icon }}</mat-icon>
<span>{{ menuitem.name | translate }}</span>
<span fxFlex></span>
<span class="menu-badge mat-{{ badge.type }}" *ngFor="let badge of menuitem.badge">{{ badge.value }}</span>
</a>
<a appAccordionToggle class="relative" mat-ripple href="{{menuitem.state}}" target="_blank" *ngIf="menuitem.type === 'extTabLink'">
<mat-icon>{{ menuitem.icon }}</mat-icon>
<span>{{ menuitem.name | translate }}</span>
<span fxFlex></span>
<span class="menu-badge mat-{{ badge.type }}" *ngFor="let badge of menuitem.badge">{{ badge.value }}</span>
</a>
<a appAccordionToggle class="relative" mat-ripple href="javascript:;" *ngIf="menuitem.type === 'sub'">
<mat-icon>{{ menuitem.icon }}</mat-icon>
<span>{{ menuitem.name | translate }}</span>
<span fxFlex></span>
<span class="menu-badge mat-{{ badge.type }}" *ngFor="let badge of menuitem.badge">{{ badge.value }}</span>
<mat-icon class="menu-caret">arrow_drop_down</mat-icon>
</a>
<mat-nav-list class="sub-menu" *ngIf="menuitem.type === 'sub'">
<mat-list-item *ngFor="let childitem of menuitem.children" routerLinkActive="open">
<a [routerLink]="['/', menuitem.state, childitem.state ]" class="relative" mat-ripple>{{ childitem.name | translate }}</a>
</mat-list-item>
</mat-nav-list>
</mat-list-item>
<mat-divider></mat-divider>
<!-- <mat-list-item>
<a (click)="addMenuItem()">
<mat-icon>add</mat-icon>
<span>Add</span>
</a>
</mat-list-item> -->
</mat-nav-list>
</div>
</div>
</div>
<div class="bg-overlay"></div>
</mat-sidenav>
<mat-toolbar class="main-header">
<div class="horizontal-top-bar w-100">
<div fxFlex.sm="100" fxFlex.xs="100" fxFlex.md="33.33" fxFlex.lg="33.33" fxFlex.xl="33.33" fxFlex="100">
<div class="search-bar" fxFlex>
<form class="search-form">
<mat-icon>search</mat-icon>
<input type="text" placeholder="Search" autofocus="true" />
</form>
</div>
</div>
<div fxFlex.sm="100" fxFlex.xs="100" fxFlex.md="33.33" fxFlex.lg="33.33" fxFlex.xl="33.33" fxFlex="100">
<div class="horizontal-logo">
<div class="branding text-center">
<h2><i class="fa fa-superpowers" aria-hidden="true"></i> <span> OPTIMA</span>
</h2>
</div>
</div>
</div>
<div fxFlex.sm="100" fxFlex.xs="100" fxFlex.md="33.33" fxFlex.lg="33.33" fxFlex.xl="33.33" fxFlex="100">
<div class="menu-links">
<button appToggleFullscreen mat-icon-button>
<mat-icon>fullscreen</mat-icon>
</button>
<button [mat-menu-trigger-for]="user2" mat-icon-button class="ml-xs overflow-visible">
<mat-icon>message</mat-icon>
</button>
<mat-menu #user2="matMenu" class="opt-menu" x-position="after">
<div mat-menu-item class="head-menu grad-blue">
Message Menu
</div>
<button mat-menu-item>
<img width="40" src="assets/images/user-1.jpg" alt="">
Next Update for angular 5
</button>
<button mat-menu-item>
<img width="40" src="assets/images/user-2.jpg" alt="">
Check out our new admin theme
</button>
<button mat-menu-item>
<img width="40" src="assets/images/user-3.jpg" alt="">
Expedita quo, laboriosam officia.
</button>
<button mat-menu-item>
<img width="40" src="assets/images/user-4.jpg" alt="">
Lorem ipsum dolor sit amet consectetur.
</button>
</mat-menu>
<button [mat-menu-trigger-for]="user1" mat-icon-button class="ml-xs overflow-visible">
<mat-icon>reorder</mat-icon>
<span class="notification-label">3</span>
</button>
<mat-menu #user1="matMenu" class="opt-menu" x-position="before">
<div mat-menu-item class="head-menu grad-blue">
User Menu
</div>
<button mat-menu-item>
<mat-icon>show_chart</mat-icon>
Charts
</button>
<button mat-menu-item>
<mat-icon>navigation</mat-icon>
Maps
</button>
<button mat-menu-item>
<mat-icon>web</mat-icon>
Calendar Settings
</button>
</mat-menu>
<button (click)="end.toggle()" mat-icon-button class="ml-xs overflow-visible">
<mat-icon>notifications</mat-icon>
<span class="notification-label">2</span>
</button>
<button [mat-menu-trigger-for]="user" mat-icon-button class="ml-xs">
<mat-icon>person</mat-icon>
</button>
<mat-menu #user="matMenu" class="opt-menu" x-position="before">
<div mat-menu-item class="head-menu grad-blue">
Settings
</div>
<button mat-menu-item>
<mat-icon>settings</mat-icon>
Setting
</button>
<button mat-menu-item>
<mat-icon>account_box</mat-icon>
Profile
</button>
<button mat-menu-item>
<mat-icon>notifications_off</mat-icon>
Disable notifications
</button>
<button mat-menu-item>
<mat-icon>exit_to_app</mat-icon>
Sign Out
</button>
</mat-menu>
</div>
</div>
</div>
<div class="vertical-menu w-100">
<button (click)="menuToggleFunc()" mat-icon-button class="lines-btn">
<mat-icon>menu</mat-icon>
</button>
<div class="search-bar" fxFlex>
<form class="search-form" fxShow="false" fxShow.gt-xs>
<mat-icon>search</mat-icon>
<input type="text" placeholder="Search" autofocus="true" />
</form>
</div>
<span fxFlex></span>
<button appToggleFullscreen mat-icon-button>
<mat-icon>fullscreen</mat-icon>
</button>
<button [mat-menu-trigger-for]="user2" mat-icon-button class="ml-xs overflow-visible">
<mat-icon>message</mat-icon>
</button>
<mat-menu #user2="matMenu" class="opt-menu" x-position="after">
<div mat-menu-item class="head-menu grad-blue">
Message Menu
</div>
<button mat-menu-item>
<img width="40" src="assets/images/user-1.jpg" alt="">
Next Update for angular 5
</button>
<button mat-menu-item>
<img width="40" src="assets/images/user-2.jpg" alt="">
Check out our new admin theme
</button>
<button mat-menu-item>
<img width="40" src="assets/images/user-3.jpg" alt="">
Expedita quo, laboriosam officia.
</button>
<button mat-menu-item>
<img width="40" src="assets/images/user-4.jpg" alt="">
Lorem ipsum dolor sit amet consectetur.
</button>
</mat-menu>
<button [mat-menu-trigger-for]="user1" mat-icon-button class="ml-xs overflow-visible">
<mat-icon>reorder</mat-icon>
<span class="notification-label">3</span>
</button>
<mat-menu #user1="matMenu" class="opt-menu" x-position="before">
<div mat-menu-item class="head-menu grad-blue">
User Menu
</div>
<button mat-menu-item>
<mat-icon>show_chart</mat-icon>
Charts
</button>
<button mat-menu-item>
<mat-icon>navigation</mat-icon>
Maps
</button>
<button mat-menu-item>
<mat-icon>web</mat-icon>
Calendar Settings
</button>
</mat-menu>
<button (click)="end.toggle()" mat-icon-button class="ml-xs overflow-visible">
<mat-icon>notifications</mat-icon>
<span class="notification-label">2</span>
</button>
<button [mat-menu-trigger-for]="user" mat-icon-button class="ml-xs">
<mat-icon>person</mat-icon>
</button>
<mat-menu #user="matMenu" class="opt-menu" x-position="before">
<div mat-menu-item class="head-menu grad-blue">
Settings
</div>
<button mat-menu-item>
<mat-icon>settings</mat-icon>
Setting
</button>
<button mat-menu-item>
<mat-icon>account_box</mat-icon>
Profile
</button>
<button mat-menu-item>
<mat-icon>notifications_off</mat-icon>
Disable notifications
</button>
<button mat-menu-item>
<mat-icon>exit_to_app</mat-icon>
Sign Out
</button>
</mat-menu>
</div>
</mat-toolbar>
<div class="horizontal-menu text-center">
<nav>
<ul class="main-h-list">
<li *ngFor="let menuitem of horizontalMenuItems.getAll()">
<a [routerLink]="['/'+menuitem.state]" *ngIf="menuitem.type === 'link'">
<mat-icon>{{ menuitem.icon }}</mat-icon>
<span>{{ menuitem.name | translate }}</span>
</a>
<a [routerLink]="['/'+menuitem.state]" *ngIf="menuitem.type === 'sub'">
<mat-icon>{{ menuitem.icon }}</mat-icon>
<span>{{ menuitem.name | translate }}</span>
</a>
<ul class="dropdown" *ngIf="menuitem.type === 'sub'">
<li *ngFor="let childitem of menuitem.children">
<a [routerLink]="['/'+childitem.state ]">{{ childitem.name | translate }}</a>
<ul class="dropdown" *ngIf="childitem.type === 'super-sub'">
<li *ngFor="let subchild of childitem.subchildren">
<a [routerLink]="['/'+subchild.state ]">{{subchild.name | translate}}</a>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</nav>
</div>
<div class="body-container">
<router-outlet></router-outlet>
</div>
<mat-sidenav #end position="end" class="chat-panel" mode="over" opened="false">
<mat-tab-group [selectedIndex]="1" mat-stretch-tabs>
<mat-tab>
<ng-template mat-tab-label>Today</ng-template>
<div class="scroll">
<mat-list class="pt-1 pb-1">
<mat-list-item>
<div fxLayout="column">
<h2 class="ma-0">{{ today | date:'EEEE' }}</h2>
<h6 class="mat-text-muted ma-0"><span>{{ today | date:'dd' }}</span>&nbsp;<span>{{ today | date:'MMMM' }}</span></h6>
</div>
</mat-list-item>
</mat-list>
<mat-nav-list>
<mat-divider></mat-divider>
<h3 mat-subheader class="text-uppercase font-weight-bold">Projects Stats</h3>
<mat-list-item>
<p class="text-mat" mat-line>Project A</p>
<mat-progress-bar mat-line mode="determinate" color="warn" value="20"></mat-progress-bar>
</mat-list-item>
<mat-list-item>
<p class="text-mat" mat-line>Project B </p>
<mat-progress-bar mat-line mode="determinate" color="accent" value="80"></mat-progress-bar>
</mat-list-item>
<mat-list-item>
<p class="text-mat" mat-line>Project C</p>
<mat-progress-bar mat-line mode="determinate" value="30"></mat-progress-bar>
</mat-list-item>
<mat-divider></mat-divider>
<h3 mat-subheader class="text-uppercase font-weight-bold">Todo</h3>
<mat-list-item>
<a mat-line href="javascript:;">Consectetur adipisicing elit. Nemo omnis.</a>
<p mat-line class="mat-text-muted text-mat">2:45PM</p>
</mat-list-item>
<mat-list-item>
<a mat-line href="javascript:;"> Temporibus cumque cupiditate </a>
<p mat-line class="mat-text-muted text-mat">3:20PM</p>
</mat-list-item>
<mat-list-item>
<a mat-line href="javascript:;">Libero voluptatibus harum quis accusamus</a>
<p mat-line class="mat-text-muted text-mat">16:00PM</p>
</mat-list-item>
</mat-nav-list>
</div>
</mat-tab>
<mat-tab>
<ng-template mat-tab-label>Notifications</ng-template>
<div class="scroll">
<mat-nav-list>
<mat-list-item>
<mat-icon mat-list-avatar class="mat-text-primary">people</mat-icon>
<h4 mat-line>Social</h4>
<p mat-line> 5 new members joined today</p>
</mat-list-item>
<mat-list-item>
<mat-icon mat-list-avatar class="mat-text-warn">local_offer</mat-icon>
<h4 mat-line>Promotions</h4>
<p mat-line>Updated your email
</p>
</mat-list-item>
<mat-list-item>
<mat-icon mat-list-avatar class="mat-text-accent">info</mat-icon>
<h4 mat-line>Updates</h4>
<p mat-line> 15 new product added</p>
</mat-list-item>
<mat-list-item>
<mat-icon mat-list-avatar class="mat-deep-purple">delete_sweep</mat-icon>
<h4 mat-line> 2 order cancelled</h4>
<span class="text-mat mat-text-muted" mat-line>{{ 1427207139000 | date: 'fullDate' }}</span>
</mat-list-item>
<mat-list-item>
<mat-icon mat-list-avatar>check_circle</mat-icon>
<h4 mat-line>System Scan completed</h4>
<span class="text-mat mat-text-muted" mat-line>{{ 1427412725000 | date: 'fullDate' }}</span>
</mat-list-item>
<mat-list-item>
<mat-icon mat-list-avatar>person_add</mat-icon>
<h4 mat-line>4 Users connected</h4>
<span class="text-mat mat-text-muted" mat-line>{{ 1428275520000 | date: 'fullDate' }}</span>
</mat-list-item>
</mat-nav-list>
</div>
</mat-tab>
</mat-tab-group>
</mat-sidenav>
</mat-sidenav-container>
<!-- Demo Purposes Only -->
<button mat-fab color="warn" class="mat-fab-bottom-right" (click)="showSettings = true">
<mat-icon class="mat-24">settings</mat-icon>
</button>
<mat-card class="settings-panel" *ngIf="showSettings">
<mat-toolbar color="warn">
<span fxFlex>Options</span>
<button mat-icon-button (click)="showSettings = false">
<mat-icon>close</mat-icon>
</button>
</mat-toolbar>
<mat-card-content class="demo-checkbox">
<span class="mb-2 d-block"><strong>Sidebar Image</strong></span>
<div class="bg-img clearfix">
<div class="pb-1" [ngClass]="{'border-active' : isBgActive('bg-1')}">
<a (click)="onSelectSidebarImage('bg-1')">
<img src="assets/images/bg-5.jpg" alt="">
</a>
</div>
<div class="pb-1" [ngClass]="{'border-active' : isBgActive('bg-2')}">
<a (click)="onSelectSidebarImage('bg-2')">
<img src="assets/images/bg-2.jpg" alt="">
</a>
</div>
<div class="pb-1" [ngClass]="{'border-active' : isBgActive('bg-3')}">
<a (click)="onSelectSidebarImage('bg-3')">
<img src="assets/images/bg-3.jpg" alt="">
</a>
</div>
<div class="pb-2" [ngClass]="{'border-active' : isBgActive('bg-4')}">
<a (click)="onSelectSidebarImage('bg-4')">
<img src="assets/images/bg-4.jpg" alt="">
</a>
</div>
</div>
<div class="color-sidebar clearfix">
<div class="pb-1">
<mat-checkbox [(ngModel)]="sidebarBg">Sidebar Image</mat-checkbox>
</div>
<span class="mb-2 d-block"><strong>Sidebar Color</strong></span>
<div class="mb-1" [ngClass]="{'border-active' : isSidebarActive('sidebar-default')}">
<a href="javascript:void(0)" (click)="onSelectedSidebarColor('sidebar-default')"><i aria-hidden="true" class="color-default fa fa-circle fa-lg def"></i>
Default</a>
</div>
<div class="mb-1" [ngClass]="{'border-active' : isSidebarActive('sidebar-green')}">
<a href="javascript:void(0)" (click)="onSelectedSidebarColor('sidebar-green')"><i aria-hidden="true" class="color-green fa fa-circle fa-lg"></i>
Green</a>
</div>
<div class="mb-1" [ngClass]="{'border-active' : isSidebarActive('sidebar-red')}">
<a href="javascript:void(0)" (click)="onSelectedSidebarColor('sidebar-red')"><i aria-hidden="true" class="color-red fa fa-circle fa-lg"></i>
Red</a>
</div>
<div class="mb-1" [ngClass]="{'border-active' : isSidebarActive('sidebar-purple')}">
<a href="javascript:void(0)" (click)="onSelectedSidebarColor('sidebar-purple')"><i aria-hidden="true" class="color-purple fa fa-circle fa-lg"></i>
Purple</a>
</div>
<div class="mb-1" [ngClass]="{'border-active' : isSidebarActive('sidebar-pink')}">
<a href="javascript:void(0)" (click)="onSelectedSidebarColor('sidebar-pink')"><i aria-hidden="true" class="color-pink fa fa-circle fa-lg"></i>
Pink</a>
</div>
<div class="mb-1" [ngClass]="{'border-active' : isSidebarActive('sidebar-blue')}">
<a href="javascript:void(0)" (click)="onSelectedSidebarColor('sidebar-blue')"><i aria-hidden="true" class="color-blue fa fa-circle fa-lg"></i>
Blue</a>
</div>
<div class="mb-1" [ngClass]="{'border-active' : isSidebarActive('sidebar-green-deep')}">
<a href="javascript:void(0)" (click)="onSelectedSidebarColor('sidebar-green-deep')"><i aria-hidden="true" class="color-green-deep fa fa-circle fa-lg"></i>
Green Deep</a>
</div>
<div class="mb-1" [ngClass]="{'border-active' : isSidebarActive('sidebar-brown')}">
<a href="javascript:void(0)" (click)="onSelectedSidebarColor('sidebar-brown')"><i aria-hidden="true" class="color-brown fa fa-circle fa-lg"></i>
Brown</a>
</div>
<div class="mb-1" [ngClass]="{'border-active' : isSidebarActive('sidebar-orange')}">
<a href="javascript:void(0)" (click)="onSelectedSidebarColor('sidebar-orange')"><i aria-hidden="true" class="color-orange fa fa-circle fa-lg"></i>
Orange</a>
</div>
</div>
<div class="color-header clearfix">
<span class="mb-2 d-block"><strong>Header Color</strong></span>
<div class="mb-1" [ngClass]="{'border-active' : isHeaderActive('header-default')}">
<a href="javascript:void(0)" (click)="onSelectedHeaderColor('header-default')"><i aria-hidden="true" class="color-default fa fa-circle fa-lg def"></i>
Default</a>
</div>
<div class="mb-1" [ngClass]="{'border-active' : isHeaderActive('header-green')}">
<a href="javascript:void(0)" (click)="onSelectedHeaderColor('header-green')"><i aria-hidden="true" class="color-green fa fa-circle fa-lg"></i>
Green</a>
</div>
<div class="mb-1" [ngClass]="{'border-active' : isHeaderActive('header-red')}">
<a href="javascript:void(0)" (click)="onSelectedHeaderColor('header-red')"><i aria-hidden="true" class="color-red fa fa-circle fa-lg"></i>
Red</a>
</div>
<div class="mb-1" [ngClass]="{'border-active' : isHeaderActive('header-purple')}">
<a href="javascript:void(0)" (click)="onSelectedHeaderColor('header-purple')"><i aria-hidden="true" class="color-purple fa fa-circle fa-lg"></i>
Purple</a>
</div>
<div class="mb-1" [ngClass]="{'border-active' : isHeaderActive('header-pink')}">
<a href="javascript:void(0)" (click)="onSelectedHeaderColor('header-pink')"><i aria-hidden="true" class="color-pink fa fa-circle fa-lg"></i>
Pink</a>
</div>
<div class="mb-1" [ngClass]="{'border-active' : isHeaderActive('header-blue')}">
<a href="javascript:void(0)" (click)="onSelectedHeaderColor('header-blue')"><i aria-hidden="true" class="color-blue fa fa-circle fa-lg"></i>
Blue</a>
</div>
<div class="mb-1" [ngClass]="{'border-active' : isHeaderActive('header-green-deep')}">
<a href="javascript:void(0)" (click)="onSelectedHeaderColor('header-green-deep')"><i aria-hidden="true" class="color-green-deep fa fa-circle fa-lg"></i>
Green Deep</a>
</div>
<div class="mb-1" [ngClass]="{'border-active' : isHeaderActive('header-brown')}">
<a href="javascript:void(0)" (click)="onSelectedHeaderColor('header-brown')"><i aria-hidden="true" class="color-brown fa fa-circle fa-lg"></i>
Brown</a>
</div>
<div class="mb-1" [ngClass]="{'border-active' : isHeaderActive('header-orange')}">
<a href="javascript:void(0)" (click)="onSelectedHeaderColor('header-orange')"><i aria-hidden="true" class="color-orange fa fa-circle fa-lg"></i>
Orange</a>
</div>
</div>
<div class="pb-1">
<mat-checkbox (change)="changeMenuLayout($event.checked)">Horizontal Menu</mat-checkbox>
</div>
<div class="pb-1">
<mat-checkbox [(ngModel)]="collapseSidebar" (change)="compactSidebar = false">Collapsed Sidebar</mat-checkbox>
</div>
<div class="pb-1">
<mat-checkbox [(ngModel)]="compactSidebar" (change)="collapseSidebar = false">Compact Sidebar</mat-checkbox>
</div>
<div class="pb-1">
<mat-checkbox [(ngModel)]="boxed">Boxed Layout</mat-checkbox>
</div>
<div class="pb-1">
<mat-checkbox [(ngModel)]="dark" >Dark Mode</mat-checkbox>
</div>
<div class="pb-1">
<mat-checkbox (change)="layoutDir = (layoutDir == 'rtl' ? 'ltr' : 'rtl')" >RTL</mat-checkbox>
</div>
<div class="pb-3">
<mat-form-field>
<mat-select placeholder="Language" class="mt-1" [(ngModel)]="currentLang" #langSelect="ngModel" (ngModelChange)="translate.use(currentLang)">
<mat-option *ngFor="let lang of translate.getLangs()" [value]="lang">{{ lang }}</mat-option>
</mat-select>
</mat-form-field>
</div>
</mat-card-content>
</mat-card>
<!-- /Demo Purposes Only -->
</div>

View File

@ -5,22 +5,17 @@ import { HorizontalMenuItems } from '../../shared/menu-items/horizontal-menu-ite
import { Subscription } from 'rxjs';
import { filter } from 'rxjs/operators';
import { TranslateService } from 'ng2-translate/ng2-translate';
import {TranslateService} from '@ngx-translate/core';
import PerfectScrollbar from 'perfect-scrollbar';
import { PerfectScrollbarConfigInterface,
PerfectScrollbarComponent, PerfectScrollbarDirective } from 'ngx-perfect-scrollbar';
import { SharedService } from '../../shared.service';
import { AwsService } from '../../aws.service';
@Component({
selector: 'app-layout',
templateUrl: './admin-layout.component.html'
})
export class AdminLayoutComponent implements OnInit, OnDestroy {
roles: string ='';
userDep: string = '';
currentUser: any = [];
private _router: Subscription;
today: number = Date.now();
@ -43,29 +38,12 @@ export class AdminLayoutComponent implements OnInit, OnDestroy {
@ViewChild('sidemenu') sidemenu;
public config: PerfectScrollbarConfigInterface = {};
constructor(private router: Router, public menuItems: MenuItems, public horizontalMenuItems : HorizontalMenuItems, public translate: TranslateService,public shared:SharedService,public aws:AwsService ) {
constructor(private router: Router, public menuItems: MenuItems, public horizontalMenuItems : HorizontalMenuItems, public translate: TranslateService ) {
const browserLang: string = translate.getBrowserLang();
translate.use(browserLang.match(/en|fr/) ? browserLang : 'en');
}
ngOnInit(): void {
this.shared.getroles().subscribe(res=>{
if(res.dataStatus == true){
this.currentUser = res.records[0];
console.log(this.currentUser);
if(this.currentUser.fk_entity_id == 1 ){
this.userDep = "SINEEGDE";
}else if(this.currentUser.fk_entity_id ==2){
this.userDep = "LENDOR";
}else{
this.userDep = "VENDOR";
}
if(this.currentUser.user_role =="ADMIN"){
this.roles = this.currentUser.user_role;
}
}
});
const elemSidebar = <HTMLElement>document.querySelector('.sidebar-container ');
if (window.matchMedia(`(min-width: 960px)`).matches && !this.isMac() && !this.compactSidebar && this.layoutDir != 'rtl') {
@ -222,14 +200,4 @@ export class AdminLayoutComponent implements OnInit, OnDestroy {
]
});
}
logout(){
this.aws.logOut().subscribe(res=>{
this.router.navigate(['/authentication/login']);
});
}
userProfile(){
this.router.navigate(['/user-pages/userprofile']);
}
}

View File

@ -1,3 +1,3 @@
.silk-forget-pass{
background-color:#fff;
.silk-forget-pass{
background-color:#fff;
}

View File

@ -1,5 +1,5 @@
.silk-user-section{
.lockscreen-form{
background-color:#fff;
}
.silk-user-section{
.lockscreen-form{
background-color:#fff;
}
}

View File

@ -0,0 +1,193 @@
/**
* Login Screen
* Aws login
* functions(login,forgetpassword,new password)
* by sriram
*/
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
import { Router } from "@angular/router";
import { AwsService } from '../../AwsService/aws.service';
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
import { CustomValidators } from 'ng2-validation';
import { MatDialog, MatDialogRef, MatDialogConfig } from '@angular/material';
import { CognitoService } from '../../AwsService/cognito.service';
@Component({
selector: 'ms-login-session',
templateUrl: './login-component.html',
styleUrls: ['./login-component.scss'],
encapsulation: ViewEncapsulation.None,
})
export class LoginComponent {
changepass: FormGroup;
email: string;
password: string;
newpassword: any;
confirmPassword: any;
changePassword: any;
status: Boolean = false;
config: MatDialogConfig = {
disableClose: false,
width: '',
height: '',
position: {
top: '',
bottom: '',
left: '',
right: ''
}
};
constructor(
private router: Router, public aws: AwsService, public dialog: MatDialog,
public shared:CognitoService,) {
}
/**
* @param email
* @param password
* AWS login service
*/
login() {
let auth = { 'Username': this.email, 'Password': this.password };
this.aws.dologin(auth).subscribe(res => {
console.log(res);
if (res !== undefined) {
this.router.navigate(['/home']);
console.log(this.shared.getToken());
}
}, err => {
console.log(err.message);
if (err.message == "New password is required.") {
//console.log("if");
this.newpassopen();
} else {
console.log("else");
}
//alert(err.message);
})
}
/**
* New password set
* Defalut aws function
* @param email password,newpassword
*/
newpassopen() {
let dialogRef = this.dialog.open(NewPasswordDialog, this.config);
dialogRef.afterClosed().subscribe(result => {
if (result !== undefined) {
let auth = { 'Username': this.email, 'Password': this.password, 'newpassword': result };
console.log(auth);
this.aws.dologin(auth).subscribe(res => {
console.log(res);
this.router.navigate(['/home']);
}, err => {
// alert(err.message);
})
}
});
}
forgotopen() {
this.status = true;
}
forgotpassword() {
let auth = { 'Username': this.email };
console.log(auth);
this.aws.userforgotpass(auth).subscribe(res => {
console.log(res);
})
}
}
// ======================= END ==============================
/**
* New password Dialog
*/
const newpassword = new FormControl('', Validators.required);
const confirmPassword = new FormControl('', CustomValidators.equalTo(newpassword));
@Component({
selector: 'app-jazz-dialog',
template: `
<h5 class="mt-0">New Password Change.</h5>
<mat-form-field>
<input matInput placeholder="New Password" #newpassword type="password" style="width: 100%;">
</mat-form-field>
<br/>
<mat-form-field>
<input matInput placeholder="ConfirmPassword" #confirmPassword type="password" style="width: 100%;">
</mat-form-field>
<small *ngIf="confirmPassword.value !='' && newpassword.value != confirmPassword.value" class="mat-text-warn">Passwords do not math.</small>
<br>
<button mat-raised-button class="mat-green" type="submit" (click)="dialogRef.close(newpassword.value)">Submit</button>
`
})
export class NewPasswordDialog {
newpassword: any = newpassword;
confirmPassword: any = confirmPassword;
jazzMessage = 'Jazzy jazz jazz';
constructor(public dialogRef: MatDialogRef<NewPasswordDialog>) {
}
}
@Component({
selector: 'app-jazz-dialog',
template: `
<h5 class="mt-0">Forgot Password</h5>
<mat-form-field>
<input matInput placeholder="Email Id" #newpassword type="Email" style="width: 100%;">
</mat-form-field>
<br>
<button mat-raised-button class="mat-green" type="submit" (click)="dialogRef.close(newpassword.value)">Submit</button>
`
})
export class ForgotPass {
newpassword: any = newpassword;
confirmPassword: any = confirmPassword;
jazzMessage = 'Jazzy jazz jazz';
constructor(public dialogRef: MatDialogRef<ForgotPass>) {
}
}

View File

@ -1,3 +1,3 @@
.register-account {
background-color: #fff;
.register-account {
background-color: #fff;
}

View File

@ -8,21 +8,15 @@ import {
MatButtonModule,
MatProgressBarModule,
MatToolbarModule } from '@angular/material';
import { FormsModule } from '@angular/forms';
import { MatIconModule} from '@angular/material';
import { FlexLayoutModule } from '@angular/flex-layout';
import { LoginComponent } from './login/login.component';
import { RegisterComponent } from './register/register.component';
import { ForgotPasswordComponent } from './forgot-password/forgot-password.component';
import { LockScreenComponent } from './lockscreen/lockscreen.component';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { FileUploadModule } from 'ng2-file-upload/ng2-file-upload';
import { TreeModule } from 'angular-tree-component';
import { NgxDatatableModule } from '@swimlane/ngx-datatable';
import { SessionRoutes } from './session.routing';
// import { lenderLoginComponent } from './lenderLogin/lenderLogin.component';
import { loginHomeComponent } from './loginHome/loginHome.component';
@NgModule({
imports: [
@ -37,20 +31,13 @@ import { loginHomeComponent } from './loginHome/loginHome.component';
MatButtonModule,
MatProgressBarModule,
MatToolbarModule,
FlexLayoutModule,
ReactiveFormsModule,
FileUploadModule,TreeModule,NgxDatatableModule,
FlexLayoutModule
],
declarations: [
LoginComponent,
RegisterComponent,
ForgotPasswordComponent,
LockScreenComponent,
loginHomeComponent,
]
})

View File

@ -4,11 +4,10 @@ import { LoginComponent } from './login/login.component';
import { RegisterComponent } from './register/register.component';
import { ForgotPasswordComponent } from './forgot-password/forgot-password.component';
import { LockScreenComponent } from './lockscreen/lockscreen.component';
// import { lenderLoginComponent } from './lenderLogin/lenderLogin.component';
import { loginHomeComponent } from './loginHome/loginHome.component';
export const SessionRoutes: Routes = [{
path: '',
redirectTo:'Welcome',
redirectTo: 'login',
pathMatch: 'full',
},{
path: '',
@ -24,10 +23,5 @@ export const SessionRoutes: Routes = [{
}, {
path: 'lockscreen',
component: LockScreenComponent
},
{
path:'Welcome',
component:loginHomeComponent
}
]
}]
}];

View File

@ -7,9 +7,9 @@
fxLayout
fxLayout.xs="column"
fxLayoutAlign="center"
fxLayoutGap="35px"
fxLayoutGap="20px"
fxLayoutGap.xs="0">
<div class="mat-dialog-title" fxFlex="15px">Branch</div>
<div class="mat-dialog-title" fxFlex>Branch</div>
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
<div fxFlex></div>
</div>

View File

@ -1,7 +1,7 @@
import { Component, OnInit, Inject } from '@angular/core';
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
import { MastersService } from '../../../service/master/masters.service';
import { MastersService } from '../../../../service/masters/masters.service';
import { Branch,States,City } from '../../../model/branch';
import { Observable } from 'rxjs/Observable';//for Datatables
@ -62,8 +62,14 @@ export class BranchDialogComponent implements OnInit {
Object.keys(BranchFormValues)
.forEach((key) => ( BranchFormValues[key] == null) && delete BranchFormValues[key]);
//console.log(BranchFormValues);
this._mastersService.addMasterDetails(BranchFormValues,'BRANCH').subscribe();
this.dialogRef.close();
this._mastersService.addMasterDetails(BranchFormValues,'BRANCH').subscribe(data=>{
// alert(1);
// console.log(data);
this._mastersService.getAllBranch();
this.dialogRef.close();
});
// this.dialogRef.close();
//alert("saved");
} else {
this._mastersService.editMasterDetails(BranchFormValues,'BRANCH').subscribe();

View File

@ -0,0 +1,84 @@
<div class="pad-wrap">
<div style="text-align: right;">
<button mat-raised-button color="primary" (click)="addBranch()" [disabled]="dialogRef"> + Add Branch</button>
</div>
</div>
<div class="example-header">
<mat-form-field>
<input matInput (keyup)="applyFilter($event.target.value)" placeholder="Filter">
</mat-form-field>
</div>
<div class="example-container mat-elevation-z8">
<mat-table [dataSource]="dataSource" matSort>
<ng-container matColumnDef="name">
<mat-header-cell *matHeaderCellDef mat-sort-header> Name </mat-header-cell>
<mat-cell *matCellDef="let row"> {{row.name}} </mat-cell>
</ng-container>
<ng-container matColumnDef="cname">
<mat-header-cell *matHeaderCellDef mat-sort-header> City Name </mat-header-cell>
<mat-cell *matCellDef="let row"> {{row.cityname}} </mat-cell>
</ng-container>
<ng-container matColumnDef="isactive">
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
<mat-cell *matCellDef="let row"> {{row.isactive}} </mat-cell>
</ng-container>
<ng-container matColumnDef="actions">
<mat-header-cell *matHeaderCellDef> </mat-header-cell>
<mat-cell *matCellDef="let row">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editBranch(row)"><mat-icon>edit</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteBranch(row.branch_id)"><mat-icon>delete_outline</mat-icon></button>
</mat-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
<mat-row *matRowDef="let row; columns: displayedColumns;">
</mat-row>
</mat-table>
<mat-paginator [pageSizeOptions]="[5, 10, 25, 100]"></mat-paginator>
</div>
<!--<table mat-table [dataSource]="dataSource" class="mat-elevation-z8">
<ng-container matColumnDef="position">
<th mat-header-cell *matHeaderCellDef> No. </th>
<td mat-cell *matCellDef="let element"> {{element.position}} </td>
</ng-container>
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef> Name </th>
<td mat-cell *matCellDef="let element"> {{element.name}} </td>
</ng-container>
<ng-container matColumnDef="weight">
<th mat-header-cell *matHeaderCellDef> Weight </th>
<td mat-cell *matCellDef="let element"> {{element.weight}} </td>
</ng-container>
<ng-container matColumnDef="symbol">
<th mat-header-cell *matHeaderCellDef> Symbol </th>
<td mat-cell *matCellDef="let element"> {{element.symbol}} </td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>-->
<!--<mat-table #table [dataSource]="dataSource" matSort>
<ng-container matColumnDef="{{column.id}}" *ngFor="let column of columnNames">
<mat-header-cell *matHeaderCellDef mat-sort-header> {{column.value}} </mat-header-cell>
<mat-cell *matCellDef="let element"> {{element[column.id]}} </mat-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
<mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>
</mat-table>-->

View File

@ -55,7 +55,7 @@
overflow: auto;
max-height: 500px;
}*/
/* Structure */
/*** Structure *
.example-container {
display: flex;
flex-direction: column;
@ -67,9 +67,9 @@
.example-header {
min-height: 64px;
padding: 8px 24px 0;
}
}****/
//mat-cell{
/**mat-cell{
.cell{
display:flex !important;
justify-content:center!important;
@ -94,4 +94,4 @@ th {
.button{
padding-left: 6px;
font-size: 20px;
}
}**/

View File

@ -0,0 +1,118 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { MatDialog,
MatDialogRef,
MatDialogConfig,
MatPaginator,
MatSort,
MatTableDataSource } from '@angular/material';
import { Observable } from 'rxjs';
import 'rxjs/add/operator/map';
import { map } from 'rxjs/operators';
import { DataSource } from '@angular/cdk/table';
import { of as observableOf, merge } from 'rxjs';
// import { Bra } from './../branch-list';
import { MastersService } from '../../../../service/masters/masters.service';
import { BranchDialogComponent } from '../branch-dialog/branch-dialog.component';
import { Branch,States,City } from '../../../model/branch';
@Component({
selector: 'app-branch-list',
templateUrl: './branch-list.component.html',
styleUrls: ['./branch-list.component.scss']
})
export class BranchListComponent implements OnInit {
isPopupOpened = true;
loader: boolean = false;
BranchList: any = [];
userData = null;
public dataLength: number;
public dataSource = new MatTableDataSource();
// displayedColumns = ['name', 'email', 'phone', 'company'];
displayedColumns = ['name','cname', 'isactive','actions'];
@ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort;
constructor(private dialog: MatDialog,
private _mastersService: MastersService) {
this._mastersService.getAllBranch().subscribe(
data => {
this.userData = data.records;
// alert(this.userData);
this.dataLength = data.records.length;
this.dataSource.data = this.userData;
}
)
// this._mastersService.getAllBranch().subscribe(dataresult =>{
// this.dataLength = dataresult.records.length;
// alert(this.dataLength);
// this.dataSource = dataresult.records;
// })
}
ngOnInit() {
// this.getBranch();
}
/**Popup for ADD Branch */
addBranch() {
this.isPopupOpened = true;
const dialogRef = this.dialog.open(BranchDialogComponent, {
data: {}
});
dialogRef.afterClosed().subscribe(result => {
this.isPopupOpened = false;
});
}
/** Popup for EDIT Branch */
editBranch(arr: Branch[]) {
this.isPopupOpened = true;
const dialogRef = this.dialog.open(BranchDialogComponent, {
data: arr
});
dialogRef.afterClosed().subscribe(result => {
this.isPopupOpened = false;
});
}
/** To delete Branch Datas */
deleteBranch(id: number) {
var PrimaryKeyWithValue ={'branch_id':id};
this._mastersService.deleteMasterDetails(PrimaryKeyWithValue,'BRANCH').subscribe();
}
ngAfterViewInit() {
this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort;
}
applyFilter(filterValue: string) {
filterValue = filterValue.trim(); // Remove whitespace
filterValue = filterValue.toLowerCase(); // Datasource defaults to lowercase matches
this.dataSource.filter = filterValue;
}
}
/** To set the All Branch value as Data sources with help of connect() */

View File

@ -3,7 +3,7 @@ import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
import { States } from '../../../model/states';
import { MastersService } from '../../../service/master/masters.service';
import { MastersService } from '../../../../service/masters/masters.service';
@Component({
selector: 'app-jazz-dialog',
templateUrl: './city-dialog.component.html',

View File

@ -10,11 +10,10 @@ import { map } from 'rxjs/operators';
import { of as observableOf, merge } from 'rxjs';
import { MastersService } from '../../../service/master/masters.service';
import { MastersService } from '../../../../service/masters/masters.service';
import { CityDialogComponent } from '../city-dialog/city-dialog.component';
import { City } from '../../../model/city';
@Component({
selector: 'app-city-list',
templateUrl: './city-list.component.html',
@ -74,7 +73,7 @@ export class CityListComponent implements OnInit {
//To get data for listing
getCity() {
this.loader = true;
this._MastersService.getAllMasterData('CITY').subscribe(dataresult => {
this._MastersService.getAllCity().subscribe(dataresult => {
this.loader = false;

View File

@ -1,7 +1,7 @@
import { Component, OnInit, Inject } from '@angular/core';
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
import { MastersService } from '../../../service/master/masters.service';
import { MastersService } from '../../../../service/masters/masters.service';
@Component({

View File

@ -10,7 +10,7 @@ import { map } from 'rxjs/operators';
import { of as observableOf, merge } from 'rxjs';
import { MastersService } from '../../../service/master/masters.service';
import { MastersService } from '../../../../service/masters/masters.service';
import { CommentsOnLocalityDialogComponent } from '../comments-on-locality-dialog/comments-on-locality-dialog.component';
import { CommentsOnLocality } from '../../../model/comments-on-locality';

View File

@ -1,11 +1,22 @@
<div class="mb-1">
<!-- <div class="mb-1">
<h2 mat-dialog-title>Company &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 mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button>
</h2>
</div> -->
<div class="container"
fxLayout
fxLayout.xs="column"
fxLayoutAlign="center"
fxLayoutGap="35px"
fxLayoutGap.xs="0">
<div class="mat-dialog-title" fxFlex="15px">Company</div>
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
<div fxFlex></div>
</div>
<form [formGroup]="_companyForm" (submit)="onSubmit()">
<form [formGroup]="_companyForm" (ngsubmit)="onSubmit()">
<div class="form-group">
<mat-dialog-content>
@ -75,14 +86,20 @@
</mat-form-field>
</div>
<div class="mb-1">
<!-- <div class="mb-1">
<mat-form-field style="width: 100%">
<input matInput type="text" placeholder="logo" required [formControl]="_companyForm.controls['logo']">
<mat-error *ngIf="!_companyForm.controls['logo'].valid && _companyForm.controls['logo'].touched" class="mat-text-warn">You must include a logo.</mat-error>
</mat-form-field>
</div> -->
<div class="mb-1">
logo
<input type="file" (change)="onFileChange($event)" [formControl]="_companyForm.controls['logo']"/>
<!-- <span *ngIf="usersData!=''">{{img}}</span> -->
</div>
<br>
<div class="row" style="text-align:right;">

View File

@ -3,7 +3,8 @@ import { Component, OnInit, Inject } from '@angular/core';
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
//import { CompanyService } from '../../../service/company.service';
import { MastersService } from '../../../service/master/masters.service';
import { MastersService } from '../../../../service/masters/masters.service';
import { FileUploader } from 'ng2-file-upload/ng2-file-upload';
@Component({
@ -19,6 +20,7 @@ export class CompanyDialogComponent implements OnInit {
stateDatas: any[];
citydatas: any[];
errorMessage:string;
files: File = null
constructor(private _formBuilder: FormBuilder,
private dialogRef: MatDialogRef<CompanyDialogComponent>,
@ -42,9 +44,9 @@ export class CompanyDialogComponent implements OnInit {
city: [this.data.city, Validators.compose([Validators.required])],
state: [this.data.state, Validators.compose([Validators.required])],
pincode: [this.data.pincode, Validators.compose([Validators.required, Validators.minLength(5), Validators.maxLength(6)])],
logo : [this.data.logo, Validators.compose([Validators.required])]
logo : [this.data.logo]
});
this._masterService.getAllMasterData('STATE')
.subscribe(
data => {
@ -66,7 +68,14 @@ export class CompanyDialogComponent implements OnInit {
}
onFileChange($event) {
//console.log($event.target.files[0]);
//if($event.target.files[0] < 0 ){
this.files = $event.target.files[0];
//}
//console.log(this.files);
}
// onSubmit() {
// if (isNaN(this.data.ID)) {
// this._companyService.addCompany(this._companyForm.value);
@ -78,6 +87,9 @@ export class CompanyDialogComponent implements OnInit {
// }
onSubmit() {
if (this.files) {
this.data.logo = this.files;
}
if(isNaN(this.data.company_id)) {
var my_array = this._companyForm.value;
Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]);

View File

@ -12,8 +12,9 @@
<th style="text-align: center;">#</th>
<!-- <th style="text-align: center;">Company ID</th> -->
<th style="text-align: center;">Company Name</th>
<th style="text-align: center;">Company City and State Name</th>
<th style="text-align: center;">Is Active</th>
<th style="text-align: center;">Company City</th>
<th style="text-align: center;">Company State</th>
<!-- <th style="text-align: center;">Is Active</th> -->
<th style="text-align: center;">Action</th>
</thead>
@ -21,8 +22,8 @@
<tr *ngFor="let CL of CompanyList; let i=index">
<td style="text-align: center;">{{i+1}}</td>
<td style="text-align: center;">{{CL.name}}</td>
<td style="text-align: center;">{{CL.city_name}} {{CL.state_name}}</td>
<td style="text-align: center;">{{CL.isactive}}</td>
<td style="text-align: center;">{{CL.city_name}}</td>
<td style="text-align: center;">{{CL.state_name}}</td>
<td style="text-align: center;">
<a (click)="editCompany(CL)"><mat-icon>edit</mat-icon></a>
<a (click)="deleteCompany(CL.company_id)"><mat-icon>delete_outline</mat-icon></a>

View File

@ -12,7 +12,7 @@ import { of as observableOf, merge } from 'rxjs';
import { CompanyDialogComponent } from '../company-dialog/company-dialog.component';
import { Company } from '../../../model/company';
import { MastersService } from '../../../service/master/masters.service';
import { MastersService } from '../../../../service/masters/masters.service';
@Component({

View File

@ -9,9 +9,9 @@
fxLayoutAlign="center"
fxLayoutGap="35px"
fxLayoutGap.xs="0">
<div class="mat-dialog-title" fxFlex="15px">Customer Behaviour</div>
<div class="mat-dialog-title" fxFlex>Customer Behaviour</div>
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
<div fxFlex></div>
<div fxFlex="15px"></div>
</div>

View File

@ -1,7 +1,7 @@
import { Component, OnInit, Inject } from '@angular/core';
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
import { MastersService } from '../../../service/master/masters.service';
import { MastersService } from '../../../../service/masters/masters.service';
@Component({

View File

@ -10,7 +10,7 @@ import { map } from 'rxjs/operators';
import { of as observableOf, merge } from 'rxjs';
import { MastersService } from '../../../service/master/masters.service';
import { MastersService } from '../../../../service/masters/masters.service';
import { CustomerBehaviourDialogComponent } from '../customer-behaviour-dialog/customer-behaviour-dialog.component';
import { CustomerBehaviour } from '../../../model/customer-behaviour';

View File

@ -9,9 +9,9 @@
fxLayoutAlign="center"
fxLayoutGap="35px"
fxLayoutGap.xs="0">
<div class="mat-dialog-title" fxFlex="15px">Customer Segment</div>
<div class="mat-dialog-title" fxFlex>Customer Segment</div>
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
<div fxFlex></div>
<div fxFlex="15px"></div>
</div>

View File

@ -1,7 +1,7 @@
import { Component, OnInit, Inject } from '@angular/core';
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
import { MastersService } from '../../../service/master/masters.service';
import { MastersService } from '../../../../service/masters/masters.service';
@Component({

View File

@ -10,7 +10,7 @@ import { map } from 'rxjs/operators';
import { of as observableOf, merge } from 'rxjs';
import { MastersService } from '../../../service/master/masters.service';
import { MastersService } from '../../../../service/masters/masters.service';
import { CustomerSegmentDialogComponent } from '../customer-segment-dialog/customer-segment-dialog.component';
import { CustomerSegment } from '../../../model/customer-segment';

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