Skip to content

Commit

Permalink
Merge pull request #123 from oliverheywood451/admin-products
Browse files Browse the repository at this point in the history
Admin login + product list
  • Loading branch information
Labedlam authored Aug 7, 2018
2 parents 30c98ad + 0133fc8 commit 881aafb
Show file tree
Hide file tree
Showing 107 changed files with 3,019 additions and 488 deletions.
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
<div class="text-center mt-3">
<h1 class="display-4">{{appConfig.appname}}</h1>
</div>
<div class="mx-auto "
style="max-width:350px;">
<h3 class="text-center text-muted mb-3">Forgot Password</h3>
<form (ngSubmit)="onSubmit()"
[formGroup]="resetEmailForm"
name="ResetEmail"
autocomplete="off"
novalidate>
<div class="form-group">
<label for="email"
class="sr-only">Email</label>
<input formControlName="email"
id="email"
type="text"
class="form-control"
placeholder="Email"
autocapitalize="off"
autofocus />
</div>
<button id="submitBtn"
type="submit"
class="btn btn-primary btn-block">Send Email</button>
</form>
<button type="button"
class="btn btn-link btn-block"
routerLink="/login">Return to Login</button>
<div class="logged-out-page">
<div class="text-center mt-3">
<h1 class="display-4">{{appConfig.appname}}</h1>
</div>
<div class="mx-auto "
style="max-width:350px;">
<h3 class="text-center text-muted mb-3">Forgot Password</h3>
<form (ngSubmit)="onSubmit()"
[formGroup]="resetEmailForm"
name="ResetEmail"
autocomplete="off"
novalidate>
<div class="form-group">
<label for="email"
class="sr-only">Email</label>
<input formControlName="email"
id="email"
type="text"
class="form-control"
placeholder="Email"
autocapitalize="off"
autofocus />
</div>
<button id="submitBtn"
type="submit"
class="btn btn-primary btn-block">Send Email</button>
</form>
<button type="button"
class="btn btn-link btn-block"
routerLink="/login">Return to Login</button>
</div>
</div>
92 changes: 45 additions & 47 deletions src/UI/Buyer/src/app/auth/containers/login/login.component.html
Original file line number Diff line number Diff line change
@@ -1,51 +1,49 @@
<section class="login">
<div class="text-center">
<p *ngIf="showRegisterLink()">Don't have an account? <button type="button"
class="btn btn-link"
routerLink="/register">Sign Up</button></p>
<h1 class="display-4">{{appConfig.appname}}</h1>
</div>
<div class="mx-auto mt-4"
style="max-width:350px;">
<h3 class="text-center headline-text">Account Login</h3>
<form (ngSubmit)="onSubmit()"
[formGroup]="form"
name="LoginForm"
autocomplete="off"
novalidate>
<div class="form-group">
<label for="username">Username</label>
<input formControlName="username"
id="username"
type="text"
class="form-control"
placeholder="Username"
autocapitalize="off"
autofocus />
</div>
<div class="form-group">
<label for="password">Password</label>
<input formControlName="password"
type="password"
class="form-control"
placeholder="Password"
id="password" />
</div>
<div class="form-group text-center">
<div class="checkbox">
<label for="rememberMeId">
<div class="text-center">
<p *ngIf="showRegisterLink()">Don't have an account? <button type="button"
class="btn btn-link"
routerLink="/register">Sign Up</button></p>
<h1 class="display-4">{{appConfig.appname}}</h1>
</div>
<div class="mx-auto mt-4"
style="max-width:350px;">
<h3 class="text-center headline-text">Account Login</h3>
<form (ngSubmit)="onSubmit()"
[formGroup]="form"
name="LoginForm"
autocomplete="off"
novalidate>
<div class="form-group">
<label for="username">Username</label>
<input formControlName="username"
id="username"
type="text"
class="form-control"
placeholder="Username"
autocapitalize="off"
autofocus />
</div>
<div class="form-group">
<label for="password">Password</label>
<input formControlName="password"
type="password"
class="form-control"
placeholder="Password"
id="password" />
</div>
<div class="form-group text-center">
<div class="checkbox">
<label for="rememberMeId">
<input formControlName="rememberMe" type="checkbox" id="rememberMeId">
Remember Me
</label>
</div>
</div>
<button id="submitBtn"
type="submit"
[disabled]="!form.valid"
class="btn btn-primary btn-lg btn-block">Submit</button>
</form>
<button type="button"
class="btn btn-link btn-block text-center"
routerLink="/forgot-password">Forgot Password</button>
</div>
</section>
</div>
<button id="submitBtn"
type="submit"
[disabled]="!form.valid"
class="btn btn-primary btn-lg btn-block">Submit</button>
</form>
<button type="button"
class="btn btn-link btn-block text-center"
routerLink="/forgot-password">Forgot Password</button>
</div>
4 changes: 2 additions & 2 deletions src/UI/Buyer/src/app/auth/containers/login/login.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ export class LoginComponent implements OnInit {
private appAuthService: AppAuthService,
private ocTokenService: OcTokenService,
private router: Router,
private fb: FormBuilder,
private formBuilder: FormBuilder,
private appStateService: AppStateService,
@Inject(applicationConfiguration) private appConfig: AppConfig
) {}

