Skip to content

Commit 3149996

Browse files
authored
Merge pull request #1 from TIBCO-Hub-Backstage/1.5.0
Version 1.5.0 related changes and released 1.5.0.
2 parents 1ad45f6 + 9729caf commit 3149996

File tree

20 files changed

+192
-128
lines changed

20 files changed

+192
-128
lines changed

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ RUN --mount=type=cache,target=/home/nonroot/.cache/pip,uid=65532,gid=65532 \
99
/home/nonroot/venv/bin/pip install setuptools
1010

1111
# Stage 1 - Create yarn install skeleton layer
12-
FROM cgr.dev/chainguard/wolfi-base@sha256:2148be123cd047f10c93e2bc88010d4abba1fc56a367d6287a251099ed5f006a AS packages
12+
FROM cgr.dev/chainguard/wolfi-base@sha256:7afaeb1ffbc9c33c21b9ddbd96a80140df1a5fa95aed6411b210bcb404e75c11 AS packages
1313

1414
WORKDIR /app
1515
COPY package.json yarn.lock ./
@@ -24,7 +24,7 @@ COPY plugins plugins
2424

2525
RUN find packages \! -name "package.json" -mindepth 2 -maxdepth 2 -exec rm -rf {} \+
2626

27-
FROM cgr.dev/chainguard/wolfi-base@sha256:2148be123cd047f10c93e2bc88010d4abba1fc56a367d6287a251099ed5f006a as build
27+
FROM cgr.dev/chainguard/wolfi-base@sha256:7afaeb1ffbc9c33c21b9ddbd96a80140df1a5fa95aed6411b210bcb404e75c11 as build
2828

2929
ENV NODE_VERSION="18=~18.20"
3030

@@ -59,7 +59,7 @@ RUN mkdir packages/backend/dist/skeleton packages/backend/dist/bundle \
5959
&& tar xzf packages/backend/dist/skeleton.tar.gz -C packages/backend/dist/skeleton \
6060
&& tar xzf packages/backend/dist/bundle.tar.gz -C packages/backend/dist/bundle
6161

62-
FROM cgr.dev/chainguard/wolfi-base@sha256:2148be123cd047f10c93e2bc88010d4abba1fc56a367d6287a251099ed5f006a as node-builder
62+
FROM cgr.dev/chainguard/wolfi-base@sha256:7afaeb1ffbc9c33c21b9ddbd96a80140df1a5fa95aed6411b210bcb404e75c11 as node-builder
6363

6464
ENV NODE_VERSION="18=~18.20"
6565

@@ -85,7 +85,7 @@ COPY --from=build --chown=65532:65532 /app/yarn.lock /app/package.json /app/pack
8585
RUN --mount=type=cache,target=/home/nonroot/.yarn/berry/cache,sharing=locked,uid=65532,gid=65532 \
8686
yarn workspaces focus --all --production && yarn cache clean --all
8787

88-
FROM --platform=linux/amd64 cgr.dev/chainguard/wolfi-base@sha256:2148be123cd047f10c93e2bc88010d4abba1fc56a367d6287a251099ed5f006a
88+
FROM --platform=linux/amd64 cgr.dev/chainguard/wolfi-base@sha256:7afaeb1ffbc9c33c21b9ddbd96a80140df1a5fa95aed6411b210bcb404e75c11
8989

9090
ENV PYTHON_VERSION="3.12=~3.12"
9191
ENV NODE_VERSION="18=~18.20"

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ docker build -t <customImageName:customImageTag> .
105105

106106
| TIBCO Developer Hub Version | TIBCO Platform Version |
107107
| --------------------------- | ---------------------- |
108+
| 1.5.0 | 1.4.0 |
108109
| 1.4.0 | 1.4.0 |
109110
| 1.3.2 | 1.3.0 |
110111
| 1.3.1 | 1.3.0 |

app-config.production.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
define: &docUrl 'https://docs.tibco.com/go/platform-cp/1.5.0/doc/html#cshid=developer_hub_overview'
12
app:
23
title: TIBCO® Developer Hub
34
# Should be the same as backend.baseUrl when using the `app-backend` plugin.
@@ -13,9 +14,9 @@ app:
1314
- title: 'TIBCO Documentation Page'
1415
icon: 'docs'
1516
links:
16-
- url: 'https://docs.tibco.com/go/platform-cp/1.4.0/doc/html#cshid=developer_hub_overview'
17+
- url: *docUrl
1718
title: 'TIBCO® Developer Hub Documentation'
18-
developerHubVersion: 1.4.0
19+
docUrl: *docUrl
1920
organization:
2021
name: TIBCO Software's
2122

app-config.yaml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
define: &docUrl 'https://docs.tibco.com/go/platform-cp/1.5.0/doc/html#cshid=developer_hub_overview'
12
app:
23
title: TIBCO® Developer Hub
34
baseUrl: http://localhost:3000/tibco/hub
@@ -12,9 +13,9 @@ app:
1213
- title: 'TIBCO Documentation Page'
1314
icon: 'docs'
1415
links:
15-
- url: 'https://docs.tibco.com/go/platform-cp/1.4.0/doc/html#cshid=developer_hub_overview'
16+
- url: *docUrl
1617
title: 'TIBCO® Developer Hub Documentation'
17-
developerHubVersion: 1.4.0
18+
docUrl: *docUrl
1819

1920
organization:
2021
name: TIBCO Software's
@@ -125,8 +126,3 @@ scaffolder:
125126
defaultCommitMessage: 'Initial commit' # Defaults to 'Initial commit'
126127
catalog:
127128
locations: []
128-
# GitHub rate limits API requests to 5,000 per hour (or more for Enterprise accounts).
129-
# For more information, visit https://backstage.io/docs/integrations/github/discovery/#github-api-rate-limits-1
130-
# You can set the refresh rate of catalog (in milliseconds) for catalog API to fetch changes from GitHub, by using the below config.
131-
# The allowed range is [100,900]
132-
# catalogRefreshDelayInSec: 300

