Merge pull request #3404 from dpalou/MOBILE-4137
MOBILE-4137 bbb: Don't display room info if showroom = falsemain
commit
22b367ea6e
|
@ -16,7 +16,7 @@
|
|||
<core-group-selector [groupInfo]="groupInfo" [(selected)]="groupId" (selectedChange)="groupChanged()"
|
||||
[multipleGroupsMessage]="'addon.mod_bigbluebuttonbn.view_groups_selection_warning' | translate"></core-group-selector>
|
||||
|
||||
<ng-container *ngIf="meetingInfo">
|
||||
<ng-container *ngIf="meetingInfo && showRoom">
|
||||
<ion-item class="ion-text-wrap" *ngIf="meetingInfo.openingtime">
|
||||
<ion-label>
|
||||
<h3>{{ 'addon.mod_bigbluebuttonbn.mod_form_field_openingtime' | translate }}</h3>
|
||||
|
@ -85,7 +85,7 @@
|
|||
|
||||
<div collapsible-footer *ngIf="!showLoading" slot="fixed">
|
||||
<div class="list-item-limited-width adaptable-buttons-row"
|
||||
*ngIf="meetingInfo && (meetingInfo.canjoin || meetingInfo.statusrunning && meetingInfo.ismoderator)">
|
||||
*ngIf="meetingInfo && showRoom && (meetingInfo.canjoin || (meetingInfo.statusrunning && meetingInfo.ismoderator))">
|
||||
<ion-button *ngIf="meetingInfo.statusrunning && meetingInfo.ismoderator" fill="outline" class="ion-margin ion-text-wrap"
|
||||
expand="block" (click)="endMeeting()">
|
||||
{{ 'addon.mod_bigbluebuttonbn.view_conference_action_end' | translate }}
|
||||
|
|
|
@ -22,7 +22,7 @@ import { CoreGroupInfo, CoreGroups } from '@services/groups';
|
|||
import { CoreDomUtils } from '@services/utils/dom';
|
||||
import { CoreUtils } from '@services/utils/utils';
|
||||
import { Translate } from '@singletons';
|
||||
import { AddonModBBB, AddonModBBBData, AddonModBBBMeetingInfoWSResponse, AddonModBBBService } from '../../services/bigbluebuttonbn';
|
||||
import { AddonModBBB, AddonModBBBData, AddonModBBBMeetingInfo, AddonModBBBService } from '../../services/bigbluebuttonbn';
|
||||
|
||||
/**
|
||||
* Component that displays a Big Blue Button activity.
|
||||
|
@ -39,7 +39,7 @@ export class AddonModBBBIndexComponent extends CoreCourseModuleMainActivityCompo
|
|||
bbb?: AddonModBBBData;
|
||||
groupInfo?: CoreGroupInfo;
|
||||
groupId = 0;
|
||||
meetingInfo?: AddonModBBBMeetingInfoWSResponse;
|
||||
meetingInfo?: AddonModBBBMeetingInfo;
|
||||
|
||||
constructor(
|
||||
protected content?: IonContent,
|
||||
|
@ -57,6 +57,10 @@ export class AddonModBBBIndexComponent extends CoreCourseModuleMainActivityCompo
|
|||
await this.loadContent();
|
||||
}
|
||||
|
||||
get showRoom(): boolean {
|
||||
return !!this.meetingInfo && (!this.meetingInfo.features || this.meetingInfo.features.showroom);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
|
|
|
@ -19,6 +19,7 @@ import { CoreSite, CoreSiteWSPreSets } from '@classes/site';
|
|||
import { CoreCourseCommonModWSOptions } from '@features/course/services/course';
|
||||
import { CoreCourseLogHelper } from '@features/course/services/log-helper';
|
||||
import { CoreSites, CoreSitesCommonWSOptions } from '@services/sites';
|
||||
import { CoreUtils } from '@services/utils/utils';
|
||||
import { CoreWSExternalFile, CoreWSExternalWarning } from '@services/ws';
|
||||
import { makeSingleton, Translate } from '@singletons';
|
||||
|
||||
|
@ -152,7 +153,7 @@ export class AddonModBBBService {
|
|||
id: number,
|
||||
groupId: number = 0,
|
||||
options: AddonModBBBGetMeetingInfoOptions = {},
|
||||
): Promise<AddonModBBBMeetingInfoWSResponse> {
|
||||
): Promise<AddonModBBBMeetingInfo> {
|
||||
const site = await CoreSites.getSite(options.siteId);
|
||||
|
||||
const params: AddonModBBBMeetingInfoWSParams = {
|
||||
|
@ -172,11 +173,16 @@ export class AddonModBBBService {
|
|||
preSets.getFromCache = false;
|
||||
}
|
||||
|
||||
return site.read<AddonModBBBMeetingInfoWSResponse>(
|
||||
const meetingInfo = await site.read<AddonModBBBMeetingInfoWSResponse>(
|
||||
'mod_bigbluebuttonbn_meeting_info',
|
||||
params,
|
||||
preSets,
|
||||
);
|
||||
|
||||
return {
|
||||
...meetingInfo,
|
||||
features: meetingInfo.features ? CoreUtils.objectToKeyValueMap(meetingInfo.features, 'name', 'isenabled') : undefined,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -353,6 +359,17 @@ export type AddonModBBBMeetingInfoWSResponse = {
|
|||
name: string; // Presentation name.
|
||||
}[];
|
||||
joinurl: string; // Join URL.
|
||||
features?: { // Enabled features. @since 4.1.
|
||||
name: string;
|
||||
isenabled: boolean;
|
||||
}[];
|
||||
};
|
||||
|
||||
/**
|
||||
* Meeting info with some calculated data.
|
||||
*/
|
||||
export type AddonModBBBMeetingInfo = Omit<AddonModBBBMeetingInfoWSResponse, 'features'> & {
|
||||
features?: Record<string, boolean>;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue