Add files via upload

This commit is contained in:
gopi17701 2018-09-29 21:21:20 -04:00 committed by GitHub
parent c02f0192eb
commit 5cf4f930bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 173 additions and 145 deletions

View File

@ -1,13 +1,13 @@
import { AppRoutingModule } from './app-routing.module';
describe('AppRoutingModule', () => {
let appRoutingModule: AppRoutingModule;
beforeEach(() => {
appRoutingModule = new AppRoutingModule();
});
it('should create an instance', () => {
expect(appRoutingModule).toBeTruthy();
});
});
import { AppRoutingModule } from './app-routing.module';
describe('AppRoutingModule', () => {
let appRoutingModule: AppRoutingModule;
beforeEach(() => {
appRoutingModule = new AppRoutingModule();
});
it('should create an instance', () => {
expect(appRoutingModule).toBeTruthy();
});
});

View File

@ -1,27 +1,31 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import {RouterModule, Routes} from '@angular/router';
import {CustomerComponent} from './customer/customer.component';
import {SalesOrderComponent} from './sales-order/sales-order.component';
import {InvoiceComponent} from './invoice/invoice.component';
import {HomepageComponent} from './homepage/homepage.component';
import {InvoiceGenComponent} from './invoice-gen/invoice-gen.component';
const routes: Routes = [
{ path: '', redirectTo: 'homepage', pathMatch: 'full'},
{ path: 'homepage', component: HomepageComponent },
{ path: 'customer', component: CustomerComponent },
{ path: 'sales-order', component: SalesOrderComponent },
{ path: 'invoice', component: InvoiceComponent },
{ path: 'invoice-gen', component: InvoiceGenComponent }
];
@NgModule({
exports: [RouterModule],
imports: [
CommonModule,
RouterModule.forRoot(routes)
],
declarations: []
})
export class AppRoutingModule { }
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import {RouterModule, Routes} from '@angular/router';
import {CustomerComponent} from './customer/customer.component';
import {SalesOrderComponent} from './sales-order/sales-order.component';
import {InvoiceComponent} from './invoice/invoice.component';
import {HomepageComponent} from './homepage/homepage.component';
import {InvoiceGenComponent} from './invoice-gen/invoice-gen.component';
import {InvoicePaymentComponent} from './invoice-payment/invoice-payment.component';
import {LoginComponent} from './login/login.component';
const routes: Routes = [
{ path: '', redirectTo: 'login', pathMatch: 'full'},
{ path: 'homepage', component: HomepageComponent },
{ path: 'customer', component: CustomerComponent },
{ path: 'sales-order', component: SalesOrderComponent },
{ path: 'invoice', component: InvoiceComponent },
{ path: 'invoice-gen', component: InvoiceGenComponent },
{ path: 'invoice-payment', component: InvoicePaymentComponent },
{ path: 'login', component: LoginComponent }
];
@NgModule({
exports: [RouterModule],
imports: [
CommonModule,
RouterModule.forRoot(routes)
],
declarations: []
})
export class AppRoutingModule { }

View File

@ -1 +1 @@

View File

@ -1,27 +1,27 @@
import { TestBed, async } from '@angular/core/testing';
import { AppComponent } from './app.component';
describe('AppComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
AppComponent
],
}).compileComponents();
}));
it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
}));
it(`should have as title 'app'`, async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app.title).toEqual('app');
}));
it('should render title in a h1 tag', async(() => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('h1').textContent).toContain('Welcome to AstuteClient2!');
}));
});
import { TestBed, async } from '@angular/core/testing';
import { AppComponent } from './app.component';
describe('AppComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
AppComponent
],
}).compileComponents();
}));
it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
}));
it(`should have as title 'app'`, async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app.title).toEqual('app');
}));
it('should render title in a h1 tag', async(() => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('h1').textContent).toContain('Welcome to AstuteClient2!');
}));
});

View File

@ -1,10 +1,10 @@
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'app';
}
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'app';
}

View File

