Skip to content

Commit

Permalink
feat(extensions): rename plugins to extensions, enable marketplace pl…
Browse files Browse the repository at this point in the history
…ugin by default and show it as catalog on the new renamed page (#2358)

* feat(marketplace): allow plugins to extend the plugins page

Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>

* feat(marketplace): update marketplace plugin

Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>

* fix(marketplace): fix mount points in app-config.dynamic-plugins.yaml

Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>

* fix(marketplace): fix e2e tests

Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>

* fix(marketplace): enable marketplace plugin by default

Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>

* fix(marketplace): update marketplace plugin

Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>

* fix(marketplace): rename to extensions/catalog

Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>

---------

Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
  • Loading branch information
christoph-jerolimov authored Mar 5, 2025
1 parent 93b19c9 commit a9001b8
Show file tree
Hide file tree
Showing 19 changed files with 237 additions and 139 deletions.
15 changes: 7 additions & 8 deletions app-config.dynamic-plugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -506,12 +506,11 @@ dynamicPlugins:
- name: marketplace
importName: MarketplaceIcon
dynamicRoutes:
- path: /marketplace
importName: MarketplacePage
menuItem:
icon: marketplace
text: Marketplace
- path: /extensions/catalog
importName: DynamicMarketplacePluginRouter
mountPoints:
- mountPoint: admin.page.plugins/cards
importName: MarketplaceCatalogContent

- mountPoint: internal.plugins/tab
importName: DynamicMarketplacePluginContent
config:
path: marketplace
title: Catalog
20 changes: 10 additions & 10 deletions dynamic-plugins.default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1089,11 +1089,11 @@ plugins:
pingIdentityOrg: {}
# Group: Marketplace
- package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-catalog-backend-module-marketplace-dynamic
disabled: true
disabled: false
- package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-marketplace-backend-dynamic
disabled: true
disabled: false
- package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-marketplace
disabled: true
disabled: false
pluginConfig:
dynamicPlugins:
frontend:
Expand All @@ -1102,11 +1102,11 @@ plugins:
- name: marketplace
importName: MarketplaceIcon
dynamicRoutes:
- path: /marketplace
importName: MarketplacePage
menuItem:
icon: marketplace
text: Marketplace
- path: /extensions/catalog
importName: DynamicMarketplacePluginRouter
mountPoints:
- mountPoint: admin.page.plugins/cards
importName: MarketplaceCatalogContent
- mountPoint: internal.plugins/tab
importName: DynamicMarketplacePluginContent
config:
path: marketplace
title: Catalog
Original file line number Diff line number Diff line change
@@ -1,50 +1,53 @@
{
"name": "red-hat-developer-hub-backstage-plugin-catalog-backend-module-marketplace",
"version": "0.0.2",
"version": "0.2.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
"private": true,
"publishConfig": {
"access": "public",
"main": "dist/index.cjs.js",
"types": "dist/index.d.ts"
"access": "public"
},
"backstage": {
"role": "backend-plugin-module",
"supported-versions": "1.35.1",
"pluginId": "catalog",
"pluginPackage": "@backstage/plugin-catalog-backend"
},
"sideEffects": false,
"exports": {
".": "./src/index.ts",
"./package.json": "./package.json"
},
"typesVersions": {
"*": {
"package.json": [
"package.json"
]
}
},
"scripts": {
"tsc": "tsc",
"build": "backstage-cli package build",
"lint:check": "backstage-cli package lint",
"test": "backstage-cli package test --passWithNoTests --coverage",
"clean": "backstage-cli package clean",
"clean-dynamic-sources": "yarn clean && rm -Rf node_modules",
"export-dynamic": "janus-cli package export-dynamic-plugin --embed-package @red-hat-developer-hub/backstage-plugin-catalog-backend-module-marketplace",
"export-dynamic": "janus-cli package export-dynamic-plugin --embed-package @red-hat-developer-hub/backstage-plugin-catalog-backend-module-marketplace --embed-package @red-hat-developer-hub/backstage-plugin-marketplace-common",
"export-dynamic:clean": "run export-dynamic --clean"
},
"dependencies": {
"@red-hat-developer-hub/backstage-plugin-catalog-backend-module-marketplace": "0.0.2"
"@red-hat-developer-hub/backstage-plugin-catalog-backend-module-marketplace": "0.2.0"
},
"devDependencies": {
"@backstage/cli": "0.29.6",
"@janus-idp/cli": "3.2.0",
"typescript": "5.7.3"
},
"files": [
"app-config.dynamic.yaml",
"dist",
"dist-scalprum"
"dist-dynamic/*.*",
"dist-dynamic/dist/**"
],
"scalprum": {
"name": "red-hat-developer-hub.backstage-plugin-catalog-backend-module-marketplace-dynamic",
"exposedModules": {
"PluginRoot": "./src/index.ts"
}
},
"repository": {
"type": "git",
"url": "https://github.com/redhat-developer/rhdh",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "red-hat-developer-hub-backstage-plugin-marketplace-backend",
"version": "0.0.2",
"version": "0.2.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
Expand Down Expand Up @@ -35,11 +35,11 @@
"test": "backstage-cli package test --passWithNoTests --coverage",
"clean": "backstage-cli package clean",
"clean-dynamic-sources": "yarn clean && rm -Rf node_modules",
"export-dynamic": "janus-cli package export-dynamic-plugin --embed-package @red-hat-developer-hub/backstage-plugin-marketplace-backend",
"export-dynamic": "janus-cli package export-dynamic-plugin --embed-package @red-hat-developer-hub/backstage-plugin-marketplace-backend --embed-package @red-hat-developer-hub/backstage-plugin-marketplace-common",
"export-dynamic:clean": "run export-dynamic --clean"
},
"dependencies": {
"@red-hat-developer-hub/backstage-plugin-marketplace-backend": "0.0.2"
"@red-hat-developer-hub/backstage-plugin-marketplace-backend": "0.2.0"
},
"devDependencies": {
"@backstage/cli": "0.29.6",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "red-hat-developer-hub-backstage-plugin-marketplace",
"version": "0.0.2",
"version": "0.2.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
Expand Down Expand Up @@ -29,7 +29,7 @@
"export-dynamic:clean": "run export-dynamic --clean"
},
"dependencies": {
"@red-hat-developer-hub/backstage-plugin-marketplace": "0.0.2"
"@red-hat-developer-hub/backstage-plugin-marketplace": "0.2.0"
},
"devDependencies": {
"@backstage/cli": "0.29.6",
Expand Down
23 changes: 23 additions & 0 deletions e2e-tests/playwright/e2e/extensions.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { test as base } from "@playwright/test";
import { Common } from "../utils/common";
import { UIhelper } from "../utils/ui-helper";

const test = base.extend<{ uiHelper: UIhelper }>({
uiHelper: async ({ page }, use) => {
use(new UIhelper(page));
},
});

test.describe("Admin > Extensions > Catalog", () => {
test.beforeEach(async ({ page, uiHelper }) => {
await new Common(page).loginAsKeycloakUser();
await uiHelper.openSidebarButton("Administration");
await uiHelper.openSidebar("Extensions");
await uiHelper.verifyHeading("Extensions");
});

test("Tabs includes a tab for extensions", async ({ uiHelper }) => {
await uiHelper.clickTab("Catalog");
// TODO: check plugins grid when we initialized some test data
});
});
19 changes: 0 additions & 19 deletions e2e-tests/playwright/e2e/plugin-marketplace.spec.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ test.describe.skip('Check RBAC "analytics-provider-segment" plugin', () => {
common = new Common(page);
await common.loginAsKeycloakUser();
await uiHelper.openSidebarButton("Administration");
await uiHelper.openSidebar("Plugins");
await uiHelper.verifyHeading("Plugins");
await uiHelper.openSidebar("Extensions");
await uiHelper.verifyHeading("Extensions");
await uiHelper.clickTab("Installed");
});

test("is disabled", async ({ page }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ test.describe("dynamic-plugins-info UI tests", () => {
common = new Common(page);
await common.loginAsGuest();
await uiHelper.openSidebarButton("Administration");
await uiHelper.openSidebar("Plugins");
await uiHelper.verifyHeading("Plugins");
await uiHelper.openSidebar("Extensions");
await uiHelper.verifyHeading("Extensions");
await uiHelper.clickTab("Installed");
});

test("it should show a table, and the table should contain techdocs plugins", async ({
Expand Down
3 changes: 1 addition & 2 deletions e2e-tests/playwright/utils/navbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ export type SidebarTabs =
| "Home"
| "Create..."
| "Learning Paths"
| "Marketplace"
| "Plugins"
| "Extensions"
| "Bulk import"
| "Docs"
| "Clusters"
Expand Down
18 changes: 14 additions & 4 deletions packages/app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,29 @@ const baseFrontendConfig = {
],
dynamicRoutes: [
{
path: '/plugins',
importName: 'DynamicPluginsInfo',
path: '/extensions',
importName: 'DynamicPluginsInfoPage',
menuItem: { text: 'Plugins', icon: 'pluginsInfoIcon' },
},
],
mountPoints: [
{
mountPoint: 'internal.plugins/tab',
importName: 'DynamicPluginsInfoContent',
config: {
path: 'installed',
title: 'Installed',
},
},
],
menuItems: {
admin: {
title: 'Administration',
icon: 'adminIcon',
},
plugins: {
extensions: {
parent: 'admin',
title: 'Plugins',
title: 'Extensions',
icon: 'pluginsInfoIcon',
},
},
Expand Down
29 changes: 29 additions & 0 deletions plugins/dynamic-plugins-info/app-config.dynamic.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# please keep this in sync with packages/app/src/App.tsx
dynamicPlugins:
frontend:
internal.plugin-dynamic-plugins-info:
appIcons:
- name: pluginsInfoIcon
importName: PluginsInfoIcon
- name: adminIcon
importName: AdminIcon
dynamicRoutes:
- path: /extensions
importName: DynamicPluginsInfoPage
menuItem:
text: Extensions
icon: pluginsInfoIcon
mountPoints:
- mountPoint: internal.plugins/tab
importName: DynamicPluginsInfoContent
config:
path: installed
title: Installed
menuItems:
admin:
title: Administration
icon: adminIcon
extensions:
parent: admin
title: Extensions
icon: pluginsInfoIcon
14 changes: 0 additions & 14 deletions plugins/dynamic-plugins-info/app-config.janus-idp.yaml

This file was deleted.

1 change: 1 addition & 0 deletions plugins/dynamic-plugins-info/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"@material-table/core": "3.2.5",
"@mui/icons-material": "5.16.14",
"@mui/material": "5.16.14",
"@scalprum/react-core": "0.9.3",
"react-use": "17.6.0"
},
"peerDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { DynamicPluginsInfoPage } from '../DynamicPluginsInfoPage';
import { DynamicPluginsTable } from '../DynamicPluginsTable/DynamicPluginsTable';

export const DynamicPluginsInfoContent = () => <DynamicPluginsInfoPage />;
export const DynamicPluginsInfoContent = () => <DynamicPluginsTable />;
Loading

0 comments on commit a9001b8

Please # to comment.