File

src/app/my-groups/group-details/group-details.page.ts

Implements

OnInit OnDestroy ViewMoreActivityActionsDelegate

Metadata

Index

Properties
Methods

Constructor

constructor(groupService: GroupService, discussionService: DiscussionService, profileService: ProfileService, formService: FormService, appGlobalService: AppGlobalService, headerService: AppHeaderService, router: Router, location: Location, platform: Platform, popoverCtrl: PopoverController, navService: NavigationService, commonUtilService: CommonUtilService, filterPipe: FilterPipe, telemetryGeneratorService: TelemetryGeneratorService, viewMoreActivityDelegateService: ViewMoreActivityDelegateService)
Parameters :
Name Type Optional
groupService GroupService No
discussionService DiscussionService No
profileService ProfileService No
formService FormService No
appGlobalService AppGlobalService No
headerService AppHeaderService No
router Router No
location Location No
platform Platform No
popoverCtrl PopoverController No
navService NavigationService No
commonUtilService CommonUtilService No
filterPipe FilterPipe No
telemetryGeneratorService TelemetryGeneratorService No
viewMoreActivityDelegateService ViewMoreActivityDelegateService No

Methods

Async activityMenuClick
activityMenuClick(event)
Parameters :
Name Optional
event No
Returns : Promise<boolean>
assignForumData
assignForumData(e)
Parameters :
Name Optional
e No
Returns : void
Async disableDF
disableDF()
Returns : any
Async enableDF
enableDF()
Returns : any
extractInitial
extractInitial(name)
Parameters :
Name Optional
name No
Returns : any
Private Async fetchGroupDetails
fetchGroupDetails()
Returns : any
Async generateDataForDF
generateDataForDF()
Returns : any
Private generateInteractTelemetry
generateInteractTelemetry(interactType, interactSubType, id?)
Parameters :
Name Optional
interactType No
interactSubType No
id Yes
Returns : void
getMemberName
getMemberName(member)
Parameters :
Name Optional
member No
Returns : any
Async groupMenuClick
groupMenuClick(event)
Parameters :
Name Optional
event No
Returns : any
handleBackButton
handleBackButton(isNavBack)
Parameters :
Name Optional
isNavBack No
Returns : void
handleDeviceBackButton
handleDeviceBackButton()
Returns : void
handleHeaderEvents
handleHeaderEvents($event)
Parameters :
Name Optional
$event No
Returns : void
ionViewWillEnter
ionViewWillEnter()
Returns : void
ionViewWillLeave
ionViewWillLeave()
Returns : void
Async memberMenuClick
memberMenuClick(event, selectedMember)
Parameters :
Name Optional
event No
selectedMember No
Returns : any
Async navigateToAddActivityPage
navigateToAddActivityPage()
Returns : any
navigateToAddUserPage
navigateToAddUserPage()
Returns : void
navigateToViewMorePage
navigateToViewMorePage(activityGroup)
Parameters :
Name Optional
activityGroup No
Returns : void
ngOnDestroy
ngOnDestroy()
Returns : void
ngOnInit
ngOnInit()
Returns : void
onActivityCardClick
onActivityCardClick(event)
Parameters :
Name Optional
event No
Returns : void
onActivitySearch
onActivitySearch(query)
Parameters :
Name Optional
query No
Returns : void
onMemberSearch
onMemberSearch(query)
Parameters :
Name Optional
query No
Returns : void
onViewMoreCardClick
onViewMoreCardClick(event: Event, activity: GroupActivity)
Parameters :
Name Type Optional
event Event No
activity GroupActivity No
Returns : void
onViewMoreCardMenuClick
onViewMoreCardMenuClick(event, activity)
Parameters :
Name Optional
event No
activity No
Returns : Promise<boolean>
Private setFlattenedActivityList
setFlattenedActivityList()
Returns : void
Private Async showDeactivateGroupPopup
showDeactivateGroupPopup()
Returns : any
Private Async showDeleteGroupPopup
showDeleteGroupPopup()
Returns : any
Private Async showDisableDFPopupPopup
showDisableDFPopupPopup()
Returns : any
Private Async showDismissAsGroupAdminPopup
showDismissAsGroupAdminPopup(selectedMember)
Parameters :
Name Optional
selectedMember No
Returns : any
Private Async showLeaveGroupPopup
showLeaveGroupPopup()
Returns : any
Private Async showMakeGroupAdminPopup
showMakeGroupAdminPopup(selectedMember)
Parameters :
Name Optional
selectedMember No
Returns : any
showMemberMenu
showMemberMenu(member)
Parameters :
Name Optional
member No
Returns : boolean
Private Async showReactivateGroupPopup
showReactivateGroupPopup()
Returns : any
Private Async showRemoveActivityPopup
showRemoveActivityPopup(selectedActivity)
Parameters :
Name Optional
selectedActivity No
Returns : Promise<boolean>
Private Async showRemoveMemberPopup
showRemoveMemberPopup(selectedMember)
Parameters :
Name Optional
selectedMember No
Returns : any
switchTabs
switchTabs(tab)
Parameters :
Name Optional
tab No
Returns : void

Properties

accessDiscussionComponent
Type : AccessDiscussionComponent
Decorators :
@ViewChild(AccessDiscussionComponent, {static: false})
activeTab
Type : string
Default value : 'activities'
activityList
Type : ActivitiesGrouped[]
Default value : []
activitySearchQuery
Type : string
corRelationList
Type : Array<CorrelationData>
Default value : []
createUserReq
Type : object
Default value : { username: '', identifier: '' }
fetchForumIdReq
filteredGroupedActivityListMap
Type : literal type
filteredMemberList
Type : []
Default value : []
flattenedActivityList
Type : []
Default value : []
forumDetails
groupCreator
Type : GroupMember
groupDetails
Type : Group
groupedActivityListMap
Type : literal type
groupId
Type : string
Public groupService
Type : GroupService
Decorators :
@Inject('GROUP_SERVICE')
headerObservable
Type : any
isGroupCreatorOrAdmin
Default value : false
isGroupLoading
Default value : false
isSuspended
Default value : false
loggedinUser
Type : GroupMember
memberList
Type : GroupMember[]
Default value : []
memberSearchQuery
Type : string
Public platform
Type : Platform
Private unregisterBackButton
Type : Subscription
userId
Type : string
import { Component, Inject, OnInit, OnDestroy, ViewChild } from '@angular/core';
import { Subscription } from 'rxjs';
import { Location } from '@angular/common';
import {
  AppHeaderService,
  CommonUtilService, AppGlobalService, TelemetryGeneratorService
} from '../../../services';
import { Router } from '@angular/router';
import { RouterLinks, MenuOverflow, ProfileConstants } from '@app/app/app.constant';
import {
  InteractType,
  InteractSubtype,
  Environment, PageId,
  ImpressionType,
  CorReleationDataType,
  ID
} from '@app/services/telemetry-constants';
import { Platform, PopoverController } from '@ionic/angular';
import {
  GroupService, GetByIdRequest, Group,
  GroupMember, GroupMemberRole, DeleteByIdRequest,
  RemoveMembersRequest,
  UpdateMembersRequest, RemoveActivitiesRequest,
  CachedItemRequestSourceFrom, GroupUpdateMembersResponse,
  GroupActivity,
  Form,
  GroupSupportedActivitiesFormField,
  CorrelationData, DiscussionService, ProfileService, FormService, ActivateAndDeactivateByIdRequest
} from '@project-sunbird/sunbird-sdk';
import {
  OverflowMenuComponent
} from '@app/app/profile/overflow-menu/overflow-menu.component';
import GraphemeSplitter from 'grapheme-splitter';
import {
  SbGenericPopoverComponent
} from '@app/app/components/popups';
import { FilterPipe } from '@app/pipes/filter/filter.pipe';
import { ActivitiesGrouped } from '@project-sunbird/client-services/models';
import {
  ViewMoreActivityDelegateService,
  ViewMoreActivityActionsDelegate
} from '../view-more-activity/view-more-activity.page';
import { NavigationService } from '@app/services/navigation-handler.service';
import { AccessDiscussionComponent } from '@app/app/components/access-discussion/access-discussion.component';

