Search in sources :

Example 1 with EAGER

use of com.vaadin.flow.data.value.ValueChangeMode.EAGER in project komunumo-server by komunumo.

the class EventDialog method createForm.

// just a lot of fields for the form
@SuppressWarnings("checkstyle:MethodLength")
@Override
public void createForm(@NotNull final FormLayout formLayout, @NotNull final Binder<Event> binder) {
    final var type = new Select<>(EventType.values());
    final var title = new TextField("Title");
    final var subtitle = new TextField("Subtitle");
    final var speaker = new MultiselectComboBox<EventSpeakerEntity>("Speaker");
    final var organizer = new MultiselectComboBox<Member>("Organizer");
    final var description = new RichTextEditor();
    final var keyword = new MultiselectComboBox<KeywordEntity>("Keyword");
    final var agenda = new RichTextEditor();
    final var level = new Select<>(EventLevel.values());
    final var language = new Select<>(EventLanguage.values());
    final var room = new TextField("Room");
    final var travelInstructions = new TextField("Travel instructions");
    final var location = new ComboBox<String>("Location");
    final var webinarUrl = new TextField("Webinar URL");
    final var youtTube = new TextField("YouTube");
    final var date = new DateTimePicker("Date & Time");
    final var duration = new TimePicker("Duration");
    final var eventUrl = new TextField("Event URL");
    final var attendeeLimit = new IntegerField("Attendee limit (0 = no limit)");
    final var membersOnly = new Checkbox("Members only");
    final var published = new Checkbox("Published");
    type.setLabel("Type");
    type.setRequiredIndicatorVisible(true);
    title.setRequiredIndicatorVisible(true);
    title.setValueChangeMode(EAGER);
    title.addValueChangeListener(changeEvent -> {
        if (eventUrl.getValue().equals(URLUtil.createReadableUrl(changeEvent.getOldValue()))) {
            eventUrl.setValue(URLUtil.createReadableUrl(changeEvent.getValue()));
        }
    });
    subtitle.setValueChangeMode(EAGER);
    speaker.setOrdered(true);
    speaker.setItemLabelGenerator(EventSpeakerEntity::fullName);
    speaker.setItems(databaseService.getAllEventSpeakers());
    organizer.setOrdered(true);
    organizer.setItemLabelGenerator(value -> String.format("%s %s", value.getFirstName(), value.getLastName()));
    organizer.setItems(databaseService.getAllAdmins());
    organizer.setRequiredIndicatorVisible(true);
    keyword.setOrdered(true);
    keyword.setItemLabelGenerator(KeywordEntity::keyword);
    keyword.setItems(databaseService.getAllKeywords());
    level.setLabel("Level");
    language.setLabel("Language");
    location.setItems(databaseService.getAllEventLocations());
    location.setAllowCustomValue(true);
    location.addValueChangeListener(changeEvent -> {
        final var value = changeEvent.getValue();
        final var isOnline = "Online".equalsIgnoreCase(value);
        webinarUrl.setEnabled(isOnline);
        webinarUrl.setRequiredIndicatorVisible(published.getValue() && isOnline);
        room.setRequiredIndicatorVisible(!isOnline);
        updateEventUrlPrefix(location, date, eventUrl);
        binder.validate();
    });
    room.setValueChangeMode(EAGER);
    travelInstructions.setValueChangeMode(EAGER);
    webinarUrl.setValueChangeMode(EAGER);
    date.setMin(LocalDateTime.now());
    date.addValueChangeListener(changeEvent -> updateEventUrlPrefix(location, date, eventUrl));
    duration.setStep(Duration.ofMinutes(15));
    duration.setMin(LocalTime.of(1, 0));
    duration.setMax(LocalTime.of(3, 0));
    eventUrl.setValueChangeMode(EAGER);
    updateEventUrlPrefix(location, date, eventUrl);
    attendeeLimit.setMin(0);
    attendeeLimit.setMax(500);
    attendeeLimit.setStep(10);
    attendeeLimit.setHasControls(true);
    published.addValueChangeListener(changeEvent -> {
        final var value = changeEvent.getValue();
        speaker.setRequiredIndicatorVisible(value);
        level.setRequiredIndicatorVisible(value);
        description.setRequiredIndicatorVisible(value);
        language.setRequiredIndicatorVisible(value);
        location.setRequiredIndicatorVisible(value);
        room.setRequiredIndicatorVisible(!"Online".equalsIgnoreCase(location.getValue()));
        date.setRequiredIndicatorVisible(value);
        duration.setRequiredIndicatorVisible(value);
        eventUrl.setRequiredIndicatorVisible(value);
        binder.validate();
    });
    formLayout.add(type, title, subtitle, speaker, organizer, level, new CustomLabel("Description"), description, keyword, new CustomLabel("Agenda"), agenda, language, location, room, travelInstructions, webinarUrl, youtTube, date, duration, eventUrl, attendeeLimit, membersOnly, published);
    binder.forField(type).withValidator(value -> !published.getValue() || value != null, "Please select a type").bind(Event::getType, Event::setType);
    binder.forField(title).withValidator(new StringLengthValidator("Please enter a title (max. 255 chars)", 1, 255)).bind(Event::getTitle, Event::setTitle);
    binder.forField(subtitle).withValidator(new StringLengthValidator("The subtitle is too long (max. 255 chars)", 0, 255)).bind(Event::getSubtitle, Event::setSubtitle);
    binder.forField(speaker).withValidator(value -> !published.getValue() || !value.isEmpty(), "Please select at least one speaker").bind(this::getSpeakers, this::setSpeakers);
    binder.forField(organizer).withValidator(value -> !value.isEmpty(), "Please select at least one organizer").bind(this::getOrganizer, this::setOrganizer);
    binder.forField(level).withValidator(value -> !published.getValue() || value != null, "Please select a level").bind(Event::getLevel, Event::setLevel);
    binder.forField(description.asHtml()).withValidator(value -> !published.getValue() || value != null && !value.isBlank(), "Please enter a description").bind(Event::getDescription, Event::setDescription);
    binder.forField(keyword).bind(this::getKeyword, this::setKeyword);
    binder.forField(agenda.asHtml()).bind(Event::getAgenda, Event::setAgenda);
    binder.forField(language).withValidator(value -> !published.getValue() || value != null, "Please select a language").bind(Event::getLanguage, Event::setLanguage);
    binder.forField(location).withValidator(value -> !published.getValue() || value != null, "Please select a location").bind(Event::getLocation, Event::setLocation);
    binder.forField(room).withValidator(value -> !published.getValue() || "Online".equalsIgnoreCase(location.getValue()) || !value.isBlank(), "Please enter a room").bind(Event::getRoom, Event::setRoom);
    binder.forField(travelInstructions).withValidator(value -> value.isBlank() || URLUtil.isValid(value), "Please enter a valid URL").bind(Event::getTravelInstructions, Event::setTravelInstructions);
    binder.forField(webinarUrl).withValidator(value -> !published.getValue() || !"Online".equalsIgnoreCase(location.getValue()) || URLUtil.isValid(value), "Please enter a valid URL").bind(Event::getWebinarUrl, Event::setWebinarUrl);
    binder.forField(youtTube).bind(Event::getYoutube, Event::setYoutube);
    binder.forField(date).withValidator(value -> isPastEvent(date) || !published.getValue() && (value == null || value.isAfter(LocalDateTime.now())) || value != null && value.isAfter(LocalDateTime.now()), "Please enter a date and time in the future").bind(Event::getDate, Event::setDate);
    binder.forField(duration).withValidator(value -> !published.getValue() || (value != null && value.isAfter(LocalTime.MIN) && value.isBefore(LocalTime.MAX)), "Please enter a duration").bind(Event::getDuration, Event::setDuration);
    // TODO check for duplicates
    binder.forField(eventUrl).withValidator(value -> !published.getValue() || value != null && !value.isBlank(), "Please enter a valid event URL").bind(Event::getEventUrl, Event::setEventUrl);
    binder.forField(attendeeLimit).bind(Event::getAttendeeLimit, Event::setAttendeeLimit);
    binder.forField(membersOnly).bind(Event::getMembersOnly, Event::setMembersOnly);
    binder.forField(published).bind(Event::getPublished, Event::setPublished);
    afterOpen = () -> {
        webinarUrl.setEnabled("Online".equalsIgnoreCase(location.getValue()));
        if (isPastEvent(date)) {
            binder.setReadOnly(true);
            binder.setValidatorsDisabled(true);
            youtTube.setReadOnly(false);
        }
    };
}
Also used : Member(org.komunumo.data.entity.Member) EventLevel(org.komunumo.data.db.enums.EventLevel) Event(org.komunumo.data.entity.Event) CustomLabel(org.komunumo.ui.component.CustomLabel) Select(com.vaadin.flow.component.select.Select) Binder(com.vaadin.flow.data.binder.Binder) LocalDateTime(java.time.LocalDateTime) ComboBox(com.vaadin.flow.component.combobox.ComboBox) EditDialog(org.komunumo.ui.component.EditDialog) KeywordEntity(org.komunumo.data.entity.KeywordEntity) EventLanguage(org.komunumo.data.db.enums.EventLanguage) AuthenticatedUser(org.komunumo.security.AuthenticatedUser) MultiselectComboBox(org.vaadin.gatanaso.MultiselectComboBox) IntegerField(com.vaadin.flow.component.textfield.IntegerField) Duration(java.time.Duration) LocalTime(java.time.LocalTime) TextField(com.vaadin.flow.component.textfield.TextField) EAGER(com.vaadin.flow.data.value.ValueChangeMode.EAGER) URLUtil(org.komunumo.util.URLUtil) Set(java.util.Set) TimePicker(com.vaadin.flow.component.timepicker.TimePicker) EventSpeakerEntity(org.komunumo.data.entity.EventSpeakerEntity) Collectors(java.util.stream.Collectors) FormLayout(com.vaadin.flow.component.formlayout.FormLayout) Checkbox(com.vaadin.flow.component.checkbox.Checkbox) StringLengthValidator(com.vaadin.flow.data.validator.StringLengthValidator) Nullable(org.jetbrains.annotations.Nullable) DatabaseService(org.komunumo.data.service.DatabaseService) RichTextEditor(com.vaadin.flow.component.richtexteditor.RichTextEditor) Year(java.time.Year) NotNull(org.jetbrains.annotations.NotNull) Callback(org.komunumo.Callback) DateTimePicker(org.komunumo.ui.component.DateTimePicker) Span(com.vaadin.flow.component.html.Span) EventType(org.komunumo.data.db.enums.EventType) TimePicker(com.vaadin.flow.component.timepicker.TimePicker) DateTimePicker(org.komunumo.ui.component.DateTimePicker) CustomLabel(org.komunumo.ui.component.CustomLabel) MultiselectComboBox(org.vaadin.gatanaso.MultiselectComboBox) EventSpeakerEntity(org.komunumo.data.entity.EventSpeakerEntity) ComboBox(com.vaadin.flow.component.combobox.ComboBox) MultiselectComboBox(org.vaadin.gatanaso.MultiselectComboBox) StringLengthValidator(com.vaadin.flow.data.validator.StringLengthValidator) IntegerField(com.vaadin.flow.component.textfield.IntegerField) DateTimePicker(org.komunumo.ui.component.DateTimePicker) KeywordEntity(org.komunumo.data.entity.KeywordEntity) Checkbox(com.vaadin.flow.component.checkbox.Checkbox) Select(com.vaadin.flow.component.select.Select) TextField(com.vaadin.flow.component.textfield.TextField) Event(org.komunumo.data.entity.Event) RichTextEditor(com.vaadin.flow.component.richtexteditor.RichTextEditor)

Example 2 with EAGER

use of com.vaadin.flow.data.value.ValueChangeMode.EAGER in project komunumo-server by komunumo.

the class SponsorDialog method createForm.

@Override
public void createForm(@NotNull final FormLayout formLayout, @NotNull final Binder<SponsorRecord> binder) {
    final var name = new TextField("Name");
    final var website = new TextField("Website");
    final var level = new ComboBox<SponsorLevel>("Level");
    final var logo = new ImageUploadField("Logo");
    final var description = new RichTextEditor();
    final var validFrom = new DatePicker("Valid from");
    final var validTo = new DatePicker("Valid to");
    final var domains = new TagField("Domains");
    name.setRequiredIndicatorVisible(true);
    name.setValueChangeMode(EAGER);
    website.setValueChangeMode(EAGER);
    level.setItems(SponsorLevel.values());
    formLayout.add(name, website, level, logo, new CustomLabel("Description"), description, validFrom, validTo, domains);
    binder.forField(name).withValidator(new StringLengthValidator("Please enter the name of the sponsor (max. 255 chars)", 1, 255)).bind(SponsorRecord::getName, SponsorRecord::setName);
    binder.forField(website).withValidator(value -> value.isEmpty() || value.startsWith("https://"), "The website address must start with \"https://\"").withValidator(new StringLengthValidator("The website address is too long (max. 255 chars)", 0, 255)).bind(SponsorRecord::getWebsite, SponsorRecord::setWebsite);
    binder.forField(level).bind(SponsorRecord::getLevel, SponsorRecord::setLevel);
    binder.forField(logo).withValidator(value -> value.isEmpty() || value.startsWith("data:") || value.startsWith("https://"), "The logo must be uploaded or the logo address must be secure (HTTPS)").withValidator(new StringLengthValidator("The logo is too big (max. 100 KB)", 0, 100_000)).bind(SponsorRecord::getLogo, SponsorRecord::setLogo);
    binder.forField(description.asHtml()).withValidator(new StringLengthValidator("The description is too long (max. 100'000 chars)", 0, 100_000)).bind(SponsorRecord::getDescription, SponsorRecord::setDescription);
    binder.forField(validFrom).withValidator(value -> value == null || validTo.isEmpty() || value.isBefore(validTo.getValue()), "The valid from date must be before the valid to date").bind(SponsorRecord::getValidFrom, SponsorRecord::setValidFrom);
    binder.forField(validTo).withValidator(value -> value == null || validFrom.isEmpty() || value.isAfter(validFrom.getValue()), "The valid to date must be after the valid from date").bind(SponsorRecord::getValidTo, SponsorRecord::setValidTo);
    binder.forField(domains).bind(this::getDomains, this::setDomains);
}
Also used : SponsorRecord(org.komunumo.data.db.tables.records.SponsorRecord) Arrays(java.util.Arrays) CustomLabel(org.komunumo.ui.component.CustomLabel) TagField(org.komunumo.ui.component.TagField) ImageUploadField(org.komunumo.ui.component.ImageUploadField) SponsorLevel(org.komunumo.data.db.enums.SponsorLevel) Binder(com.vaadin.flow.data.binder.Binder) Set(java.util.Set) ComboBox(com.vaadin.flow.component.combobox.ComboBox) DatePicker(org.komunumo.ui.component.DatePicker) Collectors(java.util.stream.Collectors) EditDialog(org.komunumo.ui.component.EditDialog) FormLayout(com.vaadin.flow.component.formlayout.FormLayout) StringLengthValidator(com.vaadin.flow.data.validator.StringLengthValidator) Nullable(org.jetbrains.annotations.Nullable) DatabaseService(org.komunumo.data.service.DatabaseService) RichTextEditor(com.vaadin.flow.component.richtexteditor.RichTextEditor) NotNull(org.jetbrains.annotations.NotNull) Callback(org.komunumo.Callback) TextField(com.vaadin.flow.component.textfield.TextField) EAGER(com.vaadin.flow.data.value.ValueChangeMode.EAGER) CustomLabel(org.komunumo.ui.component.CustomLabel) ImageUploadField(org.komunumo.ui.component.ImageUploadField) ComboBox(com.vaadin.flow.component.combobox.ComboBox) StringLengthValidator(com.vaadin.flow.data.validator.StringLengthValidator) SponsorRecord(org.komunumo.data.db.tables.records.SponsorRecord) TextField(com.vaadin.flow.component.textfield.TextField) RichTextEditor(com.vaadin.flow.component.richtexteditor.RichTextEditor) DatePicker(org.komunumo.ui.component.DatePicker) TagField(org.komunumo.ui.component.TagField)

Example 3 with EAGER

use of com.vaadin.flow.data.value.ValueChangeMode.EAGER in project komunumo-server by komunumo.

the class NewsDialog method createForm.

@Override
public void createForm(@NotNull final FormLayout formLayout, @NotNull final Binder<NewsRecord> binder) {
    final var title = new TextField("Title");
    final var subtitle = new TextField("Subtitle");
    final var teaser = new RichTextEditor();
    final var message = new RichTextEditor();
    final var showFrom = new DateTimePicker("Show from");
    final var showTo = new DateTimePicker("Show to");
    title.setRequiredIndicatorVisible(true);
    title.setValueChangeMode(EAGER);
    subtitle.setValueChangeMode(EAGER);
    formLayout.add(title, subtitle, new CustomLabel("Teaser"), teaser, new CustomLabel("Message"), message, showFrom, showTo);
    binder.forField(title).withValidator(new StringLengthValidator("Please enter the title of the news (max. 255 chars)", 1, 255)).bind(NewsRecord::getTitle, NewsRecord::setTitle);
    binder.forField(subtitle).withValidator(new StringLengthValidator("The subtitle is too long (max. 255 chars)", 0, 255)).bind(NewsRecord::getSubtitle, NewsRecord::setSubtitle);
    binder.forField(teaser.asHtml()).withValidator(new StringLengthValidator("The teaser is too long (max. 1'000 chars)", 0, 1_000)).bind(NewsRecord::getTeaser, NewsRecord::setTeaser);
    binder.forField(message.asHtml()).withValidator(new StringLengthValidator("The message is too long (max. 100'000 chars)", 0, 100_000)).bind(NewsRecord::getMessage, NewsRecord::setMessage);
    binder.forField(showFrom).withValidator(value -> value == null || showTo.isEmpty() || value.isBefore(showTo.getValue()), "The show from date must be before the show to date").bind(NewsRecord::getShowFrom, NewsRecord::setShowFrom);
    binder.forField(showTo).withValidator(value -> value == null || showFrom.isEmpty() || value.isAfter(showFrom.getValue()), "The show to date must be after the show from date").bind(NewsRecord::getShowTo, NewsRecord::setShowTo);
}
Also used : NewsRecord(org.komunumo.data.db.tables.records.NewsRecord) FormLayout(com.vaadin.flow.component.formlayout.FormLayout) StringLengthValidator(com.vaadin.flow.data.validator.StringLengthValidator) CustomLabel(org.komunumo.ui.component.CustomLabel) RichTextEditor(com.vaadin.flow.component.richtexteditor.RichTextEditor) Binder(com.vaadin.flow.data.binder.Binder) NewsRecord(org.komunumo.data.db.tables.records.NewsRecord) NotNull(org.jetbrains.annotations.NotNull) TextField(com.vaadin.flow.component.textfield.TextField) DateTimePicker(org.komunumo.ui.component.DateTimePicker) EditDialog(org.komunumo.ui.component.EditDialog) EAGER(com.vaadin.flow.data.value.ValueChangeMode.EAGER) CustomLabel(org.komunumo.ui.component.CustomLabel) StringLengthValidator(com.vaadin.flow.data.validator.StringLengthValidator) TextField(com.vaadin.flow.component.textfield.TextField) RichTextEditor(com.vaadin.flow.component.richtexteditor.RichTextEditor) DateTimePicker(org.komunumo.ui.component.DateTimePicker)

Example 4 with EAGER

use of com.vaadin.flow.data.value.ValueChangeMode.EAGER in project furms by unity-idm.

the class ProjectAllocationDashboardFormView method amountField.

private BigDecimalField amountField() {
    final BigDecimalField amountField = new BigDecimalField();
    amountField.setValueChangeMode(EAGER);
    Optional<AllocationCommunityComboBoxModel> communityAlloc = Optional.ofNullable(binder.getBean().getAllocationCommunity());
    amountField.setReadOnly(!communityAlloc.map(alloc -> alloc.split).orElse(true));
    createUnitLabel(amountField, binder.getBean().getResourceType().unit);
    binder.forField(amountField).withValidator(Objects::nonNull, getTranslation("view.community-admin.project-allocation.form.error.validation.field.amount")).withValidator(this::isAmountCorrect, getTranslation("view.community-admin.project-allocation.form.error.validation.field.amount.range")).bind(ProjectAllocationViewModel::getAmount, ProjectAllocationViewModel::setAmount);
    amountField.setValue(availableAmount);
    return amountField;
}
Also used : ProjectHasMoreThenOneResourceTypeAllocationInGivenTimeException(io.imunity.furms.api.validation.exceptions.ProjectHasMoreThenOneResourceTypeAllocationInGivenTimeException) DefaultNameField(io.imunity.furms.ui.components.DefaultNameField) DashboardView(io.imunity.furms.ui.views.community.DashboardView) NotificationUtils.showErrorNotification(io.imunity.furms.ui.utils.NotificationUtils.showErrorNotification) ValueProvider(com.vaadin.flow.function.ValueProvider) ComponentUtil(com.vaadin.flow.component.ComponentUtil) Binder(com.vaadin.flow.data.binder.Binder) Label(com.vaadin.flow.component.html.Label) PageTitle(io.imunity.furms.ui.components.PageTitle) ComboBox(com.vaadin.flow.component.combobox.ComboBox) FurmsFormLayout(io.imunity.furms.ui.components.FurmsFormLayout) Route(com.vaadin.flow.router.Route) BigDecimal(java.math.BigDecimal) ResourceMeasureUnit(io.imunity.furms.domain.resource_types.ResourceMeasureUnit) LUMO_TERTIARY(com.vaadin.flow.component.button.ButtonVariant.LUMO_TERTIARY) ProjectAllocationService(io.imunity.furms.api.project_allocation.ProjectAllocationService) FurmsViewComponent(io.imunity.furms.ui.components.FurmsViewComponent) BeanValidationBinder(com.vaadin.flow.data.binder.BeanValidationBinder) Setter(com.vaadin.flow.data.binder.Setter) UI(com.vaadin.flow.component.UI) ProjectAllocation(io.imunity.furms.domain.project_allocation.ProjectAllocation) CommunityAdminMenu(io.imunity.furms.ui.views.community.CommunityAdminMenu) EAGER(com.vaadin.flow.data.value.ValueChangeMode.EAGER) Collectors.toSet(java.util.stream.Collectors.toSet) FormButtons(io.imunity.furms.ui.components.FormButtons) AllocationCommunityComboBoxModel(io.imunity.furms.ui.components.support.models.allocation.AllocationCommunityComboBoxModel) BigDecimalField(com.vaadin.flow.component.textfield.BigDecimalField) Set(java.util.Set) ZERO(java.math.BigDecimal.ZERO) FormLayout(com.vaadin.flow.component.formlayout.FormLayout) Objects(java.util.Objects) Button(com.vaadin.flow.component.button.Button) ProjectService(io.imunity.furms.api.projects.ProjectService) Optional(java.util.Optional) ESCAPE(com.vaadin.flow.component.Key.ESCAPE) ResourceTypeComboBoxModel(io.imunity.furms.ui.components.support.models.allocation.ResourceTypeComboBoxModel) ResourceAllocationsGridItem(io.imunity.furms.ui.components.resource_allocations.ResourceAllocationsGridItem) LUMO_PRIMARY(com.vaadin.flow.component.button.ButtonVariant.LUMO_PRIMARY) AllocationCommunityComboBoxModel(io.imunity.furms.ui.components.support.models.allocation.AllocationCommunityComboBoxModel) Objects(java.util.Objects) BigDecimalField(com.vaadin.flow.component.textfield.BigDecimalField)

Example 5 with EAGER

use of com.vaadin.flow.data.value.ValueChangeMode.EAGER in project furms by unity-idm.

the class SitesView method addEditForm.

private Component addEditForm(Editor<SiteGridItem> siteEditor) {
    TextField siteNameField = new TextField();
    siteNameField.setMaxLength(NAME_MAX_LENGTH);
    siteNameField.setWidthFull();
    siteNameField.setValueChangeMode(EAGER);
    siteEditor.getBinder().forField(siteNameField).withValidator(getNotEmptyStringValidator(), getTranslation("view.sites.form.error.validation.field.name.required")).withValidator(siteName -> !siteService.isNamePresentIgnoringRecord(siteName, siteEditor.getItem().getId()), getTranslation("view.sites.form.error.validation.field.name.unique")).bind(SiteGridItem::getName, SiteGridItem::setName);
    return new Div(siteNameField);
}
Also used : DuplicatedNameValidationError(io.imunity.furms.api.validation.exceptions.DuplicatedNameValidationError) Component(com.vaadin.flow.component.Component) LoggerFactory(org.slf4j.LoggerFactory) MenuButton(io.imunity.furms.ui.components.MenuButton) PageTitle(io.imunity.furms.ui.components.PageTitle) Route(com.vaadin.flow.router.Route) FlexLayout(com.vaadin.flow.component.orderedlayout.FlexLayout) DenseGrid(io.imunity.furms.ui.components.DenseGrid) Key(com.vaadin.flow.component.Key) UI(com.vaadin.flow.component.UI) TextField(com.vaadin.flow.component.textfield.TextField) USERS(com.vaadin.flow.component.icon.VaadinIcon.USERS) MethodHandles(java.lang.invoke.MethodHandles) Editor(com.vaadin.flow.component.grid.editor.Editor) RouterGridLink(io.imunity.furms.ui.components.RouterGridLink) END(com.vaadin.flow.component.grid.ColumnTextAlign.END) Objects(java.util.Objects) List(java.util.List) Optional(java.util.Optional) NotificationUtils.showSuccessNotification(io.imunity.furms.ui.utils.NotificationUtils.showSuccessNotification) ViewHeaderLayout(io.imunity.furms.ui.components.ViewHeaderLayout) EditorOpenEvent(com.vaadin.flow.component.grid.editor.EditorOpenEvent) NotificationUtils.showErrorNotification(io.imunity.furms.ui.utils.NotificationUtils.showErrorNotification) SiteHasResourceCreditsRemoveValidationError(io.imunity.furms.api.validation.exceptions.SiteHasResourceCreditsRemoveValidationError) Binder(com.vaadin.flow.data.binder.Binder) Div(com.vaadin.flow.component.html.Div) FurmsDialog(io.imunity.furms.ui.components.FurmsDialog) PLUS_CIRCLE(com.vaadin.flow.component.icon.VaadinIcon.PLUS_CIRCLE) LUMO_TERTIARY(com.vaadin.flow.component.button.ButtonVariant.LUMO_TERTIARY) FurmsViewComponent(io.imunity.furms.ui.components.FurmsViewComponent) RouterLink(com.vaadin.flow.router.RouterLink) SiteService(io.imunity.furms.api.sites.SiteService) Icon(com.vaadin.flow.component.icon.Icon) EAGER(com.vaadin.flow.data.value.ValueChangeMode.EAGER) Logger(org.slf4j.Logger) Grid(com.vaadin.flow.component.grid.Grid) TRASH(com.vaadin.flow.component.icon.VaadinIcon.TRASH) FENIX_ADMIN_SITES(io.imunity.furms.domain.constant.RoutesConst.FENIX_ADMIN_SITES) EDIT(com.vaadin.flow.component.icon.VaadinIcon.EDIT) GridActionMenu(io.imunity.furms.ui.components.GridActionMenu) GridActionsButtonLayout(io.imunity.furms.ui.components.GridActionsButtonLayout) ClickEvent(com.vaadin.flow.component.ClickEvent) Site(io.imunity.furms.domain.sites.Site) FenixAdminMenu(io.imunity.furms.ui.views.fenix.menu.FenixAdminMenu) Collectors.toList(java.util.stream.Collectors.toList) Button(com.vaadin.flow.component.button.Button) SitesAdminsView(io.imunity.furms.ui.views.fenix.sites.admins.SitesAdminsView) Comparator(java.util.Comparator) SitesAddView(io.imunity.furms.ui.views.fenix.sites.add.SitesAddView) NAME_MAX_LENGTH(io.imunity.furms.ui.utils.FormSettings.NAME_MAX_LENGTH) Div(com.vaadin.flow.component.html.Div) TextField(com.vaadin.flow.component.textfield.TextField)

