Fix translation key for owner column title (#31200)
The entity table currently has two columns labelled "Type" as a regression was introduced in #30076 which used the same translation key for the owner column as well as the type column. This PR corrects the key so that both columns now have the correct labels. Signed-off-by: James Brooks <jamesbrooks@spotify.com>
This commit is contained in:
@@ -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.
|
||||
@@ -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(
|
||||
<TestApiProvider
|
||||
apis={[
|
||||
[errorApiRef, new MockErrorApi()],
|
||||
[translationApiRef, mockApis.translation()],
|
||||
]}
|
||||
>
|
||||
{title}
|
||||
</TestApiProvider>,
|
||||
);
|
||||
|
||||
expect(await screen.findByText('Owner')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
@@ -108,7 +108,7 @@ export const columnFactories = Object.freeze({
|
||||
},
|
||||
createOwnerColumn<T extends Entity>(): TableColumn<T> {
|
||||
return this.createEntityRelationColumn({
|
||||
title: <EntityTableColumnTitle translationKey="type" />,
|
||||
title: <EntityTableColumnTitle translationKey="owner" />,
|
||||
relation: RELATION_OWNED_BY,
|
||||
defaultKind: 'group',
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user