@Component({
  selector: 'app-group-details',
  templateUrl: './group-details.page.html',
  styleUrls: ['./group-details.page.scss'],
})
export class GroupDetailsPage implements OnInit, OnDestroy, ViewMoreActivityActionsDelegate {

  corRelationList: Array<CorrelationData> = [];
  isGroupLoading = false;
  userId: string;
  headerObservable: any;
  groupId: string;
  groupDetails: Group;
  activeTab = 'activities';
  activityList: ActivitiesGrouped[] = [];
  groupedActivityListMap: { [title: string]: GroupActivity[] };
  filteredGroupedActivityListMap: { [title: string]: GroupActivity[] };
  memberList: GroupMember[] = [];
  filteredMemberList = [];
  memberSearchQuery: string;
  activitySearchQuery: string;
  private unregisterBackButton: Subscription;
  loggedinUser: GroupMember;
  groupCreator: GroupMember;
  flattenedActivityList = [];
  isSuspended = false;
  isGroupCreatorOrAdmin = false;
  forumDetails;
  // createForumRequest;
  fetchForumIdReq;
  createUserReq = {
    username: '',
    identifier: ''
  };
  @ViewChild(AccessDiscussionComponent, { static: false }) accessDiscussionComponent: AccessDiscussionComponent;

  constructor(
    @Inject('GROUP_SERVICE') public groupService: GroupService,
    @Inject('DISCUSSION_SERVICE') private discussionService: DiscussionService,
    @Inject('PROFILE_SERVICE') private profileService: ProfileService,
    @Inject('FORM_SERVICE') private formService: FormService,
    private appGlobalService: AppGlobalService,
    private headerService: AppHeaderService,
    private router: Router,
    private location: Location,
    public platform: Platform,
    private popoverCtrl: PopoverController,
    private navService: NavigationService,
    private commonUtilService: CommonUtilService,
    private filterPipe: FilterPipe,
    private telemetryGeneratorService: TelemetryGeneratorService,
    private viewMoreActivityDelegateService: ViewMoreActivityDelegateService
  ) {
    const extras = this.router.getCurrentNavigation().extras.state;
    this.groupId = extras.groupId;
  }

  ngOnInit() {
    this.appGlobalService.getActiveProfileUid()
      .then((uid) => {
        this.userId = uid;
        this.createUserReq.identifier = uid;
      });

    this.corRelationList.push({ id: this.groupId, type: CorReleationDataType.GROUP_ID });
    this.telemetryGeneratorService.generateImpressionTelemetry(ImpressionType.VIEW, '', PageId.GROUP_DETAIL, Environment.GROUP,
      undefined, undefined, undefined, undefined, this.corRelationList);

    this.viewMoreActivityDelegateService.delegate = this;
    this.generateDataForDF();
  }

  ngOnDestroy() {
    this.viewMoreActivityDelegateService.delegate = undefined;
  }

  ionViewWillEnter() {
    this.headerService.showHeaderWithBackButton();
    this.headerObservable = this.headerService.headerEventEmitted$.subscribe(eventName => {
      this.handleHeaderEvents(eventName);
    });
    this.handleDeviceBackButton();
    this.fetchGroupDetails();
  }

  ionViewWillLeave() {
    this.headerObservable.unsubscribe();
    if (this.unregisterBackButton) {
      this.unregisterBackButton.unsubscribe();
    }
  }

  handleDeviceBackButton() {
    this.unregisterBackButton = this.platform.backButton.subscribeWithPriority(10, () => {
      this.handleBackButton(false);
    });
  }

  handleHeaderEvents($event) {
    if($event.name === 'back')
    {
      this.handleBackButton(true);
    }
  }

  handleBackButton(isNavBack) {
    this.telemetryGeneratorService.generateBackClickedTelemetry(PageId.GROUP_DETAIL,
      Environment.GROUP, isNavBack, undefined, this.corRelationList);

    this.location.back();
  }

  navigateToAddUserPage() {
    this.generateInteractTelemetry(InteractType.ADD_MEMBER, InteractSubtype.ADD_MEMBER_CLICKED, ID.ADD_MEMBER)
    this.navService.navigateTo([`/${RouterLinks.MY_GROUPS}/${RouterLinks.ADD_MEMBER_TO_GROUP}`], {
      groupId: this.groupId,
      memberList: this.memberList,
      corRelation: this.corRelationList
    });
  }

  private async fetchGroupDetails() {
    this.isGroupLoading = true;
    const getByIdRequest: GetByIdRequest = {
      from: CachedItemRequestSourceFrom.SERVER,
      id: this.groupId,
      userId: this.userId,
      options: {
        includeMembers: true,
        includeActivities: true,
        groupActivities: true
      }
    };
    try {
      this.groupDetails = await this.groupService.getById(getByIdRequest).toPromise();
      this.isSuspended = this.groupDetails.status.toLowerCase() === 'suspended';
      this.memberList = this.groupDetails.members;
      this.activityList = this.groupDetails.activitiesGrouped;
      this.activityList.forEach((a) => {
        if (a.translations) {
          a.title = this.commonUtilService.getTranslatedValue(a.translations, a.title);
        }
      });

      if (this.memberList) {
        this.memberList.sort((a, b) => {
          if (b.userId === this.userId) {
            return 1;
          } else if (a.userId === this.userId) {
            return -1;
          }
          if (b.role === GroupMemberRole.ADMIN && a.role === GroupMemberRole.MEMBER) {
            return 1;
          } else if (b.role === GroupMemberRole.MEMBER && a.role === GroupMemberRole.ADMIN) {
            return -1;
          }
          return a.name.localeCompare(b.name);
        });
      }

      this.loggedinUser = this.memberList.find(m => m.userId === this.userId);
      this.groupCreator = this.memberList.find(m => m.userId === this.groupDetails.createdBy);

      this.filteredMemberList = new Array(...this.memberList);

      this.groupedActivityListMap = this.activityList.reduce((acc, activityGroup) => {
        acc[activityGroup.title] = activityGroup.items.map((i) => {
          const activity = {
            ...i.activityInfo,
            type: i.type,
            cardImg: this.commonUtilService.getContentImg(i.activityInfo)
          };
          return activity;
        });
        return acc;
      }, {});
      this.filteredGroupedActivityListMap = { ...this.groupedActivityListMap };
      this.isGroupLoading = false;
      if (this.groupCreator.userId === this.userId || this.loggedinUser.role === GroupMemberRole.ADMIN) {
        this.isGroupCreatorOrAdmin = true;
      }
      this.setFlattenedActivityList();
    } catch (e) {
      this.isGroupLoading = false;
      console.error(e);
    }
  }

