What is the new behaviour?
new ProcessFormRenderingService (alfresco/process-services)
new CloudFormRenderingService (alfresco/process-services-cloud)
Matt Savino
@_MattSavino_twitter
@DenysVuika I'm trying any combination of injecting ProcessFormRenderingService into my component - with no luck so far. I noticed typeId was added to the custom widgets which extend WidgetComponent - so I added that. I've even tried making a custom form rendering service which extends ProcessFormRenderingService and no luck so far. I just cannot get it to recognize my custom widget. It always says Unknown type in the form.
It feels like form.component.ts is now running off of its own instance of ProcessFormRenderingService, which I don't have access to in my component and can't register my custom widget with.
All this code works on 3.6 and 3.7 and just follows the examples in demo-shell and the yo generator. I assume those don't work with 3.8.
Denys Vuika
@DenysVuika
The typeId was added to our widgets just to facilitate unit testing, it has no value outside our test suits
You can refer to the whole suit of unit tests to see what was changed: https://github.com/Alfresco/alfresco-ng2-components/pull/5601/files. I don't know how your code looks like, but you should not be redefining any custom classes, or replacing the FormRenderingService with anything else. It's hard to say why your code is failing without any steps to reproduce, but check out the unit tests we have
That example is not updated. Don't know why you take our e2e app as a reference
Matt Savino
@_MattSavino_twitter
We register the custom stencil in the constructor just like this component. Are you able to confirm this code still works?
Tim Donovan
@tdonovancsra
@DenysVuika are you saying we need to implement our own FormRenderingService provider by creating our own class?
Matt Savino
@_MattSavino_twitter
Ok can you give me an example that works?
Because I've tried everything I can think of
Denys Vuika
@DenysVuika
@tdonovancsra instead of injecting FormRenderingService you should be injecting ProcessFormRenderingService
Matt Savino
@_MattSavino_twitter
I am
it doesn't work - the component is never recognized
Denys Vuika
@DenysVuika
are we talking about APS 1.x or Cloud?
Matt Savino
@_MattSavino_twitter
APS
there's the template
I think if you try to call formRenderingService.setComponentTypeResolver() in any custom component which embeds <adf-form> in its template, you'll see that it doesn't work as of 3.8
_
Denys Vuika
@DenysVuika
Ok, guys, I think that there's a bug there. It may have multiple instances of ProcessFormRenderingService
Tim Donovan
@tdonovancsra
yeah I imported and still not working
Matt Savino
@_MattSavino_twitter
Yeah that's what it seemed like to me. I'm fine with a workaround if there is one. Thanks a lot for looking into this Denys. I really appreciate it.
I was wondering how provider works under the covers. I guess maybe it makes a separate instance just for the built in form component somehow?
Denys Vuika
@DenysVuika
Can someone try a quick workaround before I dive deeper into the fix. In the @Component attribute of the component that holds the Form, define providers section like this:
How is Alfresco Digital Workspace intended to be customized?
These are options that came to my mind:
Add customizations as Angular Library in Alfresco Digital Workspace application?
Add customizations in Alfresco Content App and deploy it as root project in Alfresco Digital Workspace application?
Something else?
2 replies
Eddie May
@freshwebs_twitter
Alfresco Hackathon is happening now - come & join us.
Matt Savino
@_MattSavino_twitter
Does anyone know how to determine the current tab in the form? We're trying to do some custom behavior based on which tab is showing. I've been trying to find a way to get the current tab index for most of the day but no luck. It's probably something simple I'm just missing. Please help :)
Matt Savino
@_MattSavino_twitter
Ok I'd doing this but I don't feel good about it: const activeTab = document.getElementsByClassName("mat-tab-label-active");
I guess we're safe unless angular changes their class names or adf stops using angular material tabs
Matt Savino
@_MattSavino_twitter
Hey @DenysVuika - quick question - is the ability to set a field's value programmatically, as the user clicks around the form not an expected requirement? We were able to programmatically set checkbox value until 3.8. But with this code change we no longer can update a checkbox in real time programatically. It only happens on init of the checkbox (IE - after saving the form and reloading) https://github.com/Alfresco/alfresco-ng2-components/pull/5657/files