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-bottom: var(--cusgray) solid 1px;
border-radius: 0px; border-radius: 0px;
// margin-left: 20px; // margin-left: 20px;
margin-left: 34px; margin-left: 30px;
margin-top: -10px; // margin-top: -10px;
// -webkit-appearance: none; // -webkit-appearance: none;
// -moz-appearance: none; // -moz-appearance: none;
text-indent: 1px; 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() { fakeSwipeAttendance() {
const request: any = {}; const request: any = {};
request.Latitude = this.lat; request.Latitude = this.lat;
@ -176,39 +153,73 @@ export class AttendScanService {
}); });
} }
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 updateFirebaseDocument(resultObject: any) { public updateFirebaseDocument(resultObject: any) {
let currentFirebaseDocument = this.common.sharedService.getSharedData('firebase-document'); try {
let currentSwipeArray = currentFirebaseDocument.document.swipeData; let currentFirebaseDocument = this.common.sharedService.getSharedData('firebase-document');
currentSwipeArray.push(resultObject); let currentSwipeArray = currentFirebaseDocument.document.swipeData;
const updatedDocument = { currentSwipeArray.push(resultObject);
swipeData: currentSwipeArray const updatedDocument = {
}; swipeData: currentSwipeArray
console.log(updatedDocument); };
this.firebasex.updateDocumentInFirestoreCollection(this.userData.EMPLOYEE_NUMBER, updatedDocument, this.collection, () => { console.log(updatedDocument);
console.log("Successfully added document with id=" + this.userData.EMPLOYEE_NUMBER); this.firebasex.updateDocumentInFirestoreCollection(this.userData.EMPLOYEE_NUMBER, updatedDocument, this.collection, () => {
}, (error) => { console.log("Successfully added document with id=" + this.userData.EMPLOYEE_NUMBER);
console.error("Error adding document: " + error); }, (error) => {
}); console.error("Error adding document: " + error);
});
} catch (error) {
console.log(error);
}
} }
public processFirebaseDocument(mode: string, result: any, isDocumentAvailable: boolean) { public processFirebaseDocument(mode: string, result: any, isDocumentAvailable: boolean) {
console.log(mode); try {
console.log(result); console.log(mode);
console.log(isDocumentAvailable); console.log(result);
this.userData = this.common.sharedService.getSharedData(AuthenticatedUser.SHARED_DATA, false); console.log(isDocumentAvailable);
console.log(this.userData); this.userData = this.common.sharedService.getSharedData(AuthenticatedUser.SHARED_DATA, false);
const resultObject = { console.log(this.userData);
modeOfAttendance: mode, const resultObject = {
messageStatus: result.MessageStatus, modeOfAttendance: mode,
transactionID: result.SWP_AuthenticateAndSwipeUserModel.TransactionID, messageStatus: result.MessageStatus,
userID: result.SWP_AuthenticateAndSwipeUserModel.UserID, transactionID: result.SWP_AuthenticateAndSwipeUserModel.TransactionID,
pointID: result.SWP_AuthenticateAndSwipeUserModel.PointID, userID: result.SWP_AuthenticateAndSwipeUserModel.UserID,
branchDescription: result.SWP_AuthenticateAndSwipeUserModel.BranchDescription pointID: result.SWP_AuthenticateAndSwipeUserModel.PointID,
} branchDescription: result.SWP_AuthenticateAndSwipeUserModel.BranchDescription
if (isDocumentAvailable) { }
this.updateFirebaseDocument(resultObject); if (isDocumentAvailable) {
} else { this.updateFirebaseDocument(resultObject);
this.createNewDocument(resultObject); } else {
this.createNewDocument(resultObject);
}
} catch (error) {
console.log(error);
} }
} }

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

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

Loading…
Cancel
Save