  getMemberName(member) {
    let memberName = member.name;
    if (this.loggedinUser.userId === member.userId) {
      memberName = this.commonUtilService.translateMessage('LOGGED_IN_MEMBER', { member_name: member.name });
    }
    return memberName;
  }

  showMemberMenu(member) {
    let showMenu = false;
    if (this.loggedinUser.role === GroupMemberRole.ADMIN
      && member.userId !== this.groupCreator.userId
      && member.userId !== this.loggedinUser.userId) {
      showMenu = true;
    }
    return showMenu;
  }

  switchTabs(tab) {
    this.activeTab = tab;
    this.generateInteractTelemetry(InteractType.TOUCH, tab === 'activities' ? InteractSubtype.ACTIVITY_TAB_CLICKED : InteractSubtype.MEMBER_TAB_CLICKED)
  }
  

  async groupMenuClick(event) {
    this.generateInteractTelemetry( InteractType.TOUCH, InteractSubtype.GROUP_KEBAB_MENU_CLICKED);
    let menuList = MenuOverflow.MENU_GROUP_NON_ADMIN;
    if (this.groupDetails.status.toLowerCase() === 'suspended') {
      if (this.groupCreator.userId === this.userId) {
        menuList = MenuOverflow.MENU_GROUP_CREATOR_SUSPENDED;
        this.isGroupCreatorOrAdmin = true;
      } else if (this.loggedinUser.role === GroupMemberRole.ADMIN) {
        menuList = MenuOverflow.MENU_GROUP_ADMIN__SUSPENDED;
        this.isGroupCreatorOrAdmin = true;
      }
    } else {
      if (this.groupCreator.userId === this.userId) {
        if(this.forumDetails){
          menuList = MenuOverflow.MENU_GROUP_CREATOR_DISABLE_DF;
        } else {
          menuList = MenuOverflow.MENU_GROUP_CREATOR;
        }
        
      } else if (this.loggedinUser.role === GroupMemberRole.ADMIN) {
        if(this.forumDetails){
          menuList = MenuOverflow.MENU_GROUP_ADMIN_DISABLE_DF
        } else {
          menuList = MenuOverflow.MENU_GROUP_ADMIN;
        }
      }
    }

    const groupOptions = await this.popoverCtrl.create({
      component: OverflowMenuComponent,
      componentProps: {
        list: menuList
      },
      event,
      cssClass: 'group-option-popover'
    });
    await groupOptions.present();

    const { data } = await groupOptions.onDidDismiss();
    if (data) {
      if (data.selectedItem === 'MENU_EDIT_GROUP_DETAILS') {
        this.generateInteractTelemetry( InteractType.UPDATE_GROUP, InteractSubtype.EDIT_GROUP_CLICKED, ID.UPDATE_GROUP);
        this.navService.navigateTo([`/${RouterLinks.MY_GROUPS}/${RouterLinks.CREATE_EDIT_GROUP}`],
          {
            groupDetails: this.groupDetails,
            corRelation: this.corRelationList
          });
      } else if (data.selectedItem === 'MENU_DELETE_GROUP') {
        this.showDeleteGroupPopup();
      } else if (data.selectedItem === 'MENU_LEAVE_GROUP') {
        this.showLeaveGroupPopup();
      } else if (data.selectedItem === 'FRMELEMENTS_LBL_DEACTIVATEGRP') {
        this.showDeactivateGroupPopup();
      } else if (data.selectedItem === 'FRMELEMENTS_LBL_ACTIVATEGRP') {
        this.showReactivateGroupPopup();
      } else if (data.selectedItem === 'ENABLE_DISCUSSION_FORUM'){
        this.enableDF();
      } else if(data.selectedItem === 'DISABLE_DISCUSSION_FORUM') {
        this.showDisableDFPopupPopup();
      }
    }
  }

  async activityMenuClick(event): Promise<boolean> {
    const selectedActivity = event.data;
    const groupOptions = await this.popoverCtrl.create({
      component: OverflowMenuComponent,
      componentProps: {
        list: MenuOverflow.MENU_GROUP_ACTIVITY_ADMIN
      },
      event: event.event,
      cssClass: 'group-option-popover group-option-popover-admin'
    });
    await groupOptions.present();

    const { data } = await groupOptions.onDidDismiss();
    if (data) {
      return this.showRemoveActivityPopup(selectedActivity);
    }
    return false;
  }

  async memberMenuClick(event, selectedMember) {
    let menuList = MenuOverflow.MENU_GROUP_MEMBER_NON_ADMIN;

    if (selectedMember.role === GroupMemberRole.ADMIN) {  // Is admin and creator
      menuList = MenuOverflow.MENU_GROUP_MEMBER_ADMIN;
    }

    const groupOptions = await this.popoverCtrl.create({
      component: OverflowMenuComponent,
      componentProps: {
        list: menuList
      },
      event: event.event,
      cssClass: 'group-option-popover'
    });
    await groupOptions.present();

    const { data } = await groupOptions.onDidDismiss();
    if (data) {
      if (data.selectedItem === 'MENU_MAKE_GROUP_ADMIN') {
        this.showMakeGroupAdminPopup(selectedMember);
      } else if (data.selectedItem === 'MENU_REMOVE_FROM_GROUP') {
        this.showRemoveMemberPopup(selectedMember);
      } else if (data.selectedItem === 'DISMISS_AS_GROUP_ADMIN') {
        this.showDismissAsGroupAdminPopup(selectedMember);
      }
    }
  }

  private async showDeactivateGroupPopup() {
    this.generateInteractTelemetry( InteractType.SELECT_DEACTIVATE, InteractSubtype.DEACTIVATE_GROUP_CLICKED, ID.SELECT_DEACTIVATE);
    const deleteConfirm = await this.popoverCtrl.create({
      component: SbGenericPopoverComponent,
      componentProps: {
        sbPopoverHeading: this.commonUtilService.translateMessage('FRMELEMENTS_LBL_DEACTIVATEGRPQUES'),
        actionsButtons: [
          {
            btntext: this.commonUtilService.translateMessage('FRMELEMENTS_BTN_DEACTIVATEGRP'),
            btnClass: 'popover-color'
          },
        ],
        icon: null,
        sbPopoverContent: this.commonUtilService.translateMessage('FRMELEMENTS_MSG_DEACTIVATEGRPMSG', { group_name: this.groupDetails.name })
      },
      cssClass: 'sb-popover danger',
    });
    await deleteConfirm.present();

    const { data } = await deleteConfirm.onDidDismiss();
    if (data && data.isLeftButtonClicked) {
      if (!this.commonUtilService.networkInfo.isNetworkAvailable) {
        this.commonUtilService.presentToastForOffline('YOU_ARE_NOT_CONNECTED_TO_THE_INTERNET');
        return;
      }
      this.generateInteractTelemetry( InteractType.INITIATED, '', ID.DEACTIVATE_GROUP);
      const loader = await this.commonUtilService.getLoader();
      await loader.present();
      try {
       const deactivateByIdRequest: ActivateAndDeactivateByIdRequest = {
          id: this.groupId
        };
        await this.groupService.suspendById(deactivateByIdRequest).toPromise();
        this.commonUtilService.showToast('FRMELEMENTS_MSG_DEACTIVATEGRPSUCCESS');
        await loader.dismiss();
        this.generateInteractTelemetry( InteractType.SUCCESS, '', ID.DEACTIVATE_GROUP);
        this.fetchGroupDetails();
      } catch (e) {
        await loader.dismiss();
        console.error(e);
        this.commonUtilService.showToast('FRMELEMENTS_MSG_DEACTIVATEGRPFAILED');
      }
    }
  }

  private async showReactivateGroupPopup() {
    this.generateInteractTelemetry( InteractType.TOUCH, InteractSubtype.REACTIVATE_GROUP_CLICKED);
    const makeGroupAdminConfirm = await this.popoverCtrl.create({
      component: SbGenericPopoverComponent,
      componentProps: {
        sbPopoverHeading: this.commonUtilService.translateMessage('FRMELEMENTS_LBL_ACTIVATEGRPQUES'),
        actionsButtons: [
          {
            btntext: this.commonUtilService.translateMessage('FRMELEMENTS_BTN_ACTIVATEGRP'),
            btnClass: 'popover-color'
          },
        ],
        icon: null,
        sbPopoverContent: this.commonUtilService.translateMessage('FRMELEMENTS_MSG_ACTIVATEGRPMSG')
      },
      cssClass: 'sb-popover',
    });
    await makeGroupAdminConfirm.present();

    const { data } = await makeGroupAdminConfirm.onDidDismiss();
    if (data && data.isLeftButtonClicked) {
      if (!this.commonUtilService.networkInfo.isNetworkAvailable) {
        this.commonUtilService.presentToastForOffline('YOU_ARE_NOT_CONNECTED_TO_THE_INTERNET');
        return;
      }

      this.generateInteractTelemetry( InteractType.INITIATED, '', ID.REACTIVATE_GROUP);
      this.isGroupLoading = true;
      const reActivateByIdRequest: ActivateAndDeactivateByIdRequest = {
        id: this.groupId
      };
      try {
        const resp = await this.groupService.reactivateById(reActivateByIdRequest).toPromise();
        this.isGroupLoading = false;
        this.commonUtilService.showToast('FRMELEMENTS_MSG_ACTIVATEGRPSUCCESS');
        this.generateInteractTelemetry( InteractType.SUCCESS, '', ID.REACTIVATE_GROUP);

        this.fetchGroupDetails();
      } catch (e) {
        this.isGroupLoading = false;
        this.commonUtilService.showToast('FRMELEMENTS_MSG_ACTIVATEGRPFAILED');
      }
    }
  }

  private async showDeleteGroupPopup() {
    this.generateInteractTelemetry( InteractType.SELECT_DELETE, InteractSubtype.DELETE_GROUP_CLICKED, ID.SELECT_DELETE);  

    const deleteConfirm = await this.popoverCtrl.create({
      component: SbGenericPopoverComponent,
      componentProps: {
        sbPopoverHeading: this.commonUtilService.translateMessage('DELETE_GROUP_POPUP_TITLE'),
        actionsButtons: [
          {
            btntext: this.commonUtilService.translateMessage('REMOVE'),
            btnClass: 'popover-color'
          },
        ],
        icon: null,
        sbPopoverContent: this.commonUtilService.translateMessage('DELETE_GROUP_DESC', { group_name: this.groupDetails.name })
      },
      cssClass: 'sb-popover danger',
    });
    await deleteConfirm.present();

    const { data } = await deleteConfirm.onDidDismiss();
    if (data && data.isLeftButtonClicked) {
      if (!this.commonUtilService.networkInfo.isNetworkAvailable) {
        this.commonUtilService.presentToastForOffline('YOU_ARE_NOT_CONNECTED_TO_THE_INTERNET');
        return;
      }
      this.generateInteractTelemetry( InteractType.INITIATED, '', ID.DELETE_GROUP);  
      const loader = await this.commonUtilService.getLoader();
      await loader.present();
      const deleteByIdRequest: DeleteByIdRequest = {
        id: this.groupId
      };
      try {
        await this.groupService.deleteById(deleteByIdRequest).toPromise();
        await loader.dismiss();
        this.commonUtilService.showToast('DELETE_GROUP_SUCCESS_MSG');
        await loader.dismiss();
        this.location.back();
        this.generateInteractTelemetry( InteractType.SUCCESS, '', ID.DELETE_GROUP);  
      } catch (e) {
        await loader.dismiss();
        console.error(e);
        this.commonUtilService.showToast('DELETE_GROUP_ERROR_MSG');
      }
    }
  }

  private async showLeaveGroupPopup() {
    this.generateInteractTelemetry( InteractType.TOUCH, InteractSubtype.LEAVE_GROUP_CLICKED);  
    const leaveGroupConfirm = await this.popoverCtrl.create({
      component: SbGenericPopoverComponent,
      componentProps: {
        sbPopoverHeading: this.commonUtilService.translateMessage('LEAVE_GROUP_POPUP_TITLE'),
        actionsButtons: [
          {
            btntext: this.commonUtilService.translateMessage('LEAVE_GROUP'),
            btnClass: 'popover-color'
          },
        ],
        icon: null,
        sbPopoverContent: this.commonUtilService.translateMessage('LEAVE_GROUP_POPUP_DESC', { group_name: this.groupDetails.name })
      },
      cssClass: 'sb-popover danger',
    });
    await leaveGroupConfirm.present();

    const { data } = await leaveGroupConfirm.onDidDismiss();
    if (data && data.isLeftButtonClicked) {
      if (!this.commonUtilService.networkInfo.isNetworkAvailable) {
        this.commonUtilService.presentToastForOffline('YOU_ARE_NOT_CONNECTED_TO_THE_INTERNET');
        return;
      }
      this.generateInteractTelemetry( InteractType.INITIATED, '', ID.LEAVE_GROUP);  
      const loader = await this.commonUtilService.getLoader();
      await loader.present();
      const removeMembersRequest: RemoveMembersRequest = {
        groupId: this.groupId,
        removeMembersRequest: {
          userIds: [this.userId]
        }
      };
      try {
        const removeMemberResponse = await this.groupService.removeMembers(removeMembersRequest).toPromise();

        await loader.dismiss();
        if (removeMemberResponse.error
          && removeMemberResponse.error.members
          && removeMemberResponse.error.members.length) {
          this.commonUtilService.showToast('LEAVE_GROUP_ERROR_MSG');
        } else {
          this.location.back();

          this.commonUtilService.showToast('LEAVE_GROUP_SUCCESS_MSG');
        this.generateInteractTelemetry( InteractType.SUCCESS, '', ID.LEAVE_GROUP);  
        }
      } catch (e) {
        console.error(e);
        await loader.dismiss();
        this.commonUtilService.showToast('LEAVE_GROUP_ERROR_MSG');
      }
    }
  }

