diff --git a/.changeset/eager-toes-start.md b/.changeset/eager-toes-start.md new file mode 100644 index 0000000000..f36cb1bb0a --- /dev/null +++ b/.changeset/eager-toes-start.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-react': patch +--- + +Correct translation key from "type" to "owner" for owner column in entity table to ensure the right translation is loaded. diff --git a/plugins/catalog-react/src/components/EntityTable/columns.test.tsx b/plugins/catalog-react/src/components/EntityTable/columns.test.tsx new file mode 100644 index 0000000000..05c9c61c26 --- /dev/null +++ b/plugins/catalog-react/src/components/EntityTable/columns.test.tsx @@ -0,0 +1,39 @@ +/* + * Copyright 2025 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { render, screen } from '@testing-library/react'; +import { columnFactories } from './columns'; +import { mockApis, MockErrorApi, TestApiProvider } from '@backstage/test-utils'; +import { errorApiRef } from '@backstage/core-plugin-api'; +import { translationApiRef } from '@backstage/core-plugin-api/alpha'; + +describe('columns', () => { + it('should render owner title', async () => { + const { title } = columnFactories.createOwnerColumn(); + + render( + + {title} + , + ); + + expect(await screen.findByText('Owner')).toBeInTheDocument(); + }); +}); diff --git a/plugins/catalog-react/src/components/EntityTable/columns.tsx b/plugins/catalog-react/src/components/EntityTable/columns.tsx index 94b1141057..1bea56dc27 100644 --- a/plugins/catalog-react/src/components/EntityTable/columns.tsx +++ b/plugins/catalog-react/src/components/EntityTable/columns.tsx @@ -108,7 +108,7 @@ export const columnFactories = Object.freeze({ }, createOwnerColumn(): TableColumn { return this.createEntityRelationColumn({ - title: , + title: , relation: RELATION_OWNED_BY, defaultKind: 'group', });