Control dashboard-order as implementing website

I know that a package developer can set a “weight” for a dashboard, but I’m wondering if there is a good way for me as user to control the order from many different extensions?

E.g. if I don’t agree with the weights that different extension developer gave their dashboard extension?

image

// Markus

Something along the lines of a package to update weights… following this that updated conditions. (just simple js over ts for the example)

{
  "name": "Dashboard Customization",
  "version": "1.0.0",
  "extensions": [
    {
      "type": "backofficeEntryPoint",
      "alias": "DashboardCustomization.EntryPoint",
      "name": "Dashboard Customization Entry Point",
      "js": "/App_Plugins/MoveRedirectManagementDashboard/dashboards-setup.js"
    }
  ]
}

wwwroot\App_Plugins\MoveRedirectManagementDashboard\dashboards-setup.js

import { UMB_SETTINGS_SECTION_ALIAS } from '@umbraco-cms/backoffice/settings';
import { UMB_SECTION_ALIAS_CONDITION_ALIAS } from '@umbraco-cms/backoffice/section';

const REDIRECT_MANAGEMENT_DASHBOARD_ALIAS = 'Umb.Dashboard.RedirectManagement';

export const onInit = (_host, extensionRegistry) => {
    
    const coreManifest = extensionRegistry.getByAlias(REDIRECT_MANAGEMENT_DASHBOARD_ALIAS);

    if (!coreManifest) return;

    coreManifest.conditions = [{
        alias: UMB_SECTION_ALIAS_CONDITION_ALIAS,
        match: UMB_SETTINGS_SECTION_ALIAS,
    }];
};

from a larger thread..

Thank @mistyn8 ! Seems like this could be used to adjust the weight and not the conditions I guess.

I’m comfortable with this but it feels like it would be nice to have a easier way for devs to move around dashboards if they need to.

I’ll post any findings here after playing with this.

Agree completely—the road to progress with Umbraco of late means everything isn’t quite as plug-and-play or straightforward as it used to be. At least AI is here to help pick up the slack to restore parity!
Appreciate you sharing your findings.

There is no feature to manipulate manifests.

But you can do a bit of hacking.

The simple one would be via the entry point(similar as in Mike comment, assuming they are registered at the time)

Then grab the manifest you want to alter, unregister it, and register a new altered version, same Alias, so same extension, Just one value is changed.

const coreManifest = extensionRegistry.getByAlias(REDIRECT_MANAGEMENT_DASHBOARD_ALIAS);

    if (!coreManifest) return;

const newManifest = {
    ...coreManifest,
weight: 1234
}

extensionRegistry.unregister(coreManifest.alias);
// Maybe you need to wait one JS Cycle here; not sure, but try without for a start.
extensionRegistry.register(newManifest);

The other option, maybe a prettier version, would be to make yours a new one that overwrites the core one:

const coreManifest = extensionRegistry.getByAlias(REDIRECT_MANAGEMENT_DASHBOARD_ALIAS);

    if (!coreManifest) return;

const newManifest = {
    ...coreManifest,
alias: 'bring.your.own.unique.alias'
overwrites: coreManifest.alias,
weight: 1234
}

extensionRegistry.register(newManifest);

I hope that helps — the reason why it is not a supported feature is that we haven’t seen the need for such so far. And what are the potential troubles of having other manipulating manifests.
But we support appending conditions as mike mentioned.

I’ve put this in to the power toys package (because we already had, enable/disable dashboards, seemed like the next step :slight_smile: )

Drag and drop re-ordering of installed dashboards :

Waooow! @KevinJump! I have to check this out! #h5yr