[sumeyye.kurtulus] said: Hi! Here's an approach you can follow:
const userNameField = new FormProp<IdentityUserDto>({ type: ePropType.String, name: 'userName', displayName: 'New Username', id: 'userName', autocomplete: 'new-username', validators: _ => [Validators.required, Validators.minLength(4)], }); export function userCreateFormContributor(formProps: FormPropList<IdentityUserDto>) { const userNameIndex = formProps.indexOf('userName', (action, name) => action.name === name); formProps.dropByIndex(userNameIndex); formProps.addByIndex(userNameField, userNameIndex); } export const identityCreateFormContributors: IdentityCreateFormPropContributors = { [eIdentityComponents.Users]: [userCreateFormContributor], }; export const identityEditFormContributors: IdentityEditFormPropContributors = { [eIdentityComponents.Users]: [userCreateFormContributor], };
Then, configure your route like this:
// app-routing.module ... { path: 'identity', loadChildren: () => import('@volo/abp.ng.identity').then(m => m.IdentityModule.forLazy({ createFormPropContributors: identityCreateFormContributors, editFormPropContributors: identityCreateFormContributors, }), ), }, ...
Let me know if you need any further help!
ah, thank you works now. i had a similar code by the id was in PascalCase , therefore it wasn't working.
is it ok if i get my ticket allocation refunded for this please?
[AI-Bot] said: const usernameProp = propList.get('userName'); if (usernameProp) { // Update validators as needed usernameProp.validators = () => [ Validators.required, Validators.minLength(6), // Example: minimum length Validators.pattern(/^[a-zA-Z0-9_]+$/) // Example: alphanumeric and underscores only ];
Hi,
i understand that there are ways to delete and add fields on form via form extensions.
How about edit? I want to edit the validation of the username.
I've tried deleting the existing username prop and added a new custom usernameprop but am now having issues when i edit the form.
https://abp.io/docs/latest/framework/ui/angular/dynamic-form-extensions
Just an FYI, I think this ticket might be related to this other ticket which i saw: https://abp.io/support/questions/8916/Text-templates-Language-texts-for-all-tenants
It might be worth linking that ticket here as this seems to solve the issue requested by the author (at least the part about language texts)
Hi berkansasmaz
Thank you, i've made both changes described
and it works now. Really appreciate the support!
Alright, i've sent an email to support for assistance.
Hi any response on this? thanks
After some testing, i did notice that language texts that do not have a base value in that language will cascade fine.
I set value of Deutsch translation to "Guten Tag" in host, that seems to cascade to tenant fine. There is no value for HomePage:Title2 in the de-DE.json
Hi berkansasmaz,
I've done the following as you mentioned, however the text in tenants are still different from what' we've set in host
Changed host text (Recommended Realplays --changed to--> Your Recommended Realplays)
However, despite implementing code you provided, the tenant still sees different (old) text:
greatly appreciated, i think we can close this ticket, many thanks