hilla icon indicating copy to clipboard operation
hilla copied to clipboard

Forward to serverview with ccdm

Open bogdanudrescu opened this issue 5 years ago • 0 comments

Add tests validating that forward to serverview works with ccdm.

If it doesn't work, fix it.

Following TODOs are removed from code, but searching by the above and below code lines should lead to the code in JavaScriptBootstrapUI:

clientConnect

        if (getForwardToClientUrl() != null) {
            navigateToClient(getForwardToClientUrl());
            acknowledgeClient();

            // TODO: Handle forward to server view.

        } else if (isPostponed()) {

leaveNavigation

        navigateToPlaceholder(new Location(PathUtil.trimPath(route)));

        // TODO: Handle forward to server view which may happen in a
        // BeforeLeaveEvent or deny the forward or reroute to a server view in
        // BeforeLeaveEvent.

        // Inform the client whether the navigation should be postponed
        if (isPostponed()) {
            cancelClient();
        } else {
            acknowledgeClient();
        }

renderViewForRoute

                navigateToPlaceholder(location);

                // TODO: Handle forward to server view which may happen in a
                // BeforeLeaveEvent or deny the forward or reroute to a server view in
                // BeforeLeaveEvent.

                if (!isPostponed()) {
                    // Route does not exist, and current view does not prevent
                    // navigation thus an error page is shown
                    handleErrorNavigation(location);
                }

Consider also JavaScriptNavigationStateRenderer:

            if (continueNavigationAction != null
                    // We're trying to navigate to a client view.
                    && JavaScriptBootstrapUI.ClientViewPlaceholder.class
                            .isAssignableFrom(getNavigationState()
                                    .getNavigationTarget())) {

                // FIXME: This could be invoked from ClientViewPlaceholder or
                // another client placeholder view type.
                jsUI.navigateToClient(
                        event.getLocation().getPathWithQueryParameters());
            }

bogdanudrescu avatar May 25 '20 10:05 bogdanudrescu