Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* enhancement (confirmation dialog): added an input field for the user to provide a comment when deleting a value * enhancement (confirmation dialog): changed the input into a textarea and added a placeholder. Also fixed an error where clicking outside of the dialog box would close the component but try to access an undefined object member. * style (confirmation message): moved css from global file to _viewer file * style (confirmation css): move all confirmation dialog and message css to _viewer file * tests (display-edit): added a test for a case where a deletion comment is provided * refactor (confirmation components): - renamed ConfirmationDialogPayload to ConfirmationDialogValueDeletionPayload - refactored the deletion comment to be optional so that it will be undefined instead of null if a comment is not provided
- Loading branch information
Showing
11 changed files
with
116 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 11 additions & 8 deletions
19
...s/dsp-ui/src/lib/action/components/confirmation-dialog/confirmation-dialog.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
<mat-dialog-content> | ||
<p class="title"> Are you sure you want to delete this value from {{data.value.propertyLabel}}?</p> | ||
<dsp-confirmation-message [value]="data.value"></dsp-confirmation-message> | ||
</mat-dialog-content> | ||
<mat-dialog-actions class="action-buttons"> | ||
<button class="cancel" mat-raised-button mat-dialog-close>{{data.buttonTextCancel}}</button> | ||
<button class="ok" mat-raised-button color="primary" (click)="onConfirmClick()">{{data.buttonTextOk}}</button> | ||
</mat-dialog-actions> | ||
<div class="deletion-dialog"> | ||
<mat-dialog-content> | ||
<p class="title"> Are you sure you want to delete this value from {{data.value.propertyLabel}}?</p> | ||
<dsp-confirmation-message #confirmMessage [value]="data.value"></dsp-confirmation-message> | ||
</mat-dialog-content> | ||
<mat-dialog-actions class="action-buttons"> | ||
<button class="cancel" mat-raised-button mat-dialog-close>{{data.buttonTextCancel}}</button> | ||
<button class="ok" mat-raised-button color="primary" (click)="onConfirmClick()">{{data.buttonTextOk}}</button> | ||
</mat-dialog-actions> | ||
</div> | ||
|
10 changes: 1 addition & 9 deletions
10
...s/dsp-ui/src/lib/action/components/confirmation-dialog/confirmation-dialog.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1 @@ | ||
.title { | ||
font-weight: bold; | ||
font-size: 18px; | ||
text-align: center; | ||
} | ||
|
||
.action-buttons { | ||
float: right; | ||
} | ||
@import "../../../../assets/style/viewer"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 8 additions & 1 deletion
9
...n/components/confirmation-dialog/confirmation-message/confirmation-message.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,13 @@ | ||
<div class="message"> | ||
<div class="deletion-dialog-message"> | ||
<p class="val-label">Confirming this action will delete the following value from {{value.propertyLabel}}:</p> | ||
<p class="val-value">Value: {{value.strval}}</p> | ||
<p class="val-comment">Value Comment: {{value.valueHasComment ? value.valueHasComment : 'No comment'}}</p> | ||
<p class="val-creation-date">Value Creation Date: {{value.valueCreationDate}}</p> | ||
<textarea | ||
matinput | ||
class="deletion-comment" | ||
type="text" | ||
(keyup)="onKey($event)" | ||
[placeholder]="'Comment why value is being deleted'" | ||
></textarea> | ||
</div> |
9 changes: 1 addition & 8 deletions
9
...n/components/confirmation-dialog/confirmation-message/confirmation-message.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1 @@ | ||
.message { | ||
font-size: 16px; | ||
background-color: #ededf5; | ||
border: 1px solid #d8d8df; | ||
border-radius: 5px; | ||
padding: 20px 10px 20px 10px; | ||
text-align: center; | ||
} | ||
@import "../../../../../assets/style/viewer"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters