Skip to content

Commit

Permalink
157628 delete account (#302)
Browse files Browse the repository at this point in the history
* 157628 - changes for delete user

* 157628 - added language files
  • Loading branch information
yashveertrigyn authored May 22, 2024
1 parent 00d7d0e commit 79f8237
Show file tree
Hide file tree
Showing 63 changed files with 2,938 additions and 70 deletions.
3 changes: 2 additions & 1 deletion src/app/client/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { TranslateHttpLoader } from '@ngx-translate/http-loader';
import { TranslateStore } from '@ngx-translate/core';
import { SbSearchFilterModule } from '@dicdikshaorg/common-form-elements';
import { ModalModule } from 'ngx-bootstrap/modal';

import { DeviceDetectorService } from 'ngx-device-detector';
import { AngularFireAnalyticsModule, ScreenTrackingService } from '@angular/fire/analytics';
import { AngularFireModule } from '@angular/fire';

Expand Down Expand Up @@ -77,6 +77,7 @@ const firebaseConfig = {
CacheService,
ChatLibService,
TranslateStore,
DeviceDetectorService,
{ provide: CacheStorageAbstract, useClass: CacheSessionStorage },
{ provide: HTTP_INTERCEPTORS, useClass: SessionExpiryInterceptor, multi: true },
{ provide: RouteReuseStrategy, useClass: CustomRouteReuseStrategy },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ export class OtpService {
return this.learnerService.post(options);
}

generateAnonymousOTP(data) {
const options = {
url: this.configService.urlConFig.URLS.OTP.ANONYMOUS.GENERATE_USERDELETE,
data: data
};
return this.learnerService.post(options);
}

verifyOTP(data) {
const options = {
url: this.configService.urlConFig.URLS.OTP.VERIFY,
Expand Down
15 changes: 15 additions & 0 deletions src/app/client/src/app/modules/core/services/user/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,21 @@ export class UserService {
));
}

/**
* This method invokes learner service to delete tthe user account
*/
public deleteUser() {
const options = {
url: this.config.urlConFig.URLS.USER.DELETE,
data: {
request: {
'userId': this.userid
}
}
};
return this.learnerService.post(options);
}

get orgIdNameMap() {
const mapOrgIdNameData = {};
_.forEach(this.organizationsDetails, (orgDetails) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<div class="sb-mat__modal">
<div mat-dialog-title class="mb-0">
</div>
<mat-dialog-content>
<app-otp-popup [otpData]="otpData" [redirectToLogin]="false" (verificationSuccess)="verificationSuccess($event)"
(closeContactForm)="closeModal()" [delete]="true">
</app-otp-popup>
</mat-dialog-content>
<router-outlet></router-outlet>
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
@use "@project-sunbird/sb-styles/assets/mixins/mixins" as *;
@use "@project-sunbird/sb-styles/assets/varSass" as *;
@use 'components/form' as *;

.ui.grey.button {
font-size: 1rem;
}

.ui.dodger-blue.button {
background: var(--primary-color);
color: var(--white);
font-size: 1rem;
height: calculateRem(38px) !important;
}

.ui.left.icon.input .icon {
font-size: 1rem;
}

.height-200 {
height: calculateRem(200px) !important;
}

.sb-field.ui.input {
display: block;

.icon {
left: 0;
top: 0.625rem;
}

.sb-form-control {
border: $sb-input-border-normal;
line-height: 1.5;
padding: 0.5714rem;

&:hover {
border: $sb-input-border-hover;
}
}
}
.delete__title{
margin: auto;
color: #dd4841 !important;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
export const mockResponse = {
userMockData: {
'userRoles': [
'PUBLIC',
'BOOK_CREATOR',
'COURSE_MENTOR',
'FLAG_REVIEWER',
'CONTENT_CREATOR',
'TEACHER_BADGE_ISSUER'
],
'rootOrg': {
'dateTime': null,
'preferredLanguage': 'English',
'approvedBy': null,
'channel': 'ROOT_ORG',
'description': 'Sunbird',
'updatedDate': '2017-08-24 06:02:10:846+0000',
'addressId': null,
'orgType': null,
'provider': null,
'orgCode': 'sunbird',
'theme': null,
'id': 'ORG_001',
'communityId': null,
'isApproved': null,
'slug': 'sunbird',
'identifier': 'ORG_001',
'thumbnail': null,
'orgName': 'Sunbird',
'updatedBy': 'user1',
'externalId': null,
'isRootOrg': true,
'rootOrgId': null,
'approvedDate': null,
'imgUrl': null,
'homeUrl': null,
'isDefault': null,
'contactDetail':
'[{\'phone\':\'213124234234\',\'email\':\'[email protected]\'},{\'phone\':\'+91213124234234\',\'email\':\'[email protected]\'}]',
'createdDate': null,
'createdBy': null,
'parentOrgId': null,
'hashTagId': 'b00bc992ef25f1a9a8d63291e20efc8d',
'noOfMembers': 1,
'status': null
},
'identifier': '874ed8a5-782e-4f6c-8f36-e0288455901e',
'profileSummary': 'asdd',
'tcUpdatedDate': null,
'avatar': 'https://sunbirddev.blob.core.windows.net/user/874ed8a5-782e-4f6c-8f36-e0288455901e/File-01242833565242982418.png',
'userName': 'ntptest102',
'rootOrgId': 'ORG_001',
'userId': '874ed8a5-782e-4f6c-8f36-e0288455901e',
'emailVerified': null,
'firstName': 'Cretation',
'lastLoginTime': 1519809987692,
'createdDate': '2017-10-31 10:47:04:723+0000',
'createdBy': '5d7eb482-c2b8-4432-bf38-cc58f3c23b45',
'email': '[email protected]'
},
userMockData1: {
'userRoles': [
'PUBLIC',
'BOOK_CREATOR',
'COURSE_MENTOR',
'FLAG_REVIEWER',
'CONTENT_CREATOR',
'TEACHER_BADGE_ISSUER'
],
'rootOrg': {
'dateTime': null,
'preferredLanguage': 'English',
'approvedBy': null,
'channel': 'ROOT_ORG',
'description': 'Sunbird',
'updatedDate': '2017-08-24 06:02:10:846+0000',
'addressId': null,
'orgType': null,
'provider': null,
'orgCode': 'sunbird',
'theme': null,
'id': 'ORG_001',
'communityId': null,
'isApproved': null,
'slug': 'sunbird',
'identifier': 'ORG_001',
'thumbnail': null,
'orgName': 'Sunbird',
'updatedBy': 'user1',
'externalId': null,
'isRootOrg': true,
'rootOrgId': null,
'approvedDate': null,
'imgUrl': null,
'homeUrl': null,
'isDefault': null,
'contactDetail':
'[{\'phone\':\'213124234234\',\'email\':\'[email protected]\'},{\'phone\':\'+91213124234234\',\'email\':\'[email protected]\'}]',
'createdDate': null,
'createdBy': null,
'parentOrgId': null,
'hashTagId': 'b00bc992ef25f1a9a8d63291e20efc8d',
'noOfMembers': 1,
'status': null
},
'identifier': '874ed8a5-782e-4f6c-8f36-e0288455901e',
'profileSummary': 'asdd',
'tcUpdatedDate': null,
'avatar': 'https://sunbirddev.blob.core.windows.net/user/874ed8a5-782e-4f6c-8f36-e0288455901e/File-01242833565242982418.png',
'userName': 'ntptest102',
'rootOrgId': 'ORG_001',
'userId': '874ed8a5-782e-4f6c-8f36-e0288455901e',
'emailVerified': null,
'firstName': 'Cretation',
'lastLoginTime': 1519809987692,
'createdDate': '2017-10-31 10:47:04:723+0000',
'createdBy': '5d7eb482-c2b8-4432-bf38-cc58f3c23b45',
'phone': '1234567890'
},
resendOtpSuccess: {
'id': 'api.otp.generate',
'ver': 'v1',
'ts': '2019-01-09 06:59:19:838+0000',
'params': {
'resmsgid': null,
'msgid': null,
'err': null,
'status': 'success',
'errmsg': null
},
'responseCode': 'OK',
'result': {
'response': 'SUCCESS'
}
},
resendPhoneOtpError: {
'id': 'api.otp.generate',
'ver': 'v1',
'ts': '2019-01-09 07:22:37:193+0000',
'error': {
'params': {
'resmsgid': null,
'msgid': 'afb0eefe-a484-4a07-89e0-a1d87ce5904d',
'err': 'ERROR_INVALID_REQUEST',
'status': 'PHONE_ALREADY_IN_USE',
'errmsg': 'Invalid emailAddress or phone number.'
},
},
'responseCode': 'CLIENT_ERROR',
'result': {}
},
resendEmailOtpError: {
'id': 'api.otp.generate',
'ver': 'v1',
'ts': '2019-01-09 07:22:37:193+0000',
'error': {
'params': {
'resmsgid': null,
'msgid': 'afb0eefe-a484-4a07-89e0-a1d87ce5904d',
'err': 'ERROR_INVALID_REQUEST',
'status': 'EMAIL_IN_USE',
'errmsg': 'Invalid emailAddress or phone number.'
},
},
'responseCode': 'CLIENT_ERROR',
'result': {}
},
resendOtpError: {
'id': 'api.otp.generate',
'ver': 'v1',
'ts': '2019-01-09 07:22:37:193+0000',
'error': {
'params': {
'resmsgid': null,
'msgid': 'afb0eefe-a484-4a07-89e0-a1d87ce5904d',
'err': 'ERROR_INVALID_REQUEST',
'status': 'ERROR',
'errmsg': 'Invalid emailAddress or phone number.'
},
},
'responseCode': 'CLIENT_ERROR',
'result': {}
},
}
Loading

0 comments on commit 79f8237

Please sign in to comment.