Merge branch 'MOHEMM-Q2-DEV' into enad-Q1

# Conflicts:
#	Mohem/src/app/my-team/details/details.component.html
MOHEMM-SFH-COLORS
umasoodch 4 years ago
commit e400a02c5c

@ -34,8 +34,8 @@
border-bottom: var(--cusgray) solid 1px;
border-radius: 0px;
// margin-left: 20px;
margin-left: 34px;
margin-top: -10px;
margin-left: 30px;
// margin-top: -10px;
// -webkit-appearance: none;
// -moz-appearance: none;
text-indent: 1px;

@ -136,29 +136,6 @@ export class AttendScanService {
});
}
public async checkFirestoreDocument(userID : string) {
let result = {};
await this.firebasex.fetchDocumentInFirestoreCollection(userID, this.collection, (document: any) => {
console.log("Successfully Fetched the document with id =");
result = {
isDocumentAvailable: true,
document: document
};
this.common.sharedService.setSharedData(result, 'firebase-document');
this.common.stopLoading();
}, (error: any) => {
console.log(error);
result = {
isDocumentAvailable: false,
document: null
};
this.common.sharedService.setSharedData(result, 'firebase-document');
this.common.stopLoading();
})
}
fakeSwipeAttendance() {
const request: any = {};
request.Latitude = this.lat;
@ -176,42 +153,76 @@ export class AttendScanService {
});
}
public updateFirebaseDocument(resultObject: any) {
let currentFirebaseDocument = this.common.sharedService.getSharedData('firebase-document');
let currentSwipeArray = currentFirebaseDocument.document.swipeData;
currentSwipeArray.push(resultObject);
const updatedDocument = {
swipeData: currentSwipeArray
};
console.log(updatedDocument);
this.firebasex.updateDocumentInFirestoreCollection(this.userData.EMPLOYEE_NUMBER, updatedDocument, this.collection, () => {
console.log("Successfully added document with id=" + this.userData.EMPLOYEE_NUMBER);
}, (error) => {
console.error("Error adding document: " + error);
});
public async checkFirestoreDocument(userID : string) {
try {
let result = {};
await this.firebasex.fetchDocumentInFirestoreCollection(userID, this.collection, (document: any) => {
console.log("Successfully Fetched the document with id =");
result = {
isDocumentAvailable: true,
document: document
};
this.common.sharedService.setSharedData(result, 'firebase-document');
this.common.stopLoading();
}, (error: any) => {
console.log(error);
result = {
isDocumentAvailable: false,
document: null
};
this.common.sharedService.setSharedData(result, 'firebase-document');
this.common.stopLoading();
})
} catch(error) {
console.log(error);
this.common.stopLoading();
}
}
public processFirebaseDocument(mode: string, result: any, isDocumentAvailable: boolean) {
console.log(mode);
console.log(result);
console.log(isDocumentAvailable);
this.userData = this.common.sharedService.getSharedData(AuthenticatedUser.SHARED_DATA, false);
console.log(this.userData);
const resultObject = {
modeOfAttendance: mode,
messageStatus: result.MessageStatus,
transactionID: result.SWP_AuthenticateAndSwipeUserModel.TransactionID,
userID: result.SWP_AuthenticateAndSwipeUserModel.UserID,
pointID: result.SWP_AuthenticateAndSwipeUserModel.PointID,
branchDescription: result.SWP_AuthenticateAndSwipeUserModel.BranchDescription
}
if (isDocumentAvailable) {
this.updateFirebaseDocument(resultObject);
} else {
this.createNewDocument(resultObject);
public updateFirebaseDocument(resultObject: any) {
try {
let currentFirebaseDocument = this.common.sharedService.getSharedData('firebase-document');
let currentSwipeArray = currentFirebaseDocument.document.swipeData;
currentSwipeArray.push(resultObject);
const updatedDocument = {
swipeData: currentSwipeArray
};
console.log(updatedDocument);
this.firebasex.updateDocumentInFirestoreCollection(this.userData.EMPLOYEE_NUMBER, updatedDocument, this.collection, () => {
console.log("Successfully added document with id=" + this.userData.EMPLOYEE_NUMBER);
}, (error) => {
console.error("Error adding document: " + error);
});
} catch (error) {
console.log(error);
}
}
public processFirebaseDocument(mode: string, result: any, isDocumentAvailable: boolean) {
try {
console.log(mode);
console.log(result);
console.log(isDocumentAvailable);
this.userData = this.common.sharedService.getSharedData(AuthenticatedUser.SHARED_DATA, false);
console.log(this.userData);
const resultObject = {
modeOfAttendance: mode,
messageStatus: result.MessageStatus,
transactionID: result.SWP_AuthenticateAndSwipeUserModel.TransactionID,
userID: result.SWP_AuthenticateAndSwipeUserModel.UserID,
pointID: result.SWP_AuthenticateAndSwipeUserModel.PointID,
branchDescription: result.SWP_AuthenticateAndSwipeUserModel.BranchDescription
}
if (isDocumentAvailable) {
this.updateFirebaseDocument(resultObject);
} else {
this.createNewDocument(resultObject);
}
} catch (error) {
console.log(error);
}
}
public createNewDocument(resultObject: any) {
let swipeData = [];
swipeData.push(resultObject);

@ -28,7 +28,7 @@ export class ConnectorService {
public static timeOut = 120 * 1000;
public static host = 'https://uat.hmgwebservices.com/';
//public static host = 'https://hmgwebservices.com/';
// public static host = 'https://hmgwebservices.com/';
constructor(public httpClient: HttpClient,
public cs: CommonService,

@ -66,16 +66,16 @@
<span class="btnTitle">{{ts.trPK('myTeam','profile-details')}}</span>
</ion-col>
</ion-col>
<ion-col [size]="3">
<ion-col [size]="3" (click)="getMenuEntries(employee)">
<ion-col>
<!-- <ion-segment-button
value="create-request"
[ngClass]="activeSegment == 'create-request' ? 'active-Segment' : 'normal-Segment'">
<img (click)="getMenuEntries(employee)" class="imgSize" src="../assets/imgs/create-req.svg"> -->
<img class="imgSize" src="../assets/imgs/create-req.svg">
<!-- <ion-label> {{ts.trPK('vacation-rule','create-request')}}</ion-label> -->
<!-- </ion-segment-button> -->
</ion-col>
<ion-col (click)="getMenuEntries(employee)"> <span class="btnTitle">{{ts.trPK('vacation-rule','create-request')}}</span></ion-col>
<ion-col > <span class="btnTitle">{{ts.trPK('vacation-rule','create-request')}}</span></ion-col>
</ion-col>
<ion-col [size]="3">
<ion-col>

Loading…
Cancel
Save