-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#37 Externalization of auth view and userGroups. Widgets are reused i…
…n wizard.
- Loading branch information
Showing
19 changed files
with
896 additions
and
619 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
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
67 changes: 67 additions & 0 deletions
67
src/main/java/software/netcore/radman/ui/component/wizard/demo/UserGroupStep.java
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 |
---|---|---|
@@ -0,0 +1,67 @@ | ||
package software.netcore.radman.ui.component.wizard.demo; | ||
|
||
import com.vaadin.flow.component.Component; | ||
import lombok.NonNull; | ||
import org.vaadin.firitin.components.orderedlayout.VVerticalLayout; | ||
import software.netcore.radman.buisness.service.user.radius.dto.RadiusGroupDto; | ||
import software.netcore.radman.ui.component.wizard.WizardStep; | ||
import software.netcore.radman.ui.view.userGroups.widget.UserGroupsForm; | ||
|
||
import java.util.List; | ||
|
||
public class UserGroupStep implements WizardStep<NewEntityWizardDataStorage> { | ||
|
||
private final VVerticalLayout contentLayout = new VVerticalLayout(); | ||
private final List<WizardStep<NewEntityWizardDataStorage>> steps; | ||
private final UserGroupsForm userGroupsForm; | ||
|
||
public UserGroupStep(List<WizardStep<NewEntityWizardDataStorage>> steps) { | ||
this.steps = steps; | ||
userGroupsForm = new UserGroupsForm(); | ||
userGroupsForm.setBean(new RadiusGroupDto()); | ||
contentLayout.withComponent(userGroupsForm); | ||
} | ||
|
||
@Override | ||
public Component getContent() { | ||
steps.add(new UserGroupStepSecond()); | ||
return contentLayout; | ||
} | ||
|
||
@Override | ||
public boolean isValid() { | ||
return userGroupsForm.isValid(); | ||
} | ||
|
||
@Override | ||
public void writeDataToStorage(@NonNull NewEntityWizardDataStorage dataStorage) { | ||
dataStorage.setRadiusGroupDto(userGroupsForm.getBean()); | ||
} | ||
|
||
private class UserGroupStepSecond implements WizardStep<NewEntityWizardDataStorage> { | ||
|
||
private final VVerticalLayout contentLayout = new VVerticalLayout(); | ||
|
||
@Override | ||
public Component getContent() { | ||
return contentLayout; | ||
} | ||
|
||
@Override | ||
public boolean isValid() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public void writeDataToStorage(@NonNull NewEntityWizardDataStorage dataStorage) { | ||
|
||
} | ||
|
||
@Override | ||
public boolean hasNextStep() { | ||
return false; | ||
} | ||
|
||
} | ||
|
||
} |
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
Oops, something went wrong.