I’m working on developing the configuration page for my module and when configuring the second page I came across this problem with my labels.
I am using a UserMfaRecord.properties file for them and I think I did everything the same way I did for the first page but somehow I can’t seem to get the labels to have the correct name. I got the category to work properly using a different .properties file (the same one I used for my first page), but when I tried using it for the labels it still didn’t change a thing. Here’s the code:
public static class UserMfaRecord extends PersistentRecord {
public static final RecordMeta<UserMfaRecord> META = new RecordMeta<UserMfaRecord>(
UserMfaRecord.class, "UserMfaRecord")
.setNounKey("UserMfaRecord.Noun")
.setNounPluralKey("UserMfaRecord.Noun.Plural");
public interface IRecordListener<T> {
void onRecordCreated(T record);
}
private static final List<IRecordListener<UserMfaRecord>> listeners = new ArrayList<>();
public static void addRecordListener(IRecordListener<UserMfaRecord> listener) {
listeners.add(listener);
}
public UserMfaRecord() {
super();
notifyCustomListeners(this);
}
public static void notifyCustomListeners(UserMfaRecord record) {
for (IRecordListener<UserMfaRecord> listener : listeners) {
listener.onRecordCreated(record);
}
}
public static final IdentityField Id = new IdentityField(META);
public static final StringField User = new StringField(META, "User", SFieldFlags.SPRIMARY_KEY,
SFieldFlags.SMANDATORY, SFieldFlags.SDESCRIPTIVE);
// public static final EncodedStringField Password
// = new EncodedStringField(META, "Password", SFieldFlags.SMANDATORY, SFieldFlags.SDESCRIPTIVE);
public static final EnumField<MfaOptions> MfaOption
= new EnumField<>(META, "MfaOption", MfaOptions.class, SFieldFlags.SMANDATORY, SFieldFlags.SDESCRIPTIVE);
public static final Category USER_DATA
= new Category("KeycloakSettingsRecord.Category.USER_DATA", 1000)
.include(User, MfaOption);
static {
User.setUnique(true);
MfaOption.setDefault(MfaOptions.SMS);
}
And here’s the properties file: UserMfaRecord.properties
User.Name=Username
MfaOption.Name=Mfa Option
If anyone has any tips I’d really appreciate the help!
