1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Use extension's app preference tab name when available (#5798)

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2022-07-06 22:34:58 -07:00 committed by GitHub
parent d44599af00
commit 07c5de6e8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 7 deletions

View File

@ -173,7 +173,7 @@ exports[`preferences - navigation to extension specific preferences given in pre
id="extensions" id="extensions"
> >
<h2> <h2>
registered-tab-page-id Metrics tab
preferences preferences
</h2> </h2>
@ -473,7 +473,7 @@ exports[`preferences - navigation to extension specific preferences given in pre
id="extensions" id="extensions"
> >
<h2> <h2>
registered-tab-page-id Metrics tab
preferences preferences
</h2> </h2>
@ -773,7 +773,7 @@ exports[`preferences - navigation to extension specific preferences given in pre
id="extensions" id="extensions"
> >
<h2> <h2>
duplicated-tab-page-id Metrics tab
preferences preferences
</h2> </h2>
@ -3264,7 +3264,7 @@ exports[`preferences - navigation to extension specific preferences when navigat
id="extensions" id="extensions"
> >
<h2> <h2>
duplicated-tab-page-id Metrics tab
preferences preferences
</h2> </h2>

View File

@ -20,9 +20,10 @@ const extensionPreferencesModelInjectable = getInjectable({
return computed(() => { return computed(() => {
const { extensionId, tabId } = pathParameters.get(); const { extensionId, tabId } = pathParameters.get();
const targetExtension = extensions.get().find((extension) => extension.sanitizedExtensionId === extensionId); const targetExtension = extensions.get().find((extension) => extension.sanitizedExtensionId === extensionId);
const targetAppTab = targetExtension?.appPreferenceTabs.find(tab => tab.id === tabId);
return { return {
extensionName: targetExtension?.manifest.name, extensionName: targetAppTab?.title ?? targetExtension?.manifest.name,
preferenceItems: getExtensionPreferenceItems(targetExtension, tabId), preferenceItems: getExtensionPreferenceItems(targetExtension, tabId),
}; };
}); });