Commit 288ff7cc authored by Lukas Burgey's avatar Lukas Burgey

Make minor changes

parent 0cd7b267
<div class="body"> <div class="body" class="mat-typography" class="body">
<div *ngIf="userService.loggedIn()" class="mat-typography"> <mat-tab-group *ngIf="userService.loggedIn()">
<div style="padding-bottom: 30px;"> <mat-tab label="Your VOs">
<h2>Your Virtual Organisations</h2> <div class="mat-typography" class="body">
<mat-accordion *ngIf="userService.user.groups.length > 0"> <h2>Your Virtual Organisations</h2>
<app-vo *ngFor="let group of userService.getGroups()" [group]="group" [deployment]="userService.getDeploymentByGroup(group)"></app-vo> <mat-accordion *ngIf="userService.user.groups.length > 0">
</mat-accordion> <app-vo *ngFor="let group of userService.getGroups()" [group]="group" [deployment]="userService.getDeploymentByGroup(group)"></app-vo>
</div> </mat-accordion>
<div style="padding-bottom: 30px;"> <p *ngIf="userService.user.groups.length == 0">
<h2>Services</h2> You are not a member in any group.
<mat-accordion *ngIf="userService.services.length > 0"> </p>
<app-service *ngFor="let service of userService.services" [deployment]="userService.getDeployment(service)" [service]="service"></app-service> </div>
</mat-accordion> </mat-tab>
<p *ngIf="userService.services.length === 0"> <mat-tab label="Services">
You have no available services.<br/> <div class="mat-typography" class="body">
This is due services requiring users to be member of a certain group. <h2>Available Services</h2>
</p> <mat-accordion *ngIf="userService.services.length > 0">
</div> <app-service *ngFor="let service of userService.services" [deployment]="userService.getDeployment(service)" [service]="service"></app-service>
</div> </mat-accordion>
<p *ngIf="userService.services.length === 0">
You have no available services.<br/>
This is due services requiring users to be member of a certain group.
</p>
</div>
</mat-tab>
</mat-tab-group>
</div> </div>
...@@ -6,6 +6,7 @@ import { SshKeysComponent } from './ssh-keys/ssh-keys.component'; ...@@ -6,6 +6,7 @@ import { SshKeysComponent } from './ssh-keys/ssh-keys.component';
import { AccountComponent } from './account/account.component'; import { AccountComponent } from './account/account.component';
import { QuestionnaireComponent } from './questionnaire/questionnaire.component'; import { QuestionnaireComponent } from './questionnaire/questionnaire.component';
import { CredentialsComponent } from './credentials/credentials.component'; import { CredentialsComponent } from './credentials/credentials.component';
import { MessageComponent } from './message/message.component';
import * as t from '../types/types.module'; import * as t from '../types/types.module';
...@@ -16,6 +17,7 @@ export class DialogService { ...@@ -16,6 +17,7 @@ export class DialogService {
accountDialog: MatDialogRef<any>; accountDialog: MatDialogRef<any>;
questionnaireDialog: MatDialogRef<any>; questionnaireDialog: MatDialogRef<any>;
credentialsDialog: MatDialogRef<any>; credentialsDialog: MatDialogRef<any>;
messageDialog: MatDialogRef<any>;
settings = { settings = {
width: '80%', width: '80%',
...@@ -68,4 +70,15 @@ export class DialogService { ...@@ -68,4 +70,15 @@ export class DialogService {
} }
); );
} }
public openMessage(stateItem: t.DeploymentStateItem) {
this.messageDialog = this.dialog.open(
MessageComponent,
{
data: {
stateItem: stateItem,
}
}
);
}
} }
...@@ -12,6 +12,7 @@ import {ProfileComponent} from './profile/profile.component'; ...@@ -12,6 +12,7 @@ import {ProfileComponent} from './profile/profile.component';
import {SshKeysComponent} from './ssh-keys/ssh-keys.component'; import {SshKeysComponent} from './ssh-keys/ssh-keys.component';
import {AccountComponent} from './account/account.component'; import {AccountComponent} from './account/account.component';
import {CredentialsComponent} from './credentials/credentials.component'; import {CredentialsComponent} from './credentials/credentials.component';
import {MessageComponent} from './message/message.component';
//providers //providers
import {DialogService} from './dialog.service'; import {DialogService} from './dialog.service';
...@@ -29,6 +30,7 @@ import {DialogService} from './dialog.service'; ...@@ -29,6 +30,7 @@ import {DialogService} from './dialog.service';
SshKeysComponent, SshKeysComponent,
AccountComponent, AccountComponent,
CredentialsComponent, CredentialsComponent,
MessageComponent,
], ],
entryComponents: [ entryComponents: [
QuestionnaireComponent, QuestionnaireComponent,
...@@ -36,6 +38,7 @@ import {DialogService} from './dialog.service'; ...@@ -36,6 +38,7 @@ import {DialogService} from './dialog.service';
SshKeysComponent, SshKeysComponent,
AccountComponent, AccountComponent,
CredentialsComponent, CredentialsComponent,
MessageComponent,
], ],
providers: [ providers: [
DialogService, DialogService,
......
<div class="mat-typography">
<h2>Deployment State</h2>
<div [ngSwitch]="stateItem.state">
<p *ngSwitchCase="'failed'">
The deployment of key {{ stateItem.key.name }} failed:
</p>
<p *ngSwitchCase="'rejected'">
The deployment of key {{ stateItem.key.name }} was rejected:
</p>
<p *ngSwitchDefault>
The deployment of key {{ stateItem.key.name }} has unknown state:
</p>
</div>
<p>
{{ stateItem.message }}
</p>
</div>
import {Component, OnInit,Inject} from '@angular/core';
import {MAT_DIALOG_DATA} from '@angular/material';
import { UserService } from '../../user.service';
import * as t from '../../types/types.module';
@Component({
selector: 'app-message',
templateUrl: './message.component.html',
styleUrls: ['./message.component.css']
})
export class MessageComponent implements OnInit {
public stateItem: t.DeploymentStateItem;
constructor(
public userService: UserService,
@Inject(MAT_DIALOG_DATA) public data: any,
) {
this.stateItem = data.stateItem;
}
ngOnInit() {
}
}
...@@ -15,6 +15,7 @@ import {MatCheckboxModule} from '@angular/material/checkbox'; ...@@ -15,6 +15,7 @@ import {MatCheckboxModule} from '@angular/material/checkbox';
import {MatTooltipModule} from '@angular/material/tooltip'; import {MatTooltipModule} from '@angular/material/tooltip';
import {MatProgressBarModule} from '@angular/material/progress-bar'; import {MatProgressBarModule} from '@angular/material/progress-bar';
import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; import {MatProgressSpinnerModule} from '@angular/material/progress-spinner';
import {MatTabsModule} from '@angular/material/tabs';
@NgModule({ @NgModule({
imports: [ imports: [
...@@ -32,6 +33,7 @@ import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; ...@@ -32,6 +33,7 @@ import {MatProgressSpinnerModule} from '@angular/material/progress-spinner';
MatCheckboxModule, MatCheckboxModule,
MatTooltipModule, MatTooltipModule,
MatProgressSpinnerModule, MatProgressSpinnerModule,
MatTabsModule,
], ],
exports: [ exports: [
MatButtonModule, MatButtonModule,
...@@ -47,6 +49,7 @@ import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; ...@@ -47,6 +49,7 @@ import {MatProgressSpinnerModule} from '@angular/material/progress-spinner';
MatCheckboxModule, MatCheckboxModule,
MatTooltipModule, MatTooltipModule,
MatProgressSpinnerModule, MatProgressSpinnerModule,
MatTabsModule,
], ],
}) })
export class MaterialModule { } export class MaterialModule { }
...@@ -67,6 +67,7 @@ export interface DeploymentStateItem { ...@@ -67,6 +67,7 @@ export interface DeploymentStateItem {
service: Service; service: Service;
services: Service[]; services: Service[];
group: Group; group: Group;
message: string;
} }
export interface DeploymentState { export interface DeploymentState {
id: number; id: number;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<div *ngIf="userService.getServices(group).length > 0; then serviceList else noServiceList"></div> <div *ngIf="userService.getServices(group).length > 0; then serviceList else noServiceList"></div>
<ng-template #serviceList> <ng-template #serviceList>
<p> <p>
These services are provided for members of this VO: These services are provided for members of this VO. You can inspect credentials by clicking on the arrows.
</p> </p>
<table style="margin-bottom: 30px; margin: auto;"> <table style="margin-bottom: 30px; margin: auto;">
<thead> <thead>
...@@ -67,16 +67,20 @@ ...@@ -67,16 +67,20 @@
matTooltip="The key {{ key.name }} is not deployed for the service {{ service.name }}."> matTooltip="The key {{ key.name }} is not deployed for the service {{ service.name }}.">
<mat-icon>call_received</mat-icon> <mat-icon>call_received</mat-icon>
</button> </button>
<button *ngSwitchCase="'failed'" mat-icon-button matTooltip="Site {{ site.name }} failed to deploy the credentials. The deployment will be retried."> <button *ngSwitchCase="'failed'" mat-icon-button
matTooltip="Site {{ site.name }} failed to deploy the key {{ key.name }}. The deployment will be retried. Click for details."
(click)="dialog.openMessage(taskItem(site, key))">
<mat-icon>error</mat-icon> <mat-icon>error</mat-icon>
</button> </button>
<button *ngSwitchCase="'rejected'" mat-icon-button matTooltip="Site {{ site.name }} rejected the deployment of the key {{ key.name }}."> <button *ngSwitchCase="'rejected'" mat-icon-button matTooltip="Site {{ site.name }} rejected the deployment of the key {{ key.name }}. Click for details."
(click)="dialog.openMessage(taskItem(site, key))">
<mat-icon>error</mat-icon> <mat-icon>error</mat-icon>
</button> </button>
<!-- if we have no deployment -> assume state == not_deployed --> <!-- if we have no deployment -> assume state == not_deployed -->
<span *ngSwitchDefault mat-icon-button matTooltip="The key {{ key.name }} is not deployed to the site {{ site.name }}."> <button *ngSwitchDefault mat-icon-button matTooltip="The key {{ key.name }} was never deployed to the site {{ site.name }}.">
<mat-icon>call_received</mat-icon> <mat-icon>call_received</mat-icon>
</span> </button>
</span> </span>
</td> </td>
</tr> </tr>
......
...@@ -37,7 +37,6 @@ button.mat-button { ...@@ -37,7 +37,6 @@ button.mat-button {
mat-icon { mat-icon {
vertical-align: middle; vertical-align: middle;
padding-right: 5px;
} }
mat-checkbox { mat-checkbox {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment