Skip to content

Proposal: App Details UI extensions should be able to configure preferences for the App Details view #25074

@jwinters01

Description

@jwinters01

Summary

Application Details View UI extensions should be able to configure certain aspects of the application details screen to fit the ideal UX of the extension.

Motivation

Image Above is an example of a UI extension we are building, along with the ideal state we would like to configure the Application view to while this extension is displayed.

Namely, while this extension is loaded, we would like to be able to:

  1. Hide the status panels, as they are unnecessary for this view.
  2. Hide certain action buttons that are irrelevant to this workflow.
  3. Move the navigation toolbar (top right) to the top-level header of the page, pushing the View's title to the center to compensate.

Initial View here for reference:
Image

Proposal

This can be accomplished by creating an additional argument passed to the registerAppViewExtension function, that will allow extensions to pass a set of overrides to appDetails view preferences

function registerAppViewExtension(
    component: ExtensionComponent,
    title: string,
    icon: string,
    prefOverrides: Partial<AppDetailsPreferences>
)

When the extension is rendered, we apply the preference changes supplied, cleaning them up as a part of a useEffect:

const ExtensionView = (props: {extension: AppViewExtension; application: models.Application; tree: models.ApplicationTree}) => {
    const {extension, application, tree} = props;
    // pull out the extension overrides, clean them up when the component is unmounted
    useEffect(() => {
        const previousPreferences = services.viewPreferences.getPreferences().appDetails
        services.viewPreferences.updatePreferences({appDetails: {...prefOverrides}})
        return () => services.viewPreferences.updatePreferences({appDetails: {...previousPreferences}})
    });
    return <extension.component application={application} tree={tree} />;
};

Some new preferences would also be created to get the UX we are looking for:
showStatusPanels: defaults to true, determines whether or not status panels should be shown
actionButtons: list of strings to represent which action buttons should be available (we can possibly make this an enum to make configuration easier)
toolsPosition: DEFAULT | INLINE, determines the position of the view tools in the top bar.

The preferences themselves are open to discussion, the important part is how they are loaded into the core application.

Metadata

Metadata

Assignees

No one assigned

    Labels

    component:uiUser interfaces bugs and enhancementscomponent:ui/extensionIssues related to UI extension mechanismenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions