Adds invite shortcut on DMPs and fixes change language bug on ui

This commit is contained in:
apapachristou 2020-07-02 11:25:06 +03:00
parent f5c70fdd60
commit 44d9cf537a
10 changed files with 101 additions and 55 deletions

View File

@ -8,12 +8,10 @@
<div class="col-md-8">
<div class="card" [style.display]="isVisible ? 'block' : 'none'">
<!-- <a class="col-auto d-flex" (click)="closeCard()"><span class="ml-auto pt-3 material-icons clear-icon">clear</span></a> -->
<p class="card-title mb-0">What is a DMP in ARGOS</p>
<p class="card-content mb-0">A Data Management Plan (DMP) is a living document describing the datasets that are generated and/ or re-used
during and after a research lifetime. DMPs aim to provide researchers with essential information to re-produce,
re-distribute and re-purpose research results thus assuring for their validity and exploitation.</p>
<p class="card-title mb-0">{{'DASHBOARD.DMP-QUESTION' | translate}}</p>
<p class="card-content mb-0">{{'DASHBOARD.INFO-DMP-TEXT' | translate}}</p>
<p class="card-content pt-3 mb-0">
New with DMPs? Visit <a><u>OpenAIREs Guide for Researchers</u></a> to learn more about how to create one!
{{'DASHBOARD.NEW-QUESTION' | translate}} <a><u>{{'DASHBOARD.OPEN-AIR-GUIDE' | translate}}</u></a> {{'DASHBOARD.LEARN-MORE' | translate}}
</p>
<div class="d-flex">
<button type="button" class="col-auto align-self-center normal-btn">Start your first DMP</button>
@ -22,15 +20,15 @@
</div>
</div>
<div class="col-md-4">
<div class="personal-usage">Personal usage</div>
<div class="personal-usage">{{'DASHBOARD.PERSONAL-USAGE' | translate}}</div>
<div class="counter-zero">0</div>
<a href="#" class="link">DMP's</a>
<a href="#" class="link">{{'DASHBOARD.DMPS' | translate}}</a>
<div class="counter-zero">0</div>
<a href="#" class="link">Dataset Descriptions</a>
<a href="#" class="link">{{'DASHBOARD.DATASET-DESCRIPTIONS' | translate}}</a>
<div class="counter-zero">0</div>
<a href="#" class="link-disabled">Grants</a>
<a href="#" class="link-disabled">{{'DASHBOARD.GRANTS' | translate}}</a>
<div class="counter-zero">0</div>
<a href="#" class="link-disabled">Related organizations</a>
<a href="#" class="link-disabled">{{'DASHBOARD.RELATED-ORGANISATIONS' | translate}}</a>
</div>
</div>
</div>

View File

@ -26,7 +26,7 @@
</div>
<div class="dataset-card-actions">
<a class="col-auto border-right pointer" [matMenuTriggerFor]="exportMenu"><span class="material-icons icon-align pr-2">open_in_new</span>{{'DATASET-LISTING.ACTIONS.EXPORT' | translate}}</a>
<a class="col-auto border-right pointer"><span class="material-icons icon-align pr-2">group_add</span>{{'DATASET-LISTING.ACTIONS.INVITE-COLLABORATORS' | translate}}</a>
<a class="col-auto border-right pointer" (click)="openShareDialog(activity.dmpId, activity.dmp)"><span class="material-icons icon-align pr-2">group_add</span>{{'DATASET-LISTING.ACTIONS.INVITE-COLLABORATORS' | translate}}</a>
<a class="col-auto pointer" [matMenuTriggerFor]="actionsMenu"><span class="material-icons icon-align pl-2">more_horiz</span></a>
<!-- <a class="col-auto" [matMenuTriggerFor]="actionsMenu" *ngIf="!publicMode"><span class="material-icons icon-align pl-2">more_horiz</span></a> -->
</div>

View File

