Skip to content

Commit

Permalink
Done changes related to improve performance
Browse files Browse the repository at this point in the history
  • Loading branch information
yugank1991 committed Sep 11, 2018
1 parent 18f19fa commit fa0dd3e
Show file tree
Hide file tree
Showing 22 changed files with 1,963 additions and 672 deletions.
Original file line number Diff line number Diff line change
@@ -1,78 +1,80 @@
<div *ngIf="false">
<h1 mat-dialog-title>Choose Login Method</h1>
<h1 mat-dialog-title>Choose Login Method</h1>

<mat-dialog-actions class="flex-container"
fxLayout="column"
fxLayoutAlign="space-around">
<button class="flex-item" mat-raised-button mat-dialog-close color="primary" (click)="googleLogin()">Google</button>
<button class="flex-item" mat-raised-button mat-dialog-close color="primary" (click)="fbLogin()">facebook</button>
<button class="flex-item" mat-raised-button mat-dialog-close color="primary" (click)="twitterLogin()">Twitter</button>
<button class="flex-item" mat-raised-button mat-dialog-close color="primary" (click)="githubLogin()">Github</button>
<button class="flex-item" mat-raised-button mat-dialog-close color="primary" (click)="passwordLogin()">Email/Password</button>
</mat-dialog-actions>
<mat-dialog-actions class="flex-container" fxLayout="column" fxLayoutAlign="space-around">
<button class="flex-item" mat-raised-button mat-dialog-close color="primary" (click)="googleLogin()">Google</button>
<button class="flex-item" mat-raised-button mat-dialog-close color="primary" (click)="fbLogin()">facebook</button>
<button class="flex-item" mat-raised-button mat-dialog-close color="primary" (click)="twitterLogin()">Twitter</button>
<button class="flex-item" mat-raised-button mat-dialog-close color="primary" (click)="githubLogin()">Github</button>
<button class="flex-item" mat-raised-button mat-dialog-close color="primary" (click)="passwordLogin()">Email/Password</button>
</mat-dialog-actions>

<mat-dialog-actions>
<button mat-dialog-close>Cancel</button>
</mat-dialog-actions>
<mat-dialog-actions>
<button mat-dialog-close>Cancel</button>
</mat-dialog-actions>
</div>

