Commit 69ca81f1 by amalk

11-11-2019

parent b4e6cdc4
# B2cNew # Allorepar
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 7.3.8. This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 7.3.8.
......
{ {
"$schema": "./node_modules/@angular/cli/lib/config/schema.json", "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1, "version": 1,
"newProjectRoot": "allorepar", "newProjectRoot": "Allorepar",
"projects": { "projects": {
"allorepar": { "Allorepar": {
"root": "", "root": "",
"sourceRoot": "src", "sourceRoot": "src",
"projectType": "application", "projectType": "application",
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
"build": { "build": {
"builder": "@angular-devkit/build-angular:browser", "builder": "@angular-devkit/build-angular:browser",
"options": { "options": {
"outputPath": "dist/allorepar", "outputPath": "dist/Allorepar",
"index": "src/index.html", "index": "src/index.html",
"main": "src/main.ts", "main": "src/main.ts",
"polyfills": "src/polyfills.ts", "polyfills": "src/polyfills.ts",
...@@ -63,18 +63,18 @@ ...@@ -63,18 +63,18 @@
"serve": { "serve": {
"builder": "@angular-devkit/build-angular:dev-server", "builder": "@angular-devkit/build-angular:dev-server",
"options": { "options": {
"browserTarget": "allorepar:build" "browserTarget": "Allorepar:build"
}, },
"configurations": { "configurations": {
"production": { "production": {
"browserTarget": "allorepar:build:production" "browserTarget": "Allorepar:build:production"
} }
} }
}, },
"extract-i18n": { "extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n", "builder": "@angular-devkit/build-angular:extract-i18n",
"options": { "options": {
"browserTarget": "allorepar:build" "browserTarget": "Allorepar:build"
} }
}, },
"test": { "test": {
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
"tsConfig": "src/tsconfig.spec.json", "tsConfig": "src/tsconfig.spec.json",
"karmaConfig": "src/karma.conf.js", "karmaConfig": "src/karma.conf.js",
"styles": [ "styles": [
"src/styles.scss", "src/styles.scss"
], ],
"scripts": [], "scripts": [],
"assets": [ "assets": [
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
} }
} }
}, },
"allorepar-e2e": { "Allorepar-e2e": {
"root": "e2e/", "root": "e2e/",
"projectType": "application", "projectType": "application",
"prefix": "", "prefix": "",
...@@ -117,11 +117,11 @@ ...@@ -117,11 +117,11 @@
"builder": "@angular-devkit/build-angular:protractor", "builder": "@angular-devkit/build-angular:protractor",
"options": { "options": {
"protractorConfig": "e2e/protractor.conf.js", "protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "allorepar:serve" "devServerTarget": "Allorepar:serve"
}, },
"configurations": { "configurations": {
"production": { "production": {
"devServerTarget": "allorepar:serve:production" "devServerTarget": "Allorepar:serve:production"
} }
} }
}, },
...@@ -137,5 +137,5 @@ ...@@ -137,5 +137,5 @@
} }
} }
}, },
"defaultProject": "allorepar" "defaultProject": "Allorepar"
} }
\ No newline at end of file
...@@ -10,7 +10,7 @@ describe('workspace-project App', () => { ...@@ -10,7 +10,7 @@ describe('workspace-project App', () => {
it('should display welcome message', () => { it('should display welcome message', () => {
page.navigateTo(); page.navigateTo();
expect(page.getTitleText()).toEqual('Welcome to b2cNew!'); expect(page.getTitleText()).toEqual('Welcome to Allorepar!');
}); });
afterEach(async () => { afterEach(async () => {
......
{ {
"name": "allorepar", "name": "Allorepar",
"version": "0.0.0", "version": "0.0.0",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
...@@ -9882,4 +9882,4 @@ ...@@ -9882,4 +9882,4 @@
"integrity": "sha512-GkPiJL8jifSrKReKaTZ5jkhrMEgXbXYC+IPo1iquBjayRa0q86w3Dipjn8b415jpitMExe9lV8iTsv8tk3DGag==" "integrity": "sha512-GkPiJL8jifSrKReKaTZ5jkhrMEgXbXYC+IPo1iquBjayRa0q86w3Dipjn8b415jpitMExe9lV8iTsv8tk3DGag=="
} }
} }
} }
\ No newline at end of file
{ {
"name": "allorepar", "name": "Allorepar",
"version": "0.0.0", "version": "0.0.0",
"scripts": { "scripts": {
"ng": "ng", "ng": "ng",
...@@ -53,4 +53,4 @@ ...@@ -53,4 +53,4 @@
"tslint": "~5.11.0", "tslint": "~5.11.0",
"typescript": "~3.4.5" "typescript": "~3.4.5"
} }
} }
\ No newline at end of file
...@@ -20,16 +20,16 @@ describe('AppComponent', () => { ...@@ -20,16 +20,16 @@ describe('AppComponent', () => {
expect(app).toBeTruthy(); expect(app).toBeTruthy();
}); });
it(`should have as title 'b2cNew'`, () => { it(`should have as title 'Allorepar'`, () => {
const fixture = TestBed.createComponent(AppComponent); const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance; const app = fixture.debugElement.componentInstance;
expect(app.title).toEqual('b2cNew'); expect(app.title).toEqual('Allorepar');
}); });
it('should render title in a h1 tag', () => { it('should render title in a h1 tag', () => {
const fixture = TestBed.createComponent(AppComponent); const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges(); fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement; const compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('h1').textContent).toContain('Welcome to b2cNew!'); expect(compiled.querySelector('h1').textContent).toContain('Welcome to Allorepar!');
}); });
}); });
...@@ -128,25 +128,41 @@ ...@@ -128,25 +128,41 @@
<div class="col-md-6"> <div class="col-md-6">
<div class="contact_right_container" fxLayout="column" fxLayoutAlign="center start"> <div class="contact_right_container" fxLayout="column" fxLayoutAlign="center start">
<div class="contact_form"> <div class="contact_form">
<div class="contact_row"> <form [formGroup]="registerForm" (ngSubmit)="onSubmit()">
<p>Name</p> <div class="contact_row form-group">
<input class="" type="text"> <p>Name</p>
</div> <input type="text" formControlName="Name" class="form-control" [ngClass]="{ 'is-invalid': submitted && f.Name.errors }" />
<div class="contact_row"> <div *ngIf="submitted && f.Name.errors" class="invalid-feedback">
<p>Email Address</p> <div *ngIf="f.Name.errors.required">Name is required</div>
<input class="" type="mail"> </div>
</div> </div>
<div class="contact_row"> <div class="contact_row form-group">
<p>Phone Number</p> <p>Email Address</p>
<input class="" type="number"> <input type="mail" formControlName="email" class="form-control" [ngClass]="{ 'is-invalid': submitted && f.email.errors }" />
</div> <div *ngIf="submitted && f.email.errors" class="invalid-feedback">
<div class="contact_row"> <div *ngIf="f.email.errors.required">Email is required</div>
<p>Comments</p> <div *ngIf="f.email.errors.email">Email must be a valid email address</div>
<textarea class="" type="number" rows="8"></textarea> </div>
</div> </div>
<div class="contact_row"> <div class="contact_row form-group">
<button mat-button class="login_btn">submit</button> <p>Phone Number</p>
</div> <input type="number" formControlName="Number" class="form-control" [ngClass]="{ 'is-invalid': submitted && f.Number.errors }" />
<div *ngIf="submitted && f.Number.errors" class="invalid-feedback">
<div *ngIf="f.Number.errors.required">Phone Number required</div>
</div>
</div>
<div class="contact_row form-group">
<p>Comments</p>
<textarea type="text" rows="8" formControlName="Comment" class="form-control" [ngClass]="{ 'is-invalid': submitted && f.Comment.errors }">
</textarea>
<div *ngIf="submitted && f.Comment.errors" class="invalid-feedback">
<div *ngIf="f.Comment.errors.required">Comment is required</div>
</div>
</div>
<div class="contact_row form-group">
<button mat-button class="login_btn">submit</button>
</div>
</form>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -314,6 +314,9 @@ section.module.parallax { ...@@ -314,6 +314,9 @@ section.module.parallax {
height: 100vh; height: 100vh;
.contact_form { .contact_form {
width: 80%; width: 80%;
.form-group {
margin-bottom: 0px !important;
}
.contact_row { .contact_row {
padding-bottom: 40px; padding-bottom: 40px;
p { p {
......
...@@ -3,6 +3,7 @@ import { Component, OnInit, HostListener } from '@angular/core'; ...@@ -3,6 +3,7 @@ import { Component, OnInit, HostListener } from '@angular/core';
import { MaterialModule } from '../../../../modules/material.module'; import { MaterialModule } from '../../../../modules/material.module';
import { NgAnimateScrollService } from 'ng-animate-scroll'; import { NgAnimateScrollService } from 'ng-animate-scroll';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
declare var $; declare var $;
...@@ -24,10 +25,12 @@ declare const window: any; ...@@ -24,10 +25,12 @@ declare const window: any;
export class HomeComponent implements OnInit { export class HomeComponent implements OnInit {
registerForm: FormGroup;
submitted = false;
menuActive:any; menuActive:any;
isShow:any; isShow:any;
constructor(private animateScrollService: NgAnimateScrollService) { constructor(private animateScrollService: NgAnimateScrollService, private formBuilder: FormBuilder) {
this.menuActive = 1; this.menuActive = 1;
this.isShow=1; this.isShow=1;
...@@ -50,6 +53,25 @@ export class HomeComponent implements OnInit { ...@@ -50,6 +53,25 @@ export class HomeComponent implements OnInit {
} }
ngOnInit() { ngOnInit() {
this.registerForm = this.formBuilder.group({
Name: ['', Validators.required],
email: ['', [Validators.required, Validators.email]],
Number: ['', [Validators.required, Validators.minLength(6)]],
Comment: ['', Validators.required],
});
}
get f() { return this.registerForm.controls; }
onSubmit() {
this.submitted = true;
// stop here if form is invalid
if (this.registerForm.invalid) {
return;
}
alert('SUCCESS!! :-)\n\n' + JSON.stringify(this.registerForm.value))
} }
......
...@@ -128,25 +128,41 @@ ...@@ -128,25 +128,41 @@
<div class="col-md-6"> <div class="col-md-6">
<div class="contact_right_container" fxLayout="column" fxLayoutAlign="center start"> <div class="contact_right_container" fxLayout="column" fxLayoutAlign="center start">
<div class="contact_form"> <div class="contact_form">
<div class="contact_row"> <form [formGroup]="registerForm" (ngSubmit)="onSubmit()">
<p>Name</p> <div class="contact_row form-group">
<input class="" type="text"> <p>Name</p>
</div> <input type="text" formControlName="Name" class="form-control" [ngClass]="{ 'is-invalid': submitted && f.Name.errors }" />
<div class="contact_row"> <div *ngIf="submitted && f.Name.errors" class="invalid-feedback">
<p>Email Address</p> <div *ngIf="f.Name.errors.required">Name is required</div>
<input class="" type="mail"> </div>
</div> </div>
<div class="contact_row"> <div class="contact_row form-group">
<p>Phone Number</p> <p>Email Address</p>
<input class="" type="number"> <input type="mail" formControlName="email" class="form-control" [ngClass]="{ 'is-invalid': submitted && f.email.errors }" />
</div> <div *ngIf="submitted && f.email.errors" class="invalid-feedback">
<div class="contact_row"> <div *ngIf="f.email.errors.required">Email is required</div>
<p>Comments</p> <div *ngIf="f.email.errors.email">Email must be a valid email address</div>
<textarea class="" type="number" rows="8"></textarea> </div>
</div> </div>
<div class="contact_row"> <div class="contact_row form-group">
<button mat-button class="login_btn">submit</button> <p>Phone Number</p>
</div> <input type="number" formControlName="Number" class="form-control" [ngClass]="{ 'is-invalid': submitted && f.Number.errors }" />
<div *ngIf="submitted && f.Number.errors" class="invalid-feedback">
<div *ngIf="f.Number.errors.required">Phone Number required</div>
</div>
</div>
<div class="contact_row form-group">
<p>Comments</p>
<textarea type="text" rows="8" formControlName="Comment" class="form-control" [ngClass]="{ 'is-invalid': submitted && f.Comment.errors }">
</textarea>
<div *ngIf="submitted && f.Comment.errors" class="invalid-feedback">
<div *ngIf="f.Comment.errors.required">Comment is required</div>
</div>
</div>
<div class="contact_row form-group">
<button mat-button class="login_btn">submit</button>
</div>
</form>
</div> </div>
</div> </div>
</div> </div>
......
import { Component, OnInit } from '@angular/core'; import { NgModule } from '@angular/core';
import { Component, OnInit, HostListener } from '@angular/core';
import { MaterialModule } from '../../../../modules/material.module';
import { NgAnimateScrollService } from 'ng-animate-scroll';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
declare var $;
declare const window: any;
@NgModule({
imports: [
MaterialModule
]
})
@Component({ @Component({
selector: 'app-home', selector: 'app-home',
templateUrl: './home.component.html', templateUrl: './home.component.html',
styleUrls: ['./home.component.scss'] styleUrls: ['./home.component.scss']
}) })
export class HomeComponent implements OnInit { export class HomeComponent implements OnInit {
constructor() { }
registerForm: FormGroup;
submitted = false;
menuActive: any;
isShow: any;
constructor(private animateScrollService: NgAnimateScrollService, private formBuilder: FormBuilder) {
this.menuActive = 1;
this.isShow = 1;
}
toHome(duration?: number) {
this.animateScrollService.scrollToElement('home', duration);
this.menuActive = 1;
}
toAboutus(duration?: number) {
this.animateScrollService.scrollToElement('aboutus', duration);
this.menuActive = 2;
}
toContact(duration?: number) {
this.animateScrollService.scrollToElement('contact', duration);
this.menuActive = 3;
}
ngOnInit() { ngOnInit() {
this.registerForm = this.formBuilder.group({
Name: ['', Validators.required],
email: ['', [Validators.required, Validators.email]],
Number: ['', [Validators.required, Validators.minLength(6)]],
Comment: ['', Validators.required],
});
}
get f() { return this.registerForm.controls; }
onSubmit() {
this.submitted = true;
// stop here if form is invalid
if (this.registerForm.invalid) {
return;
}
alert('SUCCESS!! :-)\n\n' + JSON.stringify(this.registerForm.value))
}
@HostListener('window:scroll', [])
onWindowScroll() {
const number = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
$(window).scroll(function () {
const sticky = $('.navbar'),
scroll = $(window).scrollTop();
if (scroll > 10) { sticky.addClass('scrolled_navbar'); } else { sticky.removeClass('scrolled_navbar'); }
});
} }
user() {
this.isShow = 1;
}
mechanic() {
this.isShow = 2;
}
} }
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { ReactiveFormsModule } from '@angular/forms';
/*-- IMPORTED-ROUTING-MODULES --*/ /*-- IMPORTED-ROUTING-MODULES --*/
...@@ -23,6 +24,7 @@ import { HomeComponent } from '../components/app/home/desktop/home.component'; ...@@ -23,6 +24,7 @@ import { HomeComponent } from '../components/app/home/desktop/home.component';
imports: [ imports: [
CommonModule, CommonModule,
MaterialModule, MaterialModule,
ReactiveFormsModule,
FlexLayoutModule, FlexLayoutModule,
AppDesktopRoutingModule AppDesktopRoutingModule
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { ReactiveFormsModule } from '@angular/forms';
/*-- IMPORTED-ROUTING-MODULES --*/ /*-- IMPORTED-ROUTING-MODULES --*/
...@@ -24,6 +25,7 @@ import { HomeComponent } from '../components/app/home/mobile/home.component'; ...@@ -24,6 +25,7 @@ import { HomeComponent } from '../components/app/home/mobile/home.component';
CommonModule, CommonModule,
MaterialModule, MaterialModule,
FlexLayoutModule , FlexLayoutModule ,
ReactiveFormsModule,
AppMobileRoutingModule AppMobileRoutingModule
], ],
......
...@@ -4,6 +4,7 @@ import { NgModule } from '@angular/core'; ...@@ -4,6 +4,7 @@ import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser'; import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
/*-- IMPORTED-ROUTING-MODULES --*/ /*-- IMPORTED-ROUTING-MODULES --*/
import { AppRoutingModule } from './app-routing.module'; import { AppRoutingModule } from './app-routing.module';
......
// Karma configuration file, see link for more information // Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html // https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) { module.exports = function(config) {
config.set({ config.set({
basePath: '', basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'], frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [ plugins: [
require('karma-jasmine'), require('karma-jasmine'),
require('karma-chrome-launcher'), require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'), require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'), require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma') require('@angular-devkit/build-angular/plugins/karma')
], ],
client: { client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser clearContext: false // leave Jasmine Spec Runner output visible in browser
}, },
coverageIstanbulReporter: { coverageIstanbulReporter: {
dir: require('path').join(__dirname, '../coverage/b2cNew'), dir: require('path').join(__dirname, '../coverage/Allorepar'),
reports: ['html', 'lcovonly', 'text-summary'], reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true fixWebpackSourcePaths: true
}, },
reporters: ['progress', 'kjhtml'], reporters: ['progress', 'kjhtml'],
port: 9876, port: 9876,
colors: true, colors: true,
logLevel: config.LOG_INFO, logLevel: config.LOG_INFO,
autoWatch: true, autoWatch: true,
browsers: ['Chrome'], browsers: ['Chrome'],
singleRun: false, singleRun: false,
restartOnFileChange: true restartOnFileChange: true
}); });
}; };
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment