From e3717cd02be02cd8f6bc81b5f78ee112a6fa87d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johnny=20Marie=CC=81thoz?= Date: Thu, 9 Jan 2025 10:29:41 +0100 Subject: [PATCH] primeng: admin permissions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-by: Johnny MarieĢthoz Co-Authored-by: Bertrand Zuchuat --- .../permission-detail-view.component.html | 37 ++++++----- .../permission-detail-view.component.scss | 64 ++++++++----------- .../permission-detail-view.component.ts | 3 +- projects/admin/src/app/scss/styles.scss | 1 + 4 files changed, 51 insertions(+), 54 deletions(-) diff --git a/projects/admin/src/app/record/detail-view/permission-detail-view/permission-detail-view.component.html b/projects/admin/src/app/record/detail-view/permission-detail-view/permission-detail-view.component.html index f6fddbc1a..bced85277 100644 --- a/projects/admin/src/app/record/detail-view/permission-detail-view/permission-detail-view.component.html +++ b/projects/admin/src/app/record/detail-view/permission-detail-view/permission-detail-view.component.html @@ -16,20 +16,28 @@ along with this program. If not, see . --> @if (globalPermissions) { -

Permissions matrix

-
- - - Enter a part of the permission name to filter the list. -
+
+ + + + Enter a part of the permission name to filter the list. + +
+ @if (filteredPermissionNames.length >0) { - +
- + @for (role of roles; track role) { - } @@ -38,16 +46,16 @@

Permissions matrix

@for (permissionName of filteredPermissionNames; track permissionName) { - + @for (role of roles; track role) { -
   + {{ role.name | translate }}
{{ permissionName }}{{ permissionName }} + @@ -58,7 +66,6 @@

Permissions matrix

} @else { -

No Result

+

No result

} -
} diff --git a/projects/admin/src/app/record/detail-view/permission-detail-view/permission-detail-view.component.scss b/projects/admin/src/app/record/detail-view/permission-detail-view/permission-detail-view.component.scss index 1aaa90df9..35bde503e 100644 --- a/projects/admin/src/app/record/detail-view/permission-detail-view/permission-detail-view.component.scss +++ b/projects/admin/src/app/record/detail-view/permission-detail-view/permission-detail-view.component.scss @@ -16,42 +16,32 @@ * along with this program. If not, see . */ -@import 'node_modules/bootstrap/scss/_functions'; -@import 'node_modules/bootstrap/scss/_variables'; - -table { - position: relative; - - tr td:nth-child(2), - td.type-system-role + td.type-role { - border-left: $border-width*2 solid $border-color; - } - th.type-system-role { - background-color: #f4f4f4; - } - - th { - position: sticky; - top: 0; - background: $white; - } - - .vertical-header { - text-align: left; - } - - .vertical-header span { - writing-mode: vertical-rl; - transform: rotate(180deg); - text-align: left; - max-height: 200px; - } - - .permission { - width: 200px; - } - - .access { - width: 30px; +admin-permission-detail-view { + table { + @extend .relative, .w-full, .mt-3; + border-spacing: 0; + thead tr { + @extend .bg-white, .sticky, .top-0, .vertical-align-bottom; + th span { + @extend .text-left, .max-h-13rem, .text-sm, .p-2; + writing-mode: vertical-rl; + transform: rotate(180deg); + } + th.type-system-role { + @extend .surface-100; + } + } + tbody { + tr:nth-of-type(odd) { + @extend .surface-100; + } + td { + @extend .p-3, .w-13rem, .text-center, .w-2rem; + } + td:nth-child(2), + td.type-system-role + td.type-role { + @extend .surface-border, .border-left-2; + } + } } } diff --git a/projects/admin/src/app/record/detail-view/permission-detail-view/permission-detail-view.component.ts b/projects/admin/src/app/record/detail-view/permission-detail-view/permission-detail-view.component.ts index f42fa9557..d5404121c 100644 --- a/projects/admin/src/app/record/detail-view/permission-detail-view/permission-detail-view.component.ts +++ b/projects/admin/src/app/record/detail-view/permission-detail-view/permission-detail-view.component.ts @@ -20,8 +20,7 @@ import { IRolePermission, PermissionApiService } from '../../../api/permission-a @Component({ selector: 'admin-permission-detail-view', - templateUrl: './permission-detail-view.component.html', - styleUrls: ['./permission-detail-view.component.scss'], + templateUrl: './permission-detail-view.component.html' }) export class PermissionDetailViewComponent implements OnInit { diff --git a/projects/admin/src/app/scss/styles.scss b/projects/admin/src/app/scss/styles.scss index 7e9388cc9..8f8fc6298 100644 --- a/projects/admin/src/app/scss/styles.scss +++ b/projects/admin/src/app/scss/styles.scss @@ -39,6 +39,7 @@ @import '../menu/menu-app/menu-app.component.scss'; @import '../record/detail-view/document-detail-view/holding/holding.component.scss'; @import '../record/detail-view/entities-detail-view/remote/entities-remote-detail-view.component.scss'; + @import '../record/detail-view/permission-detail-view/permission-detail-view.component.scss'; } @layer rero-ils-ui {