docs/app-config-extensions.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,26 @@ app:
1717
showBuildVersion: true
1818
```
1919
20+
## Developer Hub Version
21+
22+
Show developer hub version. Displays currently deployed version the left bottom of the Home Page UI
23+
24+
Example config:
25+
26+
```yaml
27+
app:
28+
developerHubVersion: '1.5.0'
29+
```
30+
31+
## Doc Url
32+
33+
Documentation url
34+
35+
```yaml
36+
app:
37+
docUrl: 'https://docs.tibco.com/go/platform-cp/1.5.0/doc/html#cshid=developer_hub_overview'
38+
```
39+
2040
The CI/CD pipeline automatically adds the build number to all docker images.
2141
2242
## Walk Through

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "root",
3-
"version": "1.4.0",
3+
"version": "1.5.0",
44
"private": true,
55
"engines": {
66
"node": "20 || 22"
@@ -47,7 +47,7 @@
4747
"@types/react": "^18",
4848
"@types/react-dom": "^18",
4949
"@kubernetes/client-node": "^1.0.0-rc7",
50-
"jsonpath-plus": "^10.0.7"
50+
"jsonpath-plus": "^10.3.0"
5151
},
5252
"prettier": "@spotify/prettier-config",
5353
"lint-staged": {

packages/app/config.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ export interface Config {
1919
* @visibility frontend
2020
*/
2121
developerHubVersion?: string;
22+
/**
23+
* Documentation url. String value.
24+
* @visibility frontend
25+
*/
26+
docUrl: string;
2227
};
2328
auth?: {
2429
/**

packages/app/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "app",
3-
"version": "1.4.0",
3+
"version": "1.5.0",
44
"private": true,
55
"bundled": true,
66
"backstage": {
@@ -39,8 +39,8 @@
3939
"@backstage/plugin-user-settings": "^0.8.16",
4040
"@backstage/theme": "^0.6.2",
4141
"@fontsource/source-sans-pro": "^4.5.11",
42-
"@internal/backstage-plugin-import-flow": "^1.4.0",
43-
"@internal/plugin-tibco-platform-plugin": "^1.4.0",
42+
"@internal/backstage-plugin-import-flow": "^1.5.0",
43+
"@internal/plugin-tibco-platform-plugin": "^1.5.0",
4444
"@material-ui/core": "^4.12.2",
4545
"@material-ui/icons": "^4.9.1",
4646
"@material-ui/lab": "^4.0.0-alpha.61",

packages/app/src/components/catalog-import/components/DefaultImportPage/DefaultImportPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const DefaultImportPage = () => {
5252
<ImportStepper />
5353
</Grid>,
5454
];
55-
55+
const reverseContentItems = [...contentItems].reverse();
5656
return (
5757
<Page themeId="home">
5858
<Header title="Register an existing component" />
@@ -65,7 +65,7 @@ export const DefaultImportPage = () => {
6565
</ContentHeader>
6666

6767
<Grid container spacing={2}>
68-
{isMobile ? contentItems : contentItems.reverse()}
68+
{isMobile ? contentItems : reverseContentItems}
6969
</Grid>
7070
</Content>
7171
</Page>

packages/app/src/components/home/HomePage.tsx

Lines changed: 55 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,8 @@ export const HomePage = () => {
4848
const identityApi = useApi(identityApiRef);
4949
const starredApi = useApi(starredEntitiesApiRef);
5050
const { value, loading, error } = useAsync(async () => {
51-
try {
52-
const data = await identityApi.getProfileInfo();
53-
return data.displayName;
54-
} catch (err) {
55-
throw error;
56-
}
51+
const data = await identityApi.getProfileInfo();
52+
return data.displayName;
5753
});
5854
const title = config.getOptionalString('app.title');
5955
useEffect(
@@ -100,72 +96,66 @@ export const HomePage = () => {
10096
);
10197
}
10298
}
103-
try {
104-
const result: any[] = await Promise.all(apiCalls);
105-
const newCards = [];
106-
for (const [index, card] of cards.entries()) {
107-
card.loading = false;
108-
if (card.type === HomeCardType.WalkThrough) {
109-
card.viewAllLink = walkthrough.viewAllLink;
110-
card.itemsInfo = walkthrough.items || [];
111-
} else {
112-
let items = result[index]?.items;
113-
if (card.type === HomeCardType.Template) {
114-
items = items.filter(
115-
(item: any) =>
116-
!item.metadata.tags
117-
?.map((v: any) => v.toLowerCase())
118-
.includes('import-flow'),
119-
);
120-
}
121-
if (items) {
122-
let itemsInfo = [];
123-
if (stars && stars.length > 0) {
124-
for (const item of items) {
125-
const inx = getIndex(item, stars);
126-
if (inx > -1) {
127-
item.star = true;
128-
itemsInfo.push(item);
129-
}
130-
if (itemsInfo.length >= 3) {
131-
break;
132-
}
133-
}
134-
for (const item of items) {
135-
if (itemsInfo.length >= 3) {
136-
break;
137-
}
138-
const ind = getIndex(item, stars);
139-
if (ind > -1) {
140-
continue;
141-
}
99+
100+
const result: any[] = await Promise.all(apiCalls);
101+
const newCards = [];
102+
for (const [index, card] of cards.entries()) {
103+
card.loading = false;
104+
if (card.type === HomeCardType.WalkThrough) {
105+
card.viewAllLink = walkthrough.viewAllLink;
106+
card.itemsInfo = walkthrough.items || [];
107+
} else {
108+
let items = result[index]?.items;
109+
if (card.type === HomeCardType.Template) {
110+
items = items.filter(
111+
(item: any) =>
112+
!item.metadata.tags
113+
?.map((v: any) => v.toLowerCase())
114+
.includes('import-flow'),
115+
);
116+
}
117+
if (items) {
118+
let itemsInfo = [];
119+
if (stars && stars.length > 0) {
120+
for (const item of items) {
121+
const inx = getIndex(item, stars);
122+
if (inx > -1) {
123+
item.star = true;
142124
itemsInfo.push(item);
143125
}
144-
} else {
145-
itemsInfo = result[index]?.items?.slice(
146-
0,
147-
ITEMS_PER_CARD,
148-
);
126+
if (itemsInfo.length >= 3) {
127+
break;
128+
}
129+
}
130+
for (const item of items) {
131+
if (itemsInfo.length >= 3) {
132+
break;
133+
}
134+
const ind = getIndex(item, stars);
135+
if (ind > -1) {
136+
continue;
137+
}
138+
itemsInfo.push(item);
149139
}
150-
card.itemsInfo = itemsInfo.map((item: any) => {
151-
return {
152-
title: item.metadata?.title,
153-
name: item.metadata?.name,
154-
kind: item.kind,
155-
star: item.star,
156-
namespace: item.metadata?.namespace,
157-
tags: item.metadata?.tags?.slice(0, 3),
158-
text: `${item.metadata?.description}`,
159-
};
160-
});
140+
} else {
141+
itemsInfo = result[index]?.items?.slice(0, ITEMS_PER_CARD);
161142
}
143+
card.itemsInfo = itemsInfo.map((item: any) => {
144+
return {
145+
title: item.metadata?.title,
146+
name: item.metadata?.name,
147+
kind: item.kind,
148+
star: item.star,
149+
namespace: item.metadata?.namespace,
150+
tags: item.metadata?.tags?.slice(0, 3),
151+
text: `${item.metadata?.description}`,
152+
};
153+
});
162154
}
163-
newCards.push(card);
164155
}
165-
setCards(newCards);
166-
} catch (err) {
167-
throw err;
156+
newCards.push(card);
168157
}
158+
setCards(newCards);
169159
})();
170160
},
171161
err => {

packages/app/src/components/home/components/HomeCard/HomeCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ export const HomeCard = (props: { cardData: HomeCardProps }) => {
151151
<Grid container spacing={0}>
152152
{element.tags &&
153153
element.tags.length > 0 &&
154-
element.tags!.map((tag, i) => (
154+
element.tags.map((tag, i) => (
155155
<div className="tpdh-card-item-tag" key={i}>
156156
{tag}
157157
</div>

packages/app/src/components/home/components/Introduction/Introduction.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ import React from 'react';
22
import './Introduction.css';
33
import { Grid } from '@material-ui/core';
44
import { Link } from 'react-router-dom';
5+
import { configApiRef, useApi } from '@backstage/core-plugin-api';
56

67
export const Introduction = () => {
8+
const configApi = useApi(configApiRef);
9+
const docUrl: string = configApi.get('app.docUrl');
710
return (
811
<div className="tpdh-intro-container">
912
<div className="tpdh-intro-title">What is the TIBCO® Developer Hub ?</div>
@@ -27,10 +30,7 @@ export const Introduction = () => {
2730
</Link>
2831
</Grid>
2932
<Grid item>
30-
<Link
31-
to="https://docs.tibco.com/go/platform-cp/1.4.0/doc/html#cshid=developer_hub_overview"
32-
target="_blank"
33-
>
33+
<Link to={docUrl} target="_blank">
3434
<button
3535
type="button"
3636
className="pl-button pl-button--secondary"

packages/backend/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "backend",
3-
"version": "1.4.0",
3+
"version": "1.5.0",
44
"main": "dist/index.cjs.js",
55
"types": "src/index.ts",
66
"private": true,
@@ -49,7 +49,7 @@
4949
"@backstage/plugin-search-backend-module-techdocs": "^0.3.3",
5050
"@backstage/plugin-search-backend-node": "^1.3.5",
5151
"@backstage/plugin-techdocs-backend": "^1.11.3",
52-
"@internal/backstage-plugin-scaffolder-backend-module-import-flow": "^1.4.0",
52+
"@internal/backstage-plugin-scaffolder-backend-module-import-flow": "^1.5.0",
5353
"app": "link:../app",
5454
"better-sqlite3": "^9.0.0",
5555
"dockerode": "^3.3.1",

0 commit comments

Comments
 (0)