Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Issue #ED-1957 feat: Remove hardcoded BMGS from mobile
  • Loading branch information
Ajoymaity committed Dec 8, 2023
commit 074f933bea1d272874d35df4a7460aff6fae5ed8
370 changes: 7 additions & 363 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"@ionic/storage": "2.2.0",
"@ngx-translate/core": "^11.0.1",
"@ngx-translate/http-loader": "^4.0.0",
"@project-sunbird/client-services": "6.0.1",
"@project-sunbird/client-services": "7.0.4",
"@project-sunbird/common-consumption": "6.0.1",
"@project-sunbird/common-form-elements": "6.0.0",
"@project-sunbird/content-player": "5.1.0",
Expand All @@ -78,7 +78,7 @@
"@project-sunbird/sunbird-epub-player-v9": "5.2.1",
"@project-sunbird/sunbird-pdf-player-v9": "5.1.1",
"@project-sunbird/sunbird-quml-player-v9": "5.0.2",
"@project-sunbird/sunbird-sdk": "6.0.2",
"@project-sunbird/sunbird-sdk": "7.0.11",
"@project-sunbird/sunbird-video-player-web-component": "^1.0.1",
"chart.js": "^2.9.4",
"chartjs-plugin-datalabels": "^0.7.0",
Expand Down
12 changes: 8 additions & 4 deletions src/app/category-list/category-list-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,8 @@ export class CategoryListPage implements OnInit, OnDestroy {

async ngOnInit() {
this.appName = await this.commonUtilService.getAppName();
this.getContentDetailsFrameworkCategory()
if (!this.supportedFacets) {
await this.formAndFrameworkUtilService.getFrameworkCategoryList(this.frameworkId).then((data) => {
this.categoriesList = data;
this.categoriesList.push({code: 'lastPublishedBy', name: 'Published by'})
});
this.formAPIFacets = await this.searchFilterService.fetchFacetFilterFormConfig(this.filterIdentifier, this.frameworkId);
this.supportedFacets = this.formAPIFacets.reduce((acc, filterConfig) => {
acc.push(filterConfig.code);
Expand Down Expand Up @@ -587,4 +584,11 @@ export class CategoryListPage implements OnInit, OnDestroy {
ngOnDestroy() {
this.subscriptions.forEach(s => s.unsubscribe());
}

async getContentDetailsFrameworkCategory() {
await this.formAndFrameworkUtilService.getContentFrameworkCategory(this.frameworkId).then((data) => {
this.categoriesList = data;
this.categoriesList.push({code: 'lastPublishedBy', name: 'Published by'})
});
}
}
16 changes: 6 additions & 10 deletions src/app/content-details/content-details.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@
<div class="sb-content-info-container">

<div class="sb-content-info-items"
*ngIf="frameworkCategories.length">
*ngIf="contentCategories.length">
<div class="sb-content-info-title">{{'ABOUT' | translate}}</div>

<div class="audience-info" *ngIf="content?.contentData.audience">
Expand All @@ -235,16 +235,12 @@
</div>

<ion-card class="sb-content-info-card">
<div class="sb-content-info-heading"
*ngIf="content?.contentData?.description && content?.contentData?.description?.length">
<div class="sb-content-info-heading">
{{content?.description}}</div>
<div class="sb-info" *ngFor="let category of frameworkCategories">
<div class="sb-info" *ngFor="let category of contentCategories">
<div class="sb-content-title" *ngIf="content?.contentData[category.code]">{{category.label}}</div>
<div class="sb-content-title-data">{{content?.contentData[category.code]}}</div>
</div>
<div class="sb-info" *ngIf="content?.contentData?.se_boards; else previousBoard">
<div class="sb-content-title">{{ 'BOARD' | translate }}</div>
<div class="sb-content-title-data">{{content?.contentData?.se_boards | aliased}}</div>
<div class="sb-content-title-data" *ngIf="content?.contentData[category.alterNativeCode]">{{content?.contentData[category.alterNativeCode]}}</div>
<div class="sb-content-title-data" *ngIf="!content?.contentData[category.alterNativeCode]">{{content?.contentData[category.code]}}</div>
</div>


Expand Down Expand Up @@ -311,7 +307,7 @@

</div>
<div role="button" class="read-more" id="read-more-less-btn" tabindex="0" *ngIf="content && content.contentData.description &&
content.contentData.description.length > 10 || frameworkCategories.length>1"
content.contentData.description.length > 10 || contentCategories.length>1"
(click)="showMoreFlag = !showMoreFlag; readLessorReadMore(showMoreFlag ? 'read-more-clicked' : 'read-less-clicked')">
<div *ngIf="showMoreFlag">
{{ 'READ_LESS' | translate }}
Expand Down
12 changes: 10 additions & 2 deletions src/app/content-details/content-details.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export class ContentDetailsPage implements OnInit, OnDestroy {
showMoreFlag: any = false;
navigateBackFlag = false;
@ViewChild('video') video: ElementRef | undefined;
frameworkCategories= [];
contentCategories: any;

constructor(
@Inject('PROFILE_SERVICE') private profileService: ProfileService,
Expand Down Expand Up @@ -371,7 +371,8 @@ export class ContentDetailsPage implements OnInit, OnDestroy {
* Ionic life cycle hook
*/
async ionViewWillEnter() {
this.frameworkCategories = this.appGlobalService.getCachedFrameworkCategory().value;
const frameworkId = this.appGlobalService.getCachedFrameworkCategory().id;
this.getContentCategories(frameworkId);
this.headerService.hideStatusBar();
await this.headerService.hideHeader();

Expand Down Expand Up @@ -1753,4 +1754,11 @@ export class ContentDetailsPage implements OnInit, OnDestroy {
}, 100);
}
}


async getContentCategories(frameworkId) {
await this.formFrameworkUtilService.getContentFrameworkCategory(frameworkId).then((data) => {
this.contentCategories = data;
});
}
}
7 changes: 7 additions & 0 deletions src/app/form.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,4 +230,11 @@ export class FormConstants {
component: 'app',
rootOrgId: '*'
};

public static CONTENT_FRAMEWORK_CONFIG: FormRequest = {
type: 'config',
subType: 'contentframeworkcategory',
action: 'get',
component: 'app',
};
}
36 changes: 1 addition & 35 deletions src/app/profile-settings/profile-settings.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,51 +58,17 @@
<ion-label position="stacked" class="label-font text-uppercase align-text">{{category.label | translateJson}}
</ion-label>
<ion-select [multiple]="isMultipleVales(category)" #boardSelect class="ion-text-capitalize" [formControlName]="category.identifier"
[disabled]="!(i === 0 || category.isDisable)" [interfaceOptions]="boardOptions" (ionCancel)="cancelEvent('board')"
[disabled]="!(i === 0 || category.isDisable)" [interfaceOptions]="boardOptions" (ionCancel)="cancelEvent(category, $event)"
okText="{{'BTN_SUBMIT' | translate}}" cancelText="{{'CANCEL' | translate}}"
placeholder="{{category.placeHolder | translateJson}}" (ngModelChange)="getCategoriesDetails($event, category, i)">
<ion-select-option *ngFor="let eachSyllabus of category.itemList" value="{{eachSyllabus.code}}">
{{eachSyllabus.name | aliased}}&lrm;</ion-select-option>
</ion-select>
</ion-item>

<!-- <ion-item *ngIf="category.identifier=== 'fw_category2'" appCustomIonSelect (click)="onCategoryCliked('medium')">
<ion-label position="stacked" class="label-font text-uppercase align-text">{{category.label | translateJson}}
</ion-label>
<ion-select formControlName="medium" #mediumSelect multiple="true" class="ion-text-capitalize"
[interfaceOptions]="mediumOptions" (ionCancel)="cancelEvent('medium')" okText="{{'BTN_SUBMIT' | translate}}"
cancelText="{{'CANCEL' | translate}}" [disabled]="!mediumList.length || !boardControl.value.length"
placeholder="{{category.placeHolder | translateJson}}">
<ion-select-option *ngFor="let medium of mediumList" class="ion-text-capitalize"
value="{{medium.code}}">
{{medium.name}}</ion-select-option>
</ion-select>
</ion-item> -->

<!-- <ion-item *ngIf="category.identifier=== 'fw_category3'" appCustomIonSelect (click)="onCategoryCliked('grade')">
<ion-label position="stacked" class="label-font text-uppercase align-text">{{category.label | translateJson}}
</ion-label>
<ion-select multiple="true" #gradeSelect class="ion-text-capitalize" formControlName="grade"
[interfaceOptions]="classOptions" okText="{{'BTN_SUBMIT' | translate}}"
cancelText="{{'CANCEL' | translate}}" [disabled]="!gradeList.length || !mediumControl.value.length"
(ionCancel)="cancelEvent('grade')" placeholder="{{category.placeHolder | translateJson}}">
<ion-select-option *ngFor="let grade of gradeList" class="ion-text-capitalize"
value="{{grade.code}}">
{{grade.name}}</ion-select-option>
</ion-select>
</ion-item> -->
</div>

</div>
</form>
<!-- <form [formGroup]="profileSettingsForm_1">
<div *ngFor="let data of categories; let i=index">
<div class="label-name">
<label>{{data.label}}</label>
<input type="text" style="margin-left: 10px;" (ngModelChange)="modelChanged($event, data)" placeholder={{data.placeHolder}} [formControlName]="data.identifier">
</div>
</div>
</form> -->
</div>
</ion-content>

Expand Down
Loading