Skip to content

Commit

Permalink
chore: use publisher.extension-name as extension id
Browse files Browse the repository at this point in the history
avoid potential collision if it is just the name

Change-Id: Ib872bb654e2961513f7367eff6dcb7e258b6d2e0

Signed-off-by: Florent Benoit <fbenoit@redhat.com>
Change-Id: Ie018e0a0e210b8599c7b425dc877c9d308cf870d
  • Loading branch information
benoitf committed May 24, 2023
1 parent 0f5bf12 commit 060a6fa
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/main/src/plugin/extension-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ export class ExtensionLoader {
const api = this.createApi(extensionPath, manifest);

const extension: AnalyzedExtension = {
id: manifest.name,
id: `${manifest.publisher}.${manifest.name}`,
manifest,
path: extensionPath,
mainPath: path.resolve(extensionPath, manifest.main),
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/plugin/featured/featured.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ test('getFeaturedExtensions should check installable extensions', async () => {
listExtensionsMock.mockReturnValue([
{
publisher: 'podman-desktop',
id: 'podman',
id: 'podman-desktop.podman',
// make it a built-in extension (cannot be removed, just disabled)
removable: false,
},
Expand Down
4 changes: 1 addition & 3 deletions packages/main/src/plugin/featured/featured.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ export class Featured {
};

// check if the extension is installed
const extensionInfo = extensionInfos.find(
extensionInfo => `${extensionInfo.publisher}.${extensionInfo.id}` === extensionToCheck.extensionId,
);
const extensionInfo = extensionInfos.find(extensionInfo => extensionInfo.id === extensionToCheck.extensionId);
if (extensionInfo) {
// found it so we can flag them as installed/fetched
featuredExtension.installed = true;
Expand Down
4 changes: 2 additions & 2 deletions packages/renderer/src/PreferencesNavigation.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ $: addSectionHiddenClass = (section: string): string => (sectionExpanded[section
<section class="pf-c-nav__subnav {addSectionHiddenClass('extensionsCatalog')}">
<ul class="pf-c-nav__list">
{#each $extensionInfos as extension}
<li class="pf-c-nav__item {addCurrentClass(`/preferences/extension/${extension.name}`)}">
<li class="pf-c-nav__item {addCurrentClass(`/preferences/extension/${extension.id}`)}">
<a
href="/preferences/extension/{extension.name}"
href="/preferences/extension/{extension.id}"
id="configuration-section-extensions-catalog-{extension.name.toLowerCase()}"
class="pf-c-nav__link"
style="font-weight: 200">{extension.displayName}</a>
Expand Down

0 comments on commit 060a6fa

Please sign in to comment.