no message

This commit is contained in:
Ioannis Kalyvas 2018-07-24 12:04:12 +03:00
parent 518a2ffd3c
commit 14f9be46f0
17 changed files with 266 additions and 498 deletions

4
.gitignore vendored
View File

@ -27,3 +27,7 @@ dmp-backend/data/target/
dmp-backend/queryable/target/
dmp-backend/elastic/target/
dmp-backend/queryengine/target/
*.tar
*.gz
final/
temp/

View File

@ -1,11 +0,0 @@
C:\Users\ikalyvas\Documents\OpenAIRE-EUDAT-DMP-service-pilot\dmp-backend\logging\src\main\java\eu\eudat\core\models\exception\ApiExceptionLoggingModel.java
C:\Users\ikalyvas\Documents\OpenAIRE-EUDAT-DMP-service-pilot\dmp-backend\logging\src\main\java\types\LoggingOutputType.java
C:\Users\ikalyvas\Documents\OpenAIRE-EUDAT-DMP-service-pilot\dmp-backend\logging\src\main\java\eu\eudat\core\models\AuditModel.java
C:\Users\ikalyvas\Documents\OpenAIRE-EUDAT-DMP-service-pilot\dmp-backend\logging\src\main\java\eu\eudat\core\models\LoggingModel.java
C:\Users\ikalyvas\Documents\OpenAIRE-EUDAT-DMP-service-pilot\dmp-backend\logging\src\main\java\eu\eudat\core\models\simple\SimpleAuditModel.java
C:\Users\ikalyvas\Documents\OpenAIRE-EUDAT-DMP-service-pilot\dmp-backend\logging\src\main\java\eu\eudat\core\logger\common\AbstractBatchLogger.java
C:\Users\ikalyvas\Documents\OpenAIRE-EUDAT-DMP-service-pilot\dmp-backend\logging\src\main\java\eu\eudat\core\models\simple\SimpleLoggingModel.java
C:\Users\ikalyvas\Documents\OpenAIRE-EUDAT-DMP-service-pilot\dmp-backend\logging\src\main\java\eu\eudat\core\logger\remote\http\HttpRemoteLogger.java
C:\Users\ikalyvas\Documents\OpenAIRE-EUDAT-DMP-service-pilot\dmp-backend\logging\src\main\java\eu\eudat\core\logger\Logger.java
C:\Users\ikalyvas\Documents\OpenAIRE-EUDAT-DMP-service-pilot\dmp-backend\logging\src\main\java\eu\eudat\core\models\exception\ExceptionLoggingModel.java
C:\Users\ikalyvas\Documents\OpenAIRE-EUDAT-DMP-service-pilot\dmp-backend\logging\src\main\java\types\LoggingType.java

View File

@ -30,7 +30,7 @@ spring.mail.test-connection=false
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.starttls.enable=true
mail.subject=Invitation to DMP Plan {dmpname}
mail.content=You have been invited to {dmpname} data management plan.Follow the link http://dl043.madgik.di.uoa.gr:8080/invitation/{invitationID} to submit it
mail.content=You have been invited to {dmpname} data management plan.Follow the link http://dl043.madgik.di.uoa.gr/invitation/{invitationID} to submit it
mail.from=citesagrdev@gmail.com
########################FACEBOOK LOGIN Properties#############################
facebook.login.clientId=110586756143149
@ -45,7 +45,7 @@ linkedin.login.redirect_uri=http://localhost:4200/login/linkedin
########################LINKEDIN LOGIN Properties#############################
twitter.login.clientId=HiR4hQH9HNubKC5iKQy0l4mAZ
twitter.login.clientSecret=9KZHgkqUO2QFnELSL14jeUvfUacWX23rqD8OW8X0xoRDXOSfKH
twitter.login.redirect_uri=http://localhost:4200/login/twitter
twitter.login.redirect_uri=http://dl043.madgik.di.uoa.gr/login/twitter
########################Persistence/Hibernate/Batch##############################
spring.profiles.active=devel
########################Persistence/Hibernate/Connection pool####################
@ -55,7 +55,7 @@ autouser.root.username=root
#################################################################################
b2access.externallogin.user_info_url=https://b2access-integration.fz-juelich.de:443/oauth2/userinfo
b2access.externallogin.access_token_url=https://b2access-integration.fz-juelich.de:443/oauth2/token
b2access.externallogin.redirect_uri=http://dmp.eudat.org:4200/api/oauth/authorized/b2access
b2access.externallogin.redirect_uri=http://dl043.madgik.di.uoa.gr/api/oauth/authorized/b2access
b2access.externallogin.clientid=eudatdmptool
b2access.externallogin.clientSecret=A3b*1*92
#################################################################################

View File

@ -1,3 +1,15 @@
.example-container {
background: rgb(250, 248, 248);
}
.fixed {
position: fixed;
top: 0; /* Sets the sticky toolbar to be on top */
z-index: 1000;
width: 100%;
}
.main-container{
margin-top: 64px;
padding-top: 10px;
}

View File

@ -24,7 +24,6 @@ import { AddResearchersComponent } from "../../shared/components/add-researchers
import { ViewContainerRef } from '@angular/core';
import { TdDialogService } from '@covalent/core';
import { AvailableProfilesComponent } from "../../shared/components/available-profiles/available-profiles.component";
import { AutoCompleteChipConfiguration } from "../../shared/components/autocompleteChips/AutoCompleteChipConfiguration";
import { BaseCriteria } from "../../models/criteria/BaseCriteria";
import { DataManagementPlanProfileService } from "../../services/data-management-plan-profile/datamanagement-profile.service";
import { DataManagementPlanProfileListingModel } from "../../models/data-management-plan-profile/DataManagementPlanProfileListingModel";
@ -35,276 +34,271 @@ import { IBreadCrumbComponent } from "../../shared/components/breadcrumb/definit
import { BreadcrumbItem } from "../../shared/components/breadcrumb/definition/breadcrumb-item";
@Component({
selector: 'app-dmp-editor-component',
templateUrl: 'dmp-editor.component.html',
styleUrls: ['./dmp-editor.component.scss'],
encapsulation: ViewEncapsulation.None
selector: 'app-dmp-editor-component',
templateUrl: 'dmp-editor.component.html',
styleUrls: ['./dmp-editor.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class DataManagementPlanEditorComponent implements AfterViewInit, IBreadCrumbComponent {
breadCrumbs: Observable<BreadcrumbItem[]>;
isNew = true;
textCtrl = new FormControl();
dataManagementPlan: DataManagementPlanModel;
formGroup: FormGroup = null;
breadCrumbs: Observable<BreadcrumbItem[]>;
isNew = true;
textCtrl = new FormControl();
dataManagementPlan: DataManagementPlanModel;
formGroup: FormGroup = null;
filteringOrganisationsAsync: boolean = false;
filteringResearchersAsync: boolean = false;
filteredProfilesAsync: boolean = false;
filteredOrganisations: ExternalSourcesItemModel[];
filteredResearchers: ExternalSourcesItemModel[];
filteredProfiles: DatasetProfileModel[];
filteringOrganisationsAsync: boolean = false;
filteringResearchersAsync: boolean = false;
filteredProfilesAsync: boolean = false;
filteredOrganisations: ExternalSourcesItemModel[];
filteredResearchers: ExternalSourcesItemModel[];
filteredProfiles: DatasetProfileModel[];
projectAutoCompleteConfiguration: AutoCompleteConfiguration;
organisationsAutoCompleteConfiguration: AutoCompleteChipConfiguration;
createNewVersion;
associatedUsers: Array<DmpUsersModel>
filteredOptions: Observable<DataManagementPlanProfileListingModel>
projectAutoCompleteConfiguration: AutoCompleteConfiguration;
createNewVersion;
associatedUsers: Array<DmpUsersModel>
filteredOptions: Observable<DataManagementPlanProfileListingModel>
constructor(
private dmpProfileService: DataManagementPlanProfileService,
private dataManagementPlanService: DataManagementPlanService,
private projectService: ProjectService,
private externalSourcesService: ExternalSourcesService,
private route: ActivatedRoute,
public snackBar: MatSnackBar,
public router: Router,
public language: TranslateService,
private _service: DataManagementPlanService,
public dialog: MatDialog,
private _dialogService: TdDialogService,
private _viewContainerRef: ViewContainerRef,
private languageResolverService: LanguageResolverService
) {
this.filteredOptions = dmpProfileService.getAll({ criteria: new DataManagementPlanProfileCriteria() });
}
constructor(
private dmpProfileService: DataManagementPlanProfileService,
private dataManagementPlanService: DataManagementPlanService,
private projectService: ProjectService,
private externalSourcesService: ExternalSourcesService,
private route: ActivatedRoute,
public snackBar: MatSnackBar,
public router: Router,
public language: TranslateService,
private _service: DataManagementPlanService,
public dialog: MatDialog,
private _dialogService: TdDialogService,
private _viewContainerRef: ViewContainerRef,
private languageResolverService: LanguageResolverService
) {
this.filteredOptions = dmpProfileService.getAll({ criteria: new DataManagementPlanProfileCriteria() });
}
ngAfterViewInit() {
this.route.params.subscribe((params: Params) => {
const itemId = params['id'];
ngAfterViewInit() {
this.route.params.subscribe((params: Params) => {
const itemId = params['id'];
let projectRequestItem: RequestItem<ProjectCriteria> = new RequestItem();
projectRequestItem.criteria = new ProjectCriteria();
let organisationRequestItem: RequestItem<BaseCriteria> = new RequestItem();
organisationRequestItem.criteria = new BaseCriteria();
this.projectAutoCompleteConfiguration = new AutoCompleteConfiguration(this.projectService.getWithExternal.bind(this.projectService), projectRequestItem);
this.organisationsAutoCompleteConfiguration = new AutoCompleteChipConfiguration(this.externalSourcesService.searchDMPOrganizations.bind(this.externalSourcesService), organisationRequestItem);
let projectRequestItem: RequestItem<ProjectCriteria> = new RequestItem();
projectRequestItem.criteria = new ProjectCriteria();
let organisationRequestItem: RequestItem<BaseCriteria> = new RequestItem();
organisationRequestItem.criteria = new BaseCriteria();
this.projectAutoCompleteConfiguration = new AutoCompleteConfiguration(this.projectService.getWithExternal.bind(this.projectService), projectRequestItem);
if (itemId != null) {
this.isNew = false;
this.dataManagementPlanService.getSingle(itemId).map(data => data as DataManagementPlanModel)
.subscribe(async data => {
this.dataManagementPlan = JsonSerializer.fromJSONObject(data, DataManagementPlanModel);
this.formGroup = this.dataManagementPlan.buildForm();
if (this.formGroup.get("profile") && this.formGroup.get("profile").value) {
this.textCtrl.patchValue(this.formGroup.get("profile").value);
}
this.breadCrumbs = Observable.of([
{
parentComponentName: "DataManagementPlanListingComponent",
label: 'DMPs',
url: "dmps",
notFoundResolver: [await this.projectService.getSingle(this.dataManagementPlan.project.id).map(x => ({ label: x.label, url: '/projects/edit/' + x.id }) as BreadcrumbItem).toPromise()]
}
]
)
this.associatedUsers = data.associatedUsers;
});
} else {
this.dataManagementPlan = new DataManagementPlanModel();
setTimeout(async () => {
this.formGroup = this.dataManagementPlan.buildForm();
if (this.formGroup.get("profile") && this.formGroup.get("profile").value) {
this.textCtrl.patchValue(this.formGroup.get("profile").value);
}
this.breadCrumbs = Observable.of([
{
parentComponentName: "DataManagementPlanListingComponent",
label: 'DMPs',
url: "dmps",
}
])
});
}
if (itemId != null) {
this.isNew = false;
this.dataManagementPlanService.getSingle(itemId).map(data => data as DataManagementPlanModel)
.subscribe(async data => {
this.dataManagementPlan = JsonSerializer.fromJSONObject(data, DataManagementPlanModel);
this.formGroup = this.dataManagementPlan.buildForm();
if (this.formGroup.get("profile") && this.formGroup.get("profile").value) {
this.textCtrl.patchValue(this.formGroup.get("profile").value);
}
this.breadCrumbs = Observable.of([
{
parentComponentName: "DataManagementPlanListingComponent",
label: 'DMPs',
url: "dmps",
notFoundResolver: [await this.projectService.getSingle(this.dataManagementPlan.project.id).map(x => ({ label: x.label, url: '/projects/edit/' + x.id }) as BreadcrumbItem).toPromise()]
}
]
)
this.associatedUsers = data.associatedUsers;
});
} else {
this.dataManagementPlan = new DataManagementPlanModel();
setTimeout(async () => {
this.formGroup = this.dataManagementPlan.buildForm();
if (this.formGroup.get("profile") && this.formGroup.get("profile").value) {
this.textCtrl.patchValue(this.formGroup.get("profile").value);
}
this.breadCrumbs = Observable.of([
{
parentComponentName: "DataManagementPlanListingComponent",
label: 'DMPs',
url: "dmps",
}
])
});
}
});
this.route
.queryParams
.subscribe(params => {
this.createNewVersion = params["clone"];
});
}
});
this.route
.queryParams
.subscribe(params => {
this.createNewVersion = params["clone"];
});
}
formSubmit(): void {
//this.touchAllFormFields(this.formGroup);
if (!this.isFormValid()) { return; }
this.onSubmit();
}
formSubmit(): void {
//this.touchAllFormFields(this.formGroup);
if (!this.isFormValid()) { return; }
this.onSubmit();
}
public isFormValid() {
return this.formGroup.valid;
}
public isFormValid() {
return this.formGroup.valid;
}
onSubmit(): void {
this.dataManagementPlanService.createDataManagementPlan(this.formGroup.value).subscribe(
complete => this.onCallbackSuccess(),
error => this.onCallbackError(error)
)
}
onSubmit(): void {
this.dataManagementPlanService.createDataManagementPlan(this.formGroup.value).subscribe(
complete => this.onCallbackSuccess(),
error => this.onCallbackError(error)
)
}
onCallbackSuccess(): void {
this.snackBar.openFromComponent(SnackBarNotificationComponent, {
data: { message: this.isNew ? 'GENERAL.SNACK-BAR.SUCCESSFUL-CREATION' : 'GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE', language: this.language },
duration: 3000,
})
this.router.navigate(['/dmps']);
}
onCallbackSuccess(): void {
this.snackBar.openFromComponent(SnackBarNotificationComponent, {
data: { message: this.isNew ? 'GENERAL.SNACK-BAR.SUCCESSFUL-CREATION' : 'GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE', language: this.language },
duration: 3000,
})
this.router.navigate(['/dmps']);
}
onCallbackError(error: any) {
this.setErrorModel(error.error);
//this.validateAllFormFields(this.formGroup);
}
onCallbackError(error: any) {
this.setErrorModel(error.error);
//this.validateAllFormFields(this.formGroup);
}
public setErrorModel(errorModel: BaseErrorModel) {
Object.keys(errorModel).forEach(item => {
(<any>this.dataManagementPlan.errorModel)[item] = (<any>errorModel)[item];
})
}
public setErrorModel(errorModel: BaseErrorModel) {
Object.keys(errorModel).forEach(item => {
(<any>this.dataManagementPlan.errorModel)[item] = (<any>errorModel)[item];
})
}
public cancel(): void {
this.router.navigate(['/dmps']);
}
public cancel(): void {
this.router.navigate(['/dmps']);
}
public invite(): void {
this.router.navigate(['/invite/' + this.dataManagementPlan.id]);
}
public invite(): void {
this.router.navigate(['/invite/' + this.dataManagementPlan.id]);
}
filterOrganisations(value: string): void {
filterOrganisations(value: string): void {
this.filteredOrganisations = undefined;
if (value) {
this.filteringOrganisationsAsync = true;
this.filteredOrganisations = undefined;
if (value) {
this.filteringOrganisationsAsync = true;
this.externalSourcesService.searchDMPOrganizations(value).subscribe(items => {
this.filteredOrganisations = items;
this.filteringOrganisationsAsync = false;
this.externalSourcesService.searchDMPOrganizations(value).subscribe(items => {
this.filteredOrganisations = items;
this.filteringOrganisationsAsync = false;
// this.filteredOrganisations = items.filter((filteredObj: any) => {
// return this.objectsModel ? this.objectsModel.indexOf(filteredObj) < 0 : true;
// });
// this.filteredOrganisations = items.filter((filteredObj: any) => {
// return this.objectsModel ? this.objectsModel.indexOf(filteredObj) < 0 : true;
// });
});
});
}
}
}
}
filterResearchers(value: string): void {
filterResearchers(value: string): void {
this.filteredResearchers = undefined;
if (value) {
this.filteringResearchersAsync = true;
this.filteredResearchers = undefined;
if (value) {
this.filteringResearchersAsync = true;
this.externalSourcesService.searchDMPResearchers({ criteria: { name: value, like: null } }).subscribe(items => {
this.filteredResearchers = items;
this.filteringResearchersAsync = false;
this.externalSourcesService.searchDMPResearchers({ criteria: { name: value, like: null } }).subscribe(items => {
this.filteredResearchers = items;
this.filteringResearchersAsync = false;
});
}
}
});
}
}
filterProfiles(value: string): void {
filterProfiles(value: string): void {
this.filteredProfiles = undefined;
if (value) {
this.filteredProfilesAsync = true;
this.filteredProfiles = undefined;
if (value) {
this.filteredProfilesAsync = true;
const request = new RequestItem<DatasetProfileCriteria>();
let criteria = new DatasetProfileCriteria();
criteria.like = value;
request.criteria = criteria;
this._service.searchDMPProfiles(request).subscribe(items => {
this.filteredProfiles = items;
this.filteredProfilesAsync = false;
});
}
}
const request = new RequestItem<DatasetProfileCriteria>();
let criteria = new DatasetProfileCriteria();
criteria.like = value;
request.criteria = criteria;
this._service.searchDMPProfiles(request).subscribe(items => {
this.filteredProfiles = items;
this.filteredProfilesAsync = false;
});
}
}
addResearcher(rowId: any, rowName: any) {
let dialogRef = this.dialog.open(AddResearchersComponent, {
height: '255px',
width: '700px',
data: {
dmpId: rowId,
dmpName: rowName
}
});
addResearcher(rowId: any, rowName: any) {
let dialogRef = this.dialog.open(AddResearchersComponent, {
height: '255px',
width: '700px',
data: {
dmpId: rowId,
dmpName: rowName
}
});
}
}
availableProfiles() {
let dialogRef = this.dialog.open(AvailableProfilesComponent, {
height: '355px',
width: '700px',
data: {
availableProfiles() {
let dialogRef = this.dialog.open(AvailableProfilesComponent, {
height: '355px',
width: '700px',
data: {
profiles: this.formGroup.get("profiles")
}
});
}
});
dialogRef.afterClosed().subscribe(result => {
this.formGroup.get("profiles").setValue(result);
});
return false;
}
return false;
}
openConfirm(dmpLabel, id): void {
this._dialogService.openConfirm({
message: 'Are you sure you want to delete the "' + dmpLabel + '"',
disableClose: true || false, // defaults to false
viewContainerRef: this._viewContainerRef, //OPTIONAL
title: 'Confirm', //OPTIONAL, hides if not provided
cancelButton: 'No', //OPTIONAL, defaults to 'CANCEL'
acceptButton: 'Yes' //OPTIONAL, defaults to 'ACCEPT'
// width: '500px', //OPTIONAL, defaults to 400px
}).afterClosed().subscribe((accept: boolean) => {
if (accept) {
this.dataManagementPlanService.delete(id).subscribe(() => {
this.router.navigate(['/dmps'])
});
} else {
// DO SOMETHING ELSE
}
});
}
openConfirm(dmpLabel, id): void {
this._dialogService.openConfirm({
message: 'Are you sure you want to delete the "' + dmpLabel + '"',
disableClose: true || false, // defaults to false
viewContainerRef: this._viewContainerRef, //OPTIONAL
title: 'Confirm', //OPTIONAL, hides if not provided
cancelButton: 'No', //OPTIONAL, defaults to 'CANCEL'
acceptButton: 'Yes' //OPTIONAL, defaults to 'ACCEPT'
// width: '500px', //OPTIONAL, defaults to 400px
}).afterClosed().subscribe((accept: boolean) => {
if (accept) {
this.dataManagementPlanService.delete(id).subscribe(() => {
this.router.navigate(['/dmps'])
});
} else {
// DO SOMETHING ELSE
}
});
}
selectOption(option: any) {
this.dataManagementPlan.definition = null;
this.formGroup.get("profile").patchValue(option, { emitEvent: false })
this.dmpProfileService.getSingle(option.id).subscribe(result => {
this.dataManagementPlan.definition = result.definition;
})
}
selectOption(option: any) {
this.dataManagementPlan.definition = null;
this.formGroup.get("profile").patchValue(option, { emitEvent: false })
this.dmpProfileService.getSingle(option.id).subscribe(result => {
this.dataManagementPlan.definition = result.definition;
})
}
displayWith(item: any) {
if (!item) return null;
return item["label"];
}
displayWith(item: any) {
if (!item) return null;
return item["label"];
}
redirectToProject() {
this.router.navigate(["projects/edit/" + this.dataManagementPlan.project.id])
}
redirectToProject() {
this.router.navigate(["projects/edit/" + this.dataManagementPlan.project.id])
}
redirectToDatasets() {
this.router.navigate(["datasets/dmp/" + this.dataManagementPlan.id])
}
redirectToDatasets() {
this.router.navigate(["datasets/dmp/" + this.dataManagementPlan.id])
}
newVersion(id: String, label: String) {
this.router.navigate(['/dmps/new_version/' + id, { dmpLabel: label }]);
}
newVersion(id: String, label: String) {
this.router.navigate(['/dmps/new_version/' + id, { dmpLabel: label }]);
}
clone(id: String) {
this.router.navigate(['/dmps/clone/' + id]);
}
clone(id: String) {
this.router.navigate(['/dmps/clone/' + id]);
}
}

View File

@ -19,7 +19,6 @@ import { TranslateService } from "@ngx-translate/core";
import { DataSource } from "@angular/cdk/table";
import { Observable } from "rxjs/Observable";
import { FormGroup } from '@angular/forms';
import { AutoCompleteChipConfiguration } from "../../../shared/components/autocompleteChips/AutoCompleteChipConfiguration";
import { BaseCriteria } from '../../../models/criteria/BaseCriteria';
@ -43,7 +42,6 @@ export class DataManagementPlanWizardEditorComponent implements AfterViewInit {
filteredProfiles: DatasetProfileModel[];
projectAutoCompleteConfiguration: AutoCompleteConfiguration;
organisationsAutoCompleteConfiguration: AutoCompleteChipConfiguration;
createNewVersion;
associatedUsers: Array<DmpUsersModel>
labelDisabled: boolean = false;
@ -69,7 +67,6 @@ export class DataManagementPlanWizardEditorComponent implements AfterViewInit {
let organisationRequestItem: RequestItem<BaseCriteria> = new RequestItem();
organisationRequestItem.criteria = new BaseCriteria();
this.organisationsAutoCompleteConfiguration = new AutoCompleteChipConfiguration(this.externalSourcesService.searchDMPOrganizations.bind(this.externalSourcesService), organisationRequestItem);
this.route.data.subscribe(value => {
if (value.clone == false && this.formGroup.get("label").value) {

View File

@ -8,25 +8,22 @@
</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.totalProjectCount}} headerIcon="list" [category]="this.isAuthenticated() ? 'My Projects' : 'Projects'"
[hasFootContent]="this.isAuthenticated()" [footContent]="this.isAuthenticated() ? 'Open My Projects' : 'Open Projects'"
<app-figurecard title={{dashboardStatisticsData.totalDataManagementPlanCount}} headerIcon="mode_edit" [category]="this.isAuthenticated() ? 'DASHBOARD.MY-DMPS' : 'DASHBOARD.DMPS' "
routelLink='/dmps' 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>
</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' 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>
</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() ? 'My DMPs' : 'DMPs'"
[hasFootContent]="this.isAuthenticated()" [footContent]="this.isAuthenticated() ? 'Open My DMPs' : 'Open DMPs'" routelLink='/dmps'
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>
</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() ? 'My Datasets' : 'Datasets'"
[hasFootContent]="this.isAuthenticated()" [footContent]="this.isAuthenticated() ? 'Open My Datasets' : 'Open Datasets'"
<app-figurecard title={{dashboardStatisticsData.totalDataSetCount}} headerIcon="subject" [category]="this.isAuthenticated() ? 'DASHBOARD.MY-DATASETS' : 'DASHBOARD.DATASETS'"
routelLink='/datasets' 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>
</div>
</div>
<div *ngIf="this.isAuthenticated()" class="row" style="margin-top: 30px">
<div *ngIf="this.isAuthenticated()" class="row">
<div class="col-lg-9 col-md-12 col-sm-12 col-xs-12 col-md-offset-1">
<app-recent-activity></app-recent-activity>
</div>

View File

@ -1,11 +0,0 @@
import { BaseCriteria } from "../../../models/criteria/BaseCriteria";
import { RequestItem } from "../../../models/criteria/RequestItem";
export class AutoCompleteChipConfiguration {
public callback: Function;
public requestItem: RequestItem<any>;
constructor(callback: Function, requestItem: RequestItem<any>) {
this.callback = callback;
this.requestItem = requestItem;
}
}

View File

@ -1,21 +0,0 @@
<mat-form-field>
<mat-chip-list #chipList [required]="required">
<mat-chip *ngFor="let item of selectedItems" (remove)="remove(item)">
{{item.name}}
<mat-icon matChipRemove>cancel</mat-icon>
</mat-chip>
<input matInput [matChipInputFor]="chipList" [matAutocomplete]="auto" [formControl]="control" placeholder="{{placeholder}}"
[required]="required" #chipInput>
</mat-chip-list>
<mat-error *ngIf="control['errors']['required']">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
<mat-progress-spinner matSuffix mode="indeterminate" *ngIf="loading" [diameter]="22"></mat-progress-spinner>
<mat-autocomplete #auto="matAutocomplete" [displayWith]="displayWith.bind(this)" (optionSelected)="this.optionSelected($event)">
<mat-option *ngFor="let item of filteredItems " [value]="item">
<span *ngIf="titleKey">{{item[titleKey]}}</span>
<span *ngIf="subtitleKey">{{item[subtitleKey]}}</span>
</mat-option>
<!-- <mat-option *ngIf="filteredItems.length == 0" value="das">
<span>{{'GENERAL.AUTOCOMPLETE.NO-ITEMS' | translate}}</span>
</mat-option> -->
</mat-autocomplete>
</mat-form-field>

View File

@ -1,30 +0,0 @@
.autocomplete-input {
width: 100%;
}
.autocomplete-progress {
overflow: initial !important;
}
.autocomplete {
mat-form-field {
width: 100%;
padding: 3px;
}
.mat-card {
margin: 16px 0;
}
.left-button {
float: left;
}
}
.input-table {
table-layout: fixed;
}
.full-width {
width: 100%;
}

View File

@ -1,167 +0,0 @@
import { any } from 'codelyzer/util/function';
import { FormControl, FormGroupDirective, NgForm, FormGroup, FormBuilder } from '@angular/forms';
import { Observable } from 'rxjs/Rx';
import { setTimeout } from 'timers';
import { Component, EventEmitter, Input, OnInit, Output, ViewChild, ElementRef } from '@angular/core';
import 'rxjs/add/operator/debounceTime';
import 'rxjs/add/operator/map';
import { AutoCompleteChipConfiguration } from './AutoCompleteChipConfiguration';
import { ErrorStateMatcher, MatInput } from '@angular/material';
@Component({
selector: 'auto-complete-chip',
templateUrl: './autocompleteChips.component.html',
styleUrls: ['./autocompleteChips.component.scss']
})
export class AutocompleteChipComponent implements OnInit {
@Input()
configuration: AutoCompleteChipConfiguration;
@Input()
titleKey: String;
@Input()
subtitleKey: String;
@Input()
delay: number = 700;
@Input()
placeholder: String;
filteredItems: any[];
@Input()
required: boolean;
@Input()
disabled: boolean = false;
@Input()
multiChips: boolean = false;
// @Input() selectedDropdownItem: AutoCompleteItem;
// @Output() selectedDropdownItemChange = new EventEmitter<AutoCompleteItem>();
// @Output()
// output: EventEmitter<AutoCompleteItem> = new EventEmitter<AutoCompleteItem>();
@Input() control: FormControl;
// @Input() createNew = false;
term = new FormControl();
// @Input()
// ClickFunctionCall: Function;
@ViewChild('chipInput') chipInput: MatInput;
loading = false;
hasSelectedItem = false;
selectedItems: any[] = [];
constructor() {
}
ngOnInit() {
const valueChanges = this.term.valueChanges.share();
valueChanges.subscribe(searchTerm => {
if (this.hasSelectedItem) {
this.resetFormControlValue();
} else {
this.loading = true;
}
});
valueChanges
.debounceTime(this.delay)
.distinctUntilChanged()
.switchMap(val => {
if (this.hasSelectedItem || typeof(val) !== "string") {
this.loading = false;
return this.filteredItems = [];
} else if (typeof(val)== "string") {
this.configuration.requestItem.criteria.like = val;
return this.configuration.callback(this.configuration.requestItem).map(result => {
this.filteredItems = (<any[]>result)
this.loading = false;
})
}
}).subscribe()
}
resetFormControlValue() {
this.hasSelectedItem = false;
this.term.setValue(null);
}
// // listingItemToDropDown(item: DropdownListingItem): AutoCompleteItem {
// // return (item as DropdownListingItem).toDropdownList();
// // }
optionSelected(event: any) {
this.hasSelectedItem = true;
this.selectedItems.push(event.option.value)
this.chipInput['nativeElement'].value = '';
this.control.setValue(this.selectedItems, { emitEvent: false });
//this.filteredItems = this.selectedItems;
//this.selectedDropdownItemChange.emit(event.option.value);
//this.form.updateValueAndValidity();
//this.options = [event.option.value];
//this.loading = false;
}
remove(item: any) {
// this.selectedItems.filter(function(selitem){
// return selitem.id != item.id;
// });
const index: number = this.selectedItems.indexOf(item);
if (index !== -1) {
this.selectedItems.splice(index, 1);
}
this.control.setValue(this.selectedItems);
if (this.selectedItems.length == 0) this.hasSelectedItem = false;
}
// inputOnChange(term: string) {
// //this.form.patchValue({ value: null, description: '', text: '' });
// //this.form.updateValueAndValidity();
// this.configuration.criteria.like = term;
// this.configuration.callback(this.configuration.criteria)
// .map((res: any) => this.mapper(res))
// .subscribe(
// (res: AutoCompleteItem[]) => {
// this.options = res;
// },
// null,
// () => { this.loading = false });
// }
displayWith(value: any): String {
if (!value) return '';
if (value.lenght) {
value.forEach(element => {
element['' + this.titleKey];
});
return value;
}
else return value['' + this.titleKey];
}
// displayFn(item: AutoCompleteItem): string {
// return item.text ? item.text : '';
// }
//fieldHasErrors(control: FormControl, form: FormGroupDirective | NgForm): boolean {
// return this.errorStateMatcher(control, form);
// }
}
export class AutoCompleteErrorStateMatcher implements ErrorStateMatcher {
isErrorState(control: FormControl | null, form: FormGroupDirective | NgForm | null): boolean {
const isFormSubmitted = form && form.submitted;
const isControlInvalid = control && control.invalid && (control.dirty || control.touched || isFormSubmitted);
const isFormInvalid = form && form.enabled && form.invalid && (form.dirty || form.touched || isFormSubmitted)
return !!(isControlInvalid || isFormInvalid);
}
}

View File

@ -29,6 +29,7 @@ export class AvailableProfilesComponent implements OnInit {
ngOnInit(): void {
this.formGroup = this.data["profiles"];
this.datasetService.getDatasetProfiles().subscribe(data => {
this.profiles = JsonSerializer.fromJSONArray(data, DatasetProfileModel)
}
@ -46,7 +47,7 @@ export class AvailableProfilesComponent implements OnInit {
selectedElement.label = element.value.label;
this.selectedProfiles.push(selectedElement)
})
this.dialogRef.close(this.selectedProfiles);
this.formGroup.setValue(this.selectedProfiles)
this.dialogRef.close();
}
}

View File

@ -3,7 +3,7 @@
<i class="material-icons">{{ headerIcon }}</i>
</div>
<div class="card-content">
<p class="category">{{ category }}</p>
<p class="category">{{ category | translate }}</p>
<h3 class="title">{{ title }}</h3>
</div>
<div *ngIf="hasFootContent" class="card-footer">

View File

@ -14,7 +14,6 @@ import { ProjectCriteriaComponent } from './components/criteria/projects/project
import { DatasetCriteriaComponent } from './components/criteria/datasets/datasets-criteria.component';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { DataManagementPlanCriteriaComponent } from './components/criteria/data-management-plan/dmp-criteria.component';
import { AutocompleteChipComponent } from '../shared/components/autocompleteChips/autocompleteChips.component';
import { FileUploaderComponent } from '../shared/components/file-uploader/file-uploader.component';
import { UrlListingComponent } from '../shared/components/url-listing/url-listing.component';
import { NgForLimitPipe } from './pipes/ngforlimit/ngforlimit.pipe';
@ -46,7 +45,6 @@ import { BreadcrumbComponent } from './components/breadcrumb/breadcrumb.componen
FigurecardComponent,
BaseCriteriaComponent,
FileUploaderComponent,
AutocompleteChipComponent,
UrlListingComponent,
NgForLimitPipe,
AutoCompleteComponent,
@ -69,8 +67,7 @@ import { BreadcrumbComponent } from './components/breadcrumb/breadcrumb.componen
AutocompleteComponent,
FigurecardComponent,
BaseCriteriaComponent,
FileUploaderComponent,
AutocompleteChipComponent,
FileUploaderComponent,
UrlListingComponent,
NgForLimitPipe,
AutoCompleteComponent,

View File

@ -24,7 +24,7 @@
"NAV-BAR": {
"TITLE": "OpenDMPS",
"PROJECTS": "Projects",
"DMPS": "Plans",
"DMPS": "DMPs",
"DATASETS": "Datasets",
"USERS": "Users",
"DATASETS-ADMIN": "Dataset Profiles",
@ -175,7 +175,6 @@
},
"CRITERIA": {
"FILTERS": "Filters",
"PROJECTS": {
"LIKE": "Search",
"PERIOD-FROM": "Project Start",
@ -259,7 +258,6 @@
"SOURCE": "Source",
"OUTPUT": "Output"
}
},
"ADDRESEARCHERS-EDITOR": {
"TITLE": "Add a Researcher",
@ -296,15 +294,23 @@
},
"HOMEPAGE": {
"OPEN-DMPS": {
"STATS": "OpenDMPS Statistics"
"STATS": "OpenDMPS DashBoard"
},
"MY-DMPS": {
"STATS": "My Statistics"
"STATS": "My DashBoard"
}
},
"ABOUT": {
"TITLE": "-Our Mission-",
"MAIN-CONTENT": "Our goal is to make your research data FAIR, that is findable, accessible,interoperable and re-usable. These principles precede implementation choices and do not necessarily suggest any specific technology, standard, or implementationsolution.",
"CONTRIBUTORS": "Contributors"
},
"DASHBOARD": {
"MY-PROJECTS": "My Projects",
"PROJECTS": "Projects",
"MY-DMPS": "My DMPs",
"DMPS": "DMPs",
"MY-DATASETS": "My Datasets",
"DATASETS": "Datasets"
}
}

View File

@ -1,6 +1,6 @@
export const environment = {
production: true,
Server: 'http://localhost:8080/api/',
Server: 'http://dl043.madgik.di.uoa.gr:8080/api/',
App: 'http://dl043.madgik.di.uoa.gr/',
HelpServiceUrl: 'http://dl043.madgik.di.uoa.gr:5555/'
};