use of io.imunity.furms.ui.components.FurmsFormLayout in project furms by unity-idm.
the class ProjectAllocationDashboardFormView method addForm.
private void addForm(DefaultNameField nameField) {
final FormLayout formLayout = new FurmsFormLayout();
final Label availableAmountLabel = new Label();
formLayout.addFormItem(nameField, getTranslation("view.community-admin.project-allocation.form.field.name"));
formLayout.addFormItem(projectsField(), getTranslation("view.community-admin.project-allocation.form.field.projects"));
formLayout.addFormItem(resourceTypeField(), getTranslation("view.community-admin.project-allocation.form.field.resource_type"));
formLayout.addFormItem(communityAllocation(availableAmountLabel), getTranslation("view.community-admin.project-allocation.form.field.community_allocation"));
formLayout.addFormItem(amountField(), getTranslation("view.fenix-admin.resource-credits-allocation.form.field.amount"));
formLayout.addFormItem(availableAmountLabel, "");
getContent().add(formLayout);
}
use of io.imunity.furms.ui.components.FurmsFormLayout in project furms by unity-idm.
the class SitesAddView method addForm.
private void addForm() {
FormLayout formLayout = new FurmsFormLayout();
formLayout.setSizeFull();
SiteCreationParam formData = new SiteCreationParam();
Binder<SiteCreationParam> binder = new Binder<>(SiteCreationParam.class);
binder.setBean(formData);
name.setPlaceholder(getTranslation("view.sites.add.form.name.placeholder"));
name.setRequiredIndicatorVisible(true);
name.setValueChangeMode(EAGER);
name.setMaxLength(NAME_MAX_LENGTH);
Button cancel = new Button(getTranslation("view.sites.add.form.button.cancel"), e -> doCancelAction());
cancel.addThemeVariants(LUMO_TERTIARY);
Button save = new Button(getTranslation("view.sites.add.form.button.save"), e -> doSaveAction(formData, binder));
save.addThemeVariants(LUMO_PRIMARY);
save.addClickShortcut(Key.ENTER);
FormButtons buttons = new FormButtons(cancel, save);
binder.addStatusChangeListener(status -> save.setEnabled(!isBlank(name.getValue()) && !status.hasValidationErrors()));
binder.forField(name).withValidator(getNotEmptyStringValidator(), getTranslation("view.sites.form.error.validation.field.name.required")).withValidator(siteService::isNamePresent, getTranslation("view.sites.form.error.validation.field.name.unique")).bind(SiteCreationParam::getName, SiteCreationParam::setName);
formLayout.addFormItem(name, getTranslation("view.sites.add.form.name"));
getContent().add(formLayout, buttons);
}
use of io.imunity.furms.ui.components.FurmsFormLayout in project furms by unity-idm.
the class DashboardResourceAllocateFormView method addForm.
private void addForm(DefaultNameField nameField) {
final FormLayout formLayout = new FurmsFormLayout();
final Label availableAmountLabel = new Label();
formLayout.addFormItem(nameField, getTranslation("view.fenix-admin.resource-credits-allocation.form.field.name"));
formLayout.addFormItem(siteField(), getTranslation("view.fenix-admin.resource-credits-allocation.form.field.site"));
formLayout.addFormItem(communityField(), getTranslation("view.fenix-admin.resource-credits-allocation.form.field.community"));
formLayout.addFormItem(resourceTypeField(), getTranslation("view.fenix-admin.resource-credits-allocation.form.field.resource_type"));
formLayout.addFormItem(resourceCreditField(availableAmountLabel), getTranslation("view.fenix-admin.resource-credits-allocation.form.field.resource_credit"));
formLayout.addFormItem(amountField(), getTranslation("view.fenix-admin.resource-credits-allocation.form.field.amount"));
formLayout.addFormItem(availableAmountLabel, "");
getContent().add(formLayout);
}
use of io.imunity.furms.ui.components.FurmsFormLayout in project furms by unity-idm.
the class SettingsView method addForm.
private void addForm(SiteSettingsDto dto) {
FormLayout formLayout = new FurmsFormLayout();
Binder<SiteSettingsDto> binder = new Binder<>(SiteSettingsDto.class);
binder.setBean(dto);
formLayout.add(furmsIdRow(binder.getBean().getId(), getTranslation("view.site-admin.settings.form.furms-id")));
formLayout.addFormItem(externalIdRow(binder), getTranslation("view.site-admin.settings.form.external-id"));
formLayout.addFormItem(nameRow(binder), getTranslation("view.site-admin.settings.form.name"));
formLayout.addFormItem(oauthClientIdRow(binder), getTranslation("view.site-admin.settings.form.oauth-client"));
formLayout.addFormItem(connectionInfoRow(binder), getTranslation("view.site-admin.settings.form.info"));
formLayout.addFormItem(sshKeyFromMandatory(binder), "");
formLayout.addFormItem(prohibitOldSSHKey(binder), "");
formLayout.addFormItem(uploadRow(binder), getTranslation("view.site-admin.settings.form.logo"));
formLayout.addFormItem(policyRow(binder), getTranslation("view.site-admin.settings.form.policy"));
formLayout.add(buttonsRow(binder));
getContent().add(formLayout);
}
use of io.imunity.furms.ui.components.FurmsFormLayout in project furms by unity-idm.
the class SitesView method addConnectionInfoPanel.
private void addConnectionInfoPanel() {
connectionInfo = new Div();
connectionInfo.setVisible(false);
connectionInfo.addClassName("user-sites-connection-info-content");
connectionInfoLabel = new H4("");
connectionInfoLabel.setVisible(false);
final FurmsFormLayout formLayout = new FurmsFormLayout();
formLayout.addClassName("user-sites-connection-info");
formLayout.addFormItem(connectionInfo, connectionInfoLabel);
connectionInfo.addClickListener(event -> {
if (event.getClickCount() == DOUBLECLICK) {
connectionInfoLabel.setText("");
connectionInfo.setText("");
connectionInfo.setVisible(false);
connectionInfoLabel.setVisible(false);
}
});
getContent().add(formLayout);
}
Aggregations