  private async showRemoveActivityPopup(selectedActivity): Promise<boolean> {
    this.generateInteractTelemetry( InteractType.TOUCH,  InteractSubtype.REMOVE_ACTIVITY_CLICKED);  
    const removeActivityConfirm = await this.popoverCtrl.create({
      component: SbGenericPopoverComponent,
      componentProps: {
        sbPopoverHeading: this.commonUtilService.translateMessage('REMOVE_ACTIVITY_POPUP_TITLE'),
        actionsButtons: [
          {
            btntext: this.commonUtilService.translateMessage('REMOVE_ACTIVITY'),
            btnClass: 'popover-color'
          },
        ],
        icon: null,
        sbPopoverContent: this.commonUtilService.translateMessage('REMOVE_ACTIVITY_GROUP_DESC')
      },
      cssClass: 'sb-popover danger',
    });
    await removeActivityConfirm.present();

    const { data } = await removeActivityConfirm.onDidDismiss();
    if (data && data.isLeftButtonClicked) {
      if (!this.commonUtilService.networkInfo.isNetworkAvailable) {
        this.commonUtilService.presentToastForOffline('YOU_ARE_NOT_CONNECTED_TO_THE_INTERNET');
        return false;
      }
      this.generateInteractTelemetry( InteractType.INITIATED, '', ID.REMOVE_ACTIVITY);  
      this.isGroupLoading = true;
      const removeActivitiesRequest: RemoveActivitiesRequest = {
        groupId: this.groupId,
        removeActivitiesRequest: {
          activityIds: [selectedActivity.identifier]
        }
      };
      try {
        const removeActivitiesResponse = await this.groupService.removeActivities(removeActivitiesRequest).toPromise();

        this.isGroupLoading = false;
        if (removeActivitiesResponse.error
          && removeActivitiesResponse.error.activities
          && removeActivitiesResponse.error.activities.length) {
          this.commonUtilService.showToast('REMOVE_ACTIVITY_ERROR_MSG');
          return false;
        } else {
          this.commonUtilService.showToast('REMOVE_ACTIVITY_SUCCESS_MSG');
          this.generateInteractTelemetry(InteractType.SUCCESS, '', ID.REMOVE_ACTIVITY);  
          this.fetchGroupDetails();
          return true;
        }
      } catch (e) {
        console.error('showRemoveActivityPopup', e);
        this.isGroupLoading = false;
        this.commonUtilService.showToast('REMOVE_ACTIVITY_ERROR_MSG');
        return false;
      }
    }
  }

  private async showRemoveMemberPopup(selectedMember) {
    this.generateInteractTelemetry( InteractType.TOUCH, InteractSubtype.REMOVE_MEMBER_CLICKED);  
    const removeMemberConfirm = await this.popoverCtrl.create({
      component: SbGenericPopoverComponent,
      componentProps: {
        sbPopoverHeading: this.commonUtilService.translateMessage('REMOVE_MEMBER_POPUP_TITLE'),
        actionsButtons: [
          {
            btntext: this.commonUtilService.translateMessage('REMOVE_MEMBER'),
            btnClass: 'popover-color'
          },
        ],
        icon: null,
        sbPopoverContent: this.commonUtilService.translateMessage('REMOVE_MEMBER_GROUP_DESC', { member_name: selectedMember.name })
      },
      cssClass: 'sb-popover danger',
    });
    await removeMemberConfirm.present();

    const { data } = await removeMemberConfirm.onDidDismiss();
    if (data && data.isLeftButtonClicked) {
      if (!this.commonUtilService.networkInfo.isNetworkAvailable) {
        this.commonUtilService.presentToastForOffline('YOU_ARE_NOT_CONNECTED_TO_THE_INTERNET');
        return;
      }
      this.generateInteractTelemetry(InteractType.INITIATED, '', ID.REMOVE_MEMBER);  
      this.isGroupLoading = true;
      const removeMembersRequest: RemoveMembersRequest = {
        groupId: this.groupId,
        removeMembersRequest: {
          userIds: [selectedMember.userId]
        }
      };
      try {
        const removeMemberResponse = await this.groupService.removeMembers(removeMembersRequest).toPromise();

        this.isGroupLoading = false;
        if (removeMemberResponse.error
          && removeMemberResponse.error.members
          && removeMemberResponse.error.members.length) {
          this.commonUtilService.showToast('REMOVE_MEMBER_ERROR_MSG');
        } else {
          this.commonUtilService.showToast('REMOVE_MEMBER_SUCCESS_MSG', { member_name: selectedMember.name });
          this.generateInteractTelemetry(InteractType.SUCCESS, '', ID.REMOVE_MEMBER);  
          this.fetchGroupDetails();
        }
      } catch (e) {
        this.isGroupLoading = false;
        console.error(e);
        this.commonUtilService.showToast('REMOVE_MEMBER_ERROR_MSG');
      }
    }
  }

  private async showMakeGroupAdminPopup(selectedMember) {
    this.generateInteractTelemetry(InteractType.TOUCH, InteractSubtype.MAKE_GROUP_ADMIN_CLICKED);  
    const makeGroupAdminConfirm = await this.popoverCtrl.create({
      component: SbGenericPopoverComponent,
      componentProps: {
        sbPopoverHeading: this.commonUtilService.translateMessage('MAKE_GROUP_ADMIN_POPUP_TITLE'),
        actionsButtons: [
          {
            btntext: this.commonUtilService.translateMessage('MAKE_ADMIN'),
            btnClass: 'popover-color'
          },
        ],
        icon: null,
        sbPopoverContent: this.commonUtilService.translateMessage('MAKE_GROUP_ADMIN_POPUP_DESC',
          { member_name: selectedMember.name })
      },
      cssClass: 'sb-popover',
    });
    await makeGroupAdminConfirm.present();

    const { data } = await makeGroupAdminConfirm.onDidDismiss();
    if (data && data.isLeftButtonClicked) {
      if (!this.commonUtilService.networkInfo.isNetworkAvailable) {
        this.commonUtilService.presentToastForOffline('YOU_ARE_NOT_CONNECTED_TO_THE_INTERNET');
        return;
      }
      this.generateInteractTelemetry(InteractType.INITIATED, '', ID.MAKE_GROUP_ADMIN);  
      this.isGroupLoading = true;
      const updateMembersRequest: UpdateMembersRequest = {
        groupId: this.groupId,
        updateMembersRequest: {
          members: [{
            userId: selectedMember.userId,
            role: GroupMemberRole.ADMIN
          }]
        }
      };
      try {
        const updateMemberResponse: GroupUpdateMembersResponse = await this.groupService.updateMembers(updateMembersRequest).toPromise();

        this.isGroupLoading = false;
        if (updateMemberResponse.error
          && updateMemberResponse.error.members
          && updateMemberResponse.error.members.length) {
          this.commonUtilService.showToast('MAKE_GROUP_ADMIN_ERROR_MSG', { member_name: selectedMember.name });
        } else {
          this.commonUtilService.showToast('MAKE_GROUP_ADMIN_SUCCESS_MSG', { member_name: selectedMember.name });
          this.generateInteractTelemetry(InteractType.SUCCESS, '', ID.MAKE_GROUP_ADMIN);  
          this.fetchGroupDetails();
        }
      } catch (e) {
        console.error('showMakeGroupAdminPopup', e);
        this.isGroupLoading = false;
        this.commonUtilService.showToast('MAKE_GROUP_ADMIN_ERROR_MSG', { member_name: selectedMember.name });
      }
    }
  }

