zitadel/console/src/app/pages/projects/project-list/project-list.component.html

175 lines
6.3 KiB
HTML
Raw Normal View History

<div class="projects-table-wrapper" *ngIf="projectType$ | async as type">
<cnsl-refresh-table
[hideRefresh]="true"
(refreshed)="refreshPage(type)"
[dataSize]="totalResult"
[timestamp]="viewTimestamp"
[selection]="selection"
[loading]="loading$ | async"
>
<cnsl-filter-project
actions
*ngIf="!selection.hasValue()"
(filterChanged)="applySearchQuery(type, $any($event))"
(filterOpen)="filterOpen = $event"
></cnsl-filter-project>
<ng-template actions cnslHasRole [hasRole]="['project.create']">
<a
*ngIf="type === ProjectType.PROJECTTYPE_OWNED"
[routerLink]="['/projects', 'create']"
color="primary"
mat-raised-button
class="cnsl-action-button"
>
<mat-icon class="icon">add</mat-icon>
<span>{{ 'ACTIONS.NEW' | translate }}</span>
<cnsl-action-keys (actionTriggered)="gotoRouterLink(['/projects', 'create'])"> </cnsl-action-keys>
</a>
</ng-template>
<div class="table-wrapper">
<table class="table" mat-table [dataSource]="dataSource">
<ng-container matColumnDef="select">
<th class="selection" mat-header-cell *matHeaderCellDef>
<mat-checkbox
color="primary"
(change)="$event ? masterToggle() : null"
[checked]="selection.hasValue() && isAllSelected()"
[indeterminate]="selection.hasValue() && !isAllSelected()"
>
</mat-checkbox>
</th>
<td class="selection" mat-cell *matCellDef="let row">
<mat-checkbox
color="primary"
(click)="$event.stopPropagation()"
(change)="$event ? selection.toggle(row) : null"
[checked]="selection.isSelected(row)"
>
</mat-checkbox>
</td>
</ng-container>
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef>{{ 'PROJECT.NAME' | translate }}</th>
<td
class="pointer"
[routerLink]="
type === ProjectType.PROJECTTYPE_OWNED
? ['/projects', project.id]
: ['/granted-projects', project.projectId, 'grant', project.grantId]
"
mat-cell
*matCellDef="let project"
>
<span *ngIf="project.name">{{ project.name }}</span>
<span *ngIf="project.projectName">{{ project.projectName }}</span>
</td>
</ng-container>
<ng-container matColumnDef="projectOwnerName">
<th mat-header-cell *matHeaderCellDef>{{ 'PROJECT.TABLE.RESOURCEOWNER' | translate }}</th>
<td class="pointer" mat-cell *matCellDef="let project">
{{ project.projectOwnerName }}
</td>
</ng-container>
<ng-container matColumnDef="state">
<th mat-header-cell *matHeaderCellDef>{{ 'PROJECT.TABLE.STATE' | translate }}</th>
<td
class="pointer"
[routerLink]="
type === ProjectType.PROJECTTYPE_OWNED
? ['/projects', project.id]
: ['/granted-projects', project.projectId, 'grant', project.grantId]
"
mat-cell
*matCellDef="let project"
>
<span
class="state"
[ngClass]="{
active: project.state === ProjectState.PROJECT_STATE_ACTIVE,
inactive: project.state === ProjectState.PROJECT_STATE_INACTIVE
}"
*ngIf="project.state"
>{{ 'PROJECT.STATE.' + project.state | translate }}</span
>
</td>
</ng-container>
<ng-container matColumnDef="creationDate">
<th mat-header-cell *matHeaderCellDef>{{ 'PROJECT.TABLE.CREATIONDATE' | translate }}</th>
<td
class="pointer"
[routerLink]="
type === ProjectType.PROJECTTYPE_OWNED
? ['/projects', project.id]
: ['/granted-projects', project.projectId, 'grant', project.grantId]
"
mat-cell
*matCellDef="let project"
>
<span *ngIf="project.details.creationDate">{{
fix(console): angular 15 (#4809) * cli core * update material * imports * schematics * lint * rm ng-qrcode, ngx-quicklink * replace qr code lib * rm shared module as quicklink is removed * lazy loading imports * rm public * chore(deps): bump @grpc/grpc-js from 1.7.1 to 1.8.0 in /console (#4857) Bumps [@grpc/grpc-js](https://github.com/grpc/grpc-node) from 1.7.1 to 1.8.0. - [Release notes](https://github.com/grpc/grpc-node/releases) - [Commits](https://github.com/grpc/grpc-node/compare/v1.7.1...@grpc/grpc-js@1.8.0) --- updated-dependencies: - dependency-name: "@grpc/grpc-js" dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump libphonenumber-js from 1.10.13 to 1.10.15 in /console (#4861) Bumps [libphonenumber-js](https://gitlab.com/catamphetamine/libphonenumber-js) from 1.10.13 to 1.10.15. - [Release notes](https://gitlab.com/catamphetamine/libphonenumber-js/tags) - [Changelog](https://gitlab.com/catamphetamine/libphonenumber-js/blob/master/CHANGELOG.md) - [Commits](https://gitlab.com/catamphetamine/libphonenumber-js/compare/v1.10.13...v1.10.15) --- updated-dependencies: - dependency-name: libphonenumber-js dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * rxjs * chore(deps): bump engine.io from 6.2.0 to 6.2.1 in /console (#4734) Bumps [engine.io](https://github.com/socketio/engine.io) from 6.2.0 to 6.2.1. - [Release notes](https://github.com/socketio/engine.io/releases) - [Changelog](https://github.com/socketio/engine.io/blob/main/CHANGELOG.md) - [Commits](https://github.com/socketio/engine.io/compare/6.2.0...6.2.1) --- updated-dependencies: - dependency-name: engine.io dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * lock * lint * rm comments * tsconfig ES2022 * get rid of polyfills file * use node 18 * rm age policy, legacy components * packages * build beta prerelease * remove pre-release build Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Florian Forster <florian@zitadel.com> Co-authored-by: Livio Spring <livio.a@gmail.com>
2023-01-11 14:23:16 +01:00
project.details.creationDate | timestampToDate | localizedDate : 'EEE dd. MMM, HH:mm'
}}</span>
</td>
</ng-container>
<ng-container matColumnDef="changeDate">
<th mat-header-cell *matHeaderCellDef>{{ 'PROJECT.TABLE.CHANGEDATE' | translate }}</th>
<td
class="pointer"
[routerLink]="
type === ProjectType.PROJECTTYPE_OWNED
? ['/projects', project.id]
: ['/granted-projects', project.projectId, 'grant', project.grantId]
"
mat-cell
*matCellDef="let project"
>
<span *ngIf="project.details.changeDate">{{
fix(console): angular 15 (#4809) * cli core * update material * imports * schematics * lint * rm ng-qrcode, ngx-quicklink * replace qr code lib * rm shared module as quicklink is removed * lazy loading imports * rm public * chore(deps): bump @grpc/grpc-js from 1.7.1 to 1.8.0 in /console (#4857) Bumps [@grpc/grpc-js](https://github.com/grpc/grpc-node) from 1.7.1 to 1.8.0. - [Release notes](https://github.com/grpc/grpc-node/releases) - [Commits](https://github.com/grpc/grpc-node/compare/v1.7.1...@grpc/grpc-js@1.8.0) --- updated-dependencies: - dependency-name: "@grpc/grpc-js" dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump libphonenumber-js from 1.10.13 to 1.10.15 in /console (#4861) Bumps [libphonenumber-js](https://gitlab.com/catamphetamine/libphonenumber-js) from 1.10.13 to 1.10.15. - [Release notes](https://gitlab.com/catamphetamine/libphonenumber-js/tags) - [Changelog](https://gitlab.com/catamphetamine/libphonenumber-js/blob/master/CHANGELOG.md) - [Commits](https://gitlab.com/catamphetamine/libphonenumber-js/compare/v1.10.13...v1.10.15) --- updated-dependencies: - dependency-name: libphonenumber-js dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * rxjs * chore(deps): bump engine.io from 6.2.0 to 6.2.1 in /console (#4734) Bumps [engine.io](https://github.com/socketio/engine.io) from 6.2.0 to 6.2.1. - [Release notes](https://github.com/socketio/engine.io/releases) - [Changelog](https://github.com/socketio/engine.io/blob/main/CHANGELOG.md) - [Commits](https://github.com/socketio/engine.io/compare/6.2.0...6.2.1) --- updated-dependencies: - dependency-name: engine.io dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * lock * lint * rm comments * tsconfig ES2022 * get rid of polyfills file * use node 18 * rm age policy, legacy components * packages * build beta prerelease * remove pre-release build Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Florian Forster <florian@zitadel.com> Co-authored-by: Livio Spring <livio.a@gmail.com>
2023-01-11 14:23:16 +01:00
project.details.changeDate | timestampToDate | localizedDate : 'EEE dd. MMM, HH:mm'
}}</span>
</td>
</ng-container>
<ng-container matColumnDef="actions" stickyEnd>
<th mat-header-cell *matHeaderCellDef></th>
<td mat-cell *matCellDef="let project">
<cnsl-table-actions>
<button
actions
*ngIf="project.id !== zitadelProjectId"
color="warn"
mat-icon-button
matTooltip="{{ 'ACTIONS.DELETE' | translate }}"
(click)="deleteProject(project.id, project.name)"
data-e2e="delete-project-button"
>
<i class="las la-trash"></i>
</button>
</cnsl-table-actions>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr class="highlight" mat-row *matRowDef="let row; columns: displayedColumns"></tr>
</table>
</div>
<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"
[timestamp]="viewTimestamp"
[length]="totalResult"
[pageSize]="20"
[pageSizeOptions]="[10, 20, 50, 100]"
(page)="changePage(type)"
></cnsl-paginator>
</cnsl-refresh-table>
</div>