@ -1,43 +1,53 @@
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { CustomerComponent } from './customer/customer.component';
import { AstuteClientService } from './services/astute-client-service';
import { AgGridModule } from 'ag-grid-angular';
import { ModalFormComponent } from './modal-form/modal-form.component';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import {HttpClientModule} from '@angular/common/http';
import { AppRoutingModule } from './/app-routing.module';
import { NavBarComponent } from './nav-bar/nav-bar.component';
import { SalesOrderComponent } from './sales-order/sales-order.component';
import { InvoiceComponent } from './invoice/invoice.component';
import { HomepageComponent } from './homepage/homepage.component';
import { AppBoxComponent } from './app-box/app-box.component';
import { InvoiceGenComponent } from './invoice-gen/invoice-gen.component';
import { TextMaskModule } from 'angular2-text-mask';
@NgModule({
declarations: [
AppComponent,
CustomerComponent,
ModalFormComponent,
NavBarComponent,
SalesOrderComponent,
InvoiceComponent,
HomepageComponent,
AppBoxComponent,
InvoiceGenComponent
],
imports: [
BrowserModule,
AgGridModule.withComponents([]),
NgbModule.forRoot(),
HttpClientModule,
AppRoutingModule,
TextMaskModule
],
providers: [AstuteClientService],
bootstrap: [AppComponent]
})
export class AppModule { }
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { CustomerComponent } from './customer/customer.component';
import { AstuteClientService } from './services/astute-client-service';
import { AgGridModule } from 'ag-grid-angular';
import { ModalFormComponent } from './modal-form/modal-form.component';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import {HttpClientModule} from '@angular/common/http';
import { AppRoutingModule } from './/app-routing.module';
import { NavBarComponent } from './nav-bar/nav-bar.component';
import { SalesOrderComponent } from './sales-order/sales-order.component';
import { InvoiceComponent } from './invoice/invoice.component';
import { HomepageComponent } from './homepage/homepage.component';
import { AppBoxComponent } from './app-box/app-box.component';
import { InvoiceGenComponent } from './invoice-gen/invoice-gen.component';
import { TextMaskModule } from 'angular2-text-mask';
import { LoginComponent } from './login/login.component';
import { InvoicePaymentComponent } from './invoice-payment/invoice-payment.component';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { ReactiveFormsModule } from '@angular/forms';
@NgModule({
declarations: [
AppComponent,
CustomerComponent,
ModalFormComponent,
NavBarComponent,
SalesOrderComponent,
InvoiceComponent,
HomepageComponent,
AppBoxComponent,
InvoiceGenComponent,
LoginComponent,
InvoicePaymentComponent
],
imports: [
BrowserModule,
AgGridModule.withComponents([]),
NgbModule.forRoot(),
HttpClientModule,
AppRoutingModule,
TextMaskModule,
CommonModule,
FormsModule,
ReactiveFormsModule
],
providers: [AstuteClientService],
bootstrap: [AppComponent]
})
export class AppModule { }

View File

@ -8,16 +8,6 @@
Welcome to the Astute Internal System, {{currentUser}}!
</h1>
</div>
<div class="col-lg-4">
<div class="input-group mb-3 float-right">
<input type="text" class="form-control" placeholder="Search...">
<div class="input-group-prepend">
<button class="btn btn-sm btn-info btn-round">
<i class="material-icons">search</i>
</button>
</div>
</div>
</div>
</div>
<!--applications-->

View File

@ -73,7 +73,7 @@
<span class="input-group-text">Payment Date*</span>
</td>
<td colspan="7">
<input type="text" class="form-control" #inDateReceived>
<input type="date" class="form-control" #inDateReceived>
</td>
</tr>
@ -120,7 +120,7 @@
<span class="input-group-text">Date Received*</span>
</td>
<td colspan="7">
<input type="text" class="form-control" #inDateReceived [value]="selected.paymentDate">
<input type="date" class="form-control" #inDateReceived [value]="selected.paymentDate">
</td>
</tr>
</tbody>

View File