  private async showDismissAsGroupAdminPopup(selectedMember) {
    this.generateInteractTelemetry(InteractType.TOUCH,  InteractSubtype.DISMISS_GROUP_ADMIN_CLICKED);  

    const dismissAsGroupAdminConfirm = await this.popoverCtrl.create({
      component: SbGenericPopoverComponent,
      componentProps: {
        sbPopoverHeading: this.commonUtilService.translateMessage('DISMISS_AS_GROUP_ADMIN_POPUP_TITLE'),
        actionsButtons: [
          {
            btntext: this.commonUtilService.translateMessage('DISMISS_AS_GROUP_ADMIN'),
            btnClass: 'popover-color'
          },
        ],
        icon: null,
        sbPopoverContent: this.commonUtilService.translateMessage('DISMISS_AS_GROUP_ADMIN_POPUP_DESC',
          { member_name: selectedMember.name })
      },
      cssClass: 'sb-popover',
    });
    await dismissAsGroupAdminConfirm.present();

    const { data } = await dismissAsGroupAdminConfirm.onDidDismiss();
    if (data && data.isLeftButtonClicked) {
      if (!this.commonUtilService.networkInfo.isNetworkAvailable) {
        this.commonUtilService.presentToastForOffline('YOU_ARE_NOT_CONNECTED_TO_THE_INTERNET');
        return;
      }

      this.generateInteractTelemetry(InteractType.INITIATED, '', ID.DISMISS_GROUP_ADMIN);  

      this.isGroupLoading = true;
      const updateMembersRequest: UpdateMembersRequest = {
        groupId: this.groupId,
        updateMembersRequest: {
          members: [{
            userId: selectedMember.userId,
            role: GroupMemberRole.MEMBER
          }]
        }
      };
      try {
        const updateMemberResponse: GroupUpdateMembersResponse = await this.groupService.updateMembers(updateMembersRequest).toPromise();
        this.isGroupLoading = false;
        if (updateMemberResponse.error
          && updateMemberResponse.error.members
          && updateMemberResponse.error.members.length) {
          this.commonUtilService.showToast('DISMISS_AS_GROUP_ADMIN_ERROR_MSG', { member_name: selectedMember.name });
        } else {
          this.commonUtilService.showToast('DISMISS_AS_GROUP_ADMIN_SUCCESS_MSG', { member_name: selectedMember.name });
          this.generateInteractTelemetry(InteractType.SUCCESS, '', ID.DISMISS_GROUP_ADMIN);  
          this.fetchGroupDetails();
        }
      } catch (e) {
        this.isGroupLoading = false;
        console.error(e);
        this.commonUtilService.showToast('DISMISS_AS_GROUP_ADMIN_ERROR_MSG', { member_name: selectedMember.name });
      }
    }
  }

  onMemberSearch(query) {
    this.memberSearchQuery = query;
    this.filteredMemberList = [...this.filterPipe.transform(this.memberList, 'name', query)];
  }

  onActivitySearch(query) {
    this.activitySearchQuery = query;
    for (const property in this.groupedActivityListMap) {
      if (this.groupedActivityListMap[property].length) {
        this.filteredGroupedActivityListMap[property] = this.groupedActivityListMap[property].filter(
          (activity) => activity['name'].toLowerCase().includes(query.toLowerCase())
        );
      }
    }
    this.setFlattenedActivityList();
  }

  extractInitial(name) {
    const splitter = new GraphemeSplitter();
    const split: string[] = splitter.splitGraphemes(name.trim());
    return split[0];
  }

  onActivityCardClick(event) {
    const activity = event.data;
    this.navService.navigateToDetailPage(activity, {
      content: activity,
      activityData: {
        group: this.groupDetails,
        isGroupCreatorOrAdmin: this.isGroupCreatorOrAdmin,
        activity
      },
      corRelation: this.corRelationList,
    });
    
  }

  async navigateToAddActivityPage() {
    if (!this.commonUtilService.networkInfo.isNetworkAvailable) {
      this.commonUtilService.presentToastForOffline('YOU_ARE_NOT_CONNECTED_TO_THE_INTERNET');
      return;
    }
    this.generateInteractTelemetry(InteractType.ADD_ACTIVITY, InteractSubtype.ADD_ACTIVITY_CLICKED, ID.ADD_ACTIVITY);  
    try {
      const supportedActivityResponse: Form<GroupSupportedActivitiesFormField>
        = await this.groupService.getSupportedActivities().toPromise();
      if (supportedActivityResponse && supportedActivityResponse.data && supportedActivityResponse.data.fields) {
        const supportedActivityList = supportedActivityResponse.data.fields;
        supportedActivityList.forEach(a => {
          if (a.translations) {
            a.title = this.commonUtilService.getTranslatedValue(a.translations, a.title);
          }
        });
        this.navService.navigateTo([`/${RouterLinks.MY_GROUPS}/${RouterLinks.MY_GROUP_DETAILS}/${RouterLinks.ADD_ACTIVITY_TO_GROUP}`],
          {
            supportedActivityList,
            groupId: this.groupId,
            activityList: this.activityList,
            corRelation: this.corRelationList
          });
      }
    } catch (e) {
      console.error('navigateToAddActivityPage', e);
    }
  }

  navigateToViewMorePage(activityGroup) {
    this.navService.navigateTo([`/${RouterLinks.MY_GROUPS}/${RouterLinks.MY_GROUP_DETAILS}/${RouterLinks.ACTIVITY_VIEW_MORE}`],
      {
        isMenu: this.loggedinUser.role === 'admin',
        activityGroup,
        groupId: this.groupId,
        previousPageId: PageId.GROUP_DETAIL
      });
  }

  onViewMoreCardClick(event: Event, activity: GroupActivity) {
    const data = {
      data: {
        ...activity.activityInfo,
        type: activity.type
      }
    };
    this.onActivityCardClick(data);
  }

  onViewMoreCardMenuClick(event, activity) {
    return this.activityMenuClick(event);
  }

  private setFlattenedActivityList() {
    this.flattenedActivityList = [];
    for (const key in this.filteredGroupedActivityListMap) {
      if (this.filteredGroupedActivityListMap[key]) {
        this.flattenedActivityList = [...this.flattenedActivityList , ...this.filteredGroupedActivityListMap[key]];
      }
    }
  }

  private generateInteractTelemetry(interactType, interactSubType, id?){
    this.telemetryGeneratorService.generateInteractTelemetry(
      interactType,
      interactSubType,
      Environment.GROUP,
      PageId.GROUP_DETAIL,
      undefined,
      undefined,
      undefined,
      this.corRelationList,
      id
    );
  }

  async enableDF(){
    this.generateInteractTelemetry( InteractType.TOUCH, InteractSubtype.ENABLE_DISCUSSIONS_CLICKED);
    const loader = await this.commonUtilService.getLoader();
    await loader.present();
    this.generateInteractTelemetry( InteractType.INITIATED, '', ID.ENABLE_DISCUSSIONS);
    const request = {
      context: {
        type: 'group',
        identifier: this.groupId
      },
      type: 'group'
    }
    this.discussionService.attachForum(request).toPromise()
    .then(async (response) => {
      this.generateInteractTelemetry( InteractType.SUCCESS, '', ID.ENABLE_DISCUSSIONS);
      await loader.dismiss();
      this.commonUtilService.showToast('DISCUSSION_FORUM_ENABLE_SUCCESS');
      this.accessDiscussionComponent.fetchForumIds();
      }).catch(async (err) => {
      console.log('enableDF err', err)
        await loader.dismiss();
        this.commonUtilService.showToast('SOMETHING_WENT_WRONG')
      });
  }

