Plugins: Support changing plugin IDs (hardcoded) (#67867)

This commit is contained in:
Ryan McKinley
2023-06-02 10:46:12 -07:00
committed by GitHub
parent 4fdccef7b3
commit 422684d8b0
9 changed files with 104 additions and 12 deletions

View File

@ -14,13 +14,16 @@ export function importPanelPlugin(id: string): Promise<PanelPlugin> {
return loaded;
}
const meta = config.panels[id];
const meta = config.panels[id] || Object.values(config.panels).find((p) => p.alias === id);
if (!meta) {
throw new Error(`Plugin ${id} not found`);
}
promiseCache[id] = getPanelPlugin(meta);
if (id !== meta.type) {
promiseCache[meta.type] = promiseCache[id];
}
return promiseCache[id];
}