Adds pop-up box that informs the owner/admin that their names will be made visible to everyone when openly publishing the DMP/ Dataset Desrciption. (Issue #186)

This commit is contained in:
apapachristou 2019-10-09 11:45:47 +03:00
parent f1070196a0
commit 8d343caf91
6 changed files with 60 additions and 33 deletions

View File

@ -2,17 +2,20 @@ import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { TranslateModule } from '@ngx-translate/core';
import { MaterialModule } from '../material/material.module';
import { FormsModule } from '@angular/forms';
@NgModule({
imports: [
CommonModule,
MaterialModule,
TranslateModule
TranslateModule,
FormsModule
],
exports: [
CommonModule,
MaterialModule,
TranslateModule
TranslateModule,
FormsModule
]
})
export class CommonUiModule { }

View File

@ -3,25 +3,29 @@
<div class="col-auto close-btn justify-content-start">
<mat-icon color="warn">{{ data.icon }}</mat-icon>
</div>
<div *ngIf="data.warning" class="col justify-content-center warn-text">
{{ data.warning }}
</div>
<div *ngIf="data.warning" class="col justify-content-center warn-text">{{ data.warning }}</div>
<div class="col-auto close-btn justify-content-end" (click)="close()">
<mat-icon>close</mat-icon>
</div>
</div>
<div class="row d-flex flex-row">
<div class="col confirmation-message">
{{ data.message }}
</div>
<div class="col message">{{ data.message }}</div>
<div *ngIf="!data.icon" class="col-auto close-btn justify-content-end" (click)="close()">
<mat-icon>close</mat-icon>
</div>
</div>
<div *ngIf="data.privacyPolicyNames" class="row d-flex flex-col">
<div class="col privacy-policy-names">{{ data.privacyPolicyNames }}</div>
<mat-checkbox [(ngModel)]="agreePrivacyPolicyNames" required class="checkbox-privacy">
{{'GENERAL.CONFIRMATION-DIALOG.ACTIONS.POLICY-AGREE' | translate}}
</mat-checkbox>
<div *ngIf="!agreePrivacyPolicyNames" class="required-policy">{{'GENERAL.CONFIRMATION-DIALOG.ACTIONS.REQUIRED' | translate}}</div>
</div>
<div class="row">
<div class="col"></div>
<div class="col-auto"><button mat-raised-button type="button" (click)="cancel()" class="cancel">{{ data.cancelButton }}</button></div>
<div class="col-auto"><button mat-raised-button type="button" (click)="cancel()">{{ data.cancelButton }}</button></div>
<div *ngIf="data.isDeleteConfirmation" class="col-auto"><button mat-raised-button type="button" (click)="confirm()" class="delete">{{ data.confirmButton }}</button></div>
<div *ngIf="!data.isDeleteConfirmation" class="col-auto"><button mat-raised-button type="button" (click)="confirm()" class="confirm">{{ data.confirmButton }}</button></div>
<div *ngIf="!data.isDeleteConfirmation && !data.privacyPolicyNames" class="col-auto"><button mat-raised-button type="button" (click)="confirm()" color="accent">{{ data.confirmButton }}</button></div>
<div *ngIf="!data.isDeleteConfirmation && data.privacyPolicyNames" class="col-auto"><button mat-raised-button type="button" [disabled]="!agreePrivacyPolicyNames" (click)="confirm()" color="accent">{{ data.confirmButton }}</button></div>
</div>
</div>

View File

@ -1,30 +1,44 @@
.confirmation-dialog {
.confirmation-message {
padding-bottom: 20px;
}
.confirmation {
padding-bottom: 20px;
}
.close-btn {
margin-left: auto;
cursor: pointer;
}
.privacy-policy-names {
font-weight: 700;
padding: 1em;
}
.warn-text {
color: #f44336;
}
.close-btn {
margin-left: auto;
cursor: pointer;
}
.cancel {
background-color: #aaaaaa;
color: #ffffff;
}
.warn-text {
color: #f44336;
}
.confirm {
background-color: #2cba6c;
color: #ffffff;
}
.cancel {
background-color: #aaaaaa;
color: #ffffff;
}
.delete {
background-color: #ba2c2c;
color: #ffffff;
}
.confirm {
background-color: #2cba6c;
color: #ffffff;
}
.delete {
background-color: #ba2c2c;
color: #ffffff;
}
.checkbox-privacy {
padding: 0em 1em;
}
.required-policy {
padding: 0em 1.2em 1em;
font-size: smaller;
color: #f44336;
}
}

View File

@ -8,6 +8,8 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
})
export class ConfirmationDialogComponent {
agreePrivacyPolicyNames = false;
constructor(
public dialogRef: MatDialogRef<ConfirmationDialogComponent>,
@Inject(MAT_DIALOG_DATA) public data: any

View File

@ -293,6 +293,7 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
restoreFocus: false,
data: {
message: this.language.instant('GENERAL.CONFIRMATION-DIALOG.PUBLISH-ITEM'),
privacyPolicyNames: this.language.instant('GENERAL.CONFIRMATION-DIALOG.PRIVACY-POLICY-NAMES'),
confirmButton: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.CONFIRM'),
cancelButton: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.CANCEL'),
isDeleteConfirmation: false

View File

@ -43,13 +43,16 @@
"ZENODO-DOI": "Would you like to create digital object identifier (DOI) for the DMP?",
"LEAVE-PAGE": "If you leave, your changes will be lost.",
"LEAVE-WARNING": "You have unsaved changes!",
"PRIVACY-POLICY-NAMES": "The names of all people involved into this DMP will be publicly visible. Do you agree with that?",
"ACTIONS": {
"CONFIRM": "Yes",
"NO": "No",
"DELETE": "Delete",
"REMOVE": "Remove",
"CANCEL": "Cancel",
"LEAVE": "Leave"
"LEAVE": "Leave",
"POLICY-AGREE": "Make names publicly visible.",
"REQUIRED": "Click on checkbox is required."
}
},
"NOTIFICATION-DIALOG": {