mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-20 20:08:46 +00:00
fix(console): migrate from tslint to eslint, project delete from table (#2490)
* es lint * modify tsconfig, auto lint some stuff * lint * lint * lint * lint * html ts lint * lint * lint, tsconfig * fix project delete, state table * eslint config, remove cnslHint directive * mfa selector, info row fixes * lint * fix login policy, granted orgs table state, lint Co-authored-by: Florian Forster <[email protected]>
This commit is contained in:
co-authored by
Florian Forster
parent
bdf63800f7
commit
b1caef81da
+15
-15
@@ -1,4 +1,4 @@
|
||||
<app-meta-layout>
|
||||
<cnsl-meta-layout>
|
||||
<div class="max-width-container">
|
||||
<div class="head" *ngIf="project?.projectId">
|
||||
<a [routerLink]="[ '/granted-projects' ]" mat-icon-button>
|
||||
@@ -12,17 +12,17 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ng-template appHasRole [appHasRole]="['user.grant.read', 'user.grant.read:'+grantId]">
|
||||
<app-card *ngIf="project?.projectId" title="{{ 'GRANTS.PROJECT.TITLE' | translate }}"
|
||||
<ng-template cnslHasRole [hasRole]="['user.grant.read', 'user.grant.read:'+grantId]">
|
||||
<cnsl-card *ngIf="project?.projectId" title="{{ 'GRANTS.PROJECT.TITLE' | translate }}"
|
||||
description="{{'GRANTS.PROJECT.DESCRIPTION' | translate }}">
|
||||
<app-user-grants *ngIf="projectId && grantId" [context]="UserGrantContext.GRANTED_PROJECT"
|
||||
<cnsl-user-grants *ngIf="projectId && grantId" [context]="UserGrantContext.GRANTED_PROJECT"
|
||||
[projectId]="projectId" [grantId]="grantId"
|
||||
[displayedColumns]="['select','user', 'projectId', 'dates', 'roleNamesList']"
|
||||
[disableWrite]="(['user.grant.write$','user.grant.write:'+grantId] | hasRole | async) == false"
|
||||
[disableDelete]="(['user.grant.delete$','user.grant.delete:'+grantId] | hasRole | async) == false"
|
||||
refreshOnPreviousRoutes="['/grant-create/project/{{projectId}}/grant/{{grantId}}']">
|
||||
</app-user-grants>
|
||||
</app-card>
|
||||
[disableWrite]="(['user.grant.write$','user.grant.write:'+grantId] | hasRole | async) === false"
|
||||
[disableDelete]="(['user.grant.delete$','user.grant.delete:'+grantId] | hasRole | async) === false"
|
||||
[refreshOnPreviousRoutes]="['/grant-create/project/{{projectId}}/grant/{{grantId}}']">
|
||||
</cnsl-user-grants>
|
||||
</cnsl-card>
|
||||
</ng-template>
|
||||
</div>
|
||||
<div class="side" metainfo>
|
||||
@@ -38,18 +38,18 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<mat-tab-group mat-stretch-tabs class="tab-group" disablePagination="true">
|
||||
<mat-tab-group mat-stretch-tabs class="tab-group" [disablePagination]="true">
|
||||
<mat-tab label="Details">
|
||||
<app-contributors *ngIf="project" [loading]="loading$ | async" [totalResult]="totalMemberResult"
|
||||
<cnsl-contributors *ngIf="project" [loading]="loading$ | async" [totalResult]="totalMemberResult"
|
||||
[membersSubject]="membersSubject" title="{{ 'PROJECT.MEMBER.TITLE' | translate }}"
|
||||
description="{{ 'PROJECT.MEMBER.TITLEDESC' | translate }}" (addClicked)="openAddMember()"
|
||||
(showDetailClicked)="showDetail()" (refreshClicked)="loadMembers()"
|
||||
[disabled]="(['project.member.write$', 'project.member.write:'+ project.projectId]| hasRole | async) == false">
|
||||
</app-contributors>
|
||||
[disabled]="(['project.member.write$', 'project.member.write:'+ project.projectId]| hasRole | async) === false">
|
||||
</cnsl-contributors>
|
||||
</mat-tab>
|
||||
<mat-tab label="{{ 'CHANGES.PROJECT.TITLE' | translate }}" class="meta-flex-col">
|
||||
<app-changes *ngIf="project" [changeType]="ChangeType.PROJECT" [id]="project.projectId"></app-changes>
|
||||
<cnsl-changes *ngIf="project" [changeType]="ChangeType.PROJECT" [id]="project.projectId"></cnsl-changes>
|
||||
</mat-tab>
|
||||
</mat-tab-group>
|
||||
</div>
|
||||
</app-meta-layout>
|
||||
</cnsl-meta-layout>
|
||||
+1
-1
@@ -15,7 +15,7 @@ import { ManagementService } from 'src/app/services/mgmt.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-granted-project-detail',
|
||||
selector: 'cnsl-granted-project-detail',
|
||||
templateUrl: './granted-project-detail.component.html',
|
||||
styleUrls: ['./granted-project-detail.component.scss'],
|
||||
})
|
||||
|
||||
+4
-4
@@ -11,7 +11,7 @@
|
||||
<div class="item card" *ngFor="let item of selection.selected; index as i"
|
||||
(click)="navigateToProject(item.projectId,item.grantId, $event)">
|
||||
<div class="text-part">
|
||||
<span *ngIf="item.details.changeDate" class="top">{{'PROJECT.PAGES.LASTMODIFIED' | translate}}
|
||||
<span *ngIf="item.details && item.details.changeDate" class="top">{{'PROJECT.PAGES.LASTMODIFIED' | translate}}
|
||||
{{
|
||||
item.details.changeDate | timestampToDate | localizedDate: 'EEE dd. MMM, HH:mm'
|
||||
}}</span>
|
||||
@@ -22,7 +22,7 @@
|
||||
</div>
|
||||
|
||||
<span class="description" *ngIf="item.projectOwnerName">{{item.projectOwnerName}}</span>
|
||||
<span *ngIf="item.details.creationDate" class="created">{{'PROJECT.PAGES.CREATEDON' | translate}}
|
||||
<span *ngIf="item.details && item.details.creationDate" class="created">{{'PROJECT.PAGES.CREATEDON' | translate}}
|
||||
{{ item.details.creationDate | timestampToDate | localizedDate: 'EEE dd. MMM, HH:mm'
|
||||
}}</span>
|
||||
<span class="fill-space"></span>
|
||||
@@ -38,7 +38,7 @@
|
||||
<div class="item card" *ngFor="let item of notPinned; index as i"
|
||||
(click)="navigateToProject(item.projectId,item.grantId, $event)">
|
||||
<div class="text-part">
|
||||
<span *ngIf="item.details.changeDate" class="top">{{'PROJECT.PAGES.LASTMODIFIED' | translate}}
|
||||
<span *ngIf="item.details && item.details.changeDate" class="top">{{'PROJECT.PAGES.LASTMODIFIED' | translate}}
|
||||
{{
|
||||
item.details.changeDate | timestampToDate | localizedDate: 'EEE dd. MMM, HH:mm'
|
||||
}}</span>
|
||||
@@ -47,7 +47,7 @@
|
||||
<div class="state-dot" [ngClass]="{'active': item.state === ProjectGrantState.PROJECT_GRANT_STATE_ACTIVE, 'inactive': item.state === ProjectGrantState.PROJECT_GRANT_STATE_INACTIVE}"></div>
|
||||
</div>
|
||||
<span class="description" *ngIf="item.projectOwnerName">{{item.projectOwnerName}}</span>
|
||||
<span *ngIf="item.details.creationDate" class="created">{{'PROJECT.PAGES.CREATEDON' | translate}}
|
||||
<span *ngIf="item.details && item.details.creationDate" class="created">{{'PROJECT.PAGES.CREATEDON' | translate}}
|
||||
{{ item.details.creationDate | timestampToDate | localizedDate: 'EEE dd. MMM, HH:mm' }}</span>
|
||||
<span class="fill-space"></span>
|
||||
</div>
|
||||
|
||||
+5
-3
@@ -7,7 +7,7 @@ import { GrantedProject, ProjectGrantState } from 'src/app/proto/generated/zitad
|
||||
import { StorageKey, StorageLocation, StorageService } from 'src/app/services/storage.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-granted-project-grid',
|
||||
selector: 'cnsl-granted-project-grid',
|
||||
templateUrl: './granted-project-grid.component.html',
|
||||
styleUrls: ['./granted-project-grid.component.scss'],
|
||||
animations: [
|
||||
@@ -35,7 +35,7 @@ export class GrantedProjectGridComponent implements OnChanges {
|
||||
public notPinned: Array<GrantedProject.AsObject> = [];
|
||||
@Output() newClicked: EventEmitter<boolean> = new EventEmitter();
|
||||
@Output() changedView: EventEmitter<boolean> = new EventEmitter();
|
||||
@Input() loading: boolean = false;
|
||||
@Input() loading: boolean | null = false;
|
||||
public selection: SelectionModel<GrantedProject.AsObject> = new SelectionModel<GrantedProject.AsObject>(true, []);
|
||||
|
||||
public showNewProject: boolean = false;
|
||||
@@ -70,9 +70,11 @@ export class GrantedProjectGridComponent implements OnChanges {
|
||||
this.getPrefixedItem('pinned-granted-projects').then(storageEntry => {
|
||||
if (storageEntry) {
|
||||
const array: string[] = JSON.parse(storageEntry);
|
||||
const toSelect: GrantedProject.AsObject[] = this.items.filter((item, index) => {
|
||||
const toSelect: GrantedProject.AsObject[] = this.items.filter((item) => {
|
||||
if (array.includes(item.projectId)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
this.selection.select(...toSelect);
|
||||
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<app-granted-project-grid *ngIf="grid" [loading]="loading$ | async" (changedView)="grid = false"
|
||||
<cnsl-granted-project-grid *ngIf="grid" [loading]="loading$ | async" (changedView)="grid = false"
|
||||
[items]="grantedProjectList">
|
||||
</app-granted-project-grid>
|
||||
</cnsl-granted-project-grid>
|
||||
|
||||
<div *ngIf="!grid" class="view-toggle">
|
||||
<button class="icon-button" (click)="grid = true" mat-icon-button
|
||||
@@ -10,7 +10,7 @@
|
||||
</div>
|
||||
|
||||
<div *ngIf="!grid && grantedProjectList">
|
||||
<app-refresh-table (refreshed)="refreshPage()" [dataSize]="totalResult" [timestamp]="viewTimestamp"
|
||||
<cnsl-refresh-table (refreshed)="refreshPage()" [dataSize]="totalResult" [timestamp]="viewTimestamp"
|
||||
[selection]="selection" [loading]="loading$ | async">
|
||||
|
||||
<div class="table-wrapper">
|
||||
@@ -70,12 +70,12 @@
|
||||
[routerLink]="['/granted-projects', row.projectId, 'grant', row.grantId]"></tr>
|
||||
|
||||
</table>
|
||||
<div *ngIf="(loading$ | async) == false && !dataSource?.data?.length" class="no-content-row">
|
||||
<div *ngIf="(loading$ | async) === false && !dataSource?.data?.length" class="no-content-row">
|
||||
<i class="las la-exclamation"></i>
|
||||
<span>{{'PROJECT.TABLE.EMPTY' | translate}}</span>
|
||||
</div>
|
||||
<cnsl-paginator class="paginator" #paginator [timestamp]="viewTimestamp" [length]="totalResult" [pageSize]="10"
|
||||
[pageSizeOptions]="[5, 10, 20]" (page)="changePage($event)"></cnsl-paginator>
|
||||
</div>
|
||||
</app-refresh-table>
|
||||
</cnsl-refresh-table>
|
||||
</div>
|
||||
+1
-1
@@ -12,7 +12,7 @@ import { ManagementService } from 'src/app/services/mgmt.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-granted-project-list',
|
||||
selector: 'cnsl-granted-project-list',
|
||||
templateUrl: './granted-project-list.component.html',
|
||||
styleUrls: ['./granted-project-list.component.scss'],
|
||||
animations: [
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
<p class="sub">{{ 'PROJECT.PAGES.LISTDESCRIPTION' | translate }}</p>
|
||||
|
||||
<h2>{{'PROJECT.PAGES.TYPE.GRANTED' | translate}}</h2>
|
||||
<app-granted-project-list>
|
||||
</app-granted-project-list>
|
||||
<cnsl-granted-project-list>
|
||||
</cnsl-granted-project-list>
|
||||
</div>
|
||||
@@ -1,10 +1,10 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-granted-projects',
|
||||
templateUrl: './granted-projects.component.html',
|
||||
styleUrls: ['./granted-projects.component.scss'],
|
||||
selector: 'cnsl-granted-projects',
|
||||
templateUrl: './granted-projects.component.html',
|
||||
styleUrls: ['./granted-projects.component.scss'],
|
||||
})
|
||||
export class GrantedProjectsComponent {
|
||||
constructor() { }
|
||||
constructor() { }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user