diff --git a/ng-seed/src/app/appoinment/appoinment-routing.module.ts b/ng-seed/src/app/appoinment/appoinment-routing.module.ts index 3f746e3..12187a1 100644 --- a/ng-seed/src/app/appoinment/appoinment-routing.module.ts +++ b/ng-seed/src/app/appoinment/appoinment-routing.module.ts @@ -1,13 +1,22 @@ import { Component, NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; +<<<<<<< HEAD import { AddBusinessListComponent } from './business/add-business-list/add-business-list.component'; +======= +import { AppoinmentsListComponent } from './appoinments/appoinments-list/appoinments-list.component'; +import { BusinessListComponent } from './business/business-list/business-list.component'; +import { CalendarListComponent } from './calendars/calendar-list/calendar-list.component'; +import { CustomersListComponent } from './customers/customers-list/customers-list.component'; +import { ServiceListComponent } from './service-list-details/service-list/service-list.component'; +>>>>>>> ad201609bd8dc2d9a939bf24f4eb3c1b0107e912 import { UserListComponent } from './user/user-list/user-list.component'; -const routes: Routes = [ { - path: 'add-business-list', - component: AddBusinessListComponent -}, +const routes: Routes = [ +// { +// path: 'add-business-list', +// component: AddBusinessListComponent +// }, { path: 'add-user-list', diff --git a/ng-seed/src/app/appoinment/business/add-business-list/add-business-list.component.html b/ng-seed/src/app/appoinment/business/add-business-list/add-business-list.component.html deleted file mode 100644 index ef403b0..0000000 --- a/ng-seed/src/app/appoinment/business/add-business-list/add-business-list.component.html +++ /dev/null @@ -1,64 +0,0 @@ - -
-

Add Business

-
-
- - - - -- - - {{business.name}} - - - Please Business - Please choose any other - - - - Name is required - Limit exceed - - - - - Please enter a valid email address - - - Email is required - - - - - Contact No is required - Limit exceed - - - - Address is required - Limit exceed - - - - City is required - Limit exceed - - - - City is required - Limit exceed - - -
- -
- -
- -
-
-
\ No newline at end of file diff --git a/ng-seed/src/app/appoinment/business/add-business-list/add-business-list.component.scss b/ng-seed/src/app/appoinment/business/add-business-list/add-business-list.component.scss deleted file mode 100644 index c4835fa..0000000 --- a/ng-seed/src/app/appoinment/business/add-business-list/add-business-list.component.scss +++ /dev/null @@ -1,7 +0,0 @@ -.vertical-center { - margin: 0; - // position: absolute; - // top: 50%; - // -ms-transform: translateY(-50%); - // transform: translateY(-50%); - } \ No newline at end of file diff --git a/ng-seed/src/app/appoinment/business/add-business-list/add-business-list.component.spec.ts b/ng-seed/src/app/appoinment/business/add-business-list/add-business-list.component.spec.ts deleted file mode 100644 index c19a956..0000000 --- a/ng-seed/src/app/appoinment/business/add-business-list/add-business-list.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { AddBusinessListComponent } from './add-business-list.component'; - -describe('AddBusinessListComponent', () => { - let component: AddBusinessListComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ AddBusinessListComponent ] - }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(AddBusinessListComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/ng-seed/src/app/appoinment/business/add-business-list/add-business-list.component.ts b/ng-seed/src/app/appoinment/business/add-business-list/add-business-list.component.ts deleted file mode 100644 index 66fe6b8..0000000 --- a/ng-seed/src/app/appoinment/business/add-business-list/add-business-list.component.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; -import { Router } from '@angular/router'; - -@Component({ - selector: 'app-add-business-list', - templateUrl: './add-business-list.component.html', - styleUrls: ['./add-business-list.component.scss'] -}) -export class AddBusinessListComponent implements OnInit { - form: FormGroup; - fileToUpload: any; - imageUrl: any; - - businessselect = new FormControl('', [Validators.required]); - selects = [ - {name: 'A'}, - {name: 'B'}, - {name: 'C'}, - {name: 'D'}, - ]; - - constructor(private router: Router,private formBuilder: FormBuilder) { } - - get f(){ - return this.form.controls; - } - -ngOnInit() { - this.form = new FormGroup({ - businessselect: new FormControl('', [Validators.required]), - bus_name: new FormControl('', [Validators.required, Validators.maxLength(20)]), - address: new FormControl('', [Validators.required, Validators.maxLength(50)]), - city: new FormControl('', [Validators.required, Validators.maxLength(10)]), - state: new FormControl('', [Validators.required, Validators.maxLength(10)]), - email: new FormControl('', [Validators.required, Validators.email,Validators.pattern( - '[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,63}$', - ),]), - contact_no: new FormControl('', [Validators.required, Validators.maxLength(10)]), - }); - } - - public myError = (controlName: string, errorName: string) =>{ - return this.form.controls[controlName].hasError(errorName); - } - - submit(){ - console.log(this.form.value); - } - register() { - this.router.navigate(['/']); - } - - handleFileInput(file: FileList) { - this.fileToUpload = file.item(0); - - //Show image preview - let reader = new FileReader(); - reader.onload = (event: any) => { - this.imageUrl = event.target.result; - } - reader.readAsDataURL(this.fileToUpload); - } - - -} diff --git a/ng-seed/src/app/appoinment/business/add-business/add-business.component.html b/ng-seed/src/app/appoinment/business/add-business/add-business.component.html new file mode 100644 index 0000000..cdfe5f3 --- /dev/null +++ b/ng-seed/src/app/appoinment/business/add-business/add-business.component.html @@ -0,0 +1,66 @@ + +
{{action}} Business +
+
+ +
+ + + + Name is required + Limit exceed + + + + + + Please enter a valid email address + + + Email is required + + + + + Contact No is required + Limit exceed + + + + Address is required + Limit exceed + + + + State is required + Limit exceed + + + + City is required + Limit exceed + + + + + + +
+
+ + Sure to delete {{local_data.name}}? + +
+ + +
+
+ + + + \ No newline at end of file diff --git a/ng-seed/src/app/appoinment/business/dialog-box/dialog-box.component.scss b/ng-seed/src/app/appoinment/business/add-business/add-business.component.scss similarity index 100% rename from ng-seed/src/app/appoinment/business/dialog-box/dialog-box.component.scss rename to ng-seed/src/app/appoinment/business/add-business/add-business.component.scss diff --git a/ng-seed/src/app/appoinment/user/add-user-list/add-user-list.component.spec.ts b/ng-seed/src/app/appoinment/business/add-business/add-business.component.spec.ts similarity index 53% rename from ng-seed/src/app/appoinment/user/add-user-list/add-user-list.component.spec.ts rename to ng-seed/src/app/appoinment/business/add-business/add-business.component.spec.ts index 133b584..138402c 100644 --- a/ng-seed/src/app/appoinment/user/add-user-list/add-user-list.component.spec.ts +++ b/ng-seed/src/app/appoinment/business/add-business/add-business.component.spec.ts @@ -1,20 +1,20 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { AddUserListComponent } from './add-user-list.component'; +import { AddBusinessComponent } from './add-business.component'; -describe('AddUserListComponent', () => { - let component: AddUserListComponent; - let fixture: ComponentFixture; +describe('AddBusinessComponent', () => { + let component: AddBusinessComponent; + let fixture: ComponentFixture; beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ AddUserListComponent ] + declarations: [ AddBusinessComponent ] }) .compileComponents(); }); beforeEach(() => { - fixture = TestBed.createComponent(AddUserListComponent); + fixture = TestBed.createComponent(AddBusinessComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/ng-seed/src/app/appoinment/business/dialog-box/dialog-box.component.ts b/ng-seed/src/app/appoinment/business/add-business/add-business.component.ts similarity index 92% rename from ng-seed/src/app/appoinment/business/dialog-box/dialog-box.component.ts rename to ng-seed/src/app/appoinment/business/add-business/add-business.component.ts index 308a062..39e0dc9 100644 --- a/ng-seed/src/app/appoinment/business/dialog-box/dialog-box.component.ts +++ b/ng-seed/src/app/appoinment/business/add-business/add-business.component.ts @@ -7,12 +7,14 @@ export interface UsersData { name: string; id: number; } + @Component({ - selector: 'app-dialog-box', - templateUrl: './dialog-box.component.html', - styleUrls: ['./dialog-box.component.scss'] + selector: 'app-add-business', + templateUrl: './add-business.component.html', + styleUrls: ['./add-business.component.scss'] }) -export class DialogBoxComponent implements OnInit { +export class AddBusinessComponent implements OnInit { + form: FormGroup; fileToUpload: any; imageUrl: any; @@ -21,7 +23,7 @@ export class DialogBoxComponent implements OnInit { url: string | ArrayBuffer; imageViewStatus: boolean = false; constructor(private router: Router,private formBuilder: FormBuilder, - public dialogRef: MatDialogRef, + public dialogRef: MatDialogRef, @Optional() @Inject(MAT_DIALOG_DATA) public data: UsersData) { console.log(data); this.local_data = {...data}; @@ -88,4 +90,5 @@ export class DialogBoxComponent implements OnInit { console.log(this.form.value); console.log(this.action,this.local_data) } + } diff --git a/ng-seed/src/app/appoinment/business/business-list/business-list.component.ts b/ng-seed/src/app/appoinment/business/business-list/business-list.component.ts index 92e2173..348596d 100644 --- a/ng-seed/src/app/appoinment/business/business-list/business-list.component.ts +++ b/ng-seed/src/app/appoinment/business/business-list/business-list.component.ts @@ -5,8 +5,9 @@ import { MatSort } from '@angular/material/sort'; import { MatTable, MatTableDataSource } from '@angular/material/table'; import { Router } from '@angular/router'; import Swal from 'sweetalert2/dist/sweetalert2.js'; +import { AddBusinessComponent } from '../add-business/add-business.component'; import { BusinessService } from '../business-service/business.service'; -import { DialogBoxComponent } from '../dialog-box/dialog-box.component'; + export interface UsersData { id: number; @@ -108,8 +109,13 @@ export class BusinessListComponent implements OnInit { } openDialog(action,obj) { obj.action = action; +<<<<<<< HEAD const dialogRef = this.dialog.open(DialogBoxComponent, { width: '30%', +======= + const dialogRef = this.dialog.open(AddBusinessComponent, { + width: '39%', +>>>>>>> ad201609bd8dc2d9a939bf24f4eb3c1b0107e912 height: '100%', // maxWidth: '38vw', position: { right: '0' }, diff --git a/ng-seed/src/app/appoinment/business/business.module.ts b/ng-seed/src/app/appoinment/business/business.module.ts index cfbad6d..a14c122 100644 --- a/ng-seed/src/app/appoinment/business/business.module.ts +++ b/ng-seed/src/app/appoinment/business/business.module.ts @@ -3,21 +3,19 @@ import { CommonModule } from '@angular/common'; import { BusinessRoutingModule } from './business-routing.module'; import { BusinessListComponent } from './business-list/business-list.component'; -import { AddBusinessListComponent } from './add-business-list/add-business-list.component'; import { MatSidenavModule } from '@angular/material/sidenav'; import { MatFormFieldModule } from '@angular/material/form-field'; -import { DialogBoxComponent } from './dialog-box/dialog-box.component'; import { ScrollingModule } from '@angular/cdk/scrolling'; import { DemoMaterialModule } from 'app/shared/demo.module'; import { NgScrollbarModule } from 'ngx-scrollbar'; +import { AddBusinessComponent } from './add-business/add-business.component'; @NgModule({ declarations: [ BusinessListComponent, - AddBusinessListComponent, - DialogBoxComponent + AddBusinessComponent ], imports: [ diff --git a/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.html b/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.html index 6a76a68..9066ae0 100644 --- a/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.html +++ b/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.html @@ -1,10 +1,19 @@ + + -
- -
+ - Staff Information + + Staff Information
@@ -85,9 +94,9 @@
First Name is required
-
+
@@ -95,13 +104,14 @@ - Working Hours + + Working Hours
Working Hours - +
@@ -210,6 +220,7 @@
+ Staff Booking URL @@ -238,4 +249,6 @@ -
\ No newline at end of file + + + \ No newline at end of file diff --git a/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.scss b/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.scss index a75b318..5793d5d 100644 --- a/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.scss +++ b/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.scss @@ -24,6 +24,7 @@ flex-direction: column; background-color: white; margin-left: 2rem; + // margin-top: -9rem; } mat-tab-body { @@ -324,4 +325,23 @@ margin-bottom: 10rem; } - +// .user-pro-wrap{ +// background-color: #fff; +// // height: 100%; +// width: 18%; +// } +// .userpic{ +// font-size: 17px; +// display: block; +// overflow: hidden; +// text-overflow: ellipsis; +// white-space: nowrap; +// color: #4C4C4C; +// text-align: center; +// } +// .admin{ +// display: inline-block; +// font-size: 12px; +// color: #4C4C4C; +// text-align: center; +// } diff --git a/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.ts b/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.ts index 2160ff1..0b397b8 100644 --- a/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.ts +++ b/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.ts @@ -1,5 +1,7 @@ import { Component, OnInit } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { MatDialog } from '@angular/material/dialog'; +import { EditWorkingHoursComponent } from '../edit-working-hours/edit-working-hours.component'; @Component({ selector: 'app-consultant-setting', @@ -19,7 +21,7 @@ export class ConsultantSettingComponent implements OnInit { status: 'Active', }, ]; - constructor(private formBuilder: FormBuilder) {} + constructor(private formBuilder: FormBuilder, public dialog: MatDialog) {} ngOnInit() { @@ -47,5 +49,22 @@ onSubmit() { } console.log(JSON.stringify(this.registerForm.value, null, 2)); } +openDialog(action,obj) { + obj.action = action; + const dialogRef = this.dialog.open(EditWorkingHoursComponent, { + width: '48%', + height: '100%', + // maxWidth: '38vw', + position: { right: '0' }, + data:obj + }); + // dialogRef.afterClosed().subscribe(result => { + // if(result != undefined){ + // console.log(result) + // this.formAddUpdateAndDelete(result,result.data) + // } + // }); +} + } diff --git a/ng-seed/src/app/appoinment/consultant-setting/edit-working-hours/edit-working-hours.component.html b/ng-seed/src/app/appoinment/consultant-setting/edit-working-hours/edit-working-hours.component.html index fbed12b..a2b9f0b 100644 --- a/ng-seed/src/app/appoinment/consultant-setting/edit-working-hours/edit-working-hours.component.html +++ b/ng-seed/src/app/appoinment/consultant-setting/edit-working-hours/edit-working-hours.component.html @@ -1 +1,271 @@ -

edit-working-hours works!

+
+ + + +
+
+ + + + +
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+ + +
+
Apply To All
+
+
+
+ + + + +
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+ + +
+
Apply To All
+
+
+
+ + + + +
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+ + +
+
Apply To All
+
+
+
+ + + + +
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+ + +
+
Apply To All
+
+
+
+ + + + +
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+ + +
+
Apply To All
+
+
+
+ + + + +
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+ + +
+
Apply To All
+
+
+
+ + + + +
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+ + +
+
Apply To All
+
+ + +
+ + + diff --git a/ng-seed/src/app/appoinment/consultant-setting/edit-working-hours/edit-working-hours.component.scss b/ng-seed/src/app/appoinment/consultant-setting/edit-working-hours/edit-working-hours.component.scss index e69de29..4d76379 100644 --- a/ng-seed/src/app/appoinment/consultant-setting/edit-working-hours/edit-working-hours.component.scss +++ b/ng-seed/src/app/appoinment/consultant-setting/edit-working-hours/edit-working-hours.component.scss @@ -0,0 +1,96 @@ +.edit-working{ + .popup-header { + background: #FFF; + padding: 5px 5px 5px 5px; + } + .button{ + // float: right; + margin-bottom: 1rem; + background-color: #ffff; + margin-top: -1rem; + // margin-left: 6rem; + float: right; + } + .label-container { + display: flex; + width: 100%; + border-bottom: 1px solid #F5F6F8; + box-sizing: border-box; + min-height: 40px; + padding: 13px 0; + } + .label-name{ + color: #666; + position: relative; + text-transform: capitalize; + width: 100px; + flex: none; + margin-right: 15px; + align-self: flex-start; + padding-top: 13px; + box-sizing: border-box; + line-height: 15px; + } + .labelname label { + color: #666; + font-size: 14px; + // padding: 10px 10px 10px 10px; + width: 150px; + } + .dis-flex { + display: flex!important; + } + .width-10px { + width: 10px!important; + } + .select-drop-box { + padding-right: 30px; + height: 40px; + background-color: #FFF; + font-size: 13px; + color: #111; + border-radius: 4px; + border-color: #666; + } + .addbreak{ + margin-top: 0.5rem; + margin-right: 2rem; + color: #FFF; + &:hover { + cursor: pointer; + color: #111; + } + } + // .scrollHV { + // height: calc(100vh - 190px); + // } + + .popup-button { + margin-top: 2rem; + width: 100%; + } + .cancel { + background: #F5F5F5; + color: #111; + float: left; + } + .buttons { + width: 50%; + background: #FFF; + color: #111; + font-size: 13px; + font-family: zohopuvi-medium; + text-align: center; + border-top: 1px solid #E2E2E2; + padding: 20px; + -webkit-transition: all .2s ease-in; + -moz-transition: all .2s ease-in; + transition: all .2s ease-in; + } + .add { + background: #52518F; + color: #FFF; + border-top: 1px solid #52518F; + float: left; + } +} diff --git a/ng-seed/src/app/appoinment/consultant-setting/edit-working-hours/edit-working-hours.component.ts b/ng-seed/src/app/appoinment/consultant-setting/edit-working-hours/edit-working-hours.component.ts index 59c16ba..5a3a0b1 100644 --- a/ng-seed/src/app/appoinment/consultant-setting/edit-working-hours/edit-working-hours.component.ts +++ b/ng-seed/src/app/appoinment/consultant-setting/edit-working-hours/edit-working-hours.component.ts @@ -1,4 +1,6 @@ import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup } from '@angular/forms'; +import { MatDialogRef } from '@angular/material/dialog'; @Component({ selector: 'app-edit-working-hours', @@ -7,10 +9,30 @@ import { Component, OnInit } from '@angular/core'; }) export class EditWorkingHoursComponent implements OnInit { - - constructor() { } + datainputForm: FormGroup; + timing: any[] = ['09:00am','09:30am','10:00am','10:30am','11:00am','11:30am','12:00am','12:30am','01:00pm','01:00pm','01:30pm', '02:00pm', '02:30pm', '03:00pm', '03:30pm', '04:00pm', '04:30pm', '05:00pm', '05:30pm', '06:00pm', '06:30pm', '07:00pm', '07:30pm', '08:00pm','08:30pm', '09:00pm',] - ngOnInit(): void { + constructor(public dialogRef: MatDialogRef, private fb: FormBuilder) { } + + + close() { + this.dialogRef.close(); +} + +ngOnInit(): void { + this.datainputForm = this.fb.group({ + dropDownTest: '09:00am', + dropDownTest1:'' + }) +} +onSelectChange(){ + console.log(this.datainputForm.get('dropDownTest').value); + if( this.datainputForm.get('dropDownTest').value === 'vmnic3'){ + + this.datainputForm.get('dropDownTest1').disable(); + }else{ + this.datainputForm.get('dropDownTest1').enable(); + } } } diff --git a/ng-seed/src/app/appoinment/customers/dialog-box/dialog-box.component.html b/ng-seed/src/app/appoinment/customers/add-customers/add-customers.component.html similarity index 100% rename from ng-seed/src/app/appoinment/customers/dialog-box/dialog-box.component.html rename to ng-seed/src/app/appoinment/customers/add-customers/add-customers.component.html diff --git a/ng-seed/src/app/appoinment/customers/dialog-box/dialog-box.component.scss b/ng-seed/src/app/appoinment/customers/add-customers/add-customers.component.scss similarity index 100% rename from ng-seed/src/app/appoinment/customers/dialog-box/dialog-box.component.scss rename to ng-seed/src/app/appoinment/customers/add-customers/add-customers.component.scss diff --git a/ng-seed/src/app/appoinment/user/user-dialog-box/user-dialog-box.component.spec.ts b/ng-seed/src/app/appoinment/customers/add-customers/add-customers.component.spec.ts similarity index 52% rename from ng-seed/src/app/appoinment/user/user-dialog-box/user-dialog-box.component.spec.ts rename to ng-seed/src/app/appoinment/customers/add-customers/add-customers.component.spec.ts index 9d4228a..f81a8fe 100644 --- a/ng-seed/src/app/appoinment/user/user-dialog-box/user-dialog-box.component.spec.ts +++ b/ng-seed/src/app/appoinment/customers/add-customers/add-customers.component.spec.ts @@ -1,20 +1,20 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { UserDialogBoxComponent } from './user-dialog-box.component'; +import { AddCustomersComponent } from './add-customers.component'; -describe('UserDialogBoxComponent', () => { - let component: UserDialogBoxComponent; - let fixture: ComponentFixture; +describe('AddCustomersComponent', () => { + let component: AddCustomersComponent; + let fixture: ComponentFixture; beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ UserDialogBoxComponent ] + declarations: [ AddCustomersComponent ] }) .compileComponents(); }); beforeEach(() => { - fixture = TestBed.createComponent(UserDialogBoxComponent); + fixture = TestBed.createComponent(AddCustomersComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/ng-seed/src/app/appoinment/customers/dialog-box/dialog-box.component.ts b/ng-seed/src/app/appoinment/customers/add-customers/add-customers.component.ts similarity index 90% rename from ng-seed/src/app/appoinment/customers/dialog-box/dialog-box.component.ts rename to ng-seed/src/app/appoinment/customers/add-customers/add-customers.component.ts index c0c2445..34f3893 100644 --- a/ng-seed/src/app/appoinment/customers/dialog-box/dialog-box.component.ts +++ b/ng-seed/src/app/appoinment/customers/add-customers/add-customers.component.ts @@ -6,12 +6,14 @@ export interface UsersData { cusName: string; id: number; } + @Component({ - selector: 'app-dialog-box', - templateUrl: './dialog-box.component.html', - styleUrls: ['./dialog-box.component.scss'] + selector: 'app-add-customers', + templateUrl: './add-customers.component.html', + styleUrls: ['./add-customers.component.scss'] }) -export class DialogBoxComponent implements OnInit { +export class AddCustomersComponent implements OnInit { + form: FormGroup; fileToUpload: any; imageUrl: any; @@ -19,7 +21,7 @@ export class DialogBoxComponent implements OnInit { local_data:any; url: string | ArrayBuffer; constructor(private router: Router,private formBuilder: FormBuilder, - public dialogRef: MatDialogRef, + public dialogRef: MatDialogRef, @Optional() @Inject(MAT_DIALOG_DATA) public data: UsersData) { console.log(data); this.local_data = {...data}; @@ -73,4 +75,5 @@ export class DialogBoxComponent implements OnInit { console.log(this.form.value); console.log(this.action,this.local_data) } + } diff --git a/ng-seed/src/app/appoinment/customers/customers-list/customers-list.component.ts b/ng-seed/src/app/appoinment/customers/customers-list/customers-list.component.ts index 3ad75fe..9d34fc5 100644 --- a/ng-seed/src/app/appoinment/customers/customers-list/customers-list.component.ts +++ b/ng-seed/src/app/appoinment/customers/customers-list/customers-list.component.ts @@ -3,8 +3,9 @@ import { MatDialog } from '@angular/material/dialog'; import { MatPaginator, PageEvent } from '@angular/material/paginator'; import { MatTable, MatTableDataSource } from '@angular/material/table'; import Swal from 'sweetalert2'; +import { AddCustomersComponent } from '../add-customers/add-customers.component'; import { CustomersService } from '../customers-service/customers.service'; -import { DialogBoxComponent } from '../dialog-box/dialog-box.component'; + export interface UsersData { id: number; @@ -128,7 +129,7 @@ export class CustomersListComponent implements OnInit { } openDialog(action,obj) { obj.action = action; - const dialogRef = this.dialog.open(DialogBoxComponent, { + const dialogRef = this.dialog.open(AddCustomersComponent, { width: '39%', height: '100%', // maxWidth: '38vw', diff --git a/ng-seed/src/app/appoinment/customers/customers.module.ts b/ng-seed/src/app/appoinment/customers/customers.module.ts index 08254f7..eb6ca3b 100644 --- a/ng-seed/src/app/appoinment/customers/customers.module.ts +++ b/ng-seed/src/app/appoinment/customers/customers.module.ts @@ -5,15 +5,15 @@ import { CustomersRoutingModule } from './customers-routing.module'; import { CustomersListComponent } from './customers-list/customers-list.component'; import { MatSidenavModule } from '@angular/material/sidenav'; import { MatFormFieldModule } from '@angular/material/form-field'; -import { DialogBoxComponent } from './dialog-box/dialog-box.component'; import { DemoMaterialModule } from 'app/shared/demo.module'; import { NgScrollbarModule } from 'ngx-scrollbar'; +import { AddCustomersComponent } from './add-customers/add-customers.component'; @NgModule({ declarations: [ CustomersListComponent, - DialogBoxComponent + AddCustomersComponent ], imports: [ DemoMaterialModule, diff --git a/ng-seed/src/app/appoinment/service-list-details/add-service/add-service.component.html b/ng-seed/src/app/appoinment/service-list-details/add-service/add-service.component.html new file mode 100644 index 0000000..ac1eff8 --- /dev/null +++ b/ng-seed/src/app/appoinment/service-list-details/add-service/add-service.component.html @@ -0,0 +1,20 @@ +
{{action}} Services +
+
+
+ + + + ServiceName is required + Limit exceed + + + Sure to delete {{local_data.servicesName}}? + +
+
+ + +
+
\ No newline at end of file diff --git a/ng-seed/src/app/appoinment/service-list-details/add-service/add-service.component.scss b/ng-seed/src/app/appoinment/service-list-details/add-service/add-service.component.scss new file mode 100644 index 0000000..c50ea44 --- /dev/null +++ b/ng-seed/src/app/appoinment/service-list-details/add-service/add-service.component.scss @@ -0,0 +1,11 @@ +.button{ + // float: right; + margin-bottom: 1rem; + background-color: #ffff; + margin-top: -1rem; + // margin-left: 6rem; + float: right; +} +.mat-pane{ + width: 20rem; +} \ No newline at end of file diff --git a/ng-seed/src/app/appoinment/customers/dialog-box/dialog-box.component.spec.ts b/ng-seed/src/app/appoinment/service-list-details/add-service/add-service.component.spec.ts similarity index 54% rename from ng-seed/src/app/appoinment/customers/dialog-box/dialog-box.component.spec.ts rename to ng-seed/src/app/appoinment/service-list-details/add-service/add-service.component.spec.ts index ec05663..81cccee 100644 --- a/ng-seed/src/app/appoinment/customers/dialog-box/dialog-box.component.spec.ts +++ b/ng-seed/src/app/appoinment/service-list-details/add-service/add-service.component.spec.ts @@ -1,20 +1,20 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { DialogBoxComponent } from './dialog-box.component'; +import { AddServiceComponent } from './add-service.component'; -describe('DialogBoxComponent', () => { - let component: DialogBoxComponent; - let fixture: ComponentFixture; +describe('AddServiceComponent', () => { + let component: AddServiceComponent; + let fixture: ComponentFixture; beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ DialogBoxComponent ] + declarations: [ AddServiceComponent ] }) .compileComponents(); }); beforeEach(() => { - fixture = TestBed.createComponent(DialogBoxComponent); + fixture = TestBed.createComponent(AddServiceComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/ng-seed/src/app/appoinment/service-list-details/add-service/add-service.component.ts b/ng-seed/src/app/appoinment/service-list-details/add-service/add-service.component.ts new file mode 100644 index 0000000..ffbbd48 --- /dev/null +++ b/ng-seed/src/app/appoinment/service-list-details/add-service/add-service.component.ts @@ -0,0 +1,58 @@ +import { Component, Inject, OnInit, Optional } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; +import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { Router } from '@angular/router'; +export interface UsersData { + servicesName: string; + id: number; +} + +@Component({ + selector: 'app-add-service', + templateUrl: './add-service.component.html', + styleUrls: ['./add-service.component.scss'] +}) +export class AddServiceComponent implements OnInit { + + form: FormGroup; + local_data:any; + action:string; + constructor(private router: Router,private formBuilder: FormBuilder, + public dialogRef: MatDialogRef, + @Optional() @Inject(MAT_DIALOG_DATA) public data: UsersData) { + console.log(data); + this.local_data = {...data}; + this.action = this.local_data.action; + } + get f(){ + return this.form.controls; + } + +close() { + this.dialogRef.close(); +} +closeDialog(){ + this.dialogRef.close({event:'Cancel'}); +} + +ngOnInit() { + this.form = new FormGroup({ + servicesName: new FormControl('', [Validators.required, Validators.maxLength(20)]), + }); + this.form.patchValue(this.local_data) + } + + public myError = (controlName: string, errorName: string) =>{ + return this.form.controls[controlName].hasError(errorName); + } + + submit(){ + console.log(this.form.value); + let tmp = this.form.value + tmp.serviceId = this.local_data.serviceId + this.dialogRef.close({event:this.action,data:tmp}); + console.log(this.form.value); + console.log(this.action,this.local_data) + } + +} diff --git a/ng-seed/src/app/appoinment/service-list-details/service-list.module.ts b/ng-seed/src/app/appoinment/service-list-details/service-list.module.ts new file mode 100644 index 0000000..2f683d7 --- /dev/null +++ b/ng-seed/src/app/appoinment/service-list-details/service-list.module.ts @@ -0,0 +1,22 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { ServiceListRoutingModule } from './service-list-routing.module'; +import { ServiceListComponent } from './service-list/service-list.component'; +import { DemoMaterialModule } from 'app/shared/demo.module'; +import { AddServiceComponent } from './add-service/add-service.component'; + + +@NgModule({ + declarations: [ + ServiceListComponent, + AddServiceComponent + ], + imports: [ + DemoMaterialModule, + CommonModule, + ServiceListRoutingModule, + ], + +}) +export class ServiceListModule { } diff --git a/ng-seed/src/app/appoinment/user/add-user-list/add-user-list.component.html b/ng-seed/src/app/appoinment/user/add-user-list/add-user-list.component.html deleted file mode 100644 index a963cb2..0000000 --- a/ng-seed/src/app/appoinment/user/add-user-list/add-user-list.component.html +++ /dev/null @@ -1 +0,0 @@ -

add-user-list works!

diff --git a/ng-seed/src/app/appoinment/user/add-user-list/add-user-list.component.scss b/ng-seed/src/app/appoinment/user/add-user-list/add-user-list.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/ng-seed/src/app/appoinment/user/add-user-list/add-user-list.component.ts b/ng-seed/src/app/appoinment/user/add-user-list/add-user-list.component.ts deleted file mode 100644 index f8c33e9..0000000 --- a/ng-seed/src/app/appoinment/user/add-user-list/add-user-list.component.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; -import { Router } from '@angular/router'; - -@Component({ - selector: 'app-add-user-list', - templateUrl: './add-user-list.component.html', - styleUrls: ['./add-user-list.component.scss'] -}) -export class AddUserListComponent implements OnInit { - - form: FormGroup; - fileToUpload: any; - imageUrl: any; - - businessselect = new FormControl('', [Validators.required]); - selects = [ - {name: 'A'}, - {name: 'B'}, - {name: 'C'}, - {name: 'D'}, - ]; - - constructor(private router: Router,private formBuilder: FormBuilder) { } - - get f(){ - return this.form.controls; - } - -ngOnInit() { - this.form = new FormGroup({ - businessselect: new FormControl('', [Validators.required]), - bus_name: new FormControl('', [Validators.required, Validators.maxLength(20)]), - address: new FormControl('', [Validators.required, Validators.maxLength(50)]), - city: new FormControl('', [Validators.required, Validators.maxLength(10)]), - state: new FormControl('', [Validators.required, Validators.maxLength(10)]), - email: new FormControl('', [Validators.required, Validators.email,Validators.pattern( - '[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,63}$', - ),]), - contact_no: new FormControl('', [Validators.required, Validators.maxLength(10)]), - }); - } - - public myError = (controlName: string, errorName: string) =>{ - return this.form.controls[controlName].hasError(errorName); - } - - submit(){ - console.log(this.form.value); - } - register() { - this.router.navigate(['/']); - } - - handleFileInput(file: FileList) { - this.fileToUpload = file.item(0); - - //Show image preview - let reader = new FileReader(); - reader.onload = (event: any) => { - this.imageUrl = event.target.result; - } - reader.readAsDataURL(this.fileToUpload); - } - -} diff --git a/ng-seed/src/app/appoinment/user/add-user/add-user.component.html b/ng-seed/src/app/appoinment/user/add-user/add-user.component.html new file mode 100644 index 0000000..e8c4089 --- /dev/null +++ b/ng-seed/src/app/appoinment/user/add-user/add-user.component.html @@ -0,0 +1,67 @@ + +
{{action}} Users +
+ +
+
+ + + -- + + {{business.busName}} + + + role is required + + + + + role is required + Limit exceed + + + + + Username is required + Limit exceed + + + + + Please enter a valid email address + + + Email is required + + + + + Contact No is required + Limit exceed + + + + Password is required + Limit exceed + + + +
+
+
+ + Sure to delete {{local_data.name}}? +
+
+ + +
+
+ + \ No newline at end of file diff --git a/ng-seed/src/app/appoinment/user/user-dialog-box/user-dialog-box.component.scss b/ng-seed/src/app/appoinment/user/add-user/add-user.component.scss similarity index 100% rename from ng-seed/src/app/appoinment/user/user-dialog-box/user-dialog-box.component.scss rename to ng-seed/src/app/appoinment/user/add-user/add-user.component.scss diff --git a/ng-seed/src/app/appoinment/business/dialog-box/dialog-box.component.spec.ts b/ng-seed/src/app/appoinment/user/add-user/add-user.component.spec.ts similarity index 54% rename from ng-seed/src/app/appoinment/business/dialog-box/dialog-box.component.spec.ts rename to ng-seed/src/app/appoinment/user/add-user/add-user.component.spec.ts index ec05663..68d1642 100644 --- a/ng-seed/src/app/appoinment/business/dialog-box/dialog-box.component.spec.ts +++ b/ng-seed/src/app/appoinment/user/add-user/add-user.component.spec.ts @@ -1,20 +1,20 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { DialogBoxComponent } from './dialog-box.component'; +import { AddUserComponent } from './add-user.component'; -describe('DialogBoxComponent', () => { - let component: DialogBoxComponent; - let fixture: ComponentFixture; +describe('AddUserComponent', () => { + let component: AddUserComponent; + let fixture: ComponentFixture; beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ DialogBoxComponent ] + declarations: [ AddUserComponent ] }) .compileComponents(); }); beforeEach(() => { - fixture = TestBed.createComponent(DialogBoxComponent); + fixture = TestBed.createComponent(AddUserComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/ng-seed/src/app/appoinment/user/user-dialog-box/user-dialog-box.component.ts b/ng-seed/src/app/appoinment/user/add-user/add-user.component.ts similarity index 93% rename from ng-seed/src/app/appoinment/user/user-dialog-box/user-dialog-box.component.ts rename to ng-seed/src/app/appoinment/user/add-user/add-user.component.ts index 056746b..5a47b6f 100644 --- a/ng-seed/src/app/appoinment/user/user-dialog-box/user-dialog-box.component.ts +++ b/ng-seed/src/app/appoinment/user/add-user/add-user.component.ts @@ -7,12 +7,14 @@ export interface UsersData { userName: string; id: number; } + @Component({ - selector: 'app-user-dialog-box', - templateUrl: './user-dialog-box.component.html', - styleUrls: ['./user-dialog-box.component.scss'] + selector: 'app-add-user', + templateUrl: './add-user.component.html', + styleUrls: ['./add-user.component.scss'] }) -export class UserDialogBoxComponent implements OnInit { +export class AddUserComponent implements OnInit { + hide: boolean; form: FormGroup; fileToUpload: any; @@ -23,7 +25,7 @@ export class UserDialogBoxComponent implements OnInit { businessList: any; public role = [{'name':'BADMIN'},{'name':'CONSULT'},{'name':'FRONTDESK'}] constructor(private router: Router,private formBuilder: FormBuilder, - public dialogRef: MatDialogRef, + public dialogRef: MatDialogRef, @Optional() @Inject(MAT_DIALOG_DATA) public data: UsersData,public _bus:BusinessService) { console.log(data); this.local_data = {...data}; @@ -102,5 +104,5 @@ export class UserDialogBoxComponent implements OnInit { submit(){ console.log(this.form.value); } - + } diff --git a/ng-seed/src/app/appoinment/user/user-list/user-list.component.ts b/ng-seed/src/app/appoinment/user/user-list/user-list.component.ts index 2e1f846..ce167fd 100644 --- a/ng-seed/src/app/appoinment/user/user-list/user-list.component.ts +++ b/ng-seed/src/app/appoinment/user/user-list/user-list.component.ts @@ -4,7 +4,7 @@ import { MatPaginator } from '@angular/material/paginator'; import { MatSort } from '@angular/material/sort'; import { MatTable, MatTableDataSource } from '@angular/material/table'; import Swal from 'sweetalert2/dist/sweetalert2.js'; -import { UserDialogBoxComponent } from '../user-dialog-box/user-dialog-box.component'; +import { AddUserComponent } from '../add-user/add-user.component'; import { UserService } from '../user-service/user.service'; export interface UsersData { @@ -132,7 +132,7 @@ export class UserListComponent implements OnInit { } openDialog(action,obj) { obj.action = action; - const dialogRef = this.dialog.open(UserDialogBoxComponent, { + const dialogRef = this.dialog.open(AddUserComponent, { // width: '30%', height: '100%', // maxWidth: '38vw', diff --git a/ng-seed/src/app/appoinment/user/user.module.ts b/ng-seed/src/app/appoinment/user/user.module.ts index 0baf597..ccd9bd3 100644 --- a/ng-seed/src/app/appoinment/user/user.module.ts +++ b/ng-seed/src/app/appoinment/user/user.module.ts @@ -1,21 +1,19 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { UserRoutingModule } from './user-routing.module'; -import { AddUserListComponent } from './add-user-list/add-user-list.component'; import { UserListComponent } from './user-list/user-list.component'; import { MatSidenavModule } from '@angular/material/sidenav'; import { MatFormFieldModule } from '@angular/material/form-field'; -import { UserDialogBoxComponent } from './user-dialog-box/user-dialog-box.component'; import { DemoMaterialModule } from 'app/shared/demo.module'; import { NgScrollbarModule } from 'ngx-scrollbar'; +import { AddUserComponent } from './add-user/add-user.component'; @NgModule({ declarations: [ - AddUserListComponent, UserListComponent, - UserDialogBoxComponent + AddUserComponent ], imports: [ DemoMaterialModule, diff --git a/ng-seed/src/app/end-user/service-list-details/dialog-box/dialog-box.component.spec.ts b/ng-seed/src/app/end-user/service-list-details/dialog-box/dialog-box.component.spec.ts index ec05663..68d1642 100644 --- a/ng-seed/src/app/end-user/service-list-details/dialog-box/dialog-box.component.spec.ts +++ b/ng-seed/src/app/end-user/service-list-details/dialog-box/dialog-box.component.spec.ts @@ -1,20 +1,20 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { DialogBoxComponent } from './dialog-box.component'; +import { AddUserComponent } from './add-user.component'; -describe('DialogBoxComponent', () => { - let component: DialogBoxComponent; - let fixture: ComponentFixture; +describe('AddUserComponent', () => { + let component: AddUserComponent; + let fixture: ComponentFixture; beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ DialogBoxComponent ] + declarations: [ AddUserComponent ] }) .compileComponents(); }); beforeEach(() => { - fixture = TestBed.createComponent(DialogBoxComponent); + fixture = TestBed.createComponent(AddUserComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/ng-seed/src/app/end-user/service-list-details/dialog-box/dialog-box.component.ts b/ng-seed/src/app/end-user/service-list-details/dialog-box/dialog-box.component.ts index deca586..ffbbd48 100644 --- a/ng-seed/src/app/end-user/service-list-details/dialog-box/dialog-box.component.ts +++ b/ng-seed/src/app/end-user/service-list-details/dialog-box/dialog-box.component.ts @@ -6,17 +6,19 @@ export interface UsersData { servicesName: string; id: number; } + @Component({ - selector: 'app-dialog-box', - templateUrl: './dialog-box.component.html', - styleUrls: ['./dialog-box.component.scss'] + selector: 'app-add-service', + templateUrl: './add-service.component.html', + styleUrls: ['./add-service.component.scss'] }) -export class DialogBoxComponent implements OnInit { +export class AddServiceComponent implements OnInit { + form: FormGroup; local_data:any; action:string; constructor(private router: Router,private formBuilder: FormBuilder, - public dialogRef: MatDialogRef, + public dialogRef: MatDialogRef, @Optional() @Inject(MAT_DIALOG_DATA) public data: UsersData) { console.log(data); this.local_data = {...data}; @@ -52,4 +54,5 @@ ngOnInit() { console.log(this.form.value); console.log(this.action,this.local_data) } + } diff --git a/ng-seed/src/app/end-user/service-list-details/service-list.component.ts b/ng-seed/src/app/end-user/service-list-details/service-list.component.ts index c7d4b70..7583986 100644 --- a/ng-seed/src/app/end-user/service-list-details/service-list.component.ts +++ b/ng-seed/src/app/end-user/service-list-details/service-list.component.ts @@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { MatTableDataSource } from '@angular/material/table'; import Swal from 'sweetalert2'; -import { DialogBoxComponent } from '../dialog-box/dialog-box.component'; +import { AddServiceComponent } from '../add-service/add-service.component'; import { ApiServiceService } from '../service-api-services/api-service.service'; @Component({ @@ -101,7 +101,7 @@ export class ServiceListComponent implements OnInit { openDialog(action,obj) { obj.action = action; - const dialogRef = this.dialog.open(DialogBoxComponent, { + const dialogRef = this.dialog.open(AddServiceComponent, { width: '39%', height: '100%', // maxWidth: '38vw',