Skip to content

Commit a9001b8

Browse files
feat(extensions): rename plugins to extensions, enable marketplace plugin by default and show it as catalog on the new renamed page (redhat-developer#2358)
* feat(marketplace): allow plugins to extend the plugins page Signed-off-by: Christoph Jerolimov <[email protected]> * feat(marketplace): update marketplace plugin Signed-off-by: Christoph Jerolimov <[email protected]> * fix(marketplace): fix mount points in app-config.dynamic-plugins.yaml Signed-off-by: Christoph Jerolimov <[email protected]> * fix(marketplace): fix e2e tests Signed-off-by: Christoph Jerolimov <[email protected]> * fix(marketplace): enable marketplace plugin by default Signed-off-by: Christoph Jerolimov <[email protected]> * fix(marketplace): update marketplace plugin Signed-off-by: Christoph Jerolimov <[email protected]> * fix(marketplace): rename to extensions/catalog Signed-off-by: Christoph Jerolimov <[email protected]> --------- Signed-off-by: Christoph Jerolimov <[email protected]>
1 parent 93b19c9 commit a9001b8

File tree

19 files changed

+237
-139
lines changed

19 files changed

+237
-139
lines changed

app-config.dynamic-plugins.yaml

+7-8
Original file line numberDiff line numberDiff line change
@@ -506,12 +506,11 @@ dynamicPlugins:
506506
- name: marketplace
507507
importName: MarketplaceIcon
508508
dynamicRoutes:
509-
- path: /marketplace
510-
importName: MarketplacePage
511-
menuItem:
512-
icon: marketplace
513-
text: Marketplace
509+
- path: /extensions/catalog
510+
importName: DynamicMarketplacePluginRouter
514511
mountPoints:
515-
- mountPoint: admin.page.plugins/cards
516-
importName: MarketplaceCatalogContent
517-
512+
- mountPoint: internal.plugins/tab
513+
importName: DynamicMarketplacePluginContent
514+
config:
515+
path: marketplace
516+
title: Catalog

dynamic-plugins.default.yaml

+10-10
Original file line numberDiff line numberDiff line change
@@ -1089,11 +1089,11 @@ plugins:
10891089
pingIdentityOrg: {}
10901090
# Group: Marketplace
10911091
- package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-catalog-backend-module-marketplace-dynamic
1092-
disabled: true
1092+
disabled: false
10931093
- package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-marketplace-backend-dynamic
1094-
disabled: true
1094+
disabled: false
10951095
- package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-marketplace
1096-
disabled: true
1096+
disabled: false
10971097
pluginConfig:
10981098
dynamicPlugins:
10991099
frontend:
@@ -1102,11 +1102,11 @@ plugins:
11021102
- name: marketplace
11031103
importName: MarketplaceIcon
11041104
dynamicRoutes:
1105-
- path: /marketplace
1106-
importName: MarketplacePage
1107-
menuItem:
1108-
icon: marketplace
1109-
text: Marketplace
1105+
- path: /extensions/catalog
1106+
importName: DynamicMarketplacePluginRouter
11101107
mountPoints:
1111-
- mountPoint: admin.page.plugins/cards
1112-
importName: MarketplaceCatalogContent
1108+
- mountPoint: internal.plugins/tab
1109+
importName: DynamicMarketplacePluginContent
1110+
config:
1111+
path: marketplace
1112+
title: Catalog

dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-catalog-backend-module-marketplace-dynamic/package.json

+18-15
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,53 @@
11
{
22
"name": "red-hat-developer-hub-backstage-plugin-catalog-backend-module-marketplace",
3-
"version": "0.0.2",
3+
"version": "0.2.0",
44
"main": "src/index.ts",
55
"types": "src/index.ts",
66
"license": "Apache-2.0",
7+
"private": true,
78
"publishConfig": {
8-
"access": "public",
9-
"main": "dist/index.cjs.js",
10-
"types": "dist/index.d.ts"
9+
"access": "public"
1110
},
1211
"backstage": {
1312
"role": "backend-plugin-module",
1413
"supported-versions": "1.35.1",
1514
"pluginId": "catalog",
1615
"pluginPackage": "@backstage/plugin-catalog-backend"
1716
},
18-
"sideEffects": false,
17+
"exports": {
18+
".": "./src/index.ts",
19+
"./package.json": "./package.json"
20+
},
21+
"typesVersions": {
22+
"*": {
23+
"package.json": [
24+
"package.json"
25+
]
26+
}
27+
},
1928
"scripts": {
2029
"tsc": "tsc",
2130
"build": "backstage-cli package build",
2231
"lint:check": "backstage-cli package lint",
2332
"test": "backstage-cli package test --passWithNoTests --coverage",
2433
"clean": "backstage-cli package clean",
2534
"clean-dynamic-sources": "yarn clean && rm -Rf node_modules",
26-
"export-dynamic": "janus-cli package export-dynamic-plugin --embed-package @red-hat-developer-hub/backstage-plugin-catalog-backend-module-marketplace",
35+
"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",
2736
"export-dynamic:clean": "run export-dynamic --clean"
2837
},
2938
"dependencies": {
30-
"@red-hat-developer-hub/backstage-plugin-catalog-backend-module-marketplace": "0.0.2"
39+
"@red-hat-developer-hub/backstage-plugin-catalog-backend-module-marketplace": "0.2.0"
3140
},
3241
"devDependencies": {
3342
"@backstage/cli": "0.29.6",
3443
"@janus-idp/cli": "3.2.0",
3544
"typescript": "5.7.3"
3645
},
3746
"files": [
38-
"app-config.dynamic.yaml",
3947
"dist",
40-
"dist-scalprum"
48+
"dist-dynamic/*.*",
49+
"dist-dynamic/dist/**"
4150
],
42-
"scalprum": {
43-
"name": "red-hat-developer-hub.backstage-plugin-catalog-backend-module-marketplace-dynamic",
44-
"exposedModules": {
45-
"PluginRoot": "./src/index.ts"
46-
}
47-
},
4851
"repository": {
4952
"type": "git",
5053
"url": "https://github.com/redhat-developer/rhdh",

dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-marketplace-backend-dynamic/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "red-hat-developer-hub-backstage-plugin-marketplace-backend",
3-
"version": "0.0.2",
3+
"version": "0.2.0",
44
"main": "src/index.ts",
55
"types": "src/index.ts",
66
"license": "Apache-2.0",
@@ -35,11 +35,11 @@
3535
"test": "backstage-cli package test --passWithNoTests --coverage",
3636
"clean": "backstage-cli package clean",
3737
"clean-dynamic-sources": "yarn clean && rm -Rf node_modules",
38-
"export-dynamic": "janus-cli package export-dynamic-plugin --embed-package @red-hat-developer-hub/backstage-plugin-marketplace-backend",
38+
"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",
3939
"export-dynamic:clean": "run export-dynamic --clean"
4040
},
4141
"dependencies": {
42-
"@red-hat-developer-hub/backstage-plugin-marketplace-backend": "0.0.2"
42+
"@red-hat-developer-hub/backstage-plugin-marketplace-backend": "0.2.0"
4343
},
4444
"devDependencies": {
4545
"@backstage/cli": "0.29.6",

dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-marketplace/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "red-hat-developer-hub-backstage-plugin-marketplace",
3-
"version": "0.0.2",
3+
"version": "0.2.0",
44
"main": "src/index.ts",
55
"types": "src/index.ts",
66
"license": "Apache-2.0",
@@ -29,7 +29,7 @@
2929
"export-dynamic:clean": "run export-dynamic --clean"
3030
},
3131
"dependencies": {
32-
"@red-hat-developer-hub/backstage-plugin-marketplace": "0.0.2"
32+
"@red-hat-developer-hub/backstage-plugin-marketplace": "0.2.0"
3333
},
3434
"devDependencies": {
3535
"@backstage/cli": "0.29.6",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { test as base } from "@playwright/test";
2+
import { Common } from "../utils/common";
3+
import { UIhelper } from "../utils/ui-helper";
4+
5+
const test = base.extend<{ uiHelper: UIhelper }>({
6+
uiHelper: async ({ page }, use) => {
7+
use(new UIhelper(page));
8+
},
9+
});
10+
11+
test.describe("Admin > Extensions > Catalog", () => {
12+
test.beforeEach(async ({ page, uiHelper }) => {
13+
await new Common(page).loginAsKeycloakUser();
14+
await uiHelper.openSidebarButton("Administration");
15+
await uiHelper.openSidebar("Extensions");
16+
await uiHelper.verifyHeading("Extensions");
17+
});
18+
19+
test("Tabs includes a tab for extensions", async ({ uiHelper }) => {
20+
await uiHelper.clickTab("Catalog");
21+
// TODO: check plugins grid when we initialized some test data
22+
});
23+
});

e2e-tests/playwright/e2e/plugin-marketplace.spec.ts

-19
This file was deleted.

e2e-tests/playwright/e2e/plugins/analytics/analytics-disabled-rbac.spec.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ test.describe.skip('Check RBAC "analytics-provider-segment" plugin', () => {
1313
common = new Common(page);
1414
await common.loginAsKeycloakUser();
1515
await uiHelper.openSidebarButton("Administration");
16-
await uiHelper.openSidebar("Plugins");
17-
await uiHelper.verifyHeading("Plugins");
16+
await uiHelper.openSidebar("Extensions");
17+
await uiHelper.verifyHeading("Extensions");
18+
await uiHelper.clickTab("Installed");
1819
});
1920

2021
test("is disabled", async ({ page }) => {

e2e-tests/playwright/e2e/plugins/dynamic-plugins-info/dynamic-plugins-info.spec.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ test.describe("dynamic-plugins-info UI tests", () => {
1212
common = new Common(page);
1313
await common.loginAsGuest();
1414
await uiHelper.openSidebarButton("Administration");
15-
await uiHelper.openSidebar("Plugins");
16-
await uiHelper.verifyHeading("Plugins");
15+
await uiHelper.openSidebar("Extensions");
16+
await uiHelper.verifyHeading("Extensions");
17+
await uiHelper.clickTab("Installed");
1718
});
1819

1920
test("it should show a table, and the table should contain techdocs plugins", async ({

e2e-tests/playwright/utils/navbar.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ export type SidebarTabs =
66
| "Home"
77
| "Create..."
88
| "Learning Paths"
9-
| "Marketplace"
10-
| "Plugins"
9+
| "Extensions"
1110
| "Bulk import"
1211
| "Docs"
1312
| "Clusters"

packages/app/src/App.tsx

+14-4
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,29 @@ const baseFrontendConfig = {
2323
],
2424
dynamicRoutes: [
2525
{
26-
path: '/plugins',
27-
importName: 'DynamicPluginsInfo',
26+
path: '/extensions',
27+
importName: 'DynamicPluginsInfoPage',
2828
menuItem: { text: 'Plugins', icon: 'pluginsInfoIcon' },
2929
},
3030
],
31+
mountPoints: [
32+
{
33+
mountPoint: 'internal.plugins/tab',
34+
importName: 'DynamicPluginsInfoContent',
35+
config: {
36+
path: 'installed',
37+
title: 'Installed',
38+
},
39+
},
40+
],
3141
menuItems: {
3242
admin: {
3343
title: 'Administration',
3444
icon: 'adminIcon',
3545
},
36-
plugins: {
46+
extensions: {
3747
parent: 'admin',
38-
title: 'Plugins',
48+
title: 'Extensions',
3949
icon: 'pluginsInfoIcon',
4050
},
4151
},
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# please keep this in sync with packages/app/src/App.tsx
2+
dynamicPlugins:
3+
frontend:
4+
internal.plugin-dynamic-plugins-info:
5+
appIcons:
6+
- name: pluginsInfoIcon
7+
importName: PluginsInfoIcon
8+
- name: adminIcon
9+
importName: AdminIcon
10+
dynamicRoutes:
11+
- path: /extensions
12+
importName: DynamicPluginsInfoPage
13+
menuItem:
14+
text: Extensions
15+
icon: pluginsInfoIcon
16+
mountPoints:
17+
- mountPoint: internal.plugins/tab
18+
importName: DynamicPluginsInfoContent
19+
config:
20+
path: installed
21+
title: Installed
22+
menuItems:
23+
admin:
24+
title: Administration
25+
icon: adminIcon
26+
extensions:
27+
parent: admin
28+
title: Extensions
29+
icon: pluginsInfoIcon

plugins/dynamic-plugins-info/app-config.janus-idp.yaml

-14
This file was deleted.

plugins/dynamic-plugins-info/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"@material-table/core": "3.2.5",
4040
"@mui/icons-material": "5.16.14",
4141
"@mui/material": "5.16.14",
42+
"@scalprum/react-core": "0.9.3",
4243
"react-use": "17.6.0"
4344
},
4445
"peerDependencies": {
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import { DynamicPluginsInfoPage } from '../DynamicPluginsInfoPage';
1+
import { DynamicPluginsTable } from '../DynamicPluginsTable/DynamicPluginsTable';
22

3-
export const DynamicPluginsInfoContent = () => <DynamicPluginsInfoPage />;
3+
export const DynamicPluginsInfoContent = () => <DynamicPluginsTable />;

0 commit comments

Comments
 (0)