Unverified Commit 65275efe authored by Vinu Kumar's avatar Vinu Kumar Committed by GitHub
Browse files

Issue #SH-1236 merge: Merge pull request #5222 from swetha-aggidevara/sh-809

Issue #SH-1236 fix: Group member unable to consume the textbooks
parents 487e23d9 b862915f
master Dark_theme SB-25589 SB-28090 aws_fileRead dependabot/npm_and_yarn/src/app/client/decode-uri-component-0.2.2 dependabot/npm_and_yarn/src/app/decode-uri-component-0.2.2 dependabot/npm_and_yarn/src/app/express-4.17.3 dependabot/npm_and_yarn/src/app/jsonwebtoken-9.0.0 dependabot/npm_and_yarn/src/desktop/OpenRAP/decode-uri-component-0.2.2 dependabot/npm_and_yarn/src/desktop/OpenRAP/express-4.17.3 dependabot/npm_and_yarn/src/desktop/OpenRAP/jsonwebtoken-9.0.0 dependabot/npm_and_yarn/src/desktop/OpenRAP/qs-6.5.3 dependabot/npm_and_yarn/src/desktop/decode-uri-component-0.2.2 dependabot/npm_and_yarn/src/desktop/express-4.17.3 dependabot/npm_and_yarn/src/desktop/jsonwebtoken-9.0.0 dependabot/npm_and_yarn/src/desktop/qs-6.10.3 filters_5.1.1 gcp gcp_test keshavprasadms-patch-1 keshavprasadms-patch-2 release-3.3.0 release-3.3.1 release-3.3.2 release-3.4.0 release-3.4.1 release-3.4.2 release-3.4.3 release-3.4.4 release-3.4.5 release-3.4.6 release-3.4.7 release-3.5.0 release-3.5.1 release-3.5.2 release-3.5.3 release-3.6.0 release-3.6.1 release-3.6.5 release-3.6.6 release-3.7.0 release-3.7.1 release-3.7.2 release-3.8.0 release-3.8.1 release-3.8.2 release-3.8.3 release-3.9.0 release-3.9.1 release-3.9.2 release-3.9.3 release-4.0.0 release-4.0.1 release-4.0.2 release-4.1 release-4.1.0 release-4.1.1 release-4.10.0 release-4.10.0.1 release-4.10.1 release-4.10.2 release-4.10.2.1 release-4.10.2.2 release-4.10.3 release-4.2.0 release-4.2.1 release-4.3.0 release-4.3.1 release-4.4.0 release-4.4.1 release-4.5.0 release-4.5.1 release-4.5.2 release-4.6.0 release-4.7.0 release-4.7.1 release-4.8.0 release-4.8.5 release-4.9.0 release-4.9.1 release-5.0.0 release-5.0.0.1 release-5.0.0.2 release-5.0.0.3 release-5.0.1 release-5.0.2 release-5.1.0 release-5.1.1 revert-5244-sh-809 revert-5260-SB-table-3.3.0 revert-8284-release-5.0.0 sharathkashyap-patch-1 Tags unavailable
No related merge requests found
Showing with 6 additions and 5 deletions
+6 -5
......@@ -99,6 +99,7 @@ describe('ActivityListComponent', () => {
it('should call openActivity for Admin', () => {
spyOn(component, 'addTelemetry');
spyOn(component['playerService'], 'playContent');
const event = {
data: {
name: 'Class 5 English',
......@@ -109,7 +110,7 @@ describe('ActivityListComponent', () => {
contentType: 'Course'
}};
component.openActivity(event, 'ACTIVITY_COURSE_TITLE');
expect(router.navigate).toHaveBeenCalledWith(['/learn/course', 'do_123523212190']);
expect(component['playerService'].playContent).toHaveBeenCalledWith(event.data);
expect(component.addTelemetry).toHaveBeenCalled();
});
......
import { PlayerService } from '@sunbird/core';
import { Component, Input, ViewChild, OnInit, OnDestroy } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import * as _ from 'lodash-es';
import { fromEvent, Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { ConfigService } from '../../../../shared/services/config/config.service';
import { ResourceService } from '../../../../shared/services/resource/resource.service';
import { GroupsService } from '../../../services/groups/groups.service';
import { ACTIVITY_DETAILS } from './../../../interfaces';
import { ToasterService } from '@sunbird/shared';
import { ToasterService, ConfigService, ResourceService } from '@sunbird/shared';
export interface IActivity {
name: string;
......@@ -46,6 +45,7 @@ export class ActivityListComponent implements OnInit, OnDestroy {
public resourceService: ResourceService,
private groupService: GroupsService,
private toasterService: ToasterService,
private playerService: PlayerService
) {
this.config = this.configService.appConfig;
}
......@@ -74,7 +74,7 @@ export class ActivityListComponent implements OnInit, OnDestroy {
if (_.get(this.groupData, 'isAdmin')) {
this.router.navigate([`${ACTIVITY_DETAILS}`, _.get(event, 'data.identifier')], options);
} else {
this.router.navigate(['/learn/course', _.get(event, 'data.identifier')]);
this.playerService.playContent(_.get(event, 'data'));
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment