Skip to content

Commit

Permalink
SPARK-2341 Show instructions from registrationForm
Browse files Browse the repository at this point in the history
  • Loading branch information
stokito committed Sep 12, 2024
1 parent aaf0eb0 commit 45ea7d8
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions core/src/main/java/org/jivesoftware/AccountCreationWizard.java
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,17 @@ private void startRegistration() {
if (accountManager.supportsAccountCreation()) {
formPanel.setVisible(true);
createAccountButton.setEnabled(true);
String instructions = accountManager.getAccountInstructions();
registrationForm = getRegistrationForm();
String instructions = null;
Registration info = getRegistrationInfo();
if (info != null) {
DataForm regFields = info.getExtension(DataForm.class);
if (regFields != null) {
registrationForm = getRegistrationForm(regFields);
instructions = String.join("\n", regFields.getInstructions());
} else {
instructions = info.getInstructions();
}
}
if (registrationForm != null) {
formPanelFields.add(registrationForm);
formPanelFields.setVisible(true);
Expand All @@ -263,16 +272,7 @@ private void startRegistration() {
}
}

private DataFormUI getRegistrationForm() {
Registration info = getRegistrationInfo();
if (info == null) {
return null;
}
DataForm regFields = info.getExtension(DataForm.class);
if (regFields == null) {
return null;
}
// TODO Show regFields.getTitle() and regFields.getInstructions()
private DataFormUI getRegistrationForm(DataForm regFields) {
// Create a new form without username and password that we will render ourself
DataForm extRegFields = regFields.asBuilder()
.removeField("username")
Expand Down

0 comments on commit 45ea7d8

Please sign in to comment.