Hi, I'm trying to add a custom property to the tenant entity through the dynamic form extension. In the end I want to be able to upload a file in the create and edit form which is then saved to the tenant. As a first step I wanted to add a simple string property and followed the documentation for that: https://docs.abp.io/en/abp/latest/UI/Angular/Dynamic-Form-Extensions After doing that I got the new input field but the value that I put there didn't get saved in the database. However when I added the same property through the Extension Manager in the backend it worked but then I got 2 input fields in the form. What am I doing wrong?
This is my form prop contributor:
import {
eSaasComponents,
SaasCreateFormPropContributors,
} from '@volo/abp.ng.saas';
import { SaasTenantDto } from '@volo/abp.ng.saas/proxy';
import { ePropType, FormProp, FormPropList } from '@abp/ng.components/extensible';
const imageProp = new FormProp<SaasTenantDto>({
type: ePropType.String,
name: 'Image',
displayName: 'AbpTenantManagement::Image',
formText: 'Upload an image for the tenant',
isExtra: true,
//template: ImageUploadComponent
});
export function imagePropContributor(propList: FormPropList<SaasTenantDto>) {
propList.addTail(imageProp);
}
export const saasCreateFormPropContributors: SaasCreateFormPropContributors = {
[eSaasComponents.Tenants]: [
imagePropContributor,
// You can add more contributors here
],
};
export const saasEditFormPropContributors = saasCreateFormPropContributors;
This is how I use it in my routing module:
const routes: Routes = [
//other routes
{
path: 'saas',
loadChildren: () => import('@volo/abp.ng.saas').then(m =>
m.SaasModule.forLazy({
createFormPropContributors: saasCreateFormPropContributors,
editFormPropContributors: saasEditFormPropContributors,
})
),
},
//other routes
];
@NgModule({
imports: [RouterModule.forRoot(routes, {})],
exports: [RouterModule],
})
export class AppRoutingModule {}