display if tenent is owned / master / related

This commit is contained in:
Christian Werner 2025-10-29 17:34:12 +01:00
parent 88c6857e24
commit 69920bbb10
5 changed files with 40 additions and 3 deletions

View File

@ -2,6 +2,7 @@ export interface TenantGridViewDto {
id: string;
isMaster: boolean;
name: string;
isOwner: boolean;
ownerId: string;
visibility: string;
}

View File

@ -3,7 +3,7 @@
} @else {
@for (tenant of tenants(); track tenant.id) {
<app-panel class="neutral-80">
<span class="title">{{tenant.name}}</span>
<span class="title" [ngClass]="{'owner': tenant.isOwner, 'master': tenant.isMaster, 'related': !tenant.isOwner && !tenant.isMaster}">{{tenant.name}}</span>
<span class="actions">
<button [routerLink]="tenant.id" class="primary outline">View Details</button>
</span>

View File

@ -8,6 +8,39 @@
align-items: center;
}
.title {
display: flex;
align-items: center;
&.owner, &.master, &.related {
&::before {
background-color: var(--primary-30);
color: var(--neutral-90);
font-size: 0.7rem;
line-height: 0.7rem;
padding: 0.15rem 0.3rem;
font-weight: bold;
border-radius: 0.5rem;
margin-right: 1ch;
}
}
&.owner:not(.master)::before {
content: 'Owner';
}
&.master:not(.owner)::before {
content: 'Master';
}
&.master.owner:before {
content: 'Master Owner';
}
&:not(.owner, .master)::before {
content: 'Related';
background-color: var(--secondary-30);
}
}
.actions {
margin-left: auto;
}

View File

@ -4,13 +4,14 @@ import {TenantGridViewDto} from '../../../clients/gandalf/mithrandir/tenant/dtos
import {PanelComponent} from '../../panel/panel.component';
import {LinkComponent} from '../../link/link.component';
import {RouterLink} from '@angular/router';
import {NgClass} from '@angular/common';
@Component({
selector: 'app-tenant-grid',
imports: [
PanelComponent,
LinkComponent,
RouterLink
RouterLink,
NgClass
],
templateUrl: './tenant-grid.component.html',
styleUrl: './tenant-grid.component.scss'

View File

@ -7,6 +7,8 @@ public class TenantGridViewDto
public required string Id { get; set; }
public required string Name { get; set; }
public required bool IsMaster { get; set; }
public required bool IsOwner { get; set; }
public required string OwnerId { get; set; }
public required EntityVisibility Visibility { get; set; }
}