Aggregations

Binder (com.vaadin.flow.data.binder.Binder)5 EAGER (com.vaadin.flow.data.value.ValueChangeMode.EAGER)5 FormLayout (com.vaadin.flow.component.formlayout.FormLayout)4 TextField (com.vaadin.flow.component.textfield.TextField)4 ComboBox (com.vaadin.flow.component.combobox.ComboBox)3 RichTextEditor (com.vaadin.flow.component.richtexteditor.RichTextEditor)3 StringLengthValidator (com.vaadin.flow.data.validator.StringLengthValidator)3 Set (java.util.Set)3 NotNull (org.jetbrains.annotations.NotNull)3 CustomLabel (org.komunumo.ui.component.CustomLabel)3 EditDialog (org.komunumo.ui.component.EditDialog)3 UI (com.vaadin.flow.component.UI)2 Button (com.vaadin.flow.component.button.Button)2 LUMO_TERTIARY (com.vaadin.flow.component.button.ButtonVariant.LUMO_TERTIARY)2 Route (com.vaadin.flow.router.Route)2 FurmsViewComponent (io.imunity.furms.ui.components.FurmsViewComponent)2 PageTitle (io.imunity.furms.ui.components.PageTitle)2 NotificationUtils.showErrorNotification (io.imunity.furms.ui.utils.NotificationUtils.showErrorNotification)2 Objects (java.util.Objects)2 Optional (java.util.Optional)2