Browse Source
Merge pull request #1639 from abpframework/fix/general
Fix/general
pull/1642/head
Mehmet Erim
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with
16 additions and
9 deletions
-
npm/ng-packs/packages/core/src/lib/directives/ellipsis.directive.ts
-
npm/ng-packs/packages/permission-management/src/lib/components/permission-management.component.html
-
npm/ng-packs/packages/permission-management/src/lib/components/permission-management.component.ts
-
npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.html
-
npm/ng-packs/packages/theme-basic/src/lib/components/layout/layout.component.ts
-
npm/ng-packs/packages/theme-shared/src/lib/contants/styles.ts
|
|
|
@ -5,7 +5,7 @@ import { AfterContentInit, ChangeDetectorRef, Directive, ElementRef, HostBinding |
|
|
|
}) |
|
|
|
export class EllipsisDirective implements AfterContentInit { |
|
|
|
@Input('abpEllipsis') |
|
|
|
witdh: string; |
|
|
|
width: string; |
|
|
|
|
|
|
|
@HostBinding('title') |
|
|
|
@Input() |
|
|
|
@ -21,7 +21,7 @@ export class EllipsisDirective implements AfterContentInit { |
|
|
|
|
|
|
|
@HostBinding('style.max-width') |
|
|
|
get maxWidth() { |
|
|
|
return this.enabled ? this.witdh || '160px' : undefined; |
|
|
|
return this.enabled ? this.width || '170px' : undefined; |
|
|
|
} |
|
|
|
|
|
|
|
constructor(private cdRef: ChangeDetectorRef, private elRef: ElementRef) {} |
|
|
|
|
|
|
|
@ -26,7 +26,7 @@ |
|
|
|
<li *ngFor="let group of groups$ | async; trackBy: trackByFn" class="nav-item"> |
|
|
|
<a |
|
|
|
class="nav-link pointer" |
|
|
|
[class.active]="selectedGroup.name === group.name" |
|
|
|
[class.active]="selectedGroup?.name === group?.name" |
|
|
|
(click)="onChangeGroup(group)" |
|
|
|
>{{ group?.displayName }}</a |
|
|
|
> |
|
|
|
@ -65,7 +65,7 @@ |
|
|
|
[value]="getChecked(permission.name)" |
|
|
|
[attr.id]="permission.name" |
|
|
|
class="custom-control-input" |
|
|
|
[disabled]="permission.isGranted && permission.grantedProviders.length > 0" |
|
|
|
[disabled]="isGrantedByRole(permission.grantedProviders)" |
|
|
|
/> |
|
|
|
<label |
|
|
|
class="custom-control-label" |
|
|
|
|
|
|
|
@ -94,8 +94,15 @@ export class PermissionManagementComponent implements OnInit, OnChanges { |
|
|
|
return (this.permissions.find(per => per.name === name) || { isGranted: false }).isGranted; |
|
|
|
} |
|
|
|
|
|
|
|
isGrantedByRole(grantedProviders: PermissionManagement.GrantedProvider[]): boolean { |
|
|
|
if (grantedProviders.length) { |
|
|
|
return grantedProviders.findIndex(p => p.providerName === 'Role') === -1 ? false : true; |
|
|
|
} |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
onClickCheckbox(clickedPermission: PermissionManagement.Permission, value) { |
|
|
|
if (clickedPermission.isGranted && clickedPermission.grantedProviders.length > 0) return; |
|
|
|
if (clickedPermission.isGranted && this.isGrantedByRole(clickedPermission.grantedProviders)) return; |
|
|
|
|
|
|
|
setTimeout(() => { |
|
|
|
this.permissions = this.permissions.map(per => { |
|
|
|
@ -150,7 +157,7 @@ export class PermissionManagementComponent implements OnInit, OnChanges { |
|
|
|
onClickSelectThisTab() { |
|
|
|
this.selectedGroupPermissions$.pipe(take(1)).subscribe(permissions => { |
|
|
|
permissions.forEach(permission => { |
|
|
|
if (permission.isGranted && permission.grantedProviders.length > 0) return; |
|
|
|
if (permission.isGranted && this.isGrantedByRole(permission.grantedProviders)) return; |
|
|
|
|
|
|
|
const index = this.permissions.findIndex(per => per.name === permission.name); |
|
|
|
|
|
|
|
|
|
|
|
@ -64,7 +64,7 @@ |
|
|
|
> |
|
|
|
<div ngbDropdownToggle [class.dropdown-toggle]="false" class="pointer"> |
|
|
|
<a |
|
|
|
abpEllipsis="200px" |
|
|
|
abpEllipsis="210px" |
|
|
|
[abpEllipsisEnabled]="isDropdownChildDynamic" |
|
|
|
role="button" |
|
|
|
class="btn d-block text-left py-2 px-2 dropdown-toggle" |
|
|
|
|
|
|
|
@ -9,7 +9,7 @@ import { Store } from '@ngxs/store'; |
|
|
|
animations: [slideFromBottom], |
|
|
|
}) |
|
|
|
export class LayoutComponent { |
|
|
|
isCollapsed: boolean = false; |
|
|
|
isCollapsed: boolean = true; |
|
|
|
|
|
|
|
get appInfo(): Config.Application { |
|
|
|
return this.store.selectSnapshot(ConfigState.getApplicationInfo); |
|
|
|
|
|
|
|
@ -25,7 +25,7 @@ export default ` |
|
|
|
} |
|
|
|
|
|
|
|
.navbar .dropdown-menu { |
|
|
|
min-width: 200px; |
|
|
|
min-width: 215px; |
|
|
|
} |
|
|
|
|
|
|
|
.modal { |
|
|
|
|