Skip to content

Commit

Permalink
add Tooltip to Buttons in FreieLagerobjekteView
Browse files Browse the repository at this point in the history
change Error Notification in AufnehmenView to display in center

Signed-off-by: Aleksandar Zivkovic <[email protected]>
  • Loading branch information
anywaywayany committed Mar 5, 2024
1 parent b5c9c9c commit 5d8c9bf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
7 changes: 7 additions & 0 deletions src/main/java/com/samic/samic/components/UIFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@ public static Notification notificationError(String text) {
return notification;
}

public static Notification notificationErrorCenter(String text) {
var notification = notificationError(text);
notification.setPosition(Notification.Position.MIDDLE);

return notification;
}

public static Notification notificationInfoNoDuration(String text) {
Notification notification = new Notification();
notification.setPosition(Notification.Position.BOTTOM_CENTER);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import com.samic.samic.services.ServiceStorage;
import com.samic.samic.services.ServiceStorageObject;
import com.samic.samic.views.MainLayout;
import com.vaadin.flow.component.button.Button;
import com.vaadin.flow.component.combobox.ComboBox;
import com.vaadin.flow.component.dialog.Dialog;
import com.vaadin.flow.component.formlayout.FormLayout;
Expand Down Expand Up @@ -161,8 +160,10 @@ private void initGrid() {
if (authenticatedUser.getUser().get().getRole() == Role.STORAGEADMIN
|| authenticatedUser.getUser().get().getRole() == Role.FIELDSERVICETECHNICIAN) {
grid.addComponentColumn(item -> new Span(
new Button(VaadinIcon.BOOKMARK.create(), e -> openReservationForm(item)),
new Button(VaadinIcon.INSERT.create(), e -> addToUser(item)))).setHeader("Aktionen")
UIFactory.btnIconWithTooltip(VaadinIcon.BOOKMARK.create(),
"Reservieren", e -> openReservationForm(item)),
UIFactory.btnIconWithTooltip(VaadinIcon.INSERT.create(),
"Aufnehmen", e -> addToUser(item)))).setHeader("Aktionen")
.setAutoWidth(true).setFrozenToEnd(true);
}
grid.setItemDetailsRenderer(createStorageObjectDetailsRenderer());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ private void onSave() {
storageObjectID.setValue("");
UIFactory.notificationSuccess("Lagerobjekt wurde aufgenommen").open();
} else {
UIFactory.notificationError("Das Lagerobjekt ist nicht verfügbar!").open();
UIFactory.notificationErrorCenter("Das Lagerobjekt ist nicht verfügbar!").open();
}
}
} catch (NoSuchElementException e) {
Expand Down

0 comments on commit 5d8c9bf

Please sign in to comment.