Skip to content

Commit

Permalink
added android compatible UI.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhanu-git20 committed May 19, 2021
1 parent c4da6bd commit 767dee0
Show file tree
Hide file tree
Showing 21 changed files with 1,122 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export class Global {
chatData: Array<ChatModel> = new Array<ChatModel>();
public practiceArray: Array<Practice> = [];
previousChats: Array<MessageModel> = [];
isMobile = /iPhone|webOS|mobile|CriOS|iPad|iPod|BlackBerry|IEMobile|'Android' + 'Chrome'|Opera Mini|Android/i;
isMobile :boolean = false;
// /iPhone|webOS|mobile|CriOS|iPad|iPod|BlackBerry|IEMobile|'Android' + 'Chrome'|Opera Mini|Android/i;
constructor() {
this.providerObj = new Provider();
this.patientObj = new Patient();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ export class JitsiComponent implements OnInit, OnDestroy {
REMOTE_THUMBNAIL_RATIO: 0, // 1:1
LOCAL_THUMBNAIL_RATIO: 3/3 ,
VIDEO_QUALITY_LABEL_DISABLED: true,
filmStripOnly: false,
TOOLBAR_BUTTONS: ['microphone', 'camera', 'videoquality', 'fullscreen']
//filmStripOnly: false,
TOOLBAR_BUTTONS: ['microphone', 'camera','videoquality', 'fullscreen']
}
}

Expand Down
15 changes: 14 additions & 1 deletion FewaTelemedicine/ClientApp/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,21 @@ export class AppComponent {
this.global.currentPractice=p[1];
this.global.currentProvider=p[2];
}

this.global.providerObj.url = this.global.currentProvider;

if(navigator.userAgent.match(/Android/i)
|| navigator.userAgent.match(/webOS/i)
|| navigator.userAgent.match(/iPhone/i)
|| navigator.userAgent.match(/iPad/i)
|| navigator.userAgent.match(/iPod/i)
|| navigator.userAgent.match(/BlackBerry/i)
|| navigator.userAgent.match(/Windows Phone/i))
{
this.global.isMobile = true;
}
else{
this.global.isMobile = false;
}
}

selectTheme(type) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<!-- <meta name="viewport" content="width=device-width, initial-scale=1.0"> -->
<div class="patient-intro">
<div class="container">
<div class="row">
<div class="col-12 col-xs-6">
<div class="previewVideo">
<test-audio-video></test-audio-video>
</div>
</div>
</div>
<div class="row">
<div class="col-12 col-xs-6">
<div class="card">
<div class="card-body">
<div class="welcomeNote">
<h2>Welcome,</h2>
<p>Please check in here to join your provider if you consent for
this secure video visit.</p>
<h6>Please check in below to let <b>{{global.currentProvider}}</b> know you are here</h6>
<form action="" class="user" [formGroup]="patRegForm">
<div class="form-group">
<input class="form-control post-invitation" name="name"
formControlName="patientName" type="text" placeholder="Enter your name">
<small style="color: red;" *ngIf="isControlHasError('patientName','required')">Enter
your name</small>
</div>
<div class="custom-control custom-checkbox ">
<input type="checkbox" id="customCheck" name="customCheck"
class="custom-control-input" style="z-index: 2;" formControlName="acceptTerms" />
<label class="custom-control-label" for="customRadioInline1">By clicking you will
accept our <a>Terms and Conditions</a></label>
</div>
<br>
<div class="submitButton">
<button type="submit" [disabled]="!disableCheckInBtn" class="submitBtn"
(click)="loginPatient()" href="javascript:;">Submit</button>
</div>
<div class="errorMessage" *ngIf="this.loadConfigMsg">Can not load configuration please talk with admin</div>
<div class="errorMessage" *ngIf="this.userLoggedMsg">User already logged in</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
@import '../../../global.scss';

.patient-intro{
background: url(../../../assets/img/patient-bg.png) center right;
background-repeat: no-repeat;
background-size: cover;
min-height: 105vh;
padding: 5% 0;
.previewVideo{
border-radius: 5px;
overflow: hidden;
box-shadow: 0px 5px 20px 15px rgba($black,0.05);
}
.card{
border:none;
box-shadow: 0px 5px 20px 15px rgba($black,0.05);
.card-body{
.welcomeNote{
width: 85%;
margin: 0 auto;
padding: 16% 0;
h2{
color: $black;
font-size: 24px;
}
p{
color: $light-gray;
}
h6{
font-size: 16px;
color: $gray;
b{
font-size: 17px;
color: $black;
}
}
.custom-control{
label{
font-size: 15px;
color: $light-gray;
a{
color: var(--primary);
}
}
}
.submitButton{
.submitBtn{
background: var(--primary);
color: $white;
width: 100%;
display: inline-block;
padding: 8px 20px;
margin: 20px 0;
text-align: center;
border-radius: 5px;
border: none;
}
button:disabled {
cursor: not-allowed;
}
}
}
}
}
}

@media only screen and (max-width: 600px) {
.patient-intro{
padding: 5% 0;
.card{
margin-bottom: 15px;
.card-body{
.welcomeNote{
width: 99%;
margin: 0 auto;
padding: 1% 0;
h2{
color: $black;
font-size: 20px;
}
.submitButton{
.submitBtn{
margin: 10px 0;
}
}
}
}
}
}
}
.errorMessage{
color: red;
text-align: center;
padding: 5px;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { IntroMobileComponent } from './intro-mobile.component';


describe('IntroMobileComponent', () => {
let component: IntroMobileComponent;
let fixture: ComponentFixture<IntroMobileComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ IntroMobileComponent ]
})
.compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(IntroMobileComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
// Login Patient ,Validationa nd
import { Component, OnInit } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Router } from '@angular/router';
import { Global } from 'src/app/_helpers/common/global.model';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { Practice, Patient, Provider } from '../../_helpers/models/domain-model';
import { Observable } from 'rxjs';
import { NotificationService } from 'src/app/_helpers/common/notification.service';


@Component({
selector: 'app-intro',
templateUrl: './intro-mobile.component.html',
styleUrls: ['./intro-mobile.component.scss']
})
export class IntroMobileComponent implements OnInit {
practiceObj: Practice = new Practice();
patRegForm: FormGroup;
disableCheckInBtn = true;
loadConfigMsg : boolean = false;
userLoggedMsg : boolean = false;
constructor(public httpClient: HttpClient,
public routing: Router,
public global: Global,
private formBuilder: FormBuilder,
private notificationService: NotificationService) {
this.initializeForm();
}

private initializeForm() {
this.patRegForm = this.formBuilder.group({
patientName: ['', Validators.required],
acceptTerms: new FormControl({ value: true }, Validators.required)
});
this.patRegForm.get('acceptTerms').valueChanges.subscribe(x => {
this.disableCheckInBtn = x;
});
}

ngOnInit(): void {
this.global.isProvider = false;
this.global.isPatient = true;
this.getPractice();
}

private getPractice() {
var key="73l3M3D"; //hardcoded
this.httpClient.get<any>(this.global.practiceUrl + 'GetPracticeConfiguration?practice=' + this.global.currentPractice + "&" + "key=" + key)
.subscribe(res => {
this.global.practiceObj = res;
if (!this.global.practiceObj.logoPath) {
this.global.practiceObj.logoPath = '/assets/img/logo.png';
}
this.practiceObj = this.global.practiceObj;
}, err => {
//'Can not load configuration please talk with admin.
this.loadConfigMsg = true;
setTimeout(() => {
this.loadConfigMsg = false;
}, 5000);
});
}

isControlHasError(contolName, validator): boolean {
const control = this.patRegForm.controls[contolName];
if (!control) {
return;
}
return control.touched && control.hasError(validator);
}

loginPatient() {
if (this.patRegForm.invalid) {
this.patRegForm.get('patientName').markAsTouched();
return;
}
var patient = new Patient();
patient.name = this.patRegForm.controls.patientName.value;
patient.url = this.global.currentProvider;
patient.practice=this.global.currentPractice.replace(/\s/g, "").toLowerCase();
patient.providerNameAttending=this.global.currentProvider.replace(/\s/g, "").toLowerCase();
this.global.practiceObj.url = this.global.currentPractice;
this.httpClient.
post<any>(this.global.practiceUrl + "LoginPatient", patient)
.subscribe(res => {
this.global.token = res.Token;
this.global.patientObj = res.User;
sessionStorage.setItem('PatientName', this.global.patientObj.name);
var url: string = this.global.config.videourl.replace("PROVIDERNAME", this.global.currentProvider);
this.global.config.videourl = url;
// if(this.global.isMobile = true){
this.routing.navigateByUrl('/patient/liveMobile');
// }
// else{
//this.routing.navigateByUrl('/patient/live');
// }
},
res => {
//alert('User already logged in');
this.userLoggedMsg = true;
setTimeout(() => {
this.userLoggedMsg = false;
}, 5000);
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<div class="liveChatSection">
<div class="row">
<div class="col-12 col-xs-6">
<div class="position-relative">
<div class="videoLive">
<jitsi-call *ngIf="isMeetStart" [roomName]="roomName" [remoteUserDisplayName]="remoteUserDisplayName"></jitsi-call>

<test-audio-video *ngIf="isWaiting"></test-audio-video>
</div>
<div class="VideoUserName">
<h2 *ngIf="!isWaiting">{{global.currentProvider}}</h2>
<h2 *ngIf="isWaiting">Please wait <strong>{{global.currentProvider}}</strong> will start this secure video visit.</h2>
</div>
</div>
</div>
</div>
</div>
Loading

0 comments on commit 767dee0

Please sign in to comment.