mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Adding more control over extension preferences page title (#5901)
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
1 parent
392d548bf0
commit
e334a6aeda
4 files changed
+47
-33
No files matched your search
@@ -21,10 +21,12 @@ const extensionPreferencesModelInjectable = getInjectable({
|
||||
const { extensionId, tabId } = pathParameters.get();
|
||||
const targetExtension = extensions.get().find((extension) => extension.sanitizedExtensionId === extensionId);
|
||||
const targetAppTab = targetExtension?.appPreferenceTabs.find(tab => tab.id === tabId);
|
||||
const preferencePageTitle = targetAppTab?.title || `${targetExtension?.manifest.name || "Extension"} preferences`;
|
||||
|
||||
return {
|
||||
extensionName: targetAppTab?.title ?? targetExtension?.manifest.name,
|
||||
extensionName: targetExtension?.manifest.name,
|
||||
preferenceItems: getExtensionPreferenceItems(targetExtension, tabId),
|
||||
preferencePageTitle,
|
||||
};
|
||||
});
|
||||
},
|
||||
|
||||
@@ -16,19 +16,18 @@ interface Dependencies {
|
||||
model: IComputedValue<{
|
||||
preferenceItems: RegisteredAppPreference[];
|
||||
extensionName?: string;
|
||||
preferencePageTitle?: string;
|
||||
}>;
|
||||
}
|
||||
|
||||
const NonInjectedExtensions = ({ model }: Dependencies) => {
|
||||
const { extensionName, preferenceItems } = model.get();
|
||||
const { extensionName, preferenceItems, preferencePageTitle } = model.get();
|
||||
|
||||
return (
|
||||
<Preferences data-testid="extension-preferences-page">
|
||||
<section id="extensions">
|
||||
<h2>
|
||||
{extensionName}
|
||||
{" "}
|
||||
preferences
|
||||
<h2 data-testid="extension-preferences-page-title">
|
||||
{preferencePageTitle}
|
||||
</h2>
|
||||
{!extensionName && (
|
||||
<div
|
||||
|
||||
Reference in new issue
Block a user