<mat-dialog-content>
<div class="logininner textleft">
<div class="card">
<div class="row">
<div class="col-sm-7 col-xs-12">
<form (ngSubmit)="onSubmit()" class="sign-in-form" [formGroup]="loginForm" novalidate>
<input type="hidden" formControlName="mode" [(ngModel)]="mode">
<div class="heading" [ngSwitch]="mode">
<span *ngSwitchCase="0">Login to your account</span>
<span *ngSwitchCase="1">Get a bit wiser - Sign up</span>
<span *ngSwitchCase="2">Forgot Password</span>
</div>
<mat-form-field class="full-width required">
<input matInput placeholder="Email *" formControlName="email" class="required">
<mat-hint align="end" *ngIf="loginForm.controls.email.errors && !loginForm.controls.email.pristine" class="error">Invalid Email!</mat-hint>
</mat-form-field>
<mat-form-field [class.hide]="mode === 2" class="full-width required">
<input type="password" matInput placeholder="Password *" class="required" formControlName="password">
<mat-hint align="end" *ngIf="mode !== 2 && (loginForm.controls.password.errors && !loginForm.controls.password.pristine)" class="error">Password must be atleast 6 characters</mat-hint>
</mat-form-field>
<mat-form-field [class.hide]="mode !== 1" class="full-width required">
<input type="password" matInput placeholder="Confirm Password" class="required" formControlName="confirmPassword">
<mat-hint align="end" *ngIf="mode === 1 && (loginForm.controls.password.valid && loginForm.hasError('passwordmismatch'))" class="error">Must match Password</mat-hint>
</mat-form-field>
<ng-container [ngSwitch]="mode">
<ng-container *ngSwitchCase="0">
<div class="formfield">
<label>
<input type="checkbox" name="" >Keep me logged in
</label>
</div>
<button mat-raised-button class="btn signup" type="submit" [disabled]="!loginForm.valid">Login</button>
<div class="row loginlink">
<div class="col-xs-6"><a (click)="this.mode=2" title="Forgot Password?">Forgot Password?</a></div>
<div class="col-xs-6 textrigth"><a (click)="this.mode=1" title="New Signup">New Signup</a></div>
</div>
<div class="logininner textleft">
<div class="card">
<div class="row">
<div class="col-sm-7 col-xs-12">
<form (ngSubmit)="onSubmit()" class="sign-in-form" [formGroup]="loginForm" novalidate>
<input type="hidden" formControlName="mode" [(ngModel)]="mode" aria-label="hidden">
<div class="heading" [ngSwitch]="mode">
<span *ngSwitchCase="0">Login to your account</span>
<span *ngSwitchCase="1">Get a bit wiser - Sign up</span>
<span *ngSwitchCase="2">Forgot Password</span>
</div>
<mat-form-field class="full-width required">
<input matInput placeholder="Email *" formControlName="email" class="required" aria-label="email">
<mat-hint align="end" *ngIf="loginForm.controls.email.errors && !loginForm.controls.email.pristine" class="error">Invalid
Email!
</mat-hint>
</mat-form-field>
<mat-form-field [class.hide]="mode === 2" class="full-width required">
<input type="password" matInput placeholder="Password *" class="required" formControlName="password" aria-label="password">
<mat-hint align="end" *ngIf="mode !== 2 && (loginForm.controls.password.errors && !loginForm.controls.password.pristine)"
class="error">Password must be atleast 6 characters</mat-hint>
</mat-form-field>
<mat-form-field [class.hide]="mode !== 1" class="full-width required">
<input type="password" matInput placeholder="Confirm Password" class="required" formControlName="confirmPassword" aria-label="confirm-password">
<mat-hint align="end" *ngIf="mode === 1 && (loginForm.controls.password.valid && loginForm.hasError('passwordmismatch'))"
class="error">Must match Password</mat-hint>
</mat-form-field>
<ng-container [ngSwitch]="mode">
<ng-container *ngSwitchCase="0">
<div class="formfield">
<label>
<input type="checkbox" name="">Keep me logged in
</label>
</div>
<button mat-raised-button class="btn signup" type="submit" [disabled]="!loginForm.valid">Login</button>
<div class="row loginlink">
<div class="col-xs-6"><a (click)="this.mode=2" title="Forgot Password?">Forgot Password?</a></div>
<div class="col-xs-6 textrigth"><a (click)="this.mode=1" title="New Signup">New Signup</a></div>
</div>
</ng-container>
<ng-container *ngSwitchCase="1">
<button mat-raised-button class="btn signup" type="submit" [disabled]="!loginForm.valid">Sign Up</button>
<div class="signupfree">by clicking "Sign Up" I agree to bitWiser's Terms & Conditions</div>
<div class="textcenter loginlink"><a (click)="this.mode=0" title="Login">Already have an account? Login</a></div>
</ng-container>
<ng-container *ngSwitchCase="2">
<button mat-raised-button class="btn signup" type="submit" [disabled]="!loginForm.valid">Forgot Password</button>
<div class="textcenter loginlink"><a (click)="this.mode=0" title="Login">No. I remember it now!</a></div>
</ng-container>
</ng-container>
<ng-container *ngSwitchCase="1">
<button mat-raised-button class="btn signup" type="submit" [disabled]="!loginForm.valid">Sign Up</button>
<div class="signupfree">by clicking "Sign Up" I agree to bitWiser's Terms & Conditions</div>
<div class="textcenter loginlink"><a (click)="this.mode=0" title="Login">Already have an account? Login</a></div>
</ng-container>
<ng-container *ngSwitchCase="2">
<button mat-raised-button class="btn signup" type="submit" [disabled]="!loginForm.valid">Forgot Password</button>
<div class="textcenter loginlink"><a (click)="this.mode=0" title="Login">No. I remember it now!</a></div>
</ng-container>
</ng-container>
</form>
</div>
<div class="col-sm-5 col-xs-12 withsocial">
<h3>You can also login with your social account</h3>
<a (click)="twitterLogin()"><img src="/assets/images/twitbtn.png" alt="Twitter" /></a>
<a (click)="fbLogin()"><img src="/assets/images/faceboockbtn.png" alt="facebook" /></a>
<a (click)="googleLogin()"><img src="/assets/images/gpulsebtn.png" alt="Google Plus" /></a>
<a (click)="githubLogin()"><img src="/assets/images/githubbtn.png" alt="Github" /></a>
</form>
</div>
<div class="col-sm-5 col-xs-12 withsocial">
<h3>You can also login with your social account</h3>
<a (click)="twitterLogin()"><img src="/assets/images/twitbtn.png" alt="Twitter" /></a>
<a (click)="fbLogin()"><img src="/assets/images/faceboockbtn.png" alt="facebook" /></a>
<a (click)="googleLogin()"><img src="/assets/images/gpulsebtn.png" alt="Google Plus" /></a>
<a (click)="githubLogin()"><img src="/assets/images/githubbtn.png" alt="Github" /></a>
</div>
</div>
</div>
</div>
</div>
</mat-dialog-content>
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ export const CONFIG: IConfig = {
storageBucket: 'rwa-trivia-dev-e57fc.appspot.com',
messagingSenderId: '701588063269'
},
'functionsUrl': 'https://rwa-trivia-dev-e57fc.firebaseapp.com'
'functionsUrl': 'http://localhost:5000/rwa-trivia-dev-e57fc/us-central1'
};
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h4 class="sub-message">Please do the needfull edits and resubmit the question.<
<p class="field-caption">Select the category for bulk upload</p>
<div class="row">
<div class="formfield">
<select placeholder="Select Category" class="required" formControlName="category">
<select placeholder="Select Category" class="required" formControlName="category" aria-label="category">
<option *ngFor="let category of categories; trackBy: trackById" [value]="category.id">
{{category.categoryName}}
</option>
Expand All @@ -28,7 +28,7 @@ <h4 class="sub-message">Please do the needfull edits and resubmit the question.<
</div>
<div class="optionbox row col-md-11 formfield">
<p class="field-caption">Enter Your Question</p>
<textarea placeholder="Enter Your Question" formControlName="questionText" class="required col-md-12 col-xs-12"></textarea>
<textarea placeholder="Enter Your Question" formControlName="questionText" class="required col-md-12 col-xs-12" aria-label="questionText"></textarea>
<p *ngIf="questionForm.controls.questionText.errors && !questionForm.controls.questionText.pristine" class="error">Question
is required!</p>
</div>
Expand All @@ -39,7 +39,8 @@ <h4 class="sub-message">Please do the needfull edits and resubmit the question.<
<label>
<input type="checkbox" formControlName="correct">
</label>
<input [placeholder]="'Enter Option ' + (i+1)" formControlName="answerText" type="text" class="required edit-form-input-field">
<input [placeholder]="'Enter Option ' + (i+1)" formControlName="answerText" type="text" class="required edit-form-input-field"
aria-label="answerText">
</div>
</ng-container>
<div class="error" *ngIf="!answers.valid && !answers.pristine">
Expand All @@ -65,9 +66,9 @@ <h4 class="sub-message">Please do the needfull edits and resubmit the question.<
</mat-basic-chip>
</mat-chip-list>
<input type="text" class="type-zone margin-bottom-8 edit-form-input-field" contenteditable="true" formControlName="tags"
placeholder="add tags">
placeholder="add tags" aria-label="tags">
<div>
<button type="button" class="add-tag-btn" [disabled]="questionForm.controls.tags.value==''" (click)="addTag()">Add</button>
<button type="button" class="add-tag-btn" [disabled]="questionForm.controls.tags.value==''" (click)="addTag()" aria-label="password">Add</button>
</div>

<div class="error row col-md-12" *ngIf="answers.valid && questionForm.controls.questionText.valid && questionForm.hasError('tagCountInvalid')">
Expand All @@ -76,7 +77,7 @@ <h4 class="sub-message">Please do the needfull edits and resubmit the question.<
</div>
</div>
<div class="savebox">
<button class="btn resubmit-btn" type="submit" [disabled]="!questionForm.valid">Resubmit</button>
<button class="btn resubmit-btn" type="submit" [disabled]="!questionForm.valid" aria-label="submit">Resubmit</button>
</div>
</section>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,61 +1,49 @@
<div *ngIf="questions && categoryAggregation && tagsCount" class="question-table-form">
<div fxLayout="row" fxLayoutAlign="space-between">
<div class="filter-facet-column" fxLayout="column">
<mat-list dense>
<h3 mdSubheader>Categories</h3>
<mat-list-item *ngFor="let category of categoriesObs | async">
<mat-checkbox
[disabled]="!categoryAggregation.hasOwnProperty(category.id) || categoryAggregation[category.id] === 0"
[value]="category.id"
(change)="categoryChanged($event, category)"
>
{{category.categoryName}} ({{categoryAggregation.hasOwnProperty(category.id) ? categoryAggregation[category.id] : 0}})
</mat-checkbox>
</mat-list-item>
<mat-divider></mat-divider>

