rxjs refactor
parent
05a6ddd90f
commit
92d9c2cf03
@ -1,31 +0,0 @@
|
||||
// Karma configuration file, see link for more information
|
||||
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
||||
|
||||
module.exports = function (config) {
|
||||
config.set({
|
||||
basePath: '',
|
||||
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
||||
plugins: [
|
||||
require('karma-jasmine'),
|
||||
require('karma-chrome-launcher'),
|
||||
require('karma-jasmine-html-reporter'),
|
||||
require('karma-coverage-istanbul-reporter'),
|
||||
require('@angular-devkit/build-angular/plugins/karma')
|
||||
],
|
||||
client:{
|
||||
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
||||
},
|
||||
coverageIstanbulReporter: {
|
||||
dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ],
|
||||
fixWebpackSourcePaths: true
|
||||
},
|
||||
|
||||
reporters: ['progress', 'kjhtml'],
|
||||
port: 9876,
|
||||
colors: true,
|
||||
logLevel: config.LOG_INFO,
|
||||
autoWatch: true,
|
||||
browsers: ['Chrome'],
|
||||
singleRun: false
|
||||
});
|
||||
};
|
File diff suppressed because it is too large
Load Diff
@ -1,28 +1,34 @@
|
||||
// Protractor configuration file, see link for more information
|
||||
// https://github.com/angular/protractor/blob/master/lib/config.ts
|
||||
|
||||
const { SpecReporter } = require('jasmine-spec-reporter');
|
||||
const {
|
||||
SpecReporter
|
||||
} = require('jasmine-spec-reporter');
|
||||
|
||||
exports.config = {
|
||||
allScriptsTimeout: 11000,
|
||||
specs: [
|
||||
'./e2e/**/*.e2e-spec.ts'
|
||||
],
|
||||
capabilities: {
|
||||
'browserName': 'chrome'
|
||||
},
|
||||
directConnect: true,
|
||||
baseUrl: 'http://localhost:4200/',
|
||||
framework: 'jasmine',
|
||||
jasmineNodeOpts: {
|
||||
showColors: true,
|
||||
defaultTimeoutInterval: 30000,
|
||||
print: function() {}
|
||||
},
|
||||
onPrepare() {
|
||||
require('ts-node').register({
|
||||
project: 'e2e/tsconfig.e2e.json'
|
||||
});
|
||||
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
|
||||
}
|
||||
allScriptsTimeout: 11000,
|
||||
specs: [
|
||||
'./e2e/**/*.e2e-spec.ts'
|
||||
],
|
||||
capabilities: {
|
||||
'browserName': 'chrome'
|
||||
},
|
||||
directConnect: true,
|
||||
baseUrl: 'http://localhost:4200/',
|
||||
framework: 'jasmine',
|
||||
jasmineNodeOpts: {
|
||||
showColors: true,
|
||||
defaultTimeoutInterval: 30000,
|
||||
print: function () {}
|
||||
},
|
||||
onPrepare() {
|
||||
require('ts-node').register({
|
||||
project: 'e2e/tsconfig.e2e.json'
|
||||
});
|
||||
jasmine.getEnv().addReporter(new SpecReporter({
|
||||
spec: {
|
||||
displayStacktrace: true
|
||||
}
|
||||
}));
|
||||
}
|
||||
};
|
||||
|
@ -0,0 +1,14 @@
|
||||
import { OnDestroy } from '@angular/core';
|
||||
import { Subject } from 'rxjs';
|
||||
|
||||
export abstract class BaseComponent implements OnDestroy {
|
||||
|
||||
protected _destroyed: Subject<boolean> = new Subject();
|
||||
|
||||
protected constructor() { }
|
||||
|
||||
ngOnDestroy(): void {
|
||||
this._destroyed.next(true);
|
||||
this._destroyed.complete();
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
import { OnDestroy } from '@angular/core';
|
||||
import { Subject } from 'rxjs';
|
||||
|
||||
export abstract class BaseService implements OnDestroy {
|
||||
|
||||
protected _destroyed: Subject<boolean> = new Subject();
|
||||
|
||||
protected constructor() { }
|
||||
|
||||
ngOnDestroy(): void {
|
||||
this._destroyed.next(true);
|
||||
this._destroyed.complete();
|
||||
}
|
||||
}
|
@ -1,88 +1,85 @@
|
||||
<div class="main-panel" id="main-panel">
|
||||
<div>
|
||||
<div class="row" style="margin-top: 30px">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 col-md-offset-1">
|
||||
<h3 *ngIf="!this.isAuthenticated()">{{ 'HOMEPAGE.OPEN-DMPS.STATS' | translate }}</h3>
|
||||
<h3 *ngIf="this.isAuthenticated()">{{ 'HOMEPAGE.MY-DMPS.STATS' | translate }}</h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row" style="margin-top: 30px">
|
||||
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 col-md-offset-1">
|
||||
<app-figurecard title={{dashboardStatisticsData.totalDataManagementPlanCount}} headerIcon="mode_edit" [category]="this.isAuthenticated() ? 'DASHBOARD.MY-DMPS' : 'DASHBOARD.DMPS' "
|
||||
routelLink='/dmps' buttonRedirectLink="/dmps/new" buttonTitle="Create New DMP" footerIcon="open_in_new" linearColor="linear-gradient(60deg, #ef5350, #e53935)"
|
||||
boxShadow="0 4px 20px 0px rgba(0, 0, 0, 0.14), 0 7px 10px -5px rgba(244, 67, 54, 0.4)">
|
||||
</app-figurecard>
|
||||
<mat-card *ngIf="this.isAuthenticated()" class="example-card">
|
||||
<mat-card-header>
|
||||
<mat-card-title>
|
||||
{{'RECENT-ACTIVITY.MY-TITLE-DMP' | translate}}
|
||||
</mat-card-title>
|
||||
</mat-card-header>
|
||||
<mat-card-content>
|
||||
<mat-nav-list *ngIf="dmpActivities!=null">
|
||||
<mat-list-item (click)="redirect(activity.id,RecentActivityTypes.DMP)" *ngFor="let activity of dmpActivities">
|
||||
<p mat-line>
|
||||
{{activity.label}}
|
||||
</p>
|
||||
<p mat-line>
|
||||
{{activity.timestamp | date:'shortDate'}}
|
||||
</p>
|
||||
</mat-list-item>
|
||||
</mat-nav-list>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 ">
|
||||
<app-figurecard title={{dashboardStatisticsData.totalProjectCount}} headerIcon="list" [category]="this.isAuthenticated() ? 'DASHBOARD.MY-PROJECTS' : 'DASHBOARD.PROJECTS' "
|
||||
routelLink='/projects' buttonRedirectLink="/projects/new" buttonTitle="Create New Project" footerIcon="open_in_new"
|
||||
linearColor="linear-gradient(60deg, #ffa726, #fb8c00)" boxShadow="0 4px 20px 0 rgba(0, 0, 0, 0.14), 0 7px 10px -5px rgba(255, 152, 0, 0.4)">
|
||||
</app-figurecard>
|
||||
<mat-card *ngIf="this.isAuthenticated()" class="example-card">
|
||||
<mat-card-header>
|
||||
<mat-card-title>
|
||||
{{'RECENT-ACTIVITY.MY-TITLE-PROJECT' | translate}}
|
||||
</mat-card-title>
|
||||
</mat-card-header>
|
||||
<mat-card-content>
|
||||
<mat-nav-list *ngIf="projectActivities!=null">
|
||||
<mat-list-item (click)="redirect(activity.id,RecentActivityTypes.PROJECT)" *ngFor="let activity of projectActivities">
|
||||
<p mat-line>
|
||||
{{activity.label}}
|
||||
</p>
|
||||
<p mat-line>
|
||||
{{activity.timestamp | date:'shortDate'}}
|
||||
</p>
|
||||
</mat-list-item>
|
||||
</mat-nav-list>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
|
||||
<app-figurecard title={{dashboardStatisticsData.totalDataSetCount}} headerIcon="subject" [category]="this.isAuthenticated() ? 'DASHBOARD.MY-DATASETS' : 'DASHBOARD.DATASETS'"
|
||||
routelLink='/datasets' buttonRedirectLink="/datasets/new" buttonTitle="Create New Dataset" footerIcon="open_in_new"
|
||||
linearColor="linear-gradient(60deg, #26c6da, #00acc1)" boxShadow="0 4px 20px 0px rgba(0, 0, 0, 0.14), 0 7px 10px -5px rgba(0, 188, 212, 0.4)">
|
||||
</app-figurecard>
|
||||
<mat-card *ngIf="this.isAuthenticated()" class="example-card">
|
||||
<mat-card-header>
|
||||
<mat-card-title>
|
||||
{{'RECENT-ACTIVITY.MY-TITLE-DATASET' | translate}}
|
||||
</mat-card-title>
|
||||
</mat-card-header>
|
||||
<mat-card-content>
|
||||
<mat-nav-list *ngIf="datasetActivities!=null">
|
||||
<mat-list-item (click)="redirect(activity.id,RecentActivityTypes.DATASET)" *ngFor="let activity of datasetActivities">
|
||||
<p mat-line>
|
||||
{{activity.label}}
|
||||
</p>
|
||||
<p mat-line>
|
||||
{{activity.timestamp | date:'shortDate'}}
|
||||
</p>
|
||||
</mat-list-item>
|
||||
</mat-nav-list>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="row" style="margin-top: 30px">
|
||||
<div class="col"></div>
|
||||
<div class="col-auto">
|
||||
<h3 *ngIf="!this.isAuthenticated()">{{ 'HOMEPAGE.OPEN-DMPS.STATS' | translate }}</h3>
|
||||
<h3 *ngIf="this.isAuthenticated()">{{ 'HOMEPAGE.MY-DMPS.STATS' | translate }}</h3>
|
||||
</div>
|
||||
<div class="col"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="margin-top: 30px">
|
||||
<div class="col"></div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
|
||||
<app-figurecard title={{dashboardStatisticsData.totalDataManagementPlanCount}} headerIcon="mode_edit" [category]="this.isAuthenticated() ? 'DASHBOARD.MY-DMPS' : 'DASHBOARD.DMPS' " routelLink='/dmps' buttonRedirectLink="/dmps/new" buttonTitle="Create New DMP" footerIcon="open_in_new" linearColor="linear-gradient(60deg, #ef5350, #e53935)" boxShadow="0 4px 20px 0px rgba(0, 0, 0, 0.14), 0 7px 10px -5px rgba(244, 67, 54, 0.4)">
|
||||
</app-figurecard>
|
||||
<mat-card *ngIf="this.isAuthenticated()" class="example-card">
|
||||
<mat-card-header>
|
||||
<mat-card-title>
|
||||
{{'RECENT-ACTIVITY.MY-TITLE-DMP' | translate}}
|
||||
</mat-card-title>
|
||||
</mat-card-header>
|
||||
<mat-card-content>
|
||||
<mat-nav-list *ngIf="dmpActivities!=null">
|
||||
<mat-list-item (click)="redirect(activity.id,RecentActivityTypes.DMP)" *ngFor="let activity of dmpActivities">
|
||||
<p mat-line>
|
||||
{{activity.label}}
|
||||
</p>
|
||||
<p mat-line>
|
||||
{{activity.timestamp | date:'shortDate'}}
|
||||
</p>
|
||||
</mat-list-item>
|
||||
</mat-nav-list>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 ">
|
||||
<app-figurecard title={{dashboardStatisticsData.totalProjectCount}} headerIcon="list" [category]="this.isAuthenticated() ? 'DASHBOARD.MY-PROJECTS' : 'DASHBOARD.PROJECTS' " routelLink='/projects' buttonRedirectLink="/projects/new" buttonTitle="Create New Project" footerIcon="open_in_new" linearColor="linear-gradient(60deg, #ffa726, #fb8c00)" boxShadow="0 4px 20px 0 rgba(0, 0, 0, 0.14), 0 7px 10px -5px rgba(255, 152, 0, 0.4)">
|
||||
</app-figurecard>
|
||||
<mat-card *ngIf="this.isAuthenticated()" class="example-card">
|
||||
<mat-card-header>
|
||||
<mat-card-title>
|
||||
{{'RECENT-ACTIVITY.MY-TITLE-PROJECT' | translate}}
|
||||
</mat-card-title>
|
||||
</mat-card-header>
|
||||
<mat-card-content>
|
||||
<mat-nav-list *ngIf="projectActivities!=null">
|
||||
<mat-list-item (click)="redirect(activity.id,RecentActivityTypes.PROJECT)" *ngFor="let activity of projectActivities">
|
||||
<p mat-line>
|
||||
{{activity.label}}
|
||||
</p>
|
||||
<p mat-line>
|
||||
{{activity.timestamp | date:'shortDate'}}
|
||||
</p>
|
||||
</mat-list-item>
|
||||
</mat-nav-list>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
|
||||
<app-figurecard title={{dashboardStatisticsData.totalDataSetCount}} headerIcon="subject" [category]="this.isAuthenticated() ? 'DASHBOARD.MY-DATASETS' : 'DASHBOARD.DATASETS'" routelLink='/datasets' buttonRedirectLink="/datasets/new" buttonTitle="Create New Dataset" footerIcon="open_in_new" linearColor="linear-gradient(60deg, #26c6da, #00acc1)" boxShadow="0 4px 20px 0px rgba(0, 0, 0, 0.14), 0 7px 10px -5px rgba(0, 188, 212, 0.4)">
|
||||
</app-figurecard>
|
||||
<mat-card *ngIf="this.isAuthenticated()" class="example-card">
|
||||
<mat-card-header>
|
||||
<mat-card-title>
|
||||
{{'RECENT-ACTIVITY.MY-TITLE-DATASET' | translate}}
|
||||
</mat-card-title>
|
||||
</mat-card-header>
|
||||
<mat-card-content>
|
||||
<mat-nav-list *ngIf="datasetActivities!=null">
|
||||
<mat-list-item (click)="redirect(activity.id,RecentActivityTypes.DATASET)" *ngFor="let activity of datasetActivities">
|
||||
<p mat-line>
|
||||
{{activity.label}}
|
||||
</p>
|
||||
<p mat-line>
|
||||
{{activity.timestamp | date:'shortDate'}}
|
||||
</p>
|
||||
</mat-list-item>
|
||||
</mat-nav-list>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</div>
|
||||
<div class="col"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,49 +1,56 @@
|
||||
.full-width {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.input-table {
|
||||
table-layout: fixed;
|
||||
}
|
||||
.project-editor {
|
||||
|
||||
.logo-table {
|
||||
table-layout: fixed;
|
||||
display: inline-block;
|
||||
td {
|
||||
padding: 3px;
|
||||
.project-editor-header-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.table-card .mat-grid-tile {
|
||||
background: rgba(0, 0, 0, 0.32);
|
||||
}
|
||||
|
||||
.project-editor {
|
||||
.fill-space {
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
.mat-card {
|
||||
margin: 16px 0;
|
||||
}
|
||||
p {
|
||||
margin: 16px;
|
||||
}
|
||||
.left-button {
|
||||
float: left;
|
||||
}
|
||||
.right-button {
|
||||
float: right;
|
||||
}
|
||||
.description-area {
|
||||
height: 100px;
|
||||
.logo-table {
|
||||
table-layout: fixed;
|
||||
display: inline-block;
|
||||
|
||||
td {
|
||||
padding: 3px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
h3{
|
||||
margin-top: 0px;
|
||||
}
|
||||
// .table-card .mat-grid-tile {
|
||||
// background: rgba(0, 0, 0, 0.32);
|
||||
// }
|
||||
|
||||
// .project-editor {
|
||||
// .fill-space {
|
||||
// flex: 1 1 auto;
|
||||
// }
|
||||
|
||||
// .mat-card {
|
||||
// margin: 16px 0;
|
||||
// }
|
||||
|
||||
// p {
|
||||
// margin: 16px;
|
||||
// }
|
||||
|
||||
// .left-button {
|
||||
// float: left;
|
||||
// }
|
||||
|
||||
.hidden {
|
||||
display: none !important;
|
||||
}
|
||||
// .right-button {
|
||||
// float: right;
|
||||
// }
|
||||
|
||||
// .description-area {
|
||||
// height: 100px;
|
||||
// }
|
||||
// }
|
||||
|
||||
// h3 {
|
||||
// margin-top: 0px;
|
||||
// }
|
||||
|
||||
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
@ -1,23 +1,27 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { BaseService } from '../../core/common/base/base.service';
|
||||
import { LanguageService } from '../language/language.service';
|
||||
|
||||
@Injectable()
|
||||
export class LanguageResolverService {
|
||||
export class LanguageResolverService extends BaseService {
|
||||
|
||||
private languageData = {};
|
||||
|
||||
constructor(private language: LanguageService) {
|
||||
super();
|
||||
if (Object.keys(this.languageData).length === 0) {
|
||||
this.language.getLang().subscribe(result => {
|
||||
result.forEach(item => {
|
||||
this.languageData[item.key] = item.languageKey;
|
||||
this.language.getLang()
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(result => {
|
||||
result.forEach(item => {
|
||||
this.languageData[item.key] = item.languageKey;
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public getBy(key: string): string {
|
||||
return this.languageData[key];
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,10 @@
|
||||
.facet-option-item {
|
||||
|
||||
height: auto !important;
|
||||
min-height: 48px;
|
||||
padding: 0.5em;
|
||||
|
||||
.mat-list-item-content {
|
||||
min-height: inherit;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,9 @@
|
||||
.facet-search-component {
|
||||
.mat-form-field {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.tags-chips {
|
||||
padding: 0px;
|
||||
}
|
||||
}
|
@ -1,32 +1,31 @@
|
||||
import { JsonSerializer } from '../../../utilities/JsonSerializer';
|
||||
import { UserInvitationCriteria } from '../../../models/criteria/invitation/UserInvitationCriteria';
|
||||
import { RequestItem } from '../../../models/criteria/RequestItem';
|
||||
import { Invitation } from '../../../models/invitation/Invitation';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { BaseComponent } from '../../../core/common/base/base.component';
|
||||
import { InvitationService } from '../../../services/invitation/invitation.service';
|
||||
import { User } from '../../../models/invitation/User';
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { Params, ActivatedRoute, Router } from '@angular/router';
|
||||
import { MAT_DIALOG_DATA } from '@angular/material';
|
||||
|
||||
@Component({
|
||||
selector: 'app-invitation-accepted-component',
|
||||
templateUrl: 'invitation-accepted.component.html',
|
||||
|
||||
})
|
||||
export class InvitationAcceptedComponent implements OnInit {
|
||||
export class InvitationAcceptedComponent extends BaseComponent implements OnInit {
|
||||
constructor(
|
||||
private invitationService: InvitationService,
|
||||
private route: ActivatedRoute,
|
||||
public router: Router
|
||||
) { }
|
||||
) { super(); }
|
||||
|
||||
ngOnInit(): void {
|
||||
this.route.params.subscribe(params => {
|
||||
const id = params['id'];
|
||||
this.invitationService.exchange(id).subscribe(result => {
|
||||
this.router.navigate(['dmps/edit/' + result]);
|
||||
this.route.params
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(params => {
|
||||
const id = params['id'];
|
||||
this.invitationService.exchange(id)
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(result => {
|
||||
this.router.navigate(['dmps/edit/' + result]);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -1,64 +1,70 @@
|
||||
import { JsonSerializer } from '../../../utilities/JsonSerializer';
|
||||
import { Component, Inject, OnInit } from '@angular/core';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { BaseComponent } from '../../../core/common/base/base.component';
|
||||
import { UserInvitationCriteria } from '../../../models/criteria/invitation/UserInvitationCriteria';
|
||||
import { RequestItem } from '../../../models/criteria/RequestItem';
|
||||
import { Invitation } from '../../../models/invitation/Invitation';
|
||||
import { InvitationService } from '../../../services/invitation/invitation.service';
|
||||
import { User } from '../../../models/invitation/User';
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { Params, ActivatedRoute, Router } from '@angular/router';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material';
|
||||
import { InvitationService } from '../../../services/invitation/invitation.service';
|
||||
import { JsonSerializer } from '../../../utilities/JsonSerializer';
|
||||
|
||||
@Component({
|
||||
selector: 'app-invitation-component',
|
||||
templateUrl: 'invitation.component.html',
|
||||
selector: 'app-invitation-component',
|
||||
templateUrl: 'invitation.component.html',
|
||||
|
||||
})
|
||||
export class InvitationComponent implements OnInit {
|
||||
export class InvitationComponent extends BaseComponent implements OnInit {
|
||||
|
||||
public formGroup: FormGroup;
|
||||
public formGroup: FormGroup;
|
||||
|
||||
public filteredUsersAsync = false;
|
||||
public filteredUsersAsync = false;
|
||||
|
||||
public filteredUsers: User[];
|
||||
public filteredUsers: User[];
|
||||
|
||||
constructor(
|
||||
public invitationService: InvitationService,
|
||||
public route: ActivatedRoute,
|
||||
public router: Router,
|
||||
public dialogRef: MatDialogRef<InvitationComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any
|
||||
) { }
|
||||
constructor(
|
||||
public invitationService: InvitationService,
|
||||
public route: ActivatedRoute,
|
||||
public router: Router,
|
||||
public dialogRef: MatDialogRef<InvitationComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any
|
||||
) { super(); }
|
||||
|
||||
ngOnInit(): void {
|
||||
const invitation = new Invitation();
|
||||
invitation.dataManagementPlan = this.data.dmpId;
|
||||
this.formGroup = invitation.buildForm();
|
||||
}
|
||||
ngOnInit(): void {
|
||||
const invitation = new Invitation();
|
||||
invitation.dataManagementPlan = this.data.dmpId;
|
||||
this.formGroup = invitation.buildForm();
|
||||
}
|
||||
|
||||
|
||||
send(value: any) {
|
||||
this.invitationService.inviteUsers(this.formGroup.value).subscribe(
|
||||
null, null, () => this.dialogRef.close()
|
||||
);
|
||||
}
|
||||
send(value: any) {
|
||||
this.invitationService.inviteUsers(this.formGroup.value)
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(
|
||||
null, null, () => this.dialogRef.close()
|
||||
);
|
||||
}
|
||||
|
||||
filterUsers(value: string): void {
|
||||
this.filteredUsers = undefined;
|
||||
if (value) {
|
||||
this.filteredUsersAsync = true;
|
||||
const request = new RequestItem<UserInvitationCriteria>();
|
||||
request.criteria = { like: value };
|
||||
this.invitationService.getUsers(request).subscribe(items => {
|
||||
this.filteredUsers = JsonSerializer.fromJSONArray(items, User);
|
||||
if (!this.filteredUsers || this.filteredUsers.length === 0) {
|
||||
const user = new User();
|
||||
user.email = value;
|
||||
user.name = value;
|
||||
this.filteredUsers.push(user);
|
||||
filterUsers(value: string): void {
|
||||
this.filteredUsers = undefined;
|
||||
if (value) {
|
||||
this.filteredUsersAsync = true;
|
||||
const request = new RequestItem<UserInvitationCriteria>();
|
||||
request.criteria = { like: value };
|
||||
this.invitationService.getUsers(request)
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(items => {
|
||||
this.filteredUsers = JsonSerializer.fromJSONArray(items, User);
|
||||
if (!this.filteredUsers || this.filteredUsers.length === 0) {
|
||||
const user = new User();
|
||||
user.email = value;
|
||||
user.name = value;
|
||||
this.filteredUsers.push(user);
|
||||
}
|
||||
this.filteredUsersAsync = false;
|
||||
});
|
||||
}
|
||||
this.filteredUsersAsync = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,22 +1,27 @@
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { Component, Inject } from '@angular/core';
|
||||
import { MAT_SNACK_BAR_DATA } from '@angular/material';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { BaseComponent } from '../../../core/common/base/base.component';
|
||||
@Component({
|
||||
selector: 'app-snack-bar-notification',
|
||||
templateUrl: 'snack-bar-notification.component.html'
|
||||
})
|
||||
|
||||
export class SnackBarNotificationComponent {
|
||||
export class SnackBarNotificationComponent extends BaseComponent {
|
||||
message: string;
|
||||
constructor(@Inject(MAT_SNACK_BAR_DATA) public data: any) {
|
||||
super();
|
||||
this.parseMessage(data.message, data.language);
|
||||
}
|
||||
|
||||
parseMessage(message: any, language: TranslateService): void {
|
||||
if (language) {
|
||||
language.get(message).subscribe((value: string) => {
|
||||
this.message = value;
|
||||
});
|
||||
language.get(message)
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe((value: string) => {
|
||||
this.message = value;
|
||||
});
|
||||
} else { this.message = message; }
|
||||
}
|
||||
}
|
||||
|
@ -1,25 +1,29 @@
|
||||
import { LoginService } from '../../utilties/login-service';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Router, ActivatedRoute, Params } from '@angular/router';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { BaseComponent } from '../../../core/common/base/base.component';
|
||||
import { LoginService } from '../../utilties/login-service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-b2access-login',
|
||||
templateUrl: './b2access-login.component.html',
|
||||
})
|
||||
export class B2AccessLoginComponent implements OnInit {
|
||||
export class B2AccessLoginComponent extends BaseComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
private route: ActivatedRoute,
|
||||
private loginService: LoginService
|
||||
) {
|
||||
|
||||
super();
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.route.queryParams.subscribe((data: any) => {
|
||||
if (!data['code']) { this.loginService.b2AccessGetAuthCode(); } else { this.loginService.b2AccessLogin(data['code']); }
|
||||
});
|
||||
this.route.queryParams
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe((data: any) => {
|
||||
if (!data['code']) { this.loginService.b2AccessGetAuthCode(); } else { this.loginService.b2AccessLogin(data['code']); }
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,25 +1,29 @@
|
||||
import { LoginService } from '../../utilties/login-service';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Router, ActivatedRoute, Params } from '@angular/router';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { BaseComponent } from '../../../core/common/base/base.component';
|
||||
import { LoginService } from '../../utilties/login-service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-linkedin-login',
|
||||
templateUrl: './linkedin-login.component.html',
|
||||
})
|
||||
export class LinkedInLoginComponent implements OnInit {
|
||||
export class LinkedInLoginComponent extends BaseComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
private route: ActivatedRoute,
|
||||
private loginService: LoginService
|
||||
) {
|
||||
|
||||
super();
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.route.queryParams.subscribe((data: any) => {
|
||||
if (!data['code']) { this.loginService.linkedinAuthorize(); } else { this.loginService.linkedInloginUser(data['code']); }
|
||||
});
|
||||
this.route.queryParams
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe((data: any) => {
|
||||
if (!data['code']) { this.loginService.linkedinAuthorize(); } else { this.loginService.linkedInloginUser(data['code']); }
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,52 +1,48 @@
|
||||
<div class="container">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="row col-md-6 col-sm-6 col-md-offset-3 col-sm-offset-3">
|
||||
<div class="card col-md-8 col-md-offset-2">
|
||||
<div class="card-header">
|
||||
<h4>Login</h4>
|
||||
<div class="social-btns">
|
||||
<button *ngIf="hasGoogleOauth()" mat-icon-button id="googleSignInButton">
|
||||
<i class="fa fa-google-plus"></i>
|
||||
</button>
|
||||
<button *ngIf="hasLinkedInOauth()" mat-icon-button>
|
||||
<i class="fa fa-linkedin" (click)="linkedInLogin()"></i>
|
||||
</button>
|
||||
<button *ngIf="hasFacebookOauth()" mat-icon-button (click)="facebookLogin()">
|
||||
<i class="fa fa-facebook-square"></i>
|
||||
</button>
|
||||
<button *ngIf="hasTwitterOauth()" mat-icon-button (click)="twitterLogin()">
|
||||
<i class="fa fa-twitter"></i>
|
||||
</button>
|
||||
</div>
|
||||
<button *ngIf="hasB2AccessOauth()" class="b2access-button" mat-icon-button (click)="b2AccessLogin()">
|
||||
<span class="iconmedium"></span>
|
||||
<span></span>
|
||||
</button>
|
||||
</div>
|
||||
<div *ngIf="hasNativeLogin()">
|
||||
<!-- <p class="tip">Or Be Classical</p> -->
|
||||
<div class="card-form">
|
||||
<div class="form-row">
|
||||
<i class="material-icons">email</i>
|
||||
<mat-form-field color="accent">
|
||||
<input type="text" [(ngModel)]="credential.username" matInput placeholder="Email address" />
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<i class="material-icons">lock_outline</i>
|
||||
<mat-form-field color="accent">
|
||||
<input type="password" [(ngModel)]="credential.secret" matInput placeholder="Password" />
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button mat-button (click)="nativeLogin()">LOGIN</button>
|
||||
</div>
|
||||
</div>
|
||||
<p>You dont need to have a registered account for OpenDMP</p>
|
||||
<div class="row">
|
||||
<div class="col"></div>
|
||||
<div class="card col-auto">
|
||||
<div class="card-header">
|
||||
<h4>Login</h4>
|
||||
<div class="social-btns">
|
||||
<button *ngIf="hasGoogleOauth()" mat-icon-button id="googleSignInButton">
|
||||
<i class="fa fa-google-plus"></i>
|
||||
</button>
|
||||
<button *ngIf="hasLinkedInOauth()" mat-icon-button>
|
||||
<i class="fa fa-linkedin" (click)="linkedInLogin()"></i>
|
||||
</button>
|
||||
<button *ngIf="hasFacebookOauth()" mat-icon-button (click)="facebookLogin()">
|
||||
<i class="fa fa-facebook-square"></i>
|
||||
</button>
|
||||
<button *ngIf="hasTwitterOauth()" mat-icon-button (click)="twitterLogin()">
|
||||
<i class="fa fa-twitter"></i>
|
||||
</button>
|
||||
</div>
|
||||
<button *ngIf="hasB2AccessOauth()" class="b2access-button" mat-icon-button (click)="b2AccessLogin()">
|
||||
<span class="iconmedium"></span>
|
||||
<span></span>
|
||||
</button>
|
||||
</div>
|
||||
<div *ngIf="hasNativeLogin()">
|
||||
<!-- <p class="tip">Or Be Classical</p> -->
|
||||
<div class="card-form">
|
||||
<div class="form-row">
|
||||
<i class="material-icons">email</i>
|
||||
<mat-form-field color="accent">
|
||||
<input type="text" [(ngModel)]="credential.username" matInput placeholder="Email address" />
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<i class="material-icons">lock_outline</i>
|
||||
<mat-form-field color="accent">
|
||||
<input type="password" [(ngModel)]="credential.secret" matInput placeholder="Password" />
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button mat-button (click)="nativeLogin()">LOGIN</button>
|
||||
</div>
|
||||
</div>
|
||||
<p>You dont need to have a registered account for OpenDMP</p>
|
||||
</div>
|
||||
<div class="col"></div>
|
||||
</div>
|
||||
|
@ -1,23 +1,27 @@
|
||||
import { LoginService } from '../../utilties/login-service';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { BaseComponent } from '../../../core/common/base/base.component';
|
||||
import { LoginService } from '../../utilties/login-service';
|
||||
@Component({
|
||||
selector: 'app-twitter-login',
|
||||
templateUrl: './twitter-login.component.html',
|
||||
})
|
||||
export class TwitterLoginComponent implements OnInit {
|
||||
export class TwitterLoginComponent extends BaseComponent implements OnInit {
|
||||
constructor(
|
||||
private router: Router,
|
||||
private route: ActivatedRoute,
|
||||
private loginService: LoginService
|
||||
) {
|
||||
|
||||
super();
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.route.queryParams.subscribe((data: any) => {
|
||||
if (!data['oauth_token'] && !data['oauth_verifier']) { this.loginService.twitterAuthorize(); } else { this.loginService.twitterLogin(data['oauth_token'], data['oauth_verifier']); }
|
||||
});
|
||||
this.route.queryParams
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe((data: any) => {
|
||||
if (!data['oauth_token'] && !data['oauth_verifier']) { this.loginService.twitterAuthorize(); } else { this.loginService.twitterLogin(data['oauth_token'], data['oauth_verifier']); }
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,10 +1,11 @@
|
||||
* {
|
||||
|
||||
&:active,
|
||||
:focus {
|
||||
outline: none !important;
|
||||
outline: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
label {
|
||||
}
|
||||
|
||||
label {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,140 @@
|
||||
@import '../node_modules/@angular/material/theming';
|
||||
|
||||
$app-blue-theme-primary-palette: (
|
||||
50: #e8eaf6,
|
||||
100: #c5cae9,
|
||||
200: #9fa8da,
|
||||
300: #7986cb,
|
||||
400: #5c6bc0,
|
||||
500: #3f51b5,
|
||||
600: #3949ab,
|
||||
700: #303f9f,
|
||||
800: #283593,
|
||||
900: #1a237e,
|
||||
A100: #8c9eff,
|
||||
A200: #536dfe,
|
||||
A400: #3d5afe,
|
||||
A700: #304ffe,
|
||||
contrast: (
|
||||
50: $black-87-opacity,
|
||||
100: $black-87-opacity,
|
||||
200: $black-87-opacity,
|
||||
300: white,
|
||||
400: white,
|
||||
500: $white-87-opacity,
|
||||
600: $white-87-opacity,
|
||||
700: $white-87-opacity,
|
||||
800: $white-87-opacity,
|
||||
900: $white-87-opacity,
|
||||
A100: $black-87-opacity,
|
||||
A200: white,
|
||||
A400: white,
|
||||
A700: $white-87-opacity,
|
||||
),
|
||||
);
|
||||
|
||||
$app-blue-theme-accent-palette: (
|
||||
50: #fce4ec,
|
||||
100: #f8bbd0,
|
||||
200: #f48fb1,
|
||||
300: #f06292,
|
||||
400: #ec407a,
|
||||
500: #e91e63,
|
||||
600: #d81b60,
|
||||
700: #c2185b,
|
||||
800: #ad1457,
|
||||
900: #880e4f,
|
||||
A100: #ff80ab,
|
||||
A200: #ff4081,
|
||||
A400: #f50057,
|
||||
A700: #c51162,
|
||||
contrast: (
|
||||
50: $black-87-opacity,
|
||||
100: $black-87-opacity,
|
||||
200: $black-87-opacity,
|
||||
300: $black-87-opacity,
|
||||
400: $black-87-opacity,
|
||||
500: white,
|
||||
600: white,
|
||||
700: $white-87-opacity,
|
||||
800: $white-87-opacity,
|
||||
900: $white-87-opacity,
|
||||
A100: $black-87-opacity,
|
||||
A200: white,
|
||||
A400: white,
|
||||
A700: white,
|
||||
)
|
||||
);
|
||||
|
||||
$app-blue-theme-primary: mat-palette($app-blue-theme-primary-palette);
|
||||
$app-blue-theme-accent: mat-palette($app-blue-theme-accent-palette, A200, A100, A400);
|
||||
$app-blue-theme-warn: mat-palette($mat-red);
|
||||
|
||||
$app-blue-theme-background: (
|
||||
status-bar: map_get($mat-grey, 300),
|
||||
app-bar: map_get($mat-grey, 100),
|
||||
background: map_get($mat-grey, 50),
|
||||
hover: rgba(black, 0.04),
|
||||
card: white,
|
||||
dialog: white,
|
||||
disabled-button: rgba(black, 0.12),
|
||||
raised-button: white,
|
||||
focused-button: $dark-focused,
|
||||
selected-button: map_get($mat-grey, 300),
|
||||
selected-disabled-button: map_get($mat-grey, 400),
|
||||
disabled-button-toggle: map_get($mat-grey, 200),
|
||||
unselected-chip: map_get($mat-grey, 300),
|
||||
disabled-list-option: map_get($mat-grey, 200),
|
||||
);
|
||||
|
||||
$app-blue-theme-foreground: (
|
||||
base: black,
|
||||
divider: $dark-dividers,
|
||||
dividers: $dark-dividers,
|
||||
disabled: $dark-disabled-text,
|
||||
disabled-button: rgba(black, 0.26),
|
||||
disabled-text: $dark-disabled-text,
|
||||
hint-text: $dark-disabled-text,
|
||||
secondary-text: $dark-secondary-text,
|
||||
icon: rgba(black, 0.54),
|
||||
icons: rgba(black, 0.54),
|
||||
text: rgba(black, 0.87),
|
||||
slider-min: rgba(black, 0.87),
|
||||
slider-off: rgba(black, 0.26),
|
||||
slider-off-active: rgba(black, 0.38),
|
||||
);
|
||||
|
||||
$custom-theme: (
|
||||
primary: $app-blue-theme-primary,
|
||||
accent: $app-blue-theme-accent,
|
||||
warn: $app-blue-theme-warn,
|
||||
is-dark: false,
|
||||
foreground: $app-blue-theme-foreground,
|
||||
background: $app-blue-theme-background,
|
||||
);
|
||||
|
||||
$custom-typography: mat-typography-config(
|
||||
$font-family: 'Lato, regular',
|
||||
$headline: mat-typography-level(32px, 48px, 700),
|
||||
$body-1: mat-typography-level(16px, 24px, 500)
|
||||
);
|
||||
|
||||
.blue-theme {
|
||||
@include mat-core();
|
||||
|
||||
@include angular-material-theme($custom-theme);
|
||||
|
||||
// Override typography CSS classes (e.g., mat-h1, mat-display-1, mat-typography, etc.).
|
||||
@include mat-base-typography($custom-typography);
|
||||
|
||||
// Override typography for a specific Angular Material components.
|
||||
@include mat-checkbox-typography($custom-typography);
|
||||
|
||||
// Override typography for all Angular Material, including mat-base-typography and all components.
|
||||
@include angular-material-typography($custom-typography);
|
||||
//If you're using Material's theming, you can also pass in your typography config to the mat-core mixin:
|
||||
|
||||
// Override the typography in the core CSS.
|
||||
@include mat-core($custom-typography);
|
||||
|
||||
}
|
@ -1 +0,0 @@
|
||||
goodbye world
|
@ -1,29 +0,0 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<title>Data Management Plans Creator</title>
|
||||
<base href="/">
|
||||
<!-- Compiled and minified CSS -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
|
||||
|
||||
<!-- Compiled and minified JavaScript -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<nav>
|
||||
<div class="nav-wrapper blue darken-3">
|
||||
<a href="http://opendmp.eu" class="brand-logo" style="margin-top: 20px;">
|
||||
<img src="/material/OpenDMP.png" alt="openDMP">
|
||||
</a>
|
||||
helllooooooooooooooooo
|
||||
</div>
|
||||
</nav>
|
||||
</body>
|
||||
|
||||
</html>
|
Binary file not shown.
Before Width: | Height: | Size: 3.2 KiB |
@ -1,19 +1,13 @@
|
||||
{
|
||||
"compileOnSave": false,
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist/out-tsc",
|
||||
"sourceMap": true,
|
||||
"declaration": false,
|
||||
"moduleResolution": "node",
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true,
|
||||
"target": "es5",
|
||||
"typeRoots": [
|
||||
"node_modules/@types"
|
||||
],
|
||||
"lib": [
|
||||
"es2017",
|
||||
"dom"
|
||||
]
|
||||
}
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"sourceMap": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true,
|
||||
"lib": ["es2017", "dom"],
|
||||
"noImplicitAny": false,
|
||||
"suppressImplicitAnyIndexErrors": true
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue