New field in create Collection form

52 views
Skip to first unread message

Pierre Roozmon

unread,
Sep 6, 2022, 11:48:54 AM9/6/22
to DSpace Developers
I've added  new field and it works fine (i.e. I can submit it). However, the hint attribute doesn't appear when I add it to the dynamic model. How can I get it to work:? Sanme for tool tips.

    new DynamicTextAreaModel({
      id: 'description-nom',
      name: 'dc.description.nom',
      labelTooltip: 'create.community.other-name.hint',
      controlTooltip: 'create.community.other-name.hint',
      hint: 'create.community.other-name.hint'
    }),

Pierre Roozmon

unread,
Sep 7, 2022, 7:08:09 PM9/7/22
to DSpace Developers
Just be clear, the above example is for code to create a Community, but the exact same issue exists for creating a Collection. Essentially, the problem is that previously this was done via input-forms.xml, but this is no longer supported in v7.x. 

The online literature suggestt that input-forms.xml has been replced by  submission-forms.xml and item-submission.xml, but they only pertain to creating an Item. Hence it appears that fields for a Community and Collection must be added/modified programmatically now, via one of the  dynamic control models, such as DynamicTextAreaModel.

On Tuesday, September 6, 2022 at 11:48:54 AM UTC-4 Pierre Roozmon wrote:
I've added  new field and it works fine (i.e. I can submit it). However, the hint attribute doesn't appear when I add it to the dynamic model. How can I get it to work:? Same for tool tips.

Tim Donohue

unread,
Sep 12, 2022, 1:05:34 PM9/12/22
to DSpace Developers
Hi,

I am able to successfully get "hint" settings to work.  But, you are correct, it doesn't appear that "labelTooltip" or "controlTooltip" options work.  I don't see anywhere in DSpace 7 where we use those tooltip options though.  So, it's very possible that is either a bug in the ng-dynamic-forms library (https://github.com/udos86/ng-dynamic-forms) which we use for these fields, or maybe a bug in how DSpace is using that library?

In any case, I can get a "hint" to display.  I updated "collection-form.models.ts" to add a hint to the "dc.description" here: 
https://github.com/DSpace/dspace-angular/blob/main/src/app/collection-page/collection-form/collection-form.models.ts#L26-L29

I updated it to say this:

new DynamicTextAreaModel({
    id: 'description',
    name: 'dc.description',
    hint: 'Please fill out a description of the Collection'
}),

And, I can see the results updated in the Collection form.

You are correct that in DSpace 7, currently the Community & Collection forms are not configurable except by modifying the Angular code.

Tim
Reply all
Reply to author
Forward
0 new messages