Move the comment component inside a dialog as we did for the Involved people (#2070)

This commit is contained in:
Maurizio Vitale
2017-07-12 11:14:40 +01:00
committed by Eugenio Romano
parent 0262b3426e
commit 8b87ef0a21
4 changed files with 36 additions and 6 deletions

View File

@@ -31,3 +31,10 @@
transform: translate(0, -50%); transform: translate(0, -50%);
width: 40%; width: 40%;
} }
.comments-dialog {
position: fixed;
top: 50%;
transform: translate(0, -50%);
width: 40%;
}

View File

@@ -23,10 +23,7 @@
<button type="button" md-button md-raised-button (click)="showPeopleDialog()">{{'TASK_DETAILS.LABELS.INVOLVED_PEOPLE'|translate}}</button> <button type="button" md-button md-raised-button (click)="showPeopleDialog()">{{'TASK_DETAILS.LABELS.INVOLVED_PEOPLE'|translate}}</button>
</div> </div>
<div *ngIf="showComments" class="mdl-cell mdl-cell--4-col"> <div *ngIf="showComments" class="mdl-cell mdl-cell--4-col">
<adf-comments #activiticomments <button type="button" md-button md-raised-button (click)="showCommentsDialog()">{{'TASK_DETAILS.LABELS.COMMENTS'|translate}}</button>
[readOnly]="readOnlyForm"
[taskId]="taskDetails.id">
</adf-comments>
</div> </div>
<div *ngIf="showChecklist" class="mdl-cell mdl-cell--4-col"> <div *ngIf="showChecklist" class="mdl-cell mdl-cell--4-col">
<adf-checklist #activitichecklist <adf-checklist #activitichecklist
@@ -81,4 +78,14 @@
<button type="button" md-button md-raised-button (click)="closePeopleDialog()">{{'TASK_DETAILS.ERROR.CLOSE'|translate}}</button> <button type="button" md-button md-raised-button (click)="closePeopleDialog()">{{'TASK_DETAILS.ERROR.CLOSE'|translate}}</button>
</div> </div>
</dialog> </dialog>
<dialog class="mdl-dialog comments-dialog" #dialogComments>
<div class="mdl-dialog__content">
<adf-comments #activiticomments
[readOnly]="readOnlyForm"
[taskId]="taskDetails.id">
</adf-comments>
<br><br>
<button type="button" md-button md-raised-button (click)="closeCommentsDialog()">{{'TASK_DETAILS.ERROR.CLOSE'|translate}}</button>
</div>
</dialog>
</div> </div>

View File

@@ -55,6 +55,9 @@ export class ActivitiTaskDetails implements OnInit, OnChanges {
@ViewChild('dialogPeople') @ViewChild('dialogPeople')
peopleDialog: any; peopleDialog: any;
@ViewChild('dialogComments')
commentsDialog: any;
@Input() @Input()
debugMode: boolean = false; debugMode: boolean = false;
@@ -303,6 +306,19 @@ export class ActivitiTaskDetails implements OnInit, OnChanges {
} }
} }
public showCommentsDialog(): void {
if (!this.commentsDialog.nativeElement.showModal) {
dialogPolyfill.registerDialog(this.commentsDialog.nativeElement);
}
this.commentsDialog.nativeElement.showModal();
}
public closeCommentsDialog(): void {
if (this.commentsDialog) {
this.commentsDialog.nativeElement.close();
}
}
onClaimTask(taskId: string): void { onClaimTask(taskId: string): void {
this.loadDetails(taskId); this.loadDetails(taskId);
} }

View File

@@ -28,7 +28,7 @@
.adf-comment-message { .adf-comment-message {
float: left; float: left;
width: calc(100% - 20px); width: calc(100% - 10px);
padding: 2px 10px; padding: 2px 10px;
font-family: Muli; font-family: Muli;
font-style: italic; font-style: italic;
@@ -47,7 +47,7 @@
.adf-comment-contents { .adf-comment-contents {
float: left; float: left;
width: calc(100% - 60px); width: calc(100% - 10px);
} }
adf-datatable >>> table thead { adf-datatable >>> table thead {