  async disableDF(){
    const loader = await this.commonUtilService.getLoader();
    await loader.present();
    this.generateInteractTelemetry( InteractType.INITIATED, '', ID.DISABLE_DISCUSSIONS);
    const removeForumReq = {...this.forumDetails}
    removeForumReq.cid = [removeForumReq.cid];
    this.discussionService.removeForum(removeForumReq).toPromise()
    .then(async res => {
      this.generateInteractTelemetry( InteractType.SUCCESS, '', ID.DISABLE_DISCUSSIONS);
      await loader.dismiss();
      this.forumDetails = '';
      this.commonUtilService.showToast('DISCUSSION_FORUM_DISABLE_SUCCESS');
      this.accessDiscussionComponent.fetchForumIds();
    }).catch(async err => {
      console.log('disableDF err', err)
      await loader.dismiss();
      this.commonUtilService.showToast('SOMETHING_WENT_WRONG')
    });
  }

  private async showDisableDFPopupPopup() {
    this.generateInteractTelemetry( InteractType.TOUCH, InteractSubtype.DISABLE_DISCUSSIONS_CLICKED);
    const deleteConfirm = await this.popoverCtrl.create({
      component: SbGenericPopoverComponent,
      componentProps: {
        sbPopoverHeading: this.commonUtilService.translateMessage('DISCUSSION_FORUM_DISABLE_CONFIRM'),
        actionsButtons: [
          {
            btntext: this.commonUtilService.translateMessage('DISABLE_DISCUSSION_FORUM'),
            btnClass: 'popover-color'
          },
        ],
        icon: null,
        sbPopoverContent: this.commonUtilService.translateMessage('DISCUSSION_FORUM_DISABLE_CONFIRM_DESC', { group_name: this.groupDetails.name })
      },
      cssClass: 'sb-popover danger',
    });
    await deleteConfirm.present();

    const { data } = await deleteConfirm.onDidDismiss();
    if (data && data.isLeftButtonClicked) {
      if (!this.commonUtilService.networkInfo.isNetworkAvailable) {
        this.commonUtilService.presentToastForOffline('YOU_ARE_NOT_CONNECTED_TO_THE_INTERNET');
        return;
      }
      this.disableDF();
    }
  }

  async generateDataForDF() {
    this.fetchForumIdReq =  {
      identifier: [this.groupId],
      type: 'group'
    };
    this.profileService.getActiveSessionProfile({ requiredFields: ProfileConstants.REQUIRED_FIELDS }).toPromise().then((p) => {
      this.createUserReq.username = p.serverProfile['userName'];
    });
  }

  assignForumData(e){
    console.log('assignForumData', e)
    this.forumDetails = e;
  }
  
}
<ion-content>
  <div class="gd-deactivated" *ngIf="isSuspended" tabindex="0">
    <div class="gd-deactivated-info pull-left" tabindex="0">{{'FRMELEMENTS_MSG_ACTIVATEGRPMSG' | translate}}</div>
    <div class="gd-deactivated-btn pull-left text-center" *ngIf="isGroupCreatorOrAdmin" tabindex="0">
      <button class="sb-btn-large sb-btn-small" (click)="showReactivateGroupPopup()" tabindex="0">
        {{'FRMELEMENTS_BTN_ACTIVATEGRP' | translate}}
      </button>
    </div>
  </div>
  <div class="gd-page" tabindex="0">
    <div class="gd-header">
      <div *ngIf="!isGroupLoading">
        <div class="gd-title">
          <div class="gd-name" role="heading" aria-level="1">
            {{groupDetails?.name}}
            <div class="gd-created-by" *ngIf="groupCreator">
              {{'GROUP_CREATED_BY' | translate: {'group_creator_name': groupCreator?.name} }}
            </div>
          </div>
          <div class="gd-opts">
            <accessDiscussion  aria-label="access discussion forum" [fetchForumIdReq]="fetchForumIdReq" [createUserReq]="createUserReq" (forumData)="assignForumData($event)"> </accessDiscussion>
           <span aria-label="more actions menu"><ion-icon ios="ellipsis-horizontal" role="button" aria-label="more actions menu" md="ellipsis-vertical" (click)="groupMenuClick($event)"></ion-icon></span>
          </div>
        </div>
      </div>
      <div class="m-n" *ngIf="isGroupLoading">
        <div class="skeleton-header mb-8">
          <app-skeleton-item height="1.125rem" width="75%" style="height:1.125rem; width:50%;"></app-skeleton-item>
          <app-skeleton-item height="0.875rem" width="75%" style="height:0.875rem; width:90%; margin-top:8px;">
          </app-skeleton-item>
        </div>
      </div>
      <div class="gd-tab-header" tabindex="0">
        <div class="gd-tab" (click)="switchTabs('activities')" [ngClass]="{'active': activeTab=='activities'}" tabindex="0">
          <div class="gd-tab-name gd-tab-border" 
          [attr.aria-label]="activeTab=='activities' ? 
            'Selected activities tab' : 
            'activities tab'">{{'ACTIVITIES' | translate}}</div>
        </div>
        <div class="gd-tab" (click)="switchTabs('members')" [ngClass]="{'active': activeTab=='members'}" tabindex="0">
          <div class="gd-tab-name" [attr.aria-label]="activeTab=='members' ?
            'Selected members' + memberList?.length + 'tab' :
            'members' + memberList?.length + 'tab'">{{'MEMBERS' | translate}} ({{memberList.length}})</div>
        </div>
      </div>
    </div>

    <div class="gd-tab-container" tabindex="0">
      <div class="gd-tab-content" *ngIf="activeTab=='members'">
        <div class="gd-member-search" tabindex="0">
          <img src="assets/imgs/search.svg" class="gd-member-search-icon" alt="members">
          <input type="text" [(ngModel)]="searchMember" placeholder="{{'GROUP_MEMBER_SEARCH_PLACEHOLDER' | translate}}"
            (ngModelChange)="onMemberSearch(searchMember)">
        </div>
        <div class="gd-tab-member-container" tabindex="0">
          <div class="gd-add-member-container">
            <div *ngIf="(platform.is('ios') ? false : true) && (!isSuspended && loggedinUser?.role === 'admin')" class="gd-add-member" (click)="navigateToAddUserPage()" tabindex="0">
              <span class="gd-add-member-icon">
                <img src="assets/imgs/ic_person_add_white.svg" alt="add-member">
              </span>
              <span class="gd-large-text">
                {{'ADD_MEMBER' | translate}}
              </span>
            </div>
          </div>
          <div *ngIf="isGroupLoading">
            <div *ngFor="let item of [0,1,2,3,4,5,6,7,8,9]">
              <sb-member-card [isLoading]="true"
                [config]="{size:'medium', isBold:false, isSelectable:false, view:'horizontal'}"></sb-member-card>
            </div>
          </div>
          <div *ngIf="!isGroupLoading">
            <div *ngFor="let member of filteredMemberList; let i = index">
              <sb-member-card [config]="{size:'medium', isBold:false, isSelectable:false, view:'horizontal'}"
                [identifier]="member.userId" [indexOfMember]="i" [initial]="commonUtilService.extractInitial(member.name)"
                [title]="getMemberName(member)" [isMenu]="!isSuspended && showMemberMenu(member)" [isAdmin]="member.role === 'admin'"
                (menuClick)="memberMenuClick($event, member)">
              </sb-member-card>
            </div>
          </div>
          <div *ngIf="(!isGroupLoading && !filteredMemberList) || (!isGroupLoading && filteredMemberList.length <= 1)"
            class="text-center">
            <div class="gd-empty-result" *ngIf="!memberSearchQuery">
              <img src="assets/imgs/no_member.svg" alt="no-member">
            </div>
            <div class="gd-empty-result" *ngIf="memberSearchQuery && !filteredMemberList.length">
              <img src="assets/imgs/empty_search_result.svg" alt="no-result">
              <p>{{'EMPTY_SEARCH_RESULT_GROUPS' | translate}}</p>
            </div>
          </div>
        </div>
      </div>
      <div class="gd-tab-content" *ngIf="activeTab=='activities'" tabindex="0">
        <div class="gd-member-search" tabindex="0">
          <img src="assets/imgs/search.svg" class="gd-member-search-icon" alt="search">
          <input type="text" [(ngModel)]="searchActivity" placeholder="{{'ACTIVITIESE_SEARCH_PLACEHOLDER' | translate}}"
            (ngModelChange)="onActivitySearch(searchActivity)">
        </div>
        <div *ngIf="!isGroupLoading && (!flattenedActivityList || !flattenedActivityList.length)" class="text-center" tabindex="0">
          <div class="gd-empty-result" *ngIf="!activitySearchQuery">
            <img src="assets/imgs/no_activity.svg" alt="no-activity">
          </div>
          <div class="gd-empty-result" *ngIf="activitySearchQuery">
            <img src="assets/imgs/empty_search_result.svg" alt="no-result">
            <p>{{'EMPTY_SEARCH_RESULT_GROUPS' | translate}}</p>
          </div>
        </div>
        <div *ngIf="isGroupLoading" tabindex="0">
          <div *ngFor="let item of [0,1,2,3,4,5,6,7,8,9]">
            <sb-course-card [isLoading]="true"></sb-course-card>
          </div>
        </div>
        <div *ngIf="!isGroupLoading && flattenedActivityList && flattenedActivityList.length" tabindex="0">
          <div *ngFor="let activityGroup of activityList; let i = index" class="mb-8" tabindex="0">
            <div class="gd-card-head" *ngIf="filteredGroupedActivityListMap[activityGroup?.title].length">
              <span class="gd-card-title-icon"><img src="assets/imgs/book.png" alt="book-icon"></span>
              <span class="gd-card-titile" role="heading" aria-level="2">{{activityGroup.title}}</span>
            </div>
            <div *ngFor="let activity of filteredGroupedActivityListMap[activityGroup?.title]; let j = index" tabindex="0">
                <sb-library-card 
                  (cardClick)="!isSuspended && onActivityCardClick($event)" [content]="activity" [section]="null"
                  [isMenu]="!isSuspended && loggedinUser.role === 'admin'" [cardImg]="activity?.appIcon
                      || config?.assetsPath?.book" (menuClick)="!isSuspended && activityMenuClick($event)">
                </sb-library-card>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>

