Skip to content

Commit

Permalink
Merge pull request #3560 from Ajoymaity/release-7.0.0
Browse files Browse the repository at this point in the history
Issue #ED-3414 fix: Fixed framework category label translate issue
  • Loading branch information
swayangjit authored Feb 28, 2024
2 parents 1d50adb + f260ce8 commit e5177c0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 35 deletions.
40 changes: 5 additions & 35 deletions src/app/profile/guest-profile/guest-profile.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,40 +52,6 @@ export class GuestProfilePage implements OnInit {
public currentUserTypeConfig: any = {};
frameworkData = [];
categoryDetails: any;
supportedUserType = [
{
"code": "farmer",
"name": "Farmer",
"formConfig": {
"request": {
"type": "profileConfig",
"subType": "default",
"action": "get"
},
"url": "/api/data/v1/form"
},
"translations": "{\"en\":\"Farmer\",\"as\":\"শিক্ষক\",\"bn\":\"শিক্ষক\",\"gu\":\"શિક્ષક\",\"hi\":\"शिक्षक\",\"kn\":\"ಶಿಕ್ಷಕ/ಕಿ\",\"mr\":\"शिक्षक\",\"or\":\"ଶିକ୍ଷକ\",\"pa\":\"ਅਧਿਆਪਕ\",\"ta\":\"ஆசிரியர்\",\"te\":\"ఉపాధ్యాయుడు\",\"ur\":\"استاد\"}",
"image": "ic_teacher.svg",
"ambiguousFilters": [
"user1",
"instructor"
],
"searchFilter": [
"User1",
"Instructor"
],
"attributes": {
"mandatory": [
"board",
"medium",
"gradeLevel"
],
"optional": [
"subject"
]
},
"isActive": true
}]

constructor(
@Inject('PROFILE_SERVICE') private profileService: ProfileService,
Expand Down Expand Up @@ -123,6 +89,10 @@ export class GuestProfilePage implements OnInit {
await this.refreshProfileData(false, false);
});

this.events.subscribe('onAfterLanguageChange:update', async () => {
await this.refreshProfileData(false, false);
});

this.events.subscribe(AppGlobalService.PROFILE_OBJ_CHANGED, async () => {
await this.refreshProfileData(false, false);
});
Expand Down Expand Up @@ -186,7 +156,7 @@ export class GuestProfilePage implements OnInit {
this.getSyllabusDetails();
this.refreshSignInCard();
const rootOrgId = this.onboardingConfigurationService.getAppConfig().overriddenDefaultChannelId
const supportedUserTypes = this.profile.syllabus[0] !== 'agriculture_framework' ? await this.profileHandler.getSupportedUserTypes(rootOrgId) : this.supportedUserType;
const supportedUserTypes = await this.profileHandler.getSupportedUserTypes(rootOrgId);
this.currentUserTypeConfig = supportedUserTypes.find(userTypes => userTypes.code === this.profile.profileType);
setTimeout(() => {
if (refresher) { refresher.target.complete(); }
Expand Down
4 changes: 4 additions & 0 deletions src/app/profile/profile.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ export class ProfilePage implements OnInit {
}
});

this.events.subscribe('onAfterLanguageChange:update', async () => {
await this.refreshProfileData();
});

this.events.subscribe('loggedInProfile:update', async (framework) => {
if (framework) {
this.updateLocalProfile(framework);
Expand Down

0 comments on commit e5177c0

Please sign in to comment.