<h3 mdSubheader>Tags</h3>
<mat-list-item *ngFor="let tagCount of tagsCount">
<mat-checkbox
[checked]="tagsChecked[tagCount.tag]"
(change)="tagChanged($event, tagCount.tag)">{{tagCount.tag}} ({{tagCount.count}})</mat-checkbox>
</mat-list-item>
<mat-form-field>
<input matInput placeholder="Enter Tag">
</mat-form-field>
<mat-divider></mat-divider>

<h3 mdSubheader>Status</h3>
<mat-divider></mat-divider>

<h3 mdSubheader>Updated By</h3>
<mat-divider></mat-divider>

<h3 mdSubheader>Created By</h3>
<mat-divider></mat-divider>

<h3 mdSubheader>Updated On</h3>
<mat-divider></mat-divider>

<h3 mdSubheader>Created By</h3>
</mat-list>
</div>
<div fxLayout="row" fxLayoutAlign="space-between">
<div class="filter-facet-column" fxLayout="column">
<mat-list dense>
<h3 mdSubheader>Categories</h3>
<mat-list-item *ngFor="let category of categoriesObs | async">
<mat-checkbox [disabled]="!categoryAggregation.hasOwnProperty(category.id) || categoryAggregation[category.id] === 0" [value]="category.id"
(change)="categoryChanged($event, category)">
{{category.categoryName}} ({{categoryAggregation.hasOwnProperty(category.id) ? categoryAggregation[category.id] : 0}})
</mat-checkbox>
</mat-list-item>
<mat-divider></mat-divider>

<div class="example-container mat-elevation-z8">

<question-table
[showSort]="true"
[showPaginator]="true"
[questions]="questions"
[totalCount]="totalCount"
[categoryDictionary]="categoryDictionary"
[showApproveButton]="false"
[clientSidePagination]="false"
(onApproveClicked)="approveClicked($event)"
(onPageChanged)="pageChanged($event)"
(onSortOrderChanged)="sortOrderChanged($event)">
</question-table>
</div>
<h3 mdSubheader>Tags</h3>
<mat-list-item *ngFor="let tagCount of tagsCount">
<mat-checkbox [checked]="tagsChecked[tagCount.tag]" (change)="tagChanged($event, tagCount.tag)">{{tagCount.tag}}
({{tagCount.count}})</mat-checkbox>
</mat-list-item>
<mat-form-field>
<input matInput placeholder="Enter Tag" aria-label="tag">
</mat-form-field>
<mat-divider></mat-divider>

<h3 mdSubheader>Status</h3>
<mat-divider></mat-divider>

<h3 mdSubheader>Updated By</h3>
<mat-divider></mat-divider>

<h3 mdSubheader>Created By</h3>
<mat-divider></mat-divider>

</div>
</div>
<h3 mdSubheader>Updated On</h3>
<mat-divider></mat-divider>

<h3 mdSubheader>Created By</h3>
</mat-list>
</div>

<div class="example-container mat-elevation-z8">

<question-table [showSort]="true" [showPaginator]="true" [questions]="questions" [totalCount]="totalCount" [categoryDictionary]="categoryDictionary"
[showApproveButton]="false" [clientSidePagination]="false" (onApproveClicked)="approveClicked($event)" (onPageChanged)="pageChanged($event)"
(onSortOrderChanged)="sortOrderChanged($event)">
</question-table>
</div>

</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
<div class="col-sm-10">
<div class="example-container">
<mat-form-field>
<textarea matInput placeholder="Reason for requesting a change" formControlName="reason"></textarea>
<textarea matInput placeholder="Reason for requesting a change" formControlName="reason" aria-label="reason"></textarea>
</mat-form-field>
</div>
</div>
Expand All @@ -174,7 +174,7 @@
<div class="col-sm-10">
<div class="example-container">
<mat-form-field>
<textarea matInput placeholder="Reason for Rejection" formControlName="reason"></textarea>
<textarea matInput placeholder="Reason for Rejection" formControlName="reason" aria-label="reason"></textarea>
</mat-form-field>
</div>
</div>
Expand Down
Loading

0 comments on commit fa0dd3e

Please sign in to comment.