@ -20,6 +20,7 @@ import { SnackBarNotificationLevel } from '@app/core/services/notification/ui-no
import * as FileSaver from 'file-saver';
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
import { UiNotificationService } from '@app/core/services/notification/ui-notification-service';
import { DmpInvitationDialogComponent } from '@app/ui/dmp/invitation/dmp-invitation.component';
@Component({
selector: 'app-drafts',
@ -161,6 +162,18 @@ export class DraftsComponent extends BaseComponent implements OnInit {
});
}
openShareDialog(dmpRowId: any, dmpRowName: any) {
const dialogRef = this.dialog.open(DmpInvitationDialogComponent, {
// height: '250px',
// width: '700px',
restoreFocus: false,
data: {
dmpId: dmpRowId,
dmpName: dmpRowName
}
});
}
onCallbackSuccess(id?: String): void {
this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE'), SnackBarNotificationLevel.Success);
id ? this.router.navigate(['/reload']).then(() => { this.router.navigate(['/datasets', 'edit', id]); }) : this.router.navigate(['/datasets']);

View File

@ -28,7 +28,7 @@
</div>
<div class="dataset-card-actions">
<a class="col-auto border-right pointer" [matMenuTriggerFor]="exportMenu"><span class="material-icons icon-align pr-2">open_in_new</span>{{'DATASET-LISTING.ACTIONS.EXPORT' | translate}}</a>
<a class="col-auto border-right pointer"><span class="material-icons icon-align pr-2">group_add</span>{{'DATASET-LISTING.ACTIONS.INVITE-COLLABORATORS' | translate}}</a>
<a class="col-auto border-right pointer" (click)="openShareDialog(activity.dmpId, activity.dmp)"><span class="material-icons icon-align pr-2">group_add</span>{{'DATASET-LISTING.ACTIONS.INVITE-COLLABORATORS' | translate}}</a>
<a class="col-auto pointer" [matMenuTriggerFor]="actionsMenu"><span class="material-icons icon-align pl-2">more_horiz</span></a>
<!-- <a class="col-auto" [matMenuTriggerFor]="actionsMenu" *ngIf="!publicMode"><span class="material-icons icon-align pl-2">more_horiz</span></a> -->
</div>

View File

@ -20,6 +20,7 @@ import { ValidationErrorModel } from '@common/forms/validation/error-model/valid
import { UiNotificationService } from '@app/core/services/notification/ui-notification-service';
import { SnackBarNotificationLevel } from '@common/modules/notification/ui-notification-service';
import { DatasetStatus } from '@app/core/common/enum/dataset-status';
import { DmpInvitationDialogComponent } from '@app/ui/dmp/invitation/dmp-invitation.component';
@Component({
selector: 'app-recent-edited-dataset-activity',
@ -151,6 +152,18 @@ export class RecentEditedDatasetActivityComponent extends BaseComponent implemen
});
}
openShareDialog(dmpRowId: any, dmpRowName: any, activity: any) {
const dialogRef = this.dialog.open(DmpInvitationDialogComponent, {
// height: '250px',
// width: '700px',
restoreFocus: false,
data: {
dmpId: dmpRowId,
dmpName: dmpRowName
}
});
}
getFilenameFromContentDispositionHeader(header: string): string {
const regex: RegExp = new RegExp(/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/g);

View File

@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, Output, EventEmitter } from '@angular/core';
import { Router } from '@angular/router';
import { AuthService } from '@app/core/services/auth/auth.service';
import { LanguageService } from '@app/core/services/language/language.service';
@ -9,53 +9,55 @@ import { BaseComponent } from '@common/base/base.component';
const availableLanguages: any[] = require('../../../../assets/resources/language.json');
@Component({
selector: 'app-language',
templateUrl: './language.component.html',
styleUrls: ['./language.component.scss']
selector: 'app-language',
templateUrl: './language.component.html',
styleUrls: ['./language.component.scss']
})
export class LanguageComponent extends BaseComponent implements OnInit {
@Output() languageChange: EventEmitter<any> = new EventEmitter();
languages = availableLanguages;
constructor(
private router: Router,
private authentication: AuthService,
private languageService: LanguageService,
private userService: UserService
) { super(); }
constructor(
private router: Router,
private authentication: AuthService,
private languageService: LanguageService,
private userService: UserService
) { super(); }
ngOnInit() {
}
public isAuthenticated(): boolean {
return !(!this.authentication.current());
}
public getCurrentLanguage(): any {
const lang = this.languages.find(lang => lang.value === this.languageService.getCurrentLanguage());
return lang;
}
onLanguageSelected(selectedLanguage: any) {
if (this.isAuthenticated()) {
const langMap = new Map<string, string>();
langMap.set('language', selectedLanguage.value);
this.userService.updateUserSettings({language: this.languages.find(lang => lang.value === selectedLanguage.value)})
.pipe(takeUntil(this._destroyed))
.subscribe((response) => {
this.languageService.changeLanguage(selectedLanguage.value);
this.authentication.me()
.pipe(takeUntil(this._destroyed))
.subscribe ( innerResponse =>
{this.router.navigateByUrl(this.router.url);});
},
error => {
console.log(error);
});
} else {
this.languageService.changeLanguage(selectedLanguage.value);
this.router.navigateByUrl(this.router.url);
ngOnInit() {
this.languageChange.emit(this.getCurrentLanguage().value)
}
public isAuthenticated(): boolean {
return !(!this.authentication.current());
}
public getCurrentLanguage(): any {
const lang = this.languages.find(lang => lang.value === this.languageService.getCurrentLanguage());
return lang;
}
onLanguageSelected(selectedLanguage: any) {
if (this.isAuthenticated()) {
const langMap = new Map<string, string>();
langMap.set('language', selectedLanguage.value);
this.userService.updateUserSettings({ language: this.languages.find(lang => lang.value === selectedLanguage.value) })
.pipe(takeUntil(this._destroyed))
.subscribe((response) => {
this.languageService.changeLanguage(selectedLanguage.value);
this.authentication.me()
.pipe(takeUntil(this._destroyed))
.subscribe(innerResponse => { this.router.navigateByUrl(this.router.url); });
},
error => {
console.log(error);
});
} else {
this.languageService.changeLanguage(selectedLanguage.value);
this.router.navigateByUrl(this.router.url);
}
this.languageChange.emit(selectedLanguage.value);
}
}
}

View File

@ -36,3 +36,8 @@ $mat-card-header-size: 30px !default;
.active a i{
color: #23BCBA;
}
mat-list-item {
display: flex !important;
height: auto !important;
}

View File

@ -1123,7 +1123,12 @@
"GRANTS": "Grants",
"MY-DMPS": "My DMPs",
"TITLE": "What is ARGOS?",
"DMP-QUESTION": "What is a DMP in ARGOS?",
"INFO-TEXT": "ARGOS is an open extensible service that simplifies the management, validation, monitoring and maintenance and of Data Management Plans. It allows actors (researchers, managers, supervisors etc) to create actionable DMPs that may be freely exchanged among infrastructures for carrying out specific aspects of the Data management process in accordance with the intentions and commitment of Data owners.",
"INFO-DMP-TEXT": "A Data Management Plan (DMP) is a living document describing the datasets that are generated and/ or re-used during and after a research lifetime. DMPs aim to provide researchers with essential information to re-produce,re-distribute and re-purpose research results thus assuring for their validity and exploitation.",
"NEW-QUESTION": "New with DMPs? Visit",
"OPEN-AIR-GUIDE": "OpenAIREs Guide for Researchers",
"LEARN-MORE": "to learn more about how to create one!",
"ORGANIZATIONS": "Related Organizations",
"DMPS": "DMPs",
"MY-DATASETS": "My Dataset Descriptions",

View File

@ -1110,7 +1110,12 @@
"GRANTS": "Subvenciones",
"MY-DMPS": "Mis PGDs",
"TITLE": "¿Qué es ARGOS?",
"DMP-QUESTION": "¿Que es un DMP en ARGOS?",
"INFO-TEXT": "ARGOS es un servicio extensible y abierto que simplifica la gestión, validación, monitorización y mantenimiento de los Plan de Gestión de Datos. Permite a los participantes (investigadores, gestores, supervisores, etc) crear un PGDs visible que puede ser compartido libremente entre distintas infraestructuras para llevar a cabo aspectos específicos del proceso de Gestión de Datos de acuerdo con los propósitos y el compromiso de los propietarios de los datos.",
"INFO-DMP-TEXT": "A Data Management Plan (DMP) is a living document describing the datasets that are generated and/ or re-used during and after a research lifetime. DMPs aim to provide researchers with essential information to re-produce,re-distribute and re-purpose research results thus assuring for their validity and exploitation.",
"NEW-QUESTION": "¿Nuevo con DMP? Visitar",
"OPEN-AIR-GUIDE": "Guía de OpenAIRE para investigadores",
"LEARN-MORE": "para aprender más sobre cómo crear uno!",
"ORGANIZATIONS": "Organizaciones relacionadas",
"DMPS": "PGDs",
"MY-DATASETS": "Mis descripciones del Dataset",

View File

@ -1097,8 +1097,13 @@
"MY-GRANTS": "Οι Επιχορηγήσεις μου",
"GRANTS": "Επιχορηγήσεις",
"MY-DMPS": "Τα Σχέδια Διαχείρισης Δεδομένων μου",
"TITLE": "Τi είναι το ARGOS?",
"TITLE": "Τι είναι το ARGOS?",
"DMP-QUESTION": "Τι είναι το DMP στο ARGOS?",
"NEW-QUESTION": "Νέος με τα DMP; Επίσκεψου",
"OPEN-AIR-GUIDE": "Οδηγός για ερευνητές του OpenAIRE",
"LEARN-MORE": "για να μάθετε περισσότερα για το πώς να δημιουργήσετε ένα!",
"INFO-TEXT": "Το ARGOS είναι μια ανοικτή επεκτάσιμη υπηρεσία που απλοποιεί τη διαχείριση, την επικύρωση, την παρακολούθηση και τη συντήρηση των Σχεδίων Διαχείρισης Δεδομένων. Επιτρέπει στους φορείς (ερευνητές, υπεύθυνους έρευνας, διευθυντές κλπ.) να δημιουργούν ζωντανά Σχέδια Διαχείρισης Δεδομένων που μπορούν να ανταλλάσσονται ελεύθερα μεταξύ των υποδομών για τη διεξαγωγή συγκεκριμένων πτυχών της διαδικασίας διαχείρισης Δεδομένων, σύμφωνα με τις προθέσεις και τη δέσμευση των κατόχων Δεδομένων.",
"INFO-DMP-TEXT": "A Data Management Plan (DMP) is a living document describing the datasets that are generated and/ or re-used during and after a research lifetime. DMPs aim to provide researchers with essential information to re-produce,re-distribute and re-purpose research results thus assuring for their validity and exploitation.",
"ORGANIZATIONS": "Σχετικοί Οργανισμοί",
"DMPS": "Σχέδια Διαχείρισης Δεδομένων",
"MY-DATASETS": "Οι Περιγραφές Συνόλων Δεδομένων μου",