Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
fix(user-settings): enhance build-info config to make it intuitive
  • Loading branch information
debsmita1 committed Sep 18, 2025
commit a7d15693ba2b251dec08365641b1d79ba590345a
2 changes: 1 addition & 1 deletion .ibm/pipelines/resources/config_map/app-config-rhdh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -226,4 +226,4 @@ buildInfo:
TechDocs builder: "local"
Authentication provider: "Github"
RBAC: disabled
full: true
overrideBuildInfo: true
2 changes: 1 addition & 1 deletion docs/customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ buildInfo:
TechDocs builder: 'local'
Authentication provider: 'Github'
RBAC: disabled
full: true # If set to true, only the information specified in this configuration will be displayed. If set to false, the provided details will be shown along with the build versions. By default it will only display the configured information.
overrideBuildInfo: true # If set to true, only the information specified in this configuration will be displayed. If set to false, the provided details will be shown along with the build versions. By default it will only display the configured information.
```

## Customizing the Language dropdown
Expand Down
18 changes: 16 additions & 2 deletions packages/app/config.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,13 +258,27 @@ export interface Config {
includeTransitiveGroupOwnership?: boolean;

/**
* Allows you to customize RHDH Metadata card
* Allows you to customize RHDH Metadata card information
* @deepVisibility frontend
*/
buildInfo?: {
/**
* Allows setting a title for the build information card
* @visibility frontend
*/
title: string;
/**
* Allows setting a content for the build information card
* @visibility frontend
*/
card: { [key: string]: string };
full?: boolean;
/**
* Allows setting if the default build information (RHDH Version, Backstage Version, etc.) should be overridden
* Contents will be overridden if not set to false
* @default true
* @visibility frontend
*/
overrideBuildInfo?: boolean;
};

/**
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/components/UserSettings/InfoCard.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ describe('InfoCard', () => {
'Authentication provider': 'Github',
RBAC: 'disabled',
},
full: false,
overrideBuildInfo: false,
},
},
});
Expand Down Expand Up @@ -107,7 +107,7 @@ describe('InfoCard', () => {
'Authentication provider': 'Github',
RBAC: 'disabled',
},
full: true,
overrideBuildInfo: true,
},
},
});
Expand Down
3 changes: 2 additions & 1 deletion packages/app/src/components/UserSettings/InfoCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ export const InfoCard = () => {

let clipboardText = title;
const buildDetails = Object.entries(
buildInfo?.full === false // append build versions to the object only when buildInfo.full === false
buildInfo?.full === false || // make it backward compatible with previous `full` config option
buildInfo?.overrideBuildInfo === false
? { ...buildInfo?.card, ...buildMetadata?.card }
: (buildInfo?.card ?? buildMetadata?.card),
).map(([key, value]) => `${key}: ${value}`);
Expand Down
1 change: 1 addition & 0 deletions packages/app/src/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export type BuildInfo = {
title: string;
card: { [key: string]: string };
full?: boolean;
overrideBuildInfo?: boolean;
};

export type TranslationConfig = {
Expand Down
Loading