Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions workspaces/dcm/.changeset/clean-styles-brave-logos.md

This file was deleted.

15 changes: 0 additions & 15 deletions workspaces/dcm/.changeset/fix-pagination-reset-on-search.md

This file was deleted.

5 changes: 0 additions & 5 deletions workspaces/dcm/.changeset/funny-eagles-drum.md

This file was deleted.

14 changes: 0 additions & 14 deletions workspaces/dcm/.changeset/golden-ships-deploy.md

This file was deleted.

25 changes: 0 additions & 25 deletions workspaces/dcm/.changeset/kind-ravens-rehydrate.md

This file was deleted.

6 changes: 0 additions & 6 deletions workspaces/dcm/.changeset/large-emus-share.md

This file was deleted.

27 changes: 0 additions & 27 deletions workspaces/dcm/.changeset/remove-legacy-env-specs-screens.md

This file was deleted.

41 changes: 0 additions & 41 deletions workspaces/dcm/.changeset/slim-lobsters-refactor.md

This file was deleted.

10 changes: 0 additions & 10 deletions workspaces/dcm/.changeset/swift-foxes-token.md

This file was deleted.

69 changes: 69 additions & 0 deletions workspaces/dcm/plugins/dcm-backend/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# @red-hat-developer-hub/backstage-plugin-dcm-backend

## 2.0.0

### Major Changes

- c287a53: Developing DCM Plugin skeleton

### Minor Changes

- 4a316f7: Refactor DCM frontend plugin for reusability, maintainability, and test coverage.

**New shared utilities & hooks**

- `createYupValidator` – factory that wraps a Yup schema and returns stable `validate` / `isValid` helpers, eliminating per-tab validation boilerplate.
- `useCrudTab` – custom React hook that centralises data loading, client-side search/pagination, and create/edit/delete dialog state for every CRUD tab. Tabs now consist only of feature-specific rendering logic.

**New shared components**

- `DcmCrudTabLayout` – generic layout that handles loading spinners, load-error alerts with a Retry button, empty states, and a searchable paginated table inside an `InfoCard`.
- `DcmFormDialogActions` – reusable Save / Cancel button row with loading spinner and disabled states, used by all form dialogs.
- `DcmErrorSnackbar` – transient error snackbar for surfacing delete-operation failures.
- `DcmDeleteDialog` – standalone confirmation dialog component extracted from inline usage.

**Per-feature file decomposition**

Each CRUD tab now has dedicated files for form types, Yup schema, field components, and column definitions:

- `providers/` → `providerFormTypes.ts`, `components/ProviderFormFields.tsx`, `components/ProviderStatus.tsx`, `components/CopyButton.tsx`
- `policies/` → `policyFormTypes.ts`, `components/PolicyFormFields.tsx`
- `catalog-items/` → `catalogItemFormTypes.ts`, `components/CatalogItemFormFields.tsx`
- `catalog-item-instances/` → `instanceFormTypes.ts`, `components/InstanceFormFields.tsx`
- `resources/` → `resourceFormTypes.ts`, `components/ResourceFormFields.tsx`

**Error handling improvements**

Load errors and delete errors are now surfaced in the UI via `DcmCrudTabLayout` (inline alert with Retry) and `DcmErrorSnackbar` respectively, replacing silent `.catch(() => {})` handlers.

**Dead code removal**

Removed the unused `ExampleComponent` directory and its tests.

**Test coverage**

Added unit tests for `extractApiError`, `createYupValidator`, `useCrudTab`, `DcmFormDialogActions`, `DcmDeleteDialog`, and form-type validators for providers, policies, and resources.

### Patch Changes

- ba41609: Add Docker/Podman deployment support for the DCM plugin.

- Added `Dockerfile` (multi-stage build) to produce a standalone Backstage image
- Added `app-config.production.yaml` for container runtime configuration
- Added `scripts/generate-image.sh` (renamed from `dynamic-plugins.sh`) with commands to build and push both the OCI dynamic-plugin artifact and the full Backstage application image
- Added `.dockerignore` to exclude sensitive and dev-only files from the build context
- Configured guest auth (`dangerouslyAllowOutsideDevelopment`) for container environments
- Skip SSO token exchange in the backend proxy when `clientId`/`clientSecret` are not set

- c9312e8: Fix 502 error when SSO credentials are not configured.

The backend proxy now skips the SSO token exchange when `clientId` or
`clientSecret` are absent, forwarding requests to the API gateway without
an Authorization header instead of failing with "Failed to obtain upstream
access token."

- Updated dependencies [ba41609]
- Updated dependencies [e3985a8]
- Updated dependencies [c287a53]
- Updated dependencies [4a316f7]
- @red-hat-developer-hub/backstage-plugin-dcm-common@2.0.0
2 changes: 1 addition & 1 deletion workspaces/dcm/plugins/dcm-backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@red-hat-developer-hub/backstage-plugin-dcm-backend",
"version": "1.0.0",
"version": "2.0.0",
"license": "Apache-2.0",
"main": "src/index.ts",
"types": "src/index.ts",
Expand Down
77 changes: 77 additions & 0 deletions workspaces/dcm/plugins/dcm-common/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# @red-hat-developer-hub/backstage-plugin-dcm-common

## 2.0.0

### Major Changes

- c287a53: Developing DCM Plugin skeleton

### Minor Changes

- e3985a8: DCM UI and catalog client updates for the example app and published plugins.

**Example app (`packages/app`) — RBAC navigation**

- Removed the **RBAC** sidebar entry under Administration and the `/rbac` route.
- Dropped the `@backstage-community/plugin-rbac` frontend dependency. The RBAC backend plugin may remain for permissions; only the menu and page were removed.

**`@red-hat-developer-hub/backstage-plugin-dcm` — Resources tab**

- Removed the **Resources** tab from the Data Center page and all **Placement / `resources`** proxy usage from the plugin.
- Removed `placementApiRef`, `resources` route ref, and the `PlacementClient` integration from the plugin surface.

**`@red-hat-developer-hub/backstage-plugin-dcm-common` — placement API removed; catalog rehydrate**

- Removed the Placement API client, types, and tests tied to the internal `resources` API.
- Added **`rehydrateCatalogItemInstance`** on `CatalogApi` / `CatalogClient`: `POST .../catalog-item-instances/{id}:rehydrate`.

**Catalog item instances UI**

- Added a **Rehydrate** action (outlined button with refresh icon) on each instance row, success and error snackbars, and a unit test for the new client method.

- 4a316f7: Refactor DCM frontend plugin for reusability, maintainability, and test coverage.

**New shared utilities & hooks**

- `createYupValidator` – factory that wraps a Yup schema and returns stable `validate` / `isValid` helpers, eliminating per-tab validation boilerplate.
- `useCrudTab` – custom React hook that centralises data loading, client-side search/pagination, and create/edit/delete dialog state for every CRUD tab. Tabs now consist only of feature-specific rendering logic.

**New shared components**

- `DcmCrudTabLayout` – generic layout that handles loading spinners, load-error alerts with a Retry button, empty states, and a searchable paginated table inside an `InfoCard`.
- `DcmFormDialogActions` – reusable Save / Cancel button row with loading spinner and disabled states, used by all form dialogs.
- `DcmErrorSnackbar` – transient error snackbar for surfacing delete-operation failures.
- `DcmDeleteDialog` – standalone confirmation dialog component extracted from inline usage.

**Per-feature file decomposition**

Each CRUD tab now has dedicated files for form types, Yup schema, field components, and column definitions:

- `providers/` → `providerFormTypes.ts`, `components/ProviderFormFields.tsx`, `components/ProviderStatus.tsx`, `components/CopyButton.tsx`
- `policies/` → `policyFormTypes.ts`, `components/PolicyFormFields.tsx`
- `catalog-items/` → `catalogItemFormTypes.ts`, `components/CatalogItemFormFields.tsx`
- `catalog-item-instances/` → `instanceFormTypes.ts`, `components/InstanceFormFields.tsx`
- `resources/` → `resourceFormTypes.ts`, `components/ResourceFormFields.tsx`

**Error handling improvements**

Load errors and delete errors are now surfaced in the UI via `DcmCrudTabLayout` (inline alert with Retry) and `DcmErrorSnackbar` respectively, replacing silent `.catch(() => {})` handlers.

**Dead code removal**

Removed the unused `ExampleComponent` directory and its tests.

**Test coverage**

Added unit tests for `extractApiError`, `createYupValidator`, `useCrudTab`, `DcmFormDialogActions`, `DcmDeleteDialog`, and form-type validators for providers, policies, and resources.

### Patch Changes

- ba41609: Add Docker/Podman deployment support for the DCM plugin.

- Added `Dockerfile` (multi-stage build) to produce a standalone Backstage image
- Added `app-config.production.yaml` for container runtime configuration
- Added `scripts/generate-image.sh` (renamed from `dynamic-plugins.sh`) with commands to build and push both the OCI dynamic-plugin artifact and the full Backstage application image
- Added `.dockerignore` to exclude sensitive and dev-only files from the build context
- Configured guest auth (`dangerouslyAllowOutsideDevelopment`) for container environments
- Skip SSO token exchange in the backend proxy when `clientId`/`clientSecret` are not set
2 changes: 1 addition & 1 deletion workspaces/dcm/plugins/dcm-common/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@red-hat-developer-hub/backstage-plugin-dcm-common",
"description": "Common functionalities for the dcm plugin",
"version": "1.0.0",
"version": "2.0.0",
"backstage": {
"pluginId": "dcm",
"pluginPackages": [
Expand Down
Loading