New group button should disabled when login without ldap

Disable "New group" button when user does not login with ldap
This commit is contained in:
Mia ZHOU 2018-07-31 13:32:55 +08:00
parent 2d9d6202d1
commit caa98896ae
6 changed files with 32 additions and 19 deletions

View File

@ -9,22 +9,20 @@
<link rel="icon" type="image/x-icon" href="favicon.ico?v=2">
</head>
<body style="overflow-y: hidden;">
<body>
<harbor-app>
<div class="spinner spinner-lg app-loading">
Loading...
</div>
</harbor-app>
<link rel="stylesheet" href="/static/clarity-ui.min.css">
<link rel="stylesheet" href="/static/clarity-icons.min.css">
<link rel="stylesheet" href="/static/styles.css">
<link rel="stylesheet" href="/static/clarity-ui.min.css">
<link rel="stylesheet" href="/static/clarity-icons.min.css">
<link rel="stylesheet" href="/static/styles.css">
<script src="/static/mutationobserver.min.js"></script>
<script src="/static/custom-elements.min.js"></script>
<script src="/static/clarity-icons.min.js"></script>
<script src="/static/build.min.js"></script>
<script src="/static/mutationobserver.min.js"></script>
<script src="/static/custom-elements.min.js"></script>
<script src="/static/clarity-icons.min.js"></script>
<script src="/static/build.min.js"></script>
</body>
</html>
</html>

View File

@ -64,6 +64,10 @@ export class AppConfigService {
this.configurations.admiral_endpoint.trim() !== "";
}
public isLdapMode(): boolean {
return this.configurations && this.configurations.auth_mode === 'ldap_auth';
}
// Return the reconstructed admiral url
public getAdmiralEndpoint(currentHref: string): string {
let admiralUrl: string = this.configurations.admiral_endpoint;

View File

@ -16,7 +16,7 @@
<button class="btn btn-sm btn-secondary" (click)="openAddMemberModal()" [disabled]="!hasProjectAdminRole">
<span><clr-icon shape="plus" size="16"></clr-icon>&nbsp;{{'MEMBER.NEW_USER' | translate }}</span>
</button>
<button class="btn btn-sm btn-secondary" (click)="openAddGroupModal()" [disabled]="!hasProjectAdminRole">
<button class="btn btn-sm btn-secondary" (click)="openAddGroupModal()" [disabled]="!hasProjectAdminRole || !isLdapMode">
<span><clr-icon shape="plus" size="16"></clr-icon>&nbsp;{{'MEMBER.NEW_GROUP' | translate}}</span>
</button>
<clr-dropdown id='member-action' [clrCloseMenuOnItemClick]="false" class="btn btn-sm btn-link" clrDropdownTrigger>

View File

@ -34,6 +34,7 @@ import { SessionUser } from "../../shared/session-user";
import { AddGroupComponent } from './add-group/add-group.component';
import { MemberService } from "./member.service";
import { AddMemberComponent } from "./add-member/add-member.component";
import {AppConfigService} from "../../app-config.service";
@Component({
templateUrl: "member.component.html",
@ -57,6 +58,7 @@ export class MemberComponent implements OnInit, OnDestroy {
isDelete = false;
isChangeRole = false;
loading = false;
isLdapMode: boolean = false;
isChangingRole = false;
batchChangeRoleInfos = {};
@ -76,6 +78,7 @@ export class MemberComponent implements OnInit, OnDestroy {
private OperateDialogService: ConfirmationDialogService,
private session: SessionService,
private operationService: OperationService,
private appConfigService: AppConfigService,
private ref: ChangeDetectorRef) {
this.delSub = OperateDialogService.confirmationConfirm$.subscribe(message => {
@ -107,6 +110,9 @@ export class MemberComponent implements OnInit, OnDestroy {
this.hasProjectAdminRole = (<Project>resolverData["projectResolver"]).has_project_admin_role;
}
this.retrieve(this.projectId, "");
if (this.appConfigService.isLdapMode()) {
this.isLdapMode = true;
}
}
doSearch(searchMember: string) {

View File

@ -9,7 +9,7 @@
<link rel="icon" type="image/x-icon" href="favicon.ico?v=2">
</head>
<body style="overflow-y: hidden;">
<body>
<harbor-app>
<div class="spinner spinner-lg app-loading">
Loading...

View File

@ -1,9 +1,13 @@
body {
overflow-y: hidden;
}
.app-loading {
position: absolute;
top: 50%;
left: 50%;
margin-top: -54px;
margin-left: -54px;
top: 0;
left: 0;
right:0;
bottom:0;
width: 108px !important;
height: 108px !important;
}
@ -51,7 +55,8 @@
/* set overflow bar style */
::-webkit-scrollbar {
width: 8px;background:transparent;
width: 8px;
background:transparent;
}
::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 2px rgba(0,0,0,0.3);
@ -66,6 +71,6 @@
background: rgba(255,0,0,0.4);
}
.custom-h2 {
margin-top: 0px !important;
margin-top: 0 !important;
line-height: 24px;
}