Skip to content

Commit

Permalink
Added varying tooltip to submit button
Browse files Browse the repository at this point in the history
  • Loading branch information
laxerhd committed Nov 21, 2024
1 parent 8899075 commit 42ab4d0
Showing 1 changed file with 23 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="col-12">
<form [formGroup]="form" (ngSubmit)="submitForm()">
<div class="form-group">
<label for="name">{{ 'artemisApp.attachmentUnit.createAttachmentUnit.name' | artemisTranslate }} *</label>
<label for="name">{{ 'artemisApp.attachmentUnit.createAttachmentUnit.name' | artemisTranslate }}*</label>
<input
type="text"
class="form-control"
Expand Down Expand Up @@ -105,14 +105,29 @@
</div>
<div class="row">
<div class="col-12">
<button id="submitButton" class="btn btn-primary" type="submit" [disabled]="!isFormValid()">
<span jhiTranslate="entity.action.submit"></span>
</button>
@if (hasCancelButton()) {
<button type="button" (click)="cancelForm()" class="btn btn-default">
<fa-icon [icon]="faTimes" />&nbsp;<span jhiTranslate="entity.action.cancel"></span>
<span
[ngbTooltip]="
!fileInputTouched && nameControl?.invalid
? ('artemisApp.attachmentUnit.createAttachmentUnit.nameRequiredValidationError' | artemisTranslate) +
' ' +
('artemisApp.attachmentUnit.createAttachmentUnit.fileRequiredValidationError' | artemisTranslate)
: !fileInputTouched
? ('artemisApp.attachmentUnit.createAttachmentUnit.fileRequiredValidationError' | artemisTranslate)
: nameControl?.invalid
? ('artemisApp.attachmentUnit.createAttachmentUnit.nameRequiredValidationError' | artemisTranslate)
: null
"
container="body"
>
<button id="submitButton" class="btn btn-primary" type="submit" [disabled]="!isFormValid()">
<span jhiTranslate="entity.action.submit"></span>
</button>
}
@if (hasCancelButton()) {
<button type="button" (click)="cancelForm()" class="btn btn-default">
<fa-icon [icon]="faTimes" />&nbsp;<span jhiTranslate="entity.action.cancel"></span>
</button>
}
</span>
</div>
</div>
</form>
Expand Down

0 comments on commit 42ab4d0

Please sign in to comment.