Skip to content

Commit

Permalink
Issue #SH-21 feat: Fixed jenkins error.
Browse files Browse the repository at this point in the history
  • Loading branch information
AmiableAnil committed Jun 30, 2020
1 parent 370fa5d commit 3947e61
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 16 deletions.
20 changes: 10 additions & 10 deletions src/app/components/profile-avatar/profile-avatar.component.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
import { Component, Input, OnInit, OnChanges } from '@angular/core';
import GraphemeSplitter from 'grapheme-splitter';
import { CommonUtilService } from '@app/services';

@Component({
selector: 'app-profile-avatar',
templateUrl: './profile-avatar.component.html',
styleUrls: ['./profile-avatar.component.scss'],
})
export class ProfileAvatarComponent implements OnInit , OnChanges {
export class ProfileAvatarComponent implements OnInit, OnChanges {
@Input() username: string;
@Input() isStateUser: boolean;
bgColor: string;
color: string;
initial: string;
// GraphemeSplitter = require('grapheme-splitter');
constructor() { }

constructor(
private commonUtilService: CommonUtilService,
) { }

ngOnInit() {
this.extractInitial();
}

/**
* It will detect the changes of username and call the extractInitial() method
* @param changes
*/
ngOnChanges(changes: any) {
this.username = changes.username.currentValue;
Expand Down Expand Up @@ -58,12 +60,10 @@ export class ProfileAvatarComponent implements OnInit , OnChanges {
}

/**
* It will extract the first character of the user name and return with different BG color
*/
* It will extract the first character of the user name and return with different BG color
*/
extractInitial() {
const splitter = new GraphemeSplitter();
const split: string[] = splitter.splitGraphemes(this.username.trim());
this.initial = split[0];
this.initial = this.commonUtilService.extractInitial(this.username);
if (this.initial) {
this.getBgColor(this.username);
}
Expand Down
11 changes: 6 additions & 5 deletions src/app/my-groups/activity-details/activity-details.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@
<sb-course-card [section]="null"></sb-course-card>
<div class="gd-member-search">
<ion-icon class="gd-member-search-icon" md="md-search"></ion-icon>
<input type="text" [(ngModel)]="searchMember" (ngModelChange)="onSearch(searchMember)" placeholder="{{'SEARCH_FOR_GROUP_MEMBER' | translate}}">
<input type="text" [(ngModel)]="searchMember" (ngModelChange)="onSearch(searchMember)"
placeholder="{{'SEARCH_FOR_GROUP_MEMBER' | translate}}">
</div>
<div class="ad-timestamp" [innerHTML]="'LAST_UPDATED' | translate: {'%s': timeStamp || 'time' }">
</div>
<div class="ad-mebers-container">
<div *ngFor="let member of memberList">
<div *ngFor="let member of memberList; let i = index">
<sb-member-card [config]="{size:'medium', isBold:false, isSelectable:false, view:'horizontal'}"
[identifier]="member.identifier" [initial]="member.initial" [title]="member.title" [isMenu]="member.isMenu"
[isAdmin]="member.isAdmin" (menuClick)="memberMenuClick($event)">
[identifier]="member.identifier" [indexOfMember]="i"
[initial]="commonUtilService.extractInitial(member.title)" [title]="member.title" [isAdmin]="member.isAdmin">
</sb-member-card>
</div>
</div>
</div>

</ion-content>
11 changes: 10 additions & 1 deletion src/app/my-groups/activity-details/activity-details.page.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { CommonUtilService } from '@app/services';

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

timeStamp = '';
memberList: any;

constructor(
private router: Router
private router: Router,
private commonUtilService: CommonUtilService,
) {
const extras = this.router.getCurrentNavigation().extras.state;
this.memberList = extras.memberList;
Expand All @@ -19,4 +24,8 @@ export class ActivityDetailsPage implements OnInit {
ngOnInit() {
}

onSearch(text) {
console.log('onsearch', text);
}

}

0 comments on commit 3947e61

Please sign in to comment.