Skip to content

Commit

Permalink
fix(topology): fixed UI bugs and cleaned code (#1749)
Browse files Browse the repository at this point in the history
* chore(topology): add build in prepack to include necessary style-inject modules

Signed-off-by: Yi Cai <yicai@redhat.com>

* Added changeset

Signed-off-by: Yi Cai <yicai@redhat.com>

* chore(topology): fixed UI bugs and cleaned code

Signed-off-by: Yi Cai <yicai@redhat.com>

* Updated yarn.lock

Signed-off-by: Yi Cai <yicai@redhat.com>

* Fixed tsc issues

Signed-off-by: Yi Cai <yicai@redhat.com>

* Updated yarn.lock

Signed-off-by: Yi Cai <yicai@redhat.com>

* Dedupe yarn.lock

Signed-off-by: Yi Cai <yicai@redhat.com>

* Removed janus-idp/cli dependency

Signed-off-by: Yi Cai <yicai@redhat.com>

---------

Signed-off-by: Yi Cai <yicai@redhat.com>
  • Loading branch information
ciiay authored Oct 28, 2024
1 parent b3cc919 commit 694e163
Show file tree
Hide file tree
Showing 9 changed files with 655 additions and 2,001 deletions.
7 changes: 7 additions & 0 deletions workspaces/topology/.changeset/seven-houses-melt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@backstage-community/plugin-topology': patch
---

- Fixed an issue with the topology node badge icon text color.
- Updated the stylesheet link filter string to accommodate the new topology package name.
- Removed `janus-idp/cli` from `devDependencies` as `export-dynamic` is no longer needed for the topology plugin package.
2 changes: 0 additions & 2 deletions workspaces/topology/plugins/topology/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"scripts": {
"build": "backstage-cli package build",
"clean": "backstage-cli package clean",
"export-dynamic": "janus-cli package export-dynamic-plugin --in-place",
"lint": "backstage-cli package lint",
"postpack": "backstage-cli package postpack",
"postversion": "yarn run export-dynamic",
Expand Down Expand Up @@ -72,7 +71,6 @@
"@backstage/core-app-api": "^1.15.1",
"@backstage/dev-utils": "^1.1.2",
"@backstage/test-utils": "^1.7.0",
"@janus-idp/cli": "1.15.1",
"@redhat-developer/red-hat-developer-hub-theme": "0.4.0",
"@testing-library/jest-dom": "6.4.8",
"@testing-library/react": "14.3.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
fill: var(--pf-v5-global--palette--blue-300);
}

.bs-topology-base-node-resource-icon > text {
fill: var(--pf-v5-global--palette--white);
}

.bs-topology-base-node-resource-icon-service {
fill: var(--pf-v5-global--palette--light-green-500);
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const TopologyComponent = () => {
).filter(link =>
link.attributes
.getNamedItem('href')
?.value?.includes('backstage-plugin-topology'),
?.value?.includes('backstage-community.plugin-topology'),
);

scalprumStyles.forEach(link =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const BootOrderSummary: React.FC<BootOrderSummaryProps> = ({
<BootOrderEmptySummary devices={devices} />
) : (
<ol>
{sources.map(source => (
{sources.map((source: any) => (
<li key={deviceKey(source)}>{deviceLabel(source)}</li>
))}
</ol>
Expand Down
2 changes: 2 additions & 0 deletions workspaces/topology/plugins/topology/src/globals.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ declare module '*.svg' {
const content: React.FunctionComponent<React.SVGAttributes<SVGElement>>;
export default content;
}

declare module 'lodash';
6 changes: 3 additions & 3 deletions workspaces/topology/plugins/topology/src/utils/vm-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ export const getVmiIpAddresses = (vmi: VMIKind | null) => {
return uniq(
flatMap(
// get IPs only for named interfaces because Windows reports IPs for other devices like Loopback Pseudo-Interface 1 etc.
get(vmi, 'status.interfaces', []).filter(i => !!i.name),
i => {
get(vmi, 'status.interfaces', []).filter((i: { name: any }) => !!i.name),
(i: { ipAddress: string; ipAddresses: string[] }) => {
const arr = [];
if (i.ipAddress) {
// the "ipAddress" is deprecated but still can contain useful value
Expand All @@ -174,7 +174,7 @@ export const getVmiIpAddresses = (vmi: VMIKind | null) => {
}
return arr;
},
).filter(ip => ip && ip.length > 0),
).filter((ip: string | any[]) => ip && ip.length > 0),
);
};

Expand Down
Loading

0 comments on commit 694e163

Please sign in to comment.