@ -1,6 +1,11 @@
<div class="page" style="width: 35%; margin: 20px auto auto;">
<form class="form-signin" (ngSubmit)="login(f)" #f="ngForm" style="margin-bottom: 10px">
<h2 class="form-signin-heading">Login</h2>
<div class="row">
<div class="col-12">
<img src="assets/img/AstuteLogo.gif" height="100" width="230">
<h1 class="form-signin-heading text-right">Login</h1>
</div>
</div>
<label for="username" class="sr-only">Username</label>
<input class="form-control" type="text" id="username" name="username" ngModel placeholder="Username">

View File

@ -25,7 +25,7 @@ export class LoginComponent implements OnInit {
this.astuteClientService.login(username, password).then((data) => {
if (data) {
this.router.navigate(['/home']);
this.router.navigate(['/homepage']);
} else {
alert('login failed, checked credentials');
}

View File

@ -59,7 +59,7 @@
<td style="width: 20%"><span class="input-group-text">Contract Number</span></td>
<td style="width: 30%"><input type="text" class="form-control" placeholder="External Contract Number" #contractnum></td>
<td style="width: 20%"><span class="input-group-text">Contract Amount</span></td>
<td style="width: 30%"><input type="number" class="form-control" placeholder="Derived From Details" [value]="newContractAmount" #contractamt disabled></td>
<td style="width: 30%"><input type="text" class="form-control" placeholder="Derived From Details" [value]="newContractAmount | currency" #contractamt disabled></td>
</tr>
</tbody>
</table>

View File

@ -15,7 +15,8 @@ export class AstuteClientService {
private invoiceDetailUrl = 'http://localhost:8080/astutesystem/invoice/detail';
private invoiceGenUrl = 'http://localhost:8080/astutesystem/invoice/generatedInvoice';
private invoicePaymentUrl = 'http://localhost:8080/astutesystem/invoicePayment';
private sessionId;
private sessionId=localStorage.getItem('');
private sessionString = `?sessionId=${this.sessionId}`;
constructor(private http: HttpClient) { }
@ -28,13 +29,15 @@ export class AstuteClientService {
};
return this.http
.post(this.authUrl, data, this.headers)
.post(this.authUrl, data)
.toPromise()
.then(response => {
console.log(response['entity']);
const sessionId = response['entity'];
const name = response['entity'].name;
const sessionId = response['entity'].sessionId;
if (sessionId != null) {
localStorage.setItem('SESSION_ID', sessionId);
localStorage.setItem('SESSION_USER', name);
return sessionId;
} else {
return null;
@ -42,22 +45,37 @@ export class AstuteClientService {
});
}
private getSessionId(): string {
console.log(localStorage.getItem('SESSION_ID'));
return localStorage.getItem('SESSION_ID');
}
public logout() {
localStorage.removeItem('SESSION_ID');
localStorage.removeItem('SESSION_USER');
console.log(localStorage.getItem('SESSION_ID'));
}
public getSessionId(): string {
console.log(localStorage.getItem('SESSION_ID'));
return localStorage.getItem('SESSION_ID');
}
public getSessionUser(): string {
console.log(localStorage.getItem('SESSION_USER'));
return localStorage.getItem('SESSION_USER');
}
// **************************************** Customer Service methods
public getCustomers(): Promise<any> {
console.log("*** In getCustomers()");
const url = `${this.customerUrl}`;
const url = `${this.customerUrl}${this.sessionString}`;
return this.http.get(url)
.toPromise()
.then(response => {
console.log(response['entity']);
return response['entity'];
});
})
.catch( error => {
alert(error);
});
}
public updateCustomer(customerId: number, data: any): Promise<any> {
@ -137,6 +155,7 @@ export class AstuteClientService {
// Date deliverBy;
public updatePODetail(ponum, lineItemNo, data) {
console.log("*** In updatePODetail()");
const sessionId = localStorage.getItem('sessionId');
const url = `${this.POUrl}/detail/${ponum}/${lineItemNo}`; //TODO send sessionId
return this.http.put(url, data)
.toPromise()