Relations within DualPane Component

Hi,

We are facing a bit of a dilemma.

We have established a relationship, as illustrated in the following image:

Currently, we’re attempting to utilize this relationship within a DualPane interface. While it “works” for the initial assignment, we encounter a problem: all items are displayed in the DualPane, and after selecting them, they remain available for subsequent assignments. This contradicts the concept of a 1:n relationship because the items are already in use.

How would you model/override/request the items so that only the unassigned items are displayed in the DualPane?

Hey @soeren-round-ridge,

there was a bug that was fixed with 2023.06-ext4 (A12-15146).
For a relationship that is configured as yours, you should now see the following, when you edit the links of a relationship (and close and reopen the modal again):

(QA manual was linked before the document was openend and not touched,
Backend was removed in this editing session,
Frontend was linked before the doc was opened, but removed (then the modal closed and opened again)
DevOps was added in this editing session

→ the entries behave like they should: Backend is again selectable, DevOps, Frontend & QA is not. Reclamation was never linked and is add’able.)

(However, if you still have “Duplicates allowed” set in your model file, you can add multiple links to the same document in the DualPane, but not save it. So the UI is unfriendly but the persisted data is correct. You should get a warning in the SME. Once you remove Duplicates allowed, it should work again.

)

Hi @felix-blazing-river,

this is true and works good, but only if you select the same entity.

What @soeren-round-ridge refers to is when you have Item A assigned to Person A, then Item A will still be shown as available to Person B and can be chosen, but that cannot work since the 1:n constraint.

To elaborate a bit more. We have used a CRUDForm here (which is not customizable) and then switched to our own FormEngine. We then overrode the form and tried to access the DualPaneSelection via a CustomScreenElement using a switch case, but are currently failing to integrate the DualPaneSelection because it is internal from the NodeModules. So, see the following more as pseudocode - how we thought it would work. (const customDualPane=… is then the problem)

export const AssignmentFormScreenElement = (
    props: FormModelMap.FormModelComponentProps<FormModel.CustomScreenElement>
): ReactElement => {
    const { activityId } = useContext(ViewViews.ActivityContext) ?? {};
    const isBoundModelElement = useIsBoundModelElement(props.modelElement.id);

    const customDualPane = useCallback(
        (multiSelectionProps: MultiSelectionProps) => <DualPaneSelection {...multiSelectionProps} />,
        [props.modelElement.id]
    );

    const componentProvider = useCallback(
        (config: Relationship.ComponentConfiguration) => customComponentProvider(config, customDualPane),
        [customDualPane]
    );

    if (!activityId || !isBoundModelElement) {
        return <RelationshipFormModelMap.CustomScreenElement.component {...props} />;
    }

    return (
        <div className={addPrefix("form__section")}>
            <RelationshipEngine
                activityId={activityId}
                instanceId={props.modelElement.id}
                attachmentHandler={props.config.renderOptions.config.attachmentHandler}
                componentProvider={componentProvider}
            />
        </div>
    );
};

const customComponentProvider = (
    config: Relationship.ComponentConfiguration,
    multiSelectionProps: (props: MultiSelectionProps) => ReactElement
): Component | undefined => {
    switch (config.name) {
        case "DualPaneSelection":
            return { type: "MultiSelection", component: multiSelectionProps };
        default:
            return undefined;
    }
};

Any news on this?

Hey @soeren-round-ridge / @raffael-broad-linden ,
sorry for the delay here - we’re still investigating and our DEV team will get back in contact with you shortly with further details!

Best,
Nico

Hi @soeren-round-ridge / @raffael-broad-linden ,

firstly thank you for your report/question.

Regarding your original use case of only having the documents listed as candidates that do not violate the link constrataints:
This is indeed a gap in relationships in A12. We have created a ticket (A12-15676) for it and will be following up on the topic. Of course, we will keep you in the loop here regarding any developments on this.

Regarding your approach of customizing the DualPaneSelection to workaround this problem:
Unfortunately, this is currently not possible as the DualPane components is internal. We are discussing and evaluating, if this can be made public. Once there is more information on this topic, we will also provide an update here.

If this is an urgent and important topic for your project, please let us know and we will try to find some workaround solution for you that we can provide in the meantime.

Best,
Denise

Hi @denise-narrow-token,

thank you for the response and all the information!

Since you mentioned that the DualPaneSelection Component is internal, we have experienced the same issue, that a component is internal, but we would like to use it with only slight modifications, with others as well.

To name two more examples:
The DropDownSelection, which is also a Relationship component, we had to copy-paste it together with some other internal dependencies declared by it.

The DetachedRepeat is only customizable as a whole, so while you can replace all of it, if you want to only customize a certain aspect of it, f. ex. its event buttons, they are again hard-wired into it and internal. And not only the event buttons, but also its other dependencies, which makes copy-pasting it almost impossible. There is another Thread regarding the DetachedRepeat here Customize "Commit" Button on Detached Repeat.

Maybe it would be worthwhile to consider a discussion for the other internal components as well?

Hi @raffael-broad-linden,

please excuse my late reply. I think you definetely have a valid point and I have been discussing your request within the A12 team.

Regarding the internal relationship components: There are currently plans to provide a public API for customizing the relationship components for the October release.

Regarding the DetachedRepeat (and other internal components): There are currently no plans to make this public. But if you have need for this and a concrete use case, then please create a request ticket on the A12 Support Portal and we will analyze if this would be possible.

Best,
Denise

Regarding ticket A12-15676, are there any plans to address this issue, or are there any known workarounds?

Additionally, is it possible to set a static filter beforehand?

Hello @soeren-round-ridge,

Yes, we currently have a survey to collect requirements/use cases for a future public API and customizable UI components for relationships/CDMs.

We would appreciate, if you could add your input to the survey. Thanks!

(But it is currently not possible to set a static filter beforehand.)