-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #927 from geonetwork/ME-adapt-display-sidebar
ME: Adapt styling of sidebar
- Loading branch information
Showing
14 changed files
with
148 additions
and
6 deletions.
There are no files selected for viewing
60 changes: 58 additions & 2 deletions
60
apps/metadata-editor/src/app/dashboard/sidebar/sidebar.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,61 @@ | ||
<div class="flex flex-col pt-9 px-5 gap-12 bg-neutral-100 h-full"> | ||
<div> | ||
<div class="flex h-full"> | ||
<div | ||
class="h-full bg-black w-[50px] rounded-r-lg flex flex-col justify-between" | ||
> | ||
<div class="flex flex-col justify-between h-24"> | ||
<div class="flex justify-center items-center h-12"> | ||
<img src="assets/editor-logo.svg" alt="Editor logo" /> | ||
</div> | ||
<div class=""> | ||
<div translate class="uppercase text-white rotate-[-0.25turn]"> | ||
editor.sidebar.menu.editor | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<ng-container *ngIf="platformService.getMe() | async as user"> | ||
<div | ||
*ngIf="user && user.name" | ||
class="basis-1/12 mb-2 flex flex-col justify-center items-center" | ||
> | ||
<gn-ui-button | ||
type="default" | ||
class="w-10 h-10 flex justify-center items-center hover:cursor-pointer" | ||
> | ||
<gn-ui-user-preview | ||
[user]="user" | ||
[avatarPlaceholder]="placeholder$ | async" | ||
extraClass="w-10 h-10" | ||
></gn-ui-user-preview> | ||
</gn-ui-button> | ||
<gn-ui-button | ||
type="default" | ||
class="w-10 h-10 flex justify-center items-center hover:cursor-pointer" | ||
> | ||
<img src="assets/system-shut.svg" alt="Log out" class="w-4 h-4" /> | ||
</gn-ui-button> | ||
</div> | ||
</ng-container> | ||
</div> | ||
|
||
<div class="flex flex-col pt-9 px-5 gap-10 bg-neutral-100 h-full grow"> | ||
<ng-container *ngIf="organisations$ | async as organisations"> | ||
<ng-container *ngIf="organisations[0]?.name"> | ||
<gn-ui-button | ||
*ngIf="organisations[0].logoUrl?.href" | ||
type="default" | ||
class="flex flex-col gap-3 items-center gap-2" | ||
[routerLink]="['/organizations', organisations[0].id]" | ||
> | ||
<img | ||
[src]="organisations[0].logoUrl?.href" | ||
alt="Organization logo" | ||
class="w-12 h-12" | ||
/> | ||
<span>{{ organisations[0].name }}</span> | ||
</gn-ui-button> | ||
</ng-container> | ||
</ng-container> | ||
<md-editor-dashboard-menu></md-editor-dashboard-menu> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 33 additions & 3 deletions
36
apps/metadata-editor/src/app/dashboard/sidebar/sidebar.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,44 @@ | ||
import { CommonModule } from '@angular/common' | ||
import { ChangeDetectionStrategy, Component } from '@angular/core' | ||
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core' | ||
import { TranslateModule } from '@ngx-translate/core' | ||
import { DashboardMenuComponent } from '../dashboard-menu/dashboard-menu.component' | ||
import { PlatformServiceInterface } from '@geonetwork-ui/common/domain/platform.service.interface' | ||
import { AvatarServiceInterface } from '@geonetwork-ui/api/repository' | ||
import { LetDirective } from '@ngrx/component' | ||
import { UiElementsModule } from '@geonetwork-ui/ui/elements' | ||
import { OrganizationsServiceInterface } from '@geonetwork-ui/common/domain/organizations.service.interface' | ||
import { Observable, combineLatest } from 'rxjs' | ||
import { Organization } from '@geonetwork-ui/common/domain/model/record' | ||
|
||
@Component({ | ||
selector: 'md-editor-sidebar', | ||
templateUrl: './sidebar.component.html', | ||
styleUrls: ['./sidebar.component.css'], | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
standalone: true, | ||
imports: [DashboardMenuComponent, CommonModule, TranslateModule], | ||
imports: [ | ||
DashboardMenuComponent, | ||
CommonModule, | ||
TranslateModule, | ||
LetDirective, | ||
UiElementsModule, | ||
], | ||
}) | ||
export class SidebarComponent {} | ||
export class SidebarComponent implements OnInit { | ||
public placeholder$ = this.avatarService.getPlaceholder() | ||
organisations$: Observable<Organization[]> | ||
|
||
constructor( | ||
public platformService: PlatformServiceInterface, | ||
private avatarService: AvatarServiceInterface, | ||
public organisationsService: OrganizationsServiceInterface | ||
) {} | ||
|
||
ngOnInit(): void { | ||
this.organisations$ = combineLatest( | ||
this.organisationsService.organisations$, | ||
this.platformService.getMe(), | ||
(orgs, me) => orgs.filter((org) => org.name === me?.organisation) | ||
) | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion
2
libs/ui/elements/src/lib/user-preview/user-preview.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters