Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/vaimee/my3sec
Browse files Browse the repository at this point in the history
  • Loading branch information
relu91 committed Jul 26, 2023
2 parents 47ae1a5 + 2c05c91 commit 99105a9
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.line-icon {
vertical-align: middle;
}

.clickable {
cursor: pointer !important;
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<mat-list>
<mat-list-item *ngFor="let organization of organizations | async" (click)="goTo(organization.address)">
<mat-list-item
class="clickable"
*ngFor="let organization of organizations | async"
(click)="goTo(organization.address)">
<img class="round-image" matListItemAvatar src="{{ organization.icon }}" alt="{{ organization.name }} icon" />
<span matListItemTitle>{{ organization.name }}</span>
<span matListItemLine>{{ organization.headline }}</span>
<p matListItemLine>
<mat-icon class="line-icon" fontIcon="auto_awesome_mosaic"></mat-icon>
<mat-icon class="line-icon" fontIcon="auto_awesome_mosaic"></mat-icon>
{{ organization.projectCount }} &#8226; <mat-icon class="line-icon" fontIcon="group"></mat-icon>
{{ getOrganizationMembers(organization) }}
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ActivatedRoute, Router } from '@angular/router';

import { Organization, Profile, Project } from '@shared/interfaces';
import { LoadingService } from '@shared/services/loading.service';
import { NavbarService } from '@shared/services/navbar.services';
import { NavbarService } from '@shared/services/navbar.service';
import { OrganizationService } from '@shared/services/organization.service';
import { ProfileService } from '@shared/services/profile.service';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
img {
object-fit: cover;
}
object-fit: cover;
}

.clickable {
cursor: pointer !important;
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<mat-list>
<mat-list-item *ngFor="let profile of profiles$ | async" (click)="goTo(profile.id)">
<img matListItemAvatar src="{{ profile.profileImage }}" alt="{{ profile.firstName }} icon" />
<span matListItemTitle>{{ profile.firstName }} {{ profile.surname }}</span>
<button
mat-icon-button
#tooltip="matTooltip"
matTooltip="Go to profile"
matTooltipPosition="below"
matTooltipHideDelay="500"
matListItemMeta
color="primary">
<mat-icon>login</mat-icon>
</button>
</mat-list-item>
</mat-list>
<mat-list>
<mat-list-item class="clickable" *ngFor="let profile of profiles$ | async" (click)="goTo(profile.id)">
<img matListItemAvatar src="{{ profile.profileImage }}" alt="{{ profile.firstName }} icon" />
<span matListItemTitle>{{ profile.firstName }} {{ profile.surname }}</span>
<button
mat-icon-button
#tooltip="matTooltip"
matTooltip="Go to profile"
matTooltipPosition="below"
matTooltipHideDelay="500"
matListItemMeta
color="primary">
<mat-icon>login</mat-icon>
</button>
</mat-list-item>
</mat-list>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Status } from '@shared/enums';
import { Profile } from '@shared/interfaces';
import { Project } from '@shared/interfaces/project.interface';
import { LoadingService } from '@shared/services/loading.service';
import { NavbarService } from '@shared/services/navbar.services';
import { NavbarService } from '@shared/services/navbar.service';
import { OrganizationService } from '@shared/services/organization.service';

import { ShowMembersInput, ShowMembersOutput } from '@projects/interfaces';
Expand Down
25 changes: 19 additions & 6 deletions frontend/src/app/shared/components/navbar/navbar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">

<form class="d-flex ms-auto me-auto" [formGroup]="searchForm" (ngSubmit)="onSubmit()">
<!--
Temporary disabled search bar. We have to find a way to search for organizations and profiles.
Expand All @@ -31,27 +30,41 @@
</button>
-->
</form>

<ul class="navbar-nav mb-2 mb-lg-0">
<li class="nav-item d-flex align-items-center">
<button mat-icon-button (click)="redirectToExplore()">
<button
mat-icon-button
matTooltip="Explore"
matTooltipPosition="below"
matTooltipHideDelay="500"
(click)="redirectToExplore()">
<mat-icon class="text-white">explore</mat-icon>
</button>
</li>
<li class="nav-item d-flex align-items-center">
<li
class="nav-item d-flex align-items-center"
matTooltip="free/total energy"
matTooltipPosition="below"
matTooltipHideDelay="500">
<a class="nav-link" aria-current="page">{{ freeEnergy | async }} / {{ totalEnergy | async }}</a>
<mat-icon class="text-white">flash_on</mat-icon>
</li>
<li class="nav-item d-flex align-items-center add-button">
<button mat-icon-button [matMenuTriggerFor]="menu">
<button
mat-icon-button
[matMenuTriggerFor]="menu"
matTooltip="Options"
matTooltipPosition="below"
matTooltipHideDelay="500">
<mat-icon>add</mat-icon>
</button>
<mat-menu #menu="matMenu">
<button mat-menu-item (click)="redirectToCreateOrganization()">
<mat-icon>groups</mat-icon>
<span>New Organization</span>
</button>
<!-- Temporary disabled Log Hours Component. We have to implement the feature to list tasks of an user.
<!-- Temporary disabled Log Hours Component. We have to implement the feature to list tasks of an user.
<button mat-menu-item (click)="redirectToLogHours()">
<mat-icon>hourglass_top</mat-icon>
<span>Log Hours</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { MetamaskService } from '@auth/services/metamask.service';

import { Profile } from '@shared/interfaces';
import { EnergyWalletContractService } from '@shared/services/energy-wallet-contract.service';
import { NavbarService } from '@shared/services/navbar.services';
import { NavbarService } from '@shared/services/navbar.service';
import { ProfileService } from '@shared/services/profile.service';

import { MenuItem } from '../../interfaces/menu-item.interface';
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/shared/services/organization.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ export class OrganizationService {
public getPendingMembers(address: string): Observable<Profile[]> {
return this.contractService.getPendingMembers(address).pipe(
concatMap(data => data),
switchMap(id => this.profileService.getProfile(id)),
mergeMap(id => this.profileService.getProfile(id)),
toArray()
);
}
Expand Down

0 comments on commit 99105a9

Please sign in to comment.