ngOnInit() {
this.form = this.fb.group({
this.form = this.formBuilder.group({
username: '',
password: '',
rememberMe: false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,40 +1,42 @@
<div class="text-center mt-3">
<h1 class="display-4">{{appConfig.appname}}</h1>
</div>
<div class="mx-auto "
style="max-width:350px;">
<h3 class="text-center text-muted mb-3">New Password</h3>
<form (ngSubmit)="onSubmit()"
[formGroup]="resetPasswordForm"
name="NewPassword"
autocomplete="off"
novalidate>
<div class="form-group">
<label for="psswrd"
class="sr-only">Password</label>
<input formControlName="password"
id="psswrd"
type="password"
class="form-control"
placeholder="Password"
autocapitalize="off"
autofocus />
</div>
<div class="form-group">
<label for="confirm"
class="sr-only">Confirm Password</label>
<input formControlName="passwordConfirm"
id="confirm"
type="password"
class="form-control"
placeholder="Confirm Password"
autocapitalize="off"
autofocus />
</div>
<span *ngIf="passwordMismatchError()"
class="error-message">Passwords must match</span>
<button id="submitBtn"
type="submit"
class="btn btn-primary btn-block">Set New Password</button>
</form>
<div class="logged-out-page">
<div class="text-center mt-3">
<h1 class="display-4">{{appConfig.appname}}</h1>
</div>
<div class="mx-auto "
style="max-width:350px;">
<h3 class="text-center text-muted mb-3">New Password</h3>
<form (ngSubmit)="onSubmit()"
[formGroup]="resetPasswordForm"
name="NewPassword"
autocomplete="off"
novalidate>
<div class="form-group">
<label for="psswrd"
class="sr-only">Password</label>
<input formControlName="password"
id="psswrd"
type="password"
class="form-control"
placeholder="Password"
autocapitalize="off"
autofocus />
</div>
<div class="form-group">
<label for="confirm"
class="sr-only">Confirm Password</label>
<input formControlName="passwordConfirm"
id="confirm"
type="password"
class="form-control"
placeholder="Confirm Password"
autocapitalize="off"
autofocus />
</div>
<span *ngIf="passwordMismatchError()"
class="error-message">Passwords must match</span>
<button id="submitBtn"
type="submit"
class="btn btn-primary btn-block">Set New Password</button>
</form>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
} from '@ordercloud/angular-sdk';
import { CookieModule } from 'ngx-cookie';
import { ToastrService } from 'ngx-toastr';
import { OcFormErrorService } from '@app-buyer/shared';
import { AppFormErrorService } from '@app-buyer/shared';

describe('ResetPasswordComponent', () => {
let component: ResetPasswordComponent;
Expand Down Expand Up @@ -47,7 +47,7 @@ describe('ResetPasswordComponent', () => {
{ provide: Router, useValue: router },
{ provide: ActivatedRoute, useValue: activatedRoute },
{ provide: ToastrService, useValue: toastrService },
{ provide: OcFormErrorService, useValue: formErrorService },
{ provide: AppFormErrorService, useValue: formErrorService },
{
provide: applicationConfiguration,
useValue: new InjectionToken<AppConfig>('app.config'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ import { Router, ActivatedRoute } from '@angular/router';
import { ToastrService } from 'ngx-toastr';

// ordercloud
import { OcMatchFieldsValidator, OcFormErrorService } from '@app-buyer/shared';
import {
AppMatchFieldsValidator,
AppFormErrorService,
} from '@app-buyer/shared';
import {
applicationConfiguration,
AppConfig,
Expand All @@ -30,7 +33,7 @@ export class ResetPasswordComponent implements OnInit {
private toasterService: ToastrService,
private formBuilder: FormBuilder,
private ocPasswordResetService: OcPasswordResetService,
private formErrorService: OcFormErrorService,
private formErrorService: AppFormErrorService,
@Inject(applicationConfiguration) private appConfig: AppConfig
) {}

Expand All @@ -44,7 +47,7 @@ export class ResetPasswordComponent implements OnInit {
password: '',
passwordConfirm: '',
},
{ validator: OcMatchFieldsValidator('password', 'passwordConfirm') }
{ validator: AppMatchFieldsValidator('password', 'passwordConfirm') }
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import { of, BehaviorSubject, Subject } from 'rxjs';
import { OcMeService, OcOrderService } from '@ordercloud/angular-sdk';
import {
AppStateService,
OcFormErrorService,
AppFormErrorService,
ModalService,
} from '@app-buyer/shared';
import { NO_ERRORS_SCHEMA } from '@angular/core';
import { OcGeographyService } from '@app-buyer/shared/services/oc-geography/oc-geography.service';
import { AppGeographyService } from '@app-buyer/shared/services/geography/geography.service';
import { CheckoutSectionBaseComponent } from '@app-buyer/checkout/components/checkout-section-base/checkout-section-base.component';

describe('CheckoutAddressComponent', () => {
Expand Down Expand Up @@ -70,12 +70,12 @@ describe('CheckoutAddressComponent', () => {
],
imports: [ReactiveFormsModule],
providers: [
OcFormErrorService,
AppFormErrorService,
{ provide: ModalService, useValue: modalService },
{ provide: OcMeService, useValue: meService },
{ provide: OcOrderService, useValue: orderService },
{ provide: AppStateService, useValue: appStateService },
OcGeographyService,
AppGeographyService,
],
schemas: [NO_ERRORS_SCHEMA], // Ignore template errors: remove if tests are added to test template
}).compileComponents();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { OrderApprovalDetailsComponent } from './order-approval-details.component';
import { OrderApprovalDetailsComponent } from '@app-buyer/order/containers/order-approval-details/order-approval-details.component';
import { OcOrderService } from '@ordercloud/angular-sdk';
import {
ActivatedRoute,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { NO_ERRORS_SCHEMA } from '@angular/core';

import { OrderReorderComponent } from '@app-buyer/order/containers/order-reorder/order-reorder.component.ts';
import { OrderReorderComponent } from '@app-buyer/order/containers/order-reorder/order-reorder.component';
import {
ModalService,
AppReorderService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
AppLineItemService,
AppReorderService,
} from '@app-buyer/shared';
import { orderReorderResponse } from '@app-buyer/shared/services/oc-reorder/oc-reorder.interface';
import { OrderReorderResponse } from '@app-buyer/shared/services/reorder/reorder.interface';

@Component({
selector: 'order-reorder',
Expand All @@ -18,7 +18,7 @@ import { orderReorderResponse } from '@app-buyer/shared/services/oc-reorder/oc-r
})
export class OrderReorderComponent implements OnInit, OnDestroy {
@Input() orderID: string;
reorderResponse$: Observable<orderReorderResponse>;
reorderResponse$: Observable<OrderReorderResponse>;
modalID = 'Order-Reorder';
alive = true;
message = { string: null, classType: null };
Expand All @@ -41,7 +41,7 @@ export class OrderReorderComponent implements OnInit, OnDestroy {
}
}

updateMessage(response: orderReorderResponse): void {
updateMessage(response: OrderReorderResponse): void {
if (response.InvalidLi.length && !response.ValidLi.length) {
this.message.string = `None of the line items on this order are available for reorder.`;
this.message.classType = 'danger';
Expand Down
2 changes: 1 addition & 1 deletion src/UI/Buyer/src/app/order/order.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { OrderShipmentsComponent } from '@app-buyer/order/containers/order-shipm
import { ShipmentsResolve } from '@app-buyer/order/shipments.resolve';
import { OrderReorderComponent } from '@app-buyer/order/containers/order-reorder/order-reorder.component';
import { OrderAprovalComponent } from '@app-buyer/order/containers/order-approval/order-approval.component';
import { OrderApprovalDetailsComponent } from './containers/order-approval-details/order-approval-details.component';
import { OrderApprovalDetailsComponent } from '@app-buyer/order/containers/order-approval-details/order-approval-details.component';

@NgModule({
imports: [SharedModule, OrderRoutingModule],
Expand Down
Loading

0 comments on commit 881aafb

Please sign in to comment.