</ion-content>

<ion-footer *ngIf="activeTab=='activities' && loggedinUser?.role === 'admin'">
  <div class="cd-btn" *ngIf="!isSuspended">
    <button class="sb-btn-large" (click)="navigateToAddActivityPage()">
      + {{'ADD_ACTIVITY' | translate}}
    </button>
  </div>
</ion-footer>

./group-details.page.scss

@import "src/assets/styles/_variables.scss";
@import "src/assets/styles/_custom-mixins.scss";

.font-16{
    font-size: 1rem;
}
.gd-page {
    padding: 8px;
}

.gd-deactivated{
    border: 1px solid map-get($colors, orange);
    padding: 8px;
    display: flex;
    .gd-deactivated-info{
        flex-basis: 70%;
        flex-grow: 1;
        color: map-get($colors, orange);
    }
    .gd-deactivated-btn{
        flex-basis: 30%;
    }
}

.gd-header {
    box-shadow: 0 3px 5px 4px rgba(0, 0, 0, 0.05);

    .gd-title {
        font-size: 1.125rem;
        font-weight: bold;
        padding: 8px 16px;
        position: relative;
        display: flex;
        .gd-name {
            padding-right: 60px;
            color: $gray-800;
            font-family: "Noto Sans", sans-serif;
            font-size: 1rem;
            font-weight: bold;
            letter-spacing: 0;
            line-height: 1.25rem;

            .gd-created-by {
                color: $gray-400;
                font-family: "Noto Sans", sans-serif;
                font-size: 0.688rem;
                letter-spacing: 0;
                line-height: 1.25rem;
                font-weight: normal;
            }
        }

        .gd-opts {
            position: absolute;
            right: 0.5rem;
            top: 1rem;
            .add-member-icon {
                position: relative;
                bottom: 0.375rem;
                margin-right: 8px;
            }
            ion-icon {
                color: $blue;
            }
        }
    }

}

.gd-tab-header {
    background-color: #E5EDF5;
    @include clearfix;

    .gd-tab {
        float: left;
        width: 50%;

        &.active {
            border-bottom: 2px solid $blue;
            .gd-tab-name {
                font-weight: bold;
                color: $blue;
            }
        }
    }

    .gd-tab-name {
        padding: 4px;
        text-align: center;
        margin-bottom: 5px;
        margin-top: 8px;
        color: $gray-400;
        font-size: 1rem;

        &.gd-tab-border {
            border-right: 1px solid $gray-300;
        }
    }
}
.gd-tab-member-container{
    box-shadow: 0 2px 7px 0 rgba(0,0,0,0.25);
    min-height: calc(100vh - 225px);
}

.gd-member-search {
    position: relative;
    margin: 8px 0;

    .gd-member-search-icon {
        position: absolute;
        top: 0.5rem;
        left: 0.5rem;
        font-size: 1.25rem;
        color: map-get($colors, gray_96);
        width: 1.125rem;
    }

    input {
        width: 100%;
        height: 2.188rem;
        padding: 0 8px 0 30px;
        border: 1px solid $blue;
        border-radius: 4px;
        outline: none;
        &::placeholder{
            color: map-get($colors, gray_96);
        }
    }
}

.cd-btn {
    padding: 16px;

    .sb-btn-large {
        border: none;
        color: #ffffff;
        text-align: center;
        text-decoration: none;
        display: inline-block;
        font-size: 1rem;
        cursor: pointer;
        outline: none;
        margin: 4px 0 8px;
        font-family: noto-sans, sans-serif;
        width: 100%;
        padding: 16px 0 16px 0;
        background-color: $blue;
        box-shadow: 0 2px 7px 0 rgba(0, 0, 0, 0.25);
    }



    img {
        margin-right: 8px;
        position: relative;
        bottom: 0.125rem;
    }
}

.gd-add-member {
    border-bottom: 1px solid $gray-100;
    margin: 0 8px;
    padding: 16px 0;
}

.gd-add-member-icon {
    width: 3.125rem;
    height: 3.125rem;
    border-radius: 30px;
    background-color:$green;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
    img {
        position: relative;
        top: 0.75rem;
        left: 0.625rem;
    }
}


.gd-large-text {
    color: $gray-800;
    font-family: "Noto Sans", sans-serif;
    font-size: 1rem;
    letter-spacing: 0;
    line-height: 1.25rem;
}

.showGroupOptions{
    padding: 16px;
}

.gd-empty-result{
    img{
        max-width: 65%;
        margin-top: 20%;
        margin-bottom: 16px;
        font-size: 1rem;
    }
}

.gd-card-head{
    padding: 16px 8px;
    .gd-card-title-icon{
        img{
            width: 1.125rem;
            margin-right: 8px;
        }
    }
    .gd-card-titile{
        color: $blue;
        font-size: 1rem;
        font-weight: bold;
    }
}
.sc-content{
    margin: 8px 0;
}
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""