Skip to content

Commit 992648a

Browse files
authored
Merge branch 'main' into homepage-missing-translations
2 parents d698e30 + d69d6d6 commit 992648a

456 files changed

Lines changed: 47991 additions & 19538 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,6 @@ site
6363

6464
# Cursor IDE configuration files
6565
.cursorrules
66+
67+
# Local git worktrees
68+
.worktrees/

workspaces/adoption-insights/e2e-tests/utils/translations.ts

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,35 +26,47 @@ import adoptionInsightsTranslationJa from '../../plugins/adoption-insights/src/t
2626

2727
export type InsightsMessages = typeof adoptionInsightsMessages;
2828

29-
function transform(messages: typeof adoptionInsightsTranslationDe.messages) {
30-
const result = Object.keys(messages).reduce((res, key) => {
29+
function transformFlatMessagesIntoTree(
30+
flatMessages: typeof adoptionInsightsTranslationDe.messages,
31+
) {
32+
const messages = {} as Record<string, any>;
33+
for (const key of Object.keys(flatMessages)) {
3134
const path = key.split('.');
32-
const lastIndex = path.length - 1;
33-
path.reduce((acc, currentPath, i) => {
34-
acc[currentPath] =
35-
lastIndex === i ? messages[key] : acc[currentPath] || {};
36-
return acc[currentPath];
37-
}, res);
38-
return res;
39-
}, {});
40-
41-
return result as InsightsMessages;
35+
let current = messages;
36+
for (let i = 0; i < path.length - 1; i++) {
37+
current[path[i]] = current[path[i]] || {};
38+
current = current[path[i]] as Record<string, any>;
39+
}
40+
current[path[path.length - 1]] =
41+
flatMessages[key as keyof typeof flatMessages];
42+
}
43+
return messages as InsightsMessages;
4244
}
4345

4446
export function getTranslations(locale: string) {
4547
switch (locale) {
4648
case 'en':
4749
return adoptionInsightsMessages;
4850
case 'de':
49-
return transform(adoptionInsightsTranslationDe.messages);
51+
return transformFlatMessagesIntoTree(
52+
adoptionInsightsTranslationDe.messages,
53+
);
5054
case 'es':
51-
return transform(adoptionInsightsTranslationEs.messages);
55+
return transformFlatMessagesIntoTree(
56+
adoptionInsightsTranslationEs.messages,
57+
);
5258
case 'fr':
53-
return transform(adoptionInsightsTranslationFr.messages);
59+
return transformFlatMessagesIntoTree(
60+
adoptionInsightsTranslationFr.messages,
61+
);
5462
case 'it':
55-
return transform(adoptionInsightsTranslationIt.messages);
63+
return transformFlatMessagesIntoTree(
64+
adoptionInsightsTranslationIt.messages,
65+
);
5666
case 'ja':
57-
return transform(adoptionInsightsTranslationJa.messages);
67+
return transformFlatMessagesIntoTree(
68+
adoptionInsightsTranslationJa.messages,
69+
);
5870
default:
5971
return adoptionInsightsMessages;
6072
}

workspaces/adoption-insights/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"lint": "backstage-cli repo lint --since origin/main",
3030
"lint:all": "backstage-cli repo lint",
3131
"prettier:check": "prettier --check .",
32+
"prettier:fix": "prettier --write .",
3233
"new": "backstage-cli new --scope @red-hat-developer-hub",
3334
"postinstall": "cd ../../ && yarn install"
3435
},

workspaces/adoption-insights/yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20867,9 +20867,9 @@ __metadata:
2086720867
linkType: hard
2086820868

2086920869
"fast-uri@npm:^3.0.1":
20870-
version: 3.0.6
20871-
resolution: "fast-uri@npm:3.0.6"
20872-
checksum: 10c0/74a513c2af0584448aee71ce56005185f81239eab7a2343110e5bad50c39ad4fb19c5a6f99783ead1cac7ccaf3461a6034fda89fffa2b30b6d99b9f21c2f9d29
20870+
version: 3.1.2
20871+
resolution: "fast-uri@npm:3.1.2"
20872+
checksum: 10c0/5b35641895959f3f7ab7a7b1b5542bded159346f25ec9f256817b206d50b64eda5828e90d605a2e2fc645c90519a7259c2bab2c942ee728c88b88e5be21b090d
2087320873
languageName: node
2087420874
linkType: hard
2087520875

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
'@red-hat-developer-hub/backstage-plugin-catalog-backend-module-model-catalog': patch
3+
'@red-hat-developer-hub/backstage-plugin-catalog-techdoc-url-reader-backend': patch
4+
'@red-hat-developer-hub/backstage-plugin-ai-experience-backend': patch
5+
'@red-hat-developer-hub/backstage-plugin-ai-experience-common': patch
6+
'@red-hat-developer-hub/backstage-plugin-ai-experience': patch
7+
---
8+
9+
bump workspace to 1.52.0
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@red-hat-developer-hub/backstage-plugin-ai-experience': patch
3+
---
4+
5+
Replace Material UI v4 imports with MUI v5, add StylesProvider with createGenerateClassName seed prefix to prevent CSS collisions, and migrate makeStyles to sx prop.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@red-hat-developer-hub/backstage-plugin-catalog-backend-module-catalog-backend-module-ai-resource-extensions': minor
3+
---
4+
5+
Scaffold new AIResource catalog extension and add upstream module to workspace
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# AI Integration Plugins for RHDH
2+
3+
## Build & Test Commands
4+
5+
- Install: `yarn install`
6+
- Build: `yarn build:all`
7+
- Test all: `yarn test:all`
8+
- Test single file: `yarn test -- path/to/test.ts`
9+
- Lint: `yarn lint:all`
10+
- Lint single file: `yarn lint --fix path/to/file.ts`
11+
- Type check: `yarn tsc`
12+
- Dev environment: `yarn dev`
13+
- Debug: `yarn dev:debug`
14+
15+
## Key Conventions
16+
17+
- Follows standard Backstage plugin structure: frontend plugin, backend plugin, and common shared library
18+
- Backend module (e.g. `catalog-backend-module-model-catalog`) extend Backstage catalog plugin
19+
20+
## Architecture (only non-obvious parts)
21+
22+
- `packages/` in each plugin is strictly for the dev environment; do not add application code there
23+
- `ai-experience-common` holds shared types and API definitions used by both frontend and backend
24+
25+
## PR Conventions
26+
27+
- All commits must have an `Assisted-by: <model>` footer below the sign offs
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@AGENTS.md
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"version": "1.49.4"
2+
"version": "1.52.0"
33
}

0 commit comments

Comments
 (0)