Skip to content

Commit

Permalink
Merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Mutugiii committed Nov 1, 2024
2 parents 892d762 + c4a3231 commit 5532279
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 15 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "planet",
"license": "AGPL-3.0",
"version": "0.15.22",
"version": "0.15.24",
"myplanet": {
"latest": "v0.20.75",
"min": "v0.19.75"
"latest": "v0.20.76",
"min": "v0.19.76"
},
"scripts": {
"ng": "ng",
Expand Down
12 changes: 9 additions & 3 deletions src/app/community/community.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@ <h3 style="text-align: right; margin-right: 0.5rem;">
<button mat-stroked-button (click)="openAddMessageDialog()" *ngIf="showNewsButton" i18n>New Voice</button>
</ng-container>
</h3>
<ng-container *ngIf="news?.length > 0; else noVoices">
<planet-news-list [items]="news" [shareTarget]="shareTarget" (viewChange)="toggleShowButton($event)" [viewableId]="teamId"></planet-news-list>
<ng-container *ngIf="isLoading; else loaded">
<span i18n>Loading voices...</span>
</ng-container>
<ng-template #loaded>
<ng-container *ngIf="news?.length > 0; else noVoices">
<planet-news-list [items]="news" [shareTarget]="shareTarget" (viewChange)="toggleShowButton($event)" [viewableId]="teamId"></planet-news-list>
</ng-container>
</ng-template>
<ng-template #noVoices>
<p i18n>No Voices available.</p>
</ng-template>
Expand Down Expand Up @@ -44,7 +49,8 @@ <h3 style="text-align: right; margin-right: 0.5rem;">
</button>
</div>
</ng-container>
<ng-container *ngIf="links?.length > 0; else noLinks">
<ng-container>
<span *ngIf="links?.length === 0" i18n><p>No links available.</p></span>
<mat-nav-list>
<mat-list-item *ngFor="let link of links" [routerLink]="(link.teamType === 'sync' || !planetCode) ? link.route : []" i18n-matTooltip [matTooltip]="(link.teamType === 'sync' || !planetCode) ? '' : link.title + ' is only available on ' + configuration.name" [disableRipple]="link.teamType === 'local' && planetCode">
<span matLine>{{link.title}}</span>
Expand Down
3 changes: 3 additions & 0 deletions src/app/community/community.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export class CommunityComponent implements OnInit, OnDestroy {
resizeCalendar: any = false;
deviceType: DeviceType;
deviceTypes = DeviceType;
isLoading: boolean;

constructor(
private dialog: MatDialog,
Expand All @@ -68,9 +69,11 @@ export class CommunityComponent implements OnInit, OnDestroy {

ngOnInit() {
const newsSortValue = (item: any) => item.sharedDate || item.doc.time;
this.isLoading = true;
this.getCommunityData();
this.newsService.newsUpdated$.pipe(takeUntil(this.onDestroy$)).subscribe(news => {
this.news = news.sort((a, b) => newsSortValue(b) - newsSortValue(a));
this.isLoading = false;
});
this.usersService.usersListener(true).pipe(takeUntil(this.onDestroy$)).subscribe(users => {
if (!this.planetCode) {
Expand Down
28 changes: 22 additions & 6 deletions src/app/users/users-profile/users-profile.component.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,36 @@
<mat-toolbar *ngIf="!isDialog">
<button mat-icon-button (click)="goBack()"><mat-icon>arrow_back</mat-icon></button>
<span i18n>Member Profile</span>
<span class="toolbar-fill"></span>
<mat-toolbar-row>
<button mat-icon-button (click)="goBack()">
<mat-icon>arrow_back</mat-icon>
</button>
<span i18n>Member Profile</span>
<span class="toolbar-fill"></span>
</mat-toolbar-row>
</mat-toolbar>

<div class="space-container">
<mat-toolbar class="primary-color font-size-1">
<span>{{userDetail.name}}</span>
<mat-icon class="margin-lr-5" *ngIf="userDetail.gender" svgIcon="{{userDetail.gender.toLowerCase()}}"></mat-icon>
<span class="toolbar-fill"></span>
<button mat-icon-button [matMenuTriggerFor]="menu" *ngIf="isMobile; else actionButtons">
<mat-icon>more_vert</mat-icon>
</button>
<mat-menu #menu="matMenu" class="actions-menu">
<ng-container *ngTemplateOutlet="actionButtons"></ng-container>
</mat-menu>
</mat-toolbar>
<ng-template #actionButtons>
<button mat-stroked-button class="margin-lr-3" *ngIf="hasAchievement && (user.name === urlName || user.isUserAdmin) && !isDialog" [routerLink]="['achievements', { planet: userDetail.planetCode }]">
<mat-icon class="margin-lr-3">visibility</mat-icon><span i18n>View Achievements</span>
</button>
<button mat-raised-button color="accent" class="margin-lr-3" *ngIf="editable && !isDialog" [routerLink]="['../../update/', urlName]"><mat-icon>mode_edit</mat-icon><span i18n>Edit Profile</span></button>
<a mat-raised-button color="accent" class="margin-lr-3" *ngIf="editable && !isDialog" i18n [planetChangePassword]="userDetail">Change Password</a>
</mat-toolbar>
<button mat-raised-button color="accent" class="margin-lr-3" *ngIf="editable && !isDialog" [routerLink]="['../../update/', urlName]">
<mat-icon>mode_edit</mat-icon><span i18n>Edit Profile</span>
</button>
<a mat-raised-button color="accent" class="margin-lr-3" *ngIf="editable && !isDialog" i18n [planetChangePassword]="userDetail">
Change Password
</a>
</ng-template>
<div class="view-container">
<div class="profile-container">
<div class="profile-image-section">
Expand Down
19 changes: 16 additions & 3 deletions src/app/users/users-profile/users-profile.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, OnInit, OnDestroy, Input } from '@angular/core';
import { Component, OnInit, OnDestroy, Input, HostListener } from '@angular/core';
import { ActivatedRoute, ParamMap, Router } from '@angular/router';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
Expand All @@ -9,6 +9,7 @@ import { UsersAchievementsService } from '../users-achievements/users-achievemen
import { findDocuments } from '../../shared/mangoQueries';
import { StateService } from '../../shared/state.service';
import { educationLevel } from '../user-constants';
import { DeviceInfoService, DeviceType } from '../../shared/device-info.service';

@Component({
selector: 'planet-users-profile',
Expand All @@ -27,6 +28,8 @@ export class UsersProfileComponent implements OnInit, OnDestroy {
totalLogins = 0;
lastLogin = 0;
educationLevel = educationLevel;
deviceType: DeviceType;
isMobile: boolean;
private onDestroy$ = new Subject<void>();
@Input() planetCode: string | null = null;
@Input() isDialog: boolean;
Expand All @@ -38,8 +41,12 @@ export class UsersProfileComponent implements OnInit, OnDestroy {
private userService: UserService,
private router: Router,
private usersAchievementsService: UsersAchievementsService,
private stateService: StateService
) { }
private stateService: StateService,
private deviceInfoService: DeviceInfoService
) {
this.deviceType = this.deviceInfoService.getDeviceType();
this.isMobile = this.deviceType === DeviceType.MOBILE;
}

ngOnInit() {
this.user = this.userService.get();
Expand All @@ -56,6 +63,12 @@ export class UsersProfileComponent implements OnInit, OnDestroy {
});
}

@HostListener('window:resize')
onResize() {
this.deviceType = this.deviceInfoService.getDeviceType();
this.isMobile = this.deviceType === DeviceType.MOBILE;
}

ngOnDestroy() {
this.onDestroy$.next();
this.onDestroy$.complete();
Expand Down

0 comments on commit 5532279

Please sign in to comment.