cleanup settings grid

This commit is contained in:
Max Peintner
2025-07-17 14:06:21 +02:00
parent e053b83bab
commit 62cbfd65ce
13 changed files with 39 additions and 39 deletions

View File

@@ -78,6 +78,14 @@ const routes: Routes = [
roles: ['iam.read', 'iam.read'], roles: ['iam.read', 'iam.read'],
}, },
}, },
{
path: 'actions-v1',
loadChildren: () => import('./pages/org-actions/actions.module'),
canActivate: [authGuard, roleGuard],
data: {
roles: ['iam.read', 'iam.read'],
},
},
{ {
path: 'grants', path: 'grants',
loadChildren: () => import('./pages/grants/grants.module'), loadChildren: () => import('./pages/grants/grants.module'),

View File

@@ -122,7 +122,7 @@
<a <a
class="nav-item" class="nav-item"
[routerLinkActive]="['active']" [routerLinkActive]="['active']"
[routerLink]="['/actions']" [routerLink]="['/actions-v1']"
[routerLinkActiveOptions]="{ exact: true }" [routerLinkActiveOptions]="{ exact: true }"
> >
<span class="label">{{ 'MENU.ACTIONS' | translate }}</span> <span class="label">{{ 'MENU.ACTIONS' | translate }}</span>

View File

@@ -33,7 +33,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
overflow-x: auto; overflow-x: auto;
overflow-y: visible; // Allow the indicator line to show overflow-y: hidden; // Allow the indicator line to show
align-self: stretch; align-self: stretch;
position: absolute; position: absolute;
top: 0; top: 0;

View File

@@ -11,6 +11,7 @@
ariaLabel="{{ instance.name }}" ariaLabel="{{ instance.name }}"
> >
</cnsl-header-button> </cnsl-header-button>
<cnsl-header-dropdown <cnsl-header-dropdown
[trigger]="instanceTrigger" [trigger]="instanceTrigger"
[isOpen]="isInstanceDropdownOpen()" [isOpen]="isInstanceDropdownOpen()"
@@ -30,7 +31,7 @@
></cnsl-organization-selector> ></cnsl-organization-selector>
</cnsl-header-dropdown> </cnsl-header-dropdown>
</ng-container> </ng-container>
<ng-container *ngIf="['org.read'] | hasRole | async"> <ng-container *ngIf="!onInstanceLevel() && (['org.read'] | hasRole | async) === true">
<ng-container *ngTemplateOutlet="slash"></ng-container> <ng-container *ngTemplateOutlet="slash"></ng-container>
<a <a
*ngIf="activeOrganizationQuery.data() as org" *ngIf="activeOrganizationQuery.data() as org"
@@ -53,7 +54,7 @@
</cnsl-header-dropdown> </cnsl-header-dropdown>
</ng-container> </ng-container>
<ng-container *ngIf="!isHandset()"> <ng-container *ngIf="!isHandset()">
<ng-container *ngFor="let bread of breadcrumbs(); index as i; let last = last"> <ng-container *ngFor="let bread of nestedBreadcrumbs(); index as i; let last = last">
<ng-container *ngTemplateOutlet="slash"></ng-container> <ng-container *ngTemplateOutlet="slash"></ng-container>
<a class="new-header-breadcrumb" matRipple [matRippleUnbounded]="false" [routerLink]="bread.routerLink"> <a class="new-header-breadcrumb" matRipple [matRippleUnbounded]="false" [routerLink]="bread.routerLink">
{{ bread.name }} {{ bread.name }}

View File

@@ -57,7 +57,9 @@ export class NewHeaderComponent {
protected readonly instanceSelectorSecondStep = signal(false); protected readonly instanceSelectorSecondStep = signal(false);
protected readonly activeOrganizationQuery = this.newOrganizationService.activeOrganizationQuery(); protected readonly activeOrganizationQuery = this.newOrganizationService.activeOrganizationQuery();
protected readonly isHandset: Signal<boolean>; protected readonly isHandset: Signal<boolean>;
protected readonly breadcrumbs: Signal<Breadcrumb[]>; protected readonly breadcrumbs: Signal<Breadcrumb[]> = toSignal(this.breadcrumbService.breadcrumbs$, { initialValue: [] });
protected readonly nestedBreadcrumbs: Signal<Breadcrumb[]>;
protected readonly onInstanceLevel: Signal<boolean>;
constructor( constructor(
private readonly newOrganizationService: NewOrganizationService, private readonly newOrganizationService: NewOrganizationService,
@@ -68,7 +70,8 @@ export class NewHeaderComponent {
private readonly breadcrumbService: BreadcrumbService, private readonly breadcrumbService: BreadcrumbService,
) { ) {
this.isHandset = this.getIsHandset(); this.isHandset = this.getIsHandset();
this.breadcrumbs = this.getBreadcrumbs(); this.nestedBreadcrumbs = this.getBreadcrumbs();
this.onInstanceLevel = this.isOnInstanceLevel();
effect(() => { effect(() => {
if (this.listMyZitadelPermissionsQuery.isError()) { if (this.listMyZitadelPermissionsQuery.isError()) {
@@ -96,11 +99,17 @@ export class NewHeaderComponent {
} }
private getBreadcrumbs() { private getBreadcrumbs() {
const breadcrumbs = toSignal(this.breadcrumbService.breadcrumbs$, { initialValue: [] });
return computed(() => return computed(() =>
breadcrumbs().filter( this.breadcrumbs().filter(
(breadcrumb) => breadcrumb.type === BreadcrumbType.PROJECT || breadcrumb.type === BreadcrumbType.APP, (breadcrumb) => breadcrumb.type === BreadcrumbType.PROJECT || breadcrumb.type === BreadcrumbType.APP,
), ),
); );
} }
private isOnInstanceLevel() {
return computed(() => {
console.log(this.breadcrumbs());
return this.breadcrumbs().length === 1 && this.breadcrumbs()[0].type === BreadcrumbType.INSTANCE;
});
}
} }

View File

@@ -1,11 +1,8 @@
<div class="org-title-row"> <div class="org-title-row">
<h2>{{ 'DESCRIPTIONS.ORG.TITLE' | translate }}</h2> <h2>{{ 'DESCRIPTIONS.SETTINGS.INSTANCE.TITLE' | translate }}</h2>
<a mat-icon-button href="https://zitadel.com/docs/concepts/structure/organizations" rel="noreferrer" target="_blank">
<mat-icon class="icon">info_outline</mat-icon>
</a>
</div> </div>
<p class="top-desc cnsl-secondary-text"> <p class="top-desc cnsl-secondary-text">
{{ 'DESCRIPTIONS.ORG.DESCRIPTION' | translate }} {{ 'DESCRIPTIONS.SETTINGS.INSTANCE.DESCRIPTION' | translate }}
</p> </p>
<div class="row-lyt" [ngClass]="{ more: type === PolicyComponentServiceType.ADMIN }"> <div class="row-lyt" [ngClass]="{ more: type === PolicyComponentServiceType.ADMIN }">
<ng-container *ngFor="let setting of SETTINGS"> <ng-container *ngFor="let setting of SETTINGS">

View File

@@ -1,7 +1,6 @@
.org-title-row { .org-title-row {
display: flex; display: flex;
align-items: center; align-items: center;
margin-top: 1rem;
h2 { h2 {
font-size: 1.2rem; font-size: 1.2rem;

View File

@@ -11,10 +11,12 @@
<cnsl-shortcuts /> <cnsl-shortcuts />
</ng-template> </ng-template>
<p class="disclaimer cnsl-secondary-text">{{ 'HOME.DISCLAIMER' | translate }}</p> <ng-container *ngIf="['policy.read'] | hasRole | async">
<cnsl-settings-grid [type]="PolicyComponentServiceType.ADMIN"></cnsl-settings-grid>
</ng-container>
<span class="fill-space"></span> <span class="fill-space"></span>
<h2 class="desc">{{ 'ONBOARDING.MOREDESCRIPTION' | translate }}</h2> <h2 class="home-desc">{{ 'ONBOARDING.MOREDESCRIPTION' | translate }}</h2>
<div class="home-grid-container"> <div class="home-grid-container">
<a href="https://zitadel.com/docs/guides/start/quickstart" target="_blank" rel="noreferrer" class="grid-item"> <a href="https://zitadel.com/docs/guides/start/quickstart" target="_blank" rel="noreferrer" class="grid-item">

View File

@@ -38,9 +38,9 @@
} }
} }
.desc { .home-desc {
font-size: 1.2rem; font-size: 1.2rem;
margin-top: 0; margin-top: 2rem;
text-transform: uppercase; text-transform: uppercase;
} }
@@ -143,13 +143,6 @@
} }
} }
.disclaimer {
font-size: 14px;
margin-top: 0;
margin-bottom: 5rem;
font-style: italic;
}
.fill-space { .fill-space {
flex: 1; flex: 1;
} }

View File

@@ -1,4 +1,5 @@
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { PolicyComponentServiceType } from 'src/app/modules/policies/policy-component-types.enum';
import { Breadcrumb, BreadcrumbService, BreadcrumbType } from 'src/app/services/breadcrumb.service'; import { Breadcrumb, BreadcrumbService, BreadcrumbType } from 'src/app/services/breadcrumb.service';
import { GrpcAuthService } from 'src/app/services/grpc-auth.service'; import { GrpcAuthService } from 'src/app/services/grpc-auth.service';
import { ThemeService } from 'src/app/services/theme.service'; import { ThemeService } from 'src/app/services/theme.service';
@@ -21,6 +22,8 @@ export class HomeComponent {
public dark: boolean = true; public dark: boolean = true;
protected readonly PolicyComponentServiceType = PolicyComponentServiceType;
constructor( constructor(
public authService: GrpcAuthService, public authService: GrpcAuthService,
breadcrumbService: BreadcrumbService, breadcrumbService: BreadcrumbService,

View File

@@ -14,6 +14,7 @@ import { HasRolePipeModule } from 'src/app/pipes/has-role-pipe/has-role-pipe.mod
import { HomeRoutingModule } from './home-routing.module'; import { HomeRoutingModule } from './home-routing.module';
import { HomeComponent } from './home.component'; import { HomeComponent } from './home.component';
import { QuickstartComponent } from 'src/app/components/quickstart/quickstart.component'; import { QuickstartComponent } from 'src/app/components/quickstart/quickstart.component';
import { SettingsGridModule } from 'src/app/modules/settings-grid/settings-grid.module';
@NgModule({ @NgModule({
declarations: [HomeComponent], declarations: [HomeComponent],
@@ -31,6 +32,7 @@ import { QuickstartComponent } from 'src/app/components/quickstart/quickstart.co
ShortcutsModule, ShortcutsModule,
OnboardingModule, OnboardingModule,
MatRippleModule, MatRippleModule,
SettingsGridModule,
], ],
}) })
export default class HomeModule {} export default class HomeModule {}

View File

@@ -44,10 +44,6 @@
</cnsl-top-view> </cnsl-top-view>
<div class="max-width-container"> <div class="max-width-container">
<cnsl-meta-layout> <cnsl-meta-layout>
<ng-container *ngIf="['policy.read'] | hasRole | async; else nopolicyreadpermission">
<cnsl-settings-grid [type]="PolicyComponentServiceType.MGMT"></cnsl-settings-grid>
</ng-container>
<cnsl-metadata <cnsl-metadata
[description]="'DESCRIPTIONS.ORG.METADATA' | translate" [description]="'DESCRIPTIONS.ORG.METADATA' | translate"
[metadata]="metadata" [metadata]="metadata"
@@ -56,14 +52,6 @@
(refresh)="loadMetadata()" (refresh)="loadMetadata()"
></cnsl-metadata> ></cnsl-metadata>
<ng-template #nopolicyreadpermission>
<div class="no-permission-warn-wrapper">
<cnsl-info-section class="info-section-warn" [fitWidth]="true" [type]="InfoSectionType.ALERT">{{
'ORG.PAGES.NOPERMISSION' | translate
}}</cnsl-info-section>
</div>
</ng-template>
<div metainfo> <div metainfo>
<cnsl-changes *ngIf="org && reloadChanges()" [changeType]="ChangeType.ORG" [id]="org.id"></cnsl-changes> <cnsl-changes *ngIf="org && reloadChanges()" [changeType]="ChangeType.ORG" [id]="org.id"></cnsl-changes>
</div> </div>

View File

@@ -19,7 +19,6 @@ import { InputModule } from 'src/app/modules/input/input.module';
import { MetaLayoutModule } from 'src/app/modules/meta-layout/meta-layout.module'; import { MetaLayoutModule } from 'src/app/modules/meta-layout/meta-layout.module';
import { MetadataModule } from 'src/app/modules/metadata/metadata.module'; import { MetadataModule } from 'src/app/modules/metadata/metadata.module';
import { NameDialogModule } from 'src/app/modules/name-dialog/name-dialog.module'; import { NameDialogModule } from 'src/app/modules/name-dialog/name-dialog.module';
import { SettingsGridModule } from 'src/app/modules/settings-grid/settings-grid.module';
import { TopViewModule } from 'src/app/modules/top-view/top-view.module'; import { TopViewModule } from 'src/app/modules/top-view/top-view.module';
import { WarnDialogModule } from 'src/app/modules/warn-dialog/warn-dialog.module'; import { WarnDialogModule } from 'src/app/modules/warn-dialog/warn-dialog.module';
import { HasRolePipeModule } from 'src/app/pipes/has-role-pipe/has-role-pipe.module'; import { HasRolePipeModule } from 'src/app/pipes/has-role-pipe/has-role-pipe.module';
@@ -55,7 +54,6 @@ import { OrgRoutingModule } from './org-routing.module';
MatProgressSpinnerModule, MatProgressSpinnerModule,
MetadataModule, MetadataModule,
TranslateModule, TranslateModule,
SettingsGridModule,
ContributorsModule, ContributorsModule,
CopyToClipboardModule, CopyToClipboardModule,
], ],