Commit e8e92744 authored by François Agneray's avatar François Agneray
Browse files

Merge branch 'fixes-sonarqube' into 'develop'

Fixes sonarqube

See merge request !56
parents 9a600a6d 53ec20b9
Pipeline #1570 passed with stages
in 13 minutes and 7 seconds
......@@ -35,7 +35,7 @@ import { environment } from '../environments/environment';
DetailModule,
AppRoutingModule
],
providers: [ { provide: RouterStateSerializer, useClass: CustomRouterStateSerializer } ],
providers: [{ provide: RouterStateSerializer, useClass: CustomRouterStateSerializer }],
bootstrap: [AppComponent]
})
export class AppModule { }
......@@ -12,7 +12,7 @@ export const reducers: ActionReducerMap<State> = {
};
export function logger(reducer: ActionReducer<State>): ActionReducer<State> {
return function(state: State, action: any): State {
return (state: State, action: any): State => {
console.group(action.type);
const nextState = reducer(state, action);
console.log(`%c prev state`, `color: #9E9E9E; font-weight: bold`, state);
......
......@@ -8,28 +8,45 @@
<div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" routerLink="/home" routerLinkActive="active"><i class="fas fa-home"></i> Home <span class="sr-only">(current)</span></a>
<a class="nav-link" routerLink="/home" routerLinkActive="active">
<span class="fas fa-home"></span> Home
</a>
</li>
<li class="nav-item">
<a class="nav-link" routerLink="/search" routerLinkActive="active"><i class="fas fa-search"></i> Search</a>
<a class="nav-link" routerLink="/search" routerLinkActive="active">
<span class="fas fa-search"></span> Search
</a>
</li>
</ul>
<button *ngIf="!isAuthenticated" class="btn btn-outline-success my-2 my-sm-0" routerLink="/login">Sign In / Register</button>
<button *ngIf="!isAuthenticated" class="btn btn-outline-success my-2 my-sm-0" routerLink="/login">
Sign In / Register
</button>
<span *ngIf="isAuthenticated" dropdown>
<button id="button-basic" dropdownToggle type="button" class="btn btn-light" aria-controls="dropdown-basic">
<span class="fa-stack text-secondary">
<i class="fas fa-circle fa-2x"></i>
<i class="fas fa-user fa-stack-1x fa-inverse"></i>
<span class="fa-stack theme-color">
<span class="fas fa-circle fa-2x"></span>
<span class="fas fa-user fa-stack-1x fa-inverse"></span>
</span>
&nbsp;
<i class="fas fa-chevron-down text-secondary"></i>
<span class="fas fa-chevron-down text-secondary"></span>
</button>
<ul id="basic-link-dropdown" *dropdownMenu class="dropdown-menu dropdown-menu-right dropdown-up" role="menu" aria-labelledby="basic-link">
<li role="menuitem"><span class="dropdown-item font-italic">{{ loginToken.email }}</span></li>
<ul id="basic-link-dropdown" *dropdownMenu class="dropdown-menu dropdown-menu-right dropdown-up" role="menu"
aria-labelledby="basic-link">
<li role="menuitem">
<span class="dropdown-item font-italic">{{ loginToken.email }}</span>
</li>
<li class="divider dropdown-divider"></li>
<li role="menuitem"><a class="dropdown-item" routerLink="/change-password"><i class="fas fa-key"></i> &nbsp; Change password</a></li>
<li role="menuitem">
<a class="dropdown-item" routerLink="/change-password">
<span class="fas fa-key fa-fw"></span> Change password
</a>
</li>
<li class="divider dropdown-divider"></li>
<li role="menuitem"><a class="dropdown-item text-danger pointer" (click)="logout.emit()"><i class="fas fa-sign-out-alt"></i> &nbsp; Sign Out</a></li>
<li role="menuitem">
<a class="dropdown-item text-danger pointer" (click)="logout.emit()">
<span class="fas fa-sign-out-alt fa-fw"></span> Sign Out
</a>
</li>
</ul>
</span>
</div>
......@@ -37,18 +54,41 @@
<!-- Dropdown appearing on mobile only -->
<span dropdown>
<button id="button-basic" dropdownToggle type="button" class="navbar-toggler" aria-controls="dropdown-basic">
<i class="fas fa-bars"></i>
<span class="fas fa-bars"></span>
</button>
<ul id="basic-link-dropdown" *dropdownMenu class="dropdown-menu dropdown-menu-right dropdown-up" role="menu" aria-labelledby="basic-link">
<li *ngIf="isAuthenticated" role="menuitem"><span class="dropdown-item font-italic">{{ loginToken.email }}</span></li>
<ul id="basic-link-dropdown" *dropdownMenu class="dropdown-menu dropdown-menu-right dropdown-up" role="menu"
aria-labelledby="basic-link">
<li *ngIf="isAuthenticated" role="menuitem">
<span class="dropdown-item font-italic">{{ loginToken.email }}</span>
</li>
<li *ngIf="isAuthenticated" class="divider dropdown-divider"></li>
<li role="menuitem"><a class="dropdown-item" routerLink="/home"><i class="fas fa-home"></i> &nbsp; Home</a></li>
<li role="menuitem"><a class="dropdown-item" routerLink="/search"><i class="fas fa-search"></i> &nbsp; Search</a></li>
<li role="menuitem">
<a class="dropdown-item" routerLink="/home">
<span class="fas fa-home fa-fw"></span> Home
</a>
</li>
<li role="menuitem">
<a class="dropdown-item" routerLink="/search">
<span class="fas fa-search fa-fw"></span> Search
</a>
</li>
<li *ngIf="isAuthenticated" class="divider dropdown-divider"></li>
<li *ngIf="isAuthenticated" role="menuitem"><a class="dropdown-item" routerLink="/change-password"><i class="fas fa-key"></i> &nbsp; Change password</a></li>
<li *ngIf="isAuthenticated" role="menuitem">
<a class="dropdown-item" routerLink="/change-password">
<span class="fas fa-key fa-fw"></span> Change password
</a>
</li>
<li class="divider dropdown-divider"></li>
<li role="menuitem"><a *ngIf="!isAuthenticated" class="dropdown-item text-success" routerLink="/login"><i class="fas fa-sign-in-alt"></i> &nbsp; Sign In / Register</a></li>
<li role="menuitem"><a *ngIf="isAuthenticated" class="dropdown-item pointer text-danger" (click)="logout.emit()"><i class="fas fa-sign-out-alt"></i> &nbsp; Sign Out</a></li>
<li role="menuitem">
<a *ngIf="!isAuthenticated" class="dropdown-item text-success" routerLink="/login">
<span class="fas fa-sign-in-alt fa-fw"></span> Sign In / Register
</a>
</li>
<li role="menuitem">
<a *ngIf="isAuthenticated" class="dropdown-item pointer text-danger" (click)="logout.emit()">
<span class="fas fa-sign-out-alt fa-fw"></span> Sign Out
</a>
</li>
</ul>
</span>
</nav>
\ No newline at end of file
<header>
<app-anis-nav [isAuthenticated]="isAuthenticated | async" [loginToken]="loginToken | async" (logout)="logout()"></app-anis-nav>
<app-anis-nav [isAuthenticated]="isAuthenticated | async" [loginToken]="loginToken | async" (logout)="logout()">
</app-anis-nav>
</header>
<main role="main" class="container flex-shrink-0 pb-4">
<router-outlet></router-outlet>
......@@ -37,7 +38,4 @@
</div>
</div>
</div>
</footer>
</footer>
\ No newline at end of file
<h2 class="text-center title">Page not found (404)</h2>
<br>
\ No newline at end of file
......@@ -4,6 +4,4 @@ import { Component } from '@angular/core';
selector: 'app-not-found-page',
templateUrl: 'not-found-page.component.html'
})
export class NotFoundPageComponent {
}
export class NotFoundPageComponent { }
......@@ -2,4 +2,4 @@ import { ObjectDisplayComponent } from './object-display.component';
export const dummiesComponents = [
ObjectDisplayComponent
];
\ No newline at end of file
];
......@@ -5,7 +5,6 @@ import { Attribute } from '../../metamodel/model';
@Component({
selector: 'app-object-display',
templateUrl: 'object-display.component.html',
styleUrls: ['object-display.component.css'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class ObjectDisplayComponent {
......@@ -15,6 +14,6 @@ export class ObjectDisplayComponent {
getAttributesVisible() {
return this.attributeList
.filter(a => a.detail)
.sort((a, b) => a.display_detail - b.display_detail);;
.sort((a, b) => a.display_detail - b.display_detail);
}
}
......@@ -16,8 +16,7 @@ interface StoreState {
@Component({
selector: 'app-detail-page',
templateUrl: 'detail.component.html',
styleUrls: ['detail.component.css']
templateUrl: 'detail.component.html'
})
export class DetailComponent implements OnInit, OnDestroy {
public pristine: Observable<boolean>;
......
......@@ -90,6 +90,7 @@ export class DetailEffects {
const objectSelected = state.router.state.params.objectSelected;
const attributes = state.detail.attributeList;
const attributeCriterionId = attributes.find(a => a.search_flag === 'ID');
console.log(attributes);
const attributesOutputList = attributes.filter(a => a.detail).map(a => a.id);
return this.detailService.retrieveObject(datasetName, attributeCriterionId.id, objectSelected, attributesOutputList).pipe(
map((object: any[]) => new detailActions.RetrieveObjectSuccessAction(object[0])),
......
......@@ -10,7 +10,7 @@ export class DetailService {
constructor(private http: HttpClient) { }
retrieveObject(datasetName: string, attributeCriterionId: number, objectSelected: string, attributesOutputList: number[]) {
const query = datasetName + '?c=' + attributeCriterionId + "::eq::" + objectSelected + "&a=" + attributesOutputList.join(';');
const query = datasetName + '?c=' + attributeCriterionId + '::eq::' + objectSelected + '&a=' + attributesOutputList.join(';');
return this.http.get<any[]>(this.API_PATH + '/data/' + query);
}
}
<h1 class="mb-3">ANIS</h1>
<p dir="auto">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras a laoreet risus, vel placerat sem. In vestibulum odio ut enim venenatis commodo.</p>
<p dir="auto">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras a laoreet risus, vel placerat sem. In vestibulum odio
ut enim venenatis commodo.
</p>
<ul dir="auto">
<li>Explore datasets on ANIS (no login needed)</li>
......
......@@ -4,5 +4,4 @@ import { Component } from '@angular/core';
selector: 'app-account-benefits',
templateUrl: 'account-benefits.component.html'
})
export class AccountBenefitsComponent {
}
export class AccountBenefitsComponent { }
<form name="form" (ngSubmit)="f.form.valid && submitted.emit(f.form.value)" #f="ngForm" novalidate>
<div class="form-group">
<label for="email">Email address</label>
<input type="email" id="email" class="form-control" name="email" [(ngModel)]="email" placeholder="Enter email" required autofocus>
<input type="email" id="email" class="form-control" name="email" [(ngModel)]="email" placeholder="Enter email"
required autofocus>
</div>
<div class="form-group">
<button type="submit" class="btn btn-success" [disabled]="!f.form.valid || f.form.pristine">Reset password</button>
<button type="submit" class="btn btn-success" [disabled]="!f.form.valid || f.form.pristine">
Reset password
</button>
</div>
</form>
\ No newline at end of file
<form name="form" (ngSubmit)="f.form.valid && submitted.emit(f.form.value)" #f="ngForm" novalidate>
<div class="form-group">
<label for="email">Email address</label>
<input type="email" id="email" class="form-control" name="email" [(ngModel)]="model.email" placeholder="Enter email" required autofocus>
<input type="email" id="email" class="form-control" name="email" [(ngModel)]="model.email"
placeholder="Enter email" required autofocus>
<small class="form-text text-muted">We'll never share your email with anyone else.</small>
</div>
<div class="form-group">
<label for="password">Password</label>
<input type="password" id="password" class="form-control" name="password" [(ngModel)]="model.password" placeholder="Password" required>
<input type="password" id="password" class="form-control" name="password" [(ngModel)]="model.password"
placeholder="Password" required>
</div>
<div class="form-group">
<button type="submit" class="btn btn-success" [disabled]="!f.form.valid || f.form.pristine">Sign In</button>
......
<form (ngSubmit)="f.form.valid && submitted.emit(f.form.value)" #f="ngForm" novalidate>
<div class="form-group">
<label for="register_email">Email address</label>
<input type="email" id="register_email" class="form-control" name="email" [(ngModel)]="model.email" placeholder="Enter email" required>
<input type="email" id="register_email" class="form-control" name="email" [(ngModel)]="model.email"
placeholder="Enter email" required>
<small class="form-text text-muted">We'll never share your email with anyone else.</small>
</div><div class="form-group">
</div>
<div class="form-group">
<label for="confirm_email">Email confirmation</label>
<input type="email" id="confirm_email" class="form-control" name="confirm_email" placeholder="Enter email" required>
<input type="email" id="confirm_email" class="form-control" name="confirm_email" placeholder="Enter email"
required>
</div>
<div class="form-group">
<label for="register_password">Password</label>
<input type="password" id="register_password" class="form-control" name="password" [(ngModel)]="model.password" placeholder="Password" required>
<input type="password" id="register_password" class="form-control" name="password" [(ngModel)]="model.password"
placeholder="Password" required>
</div>
<button type="submit" class="btn btn-success" [disabled]="!f.form.valid || f.form.pristine">Register</button>
</form>
\ No newline at end of file
<form name="form" (ngSubmit)="f.form.valid && submitted()" #f="ngForm" novalidate>
<div class="form-group">
<label for="password">Password</label>
<input type="password"
id="password"
class="form-control"
name="password"
[(ngModel)]="model.password"
placeholder="Enter your password"
required>
<input type="password"
id="password"
class="form-control"
name="password"
[(ngModel)]="model.password"
placeholder="Enter your password"
required>
</div>
<div class="form-group">
<label for="new_password">New password</label>
<input type="password"
id="new_password"
class="form-control"
name="new_password"
[(ngModel)]="model.newPassword"
placeholder="Enter new password"
required>
<input type="password"
id="new_password"
class="form-control"
name="new_password"
[(ngModel)]="model.newPassword"
placeholder="Enter new password"
required>
</div>
<div class="form-group">
<label for="confirm_password">Confirm assword</label>
<input type="password"
id="confirm_password"
class="form-control"
name="confirm_password"
[(ngModel)]="model.confirmPassword"
placeholder="Confirm new password"
required>
<input type="password"
id="confirm_password"
class="form-control"
name="confirm_password"
[(ngModel)]="model.confirmPassword"
placeholder="Confirm new password"
required>
</div>
<div class="form-group">
<button type="submit" class="btn btn-success" [disabled]="!f.form.valid || f.form.pristine">
......
......@@ -8,12 +8,12 @@ import * as fromLogin from '../store/login.reducer';
@Component({
selector: 'app-forgot-password',
templateUrl: 'forgot-password.component.html',
styleUrls: [ 'login.component.css']
styleUrls: ['login.component.css']
})
export class ForgotPasswordComponent implements OnInit {
constructor(private store: Store<{login: fromLogin.State}>) { }
constructor(private store: Store<{ login: fromLogin.State }>) { }
ngOnInit() {}
ngOnInit() { }
forgotPassword(email: string) {
this.store.dispatch(new loginActions.ForgotPasswordAction(email));
......
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