Ensure that CatalogEntity.getName() and CatalogEntity.getId() are always used (#4763)

This commit is contained in:
Sebastian Malton authored and GitHub committed 2022-01-27 14:42:19 -05:00
1 parent 1cac3ca74c
commit 8d8491a035
17 files changed
+98 -166

No files matched your search

@@ -11,7 +11,7 @@ import type { CatalogEntity } from "../../api/catalog-entity";
import * as components from "./components";
function getClusterForEntity(entity: CatalogEntity) {
return ClusterStore.getInstance().getById(entity.metadata.uid);
return ClusterStore.getInstance().getById(entity.getId());
}
export function GeneralSettings({ entity }: EntitySettingViewProps) {
@@ -75,8 +75,8 @@ export class ClusterIconSetting extends React.Component<Props> {
accept="image/*"
label={
<Avatar
colorHash={`${entity.metadata.name}-${entity.metadata.source}`}
title={entity.metadata.name}
colorHash={`${entity.getName()}-${entity.metadata.source}`}
title={entity.getName()}
src={entity.spec.icon?.src}
size={53}
/>
@@ -29,7 +29,7 @@ export class ClusterNameSetting extends React.Component<Props> {
componentDidMount() {
disposeOnUnmount(this,
autorun(() => {
this.name = this.props.cluster.preferences.clusterName || this.props.entity.metadata.name;
this.name = this.props.cluster.preferences.clusterName || this.props.entity.getName();
}),
);
}