Skip to content

Commit

Permalink
Remove the deprecated displayname field from Dashboard extensions
Browse files Browse the repository at this point in the history
The `displayname` field was deprecated in v0.49.0 LTS.

Remove the remaining code that was added for backwards compatibility.
  • Loading branch information
AlanGreene committed Jan 21, 2025
1 parent 30bbd62 commit 957aefc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 38 deletions.
5 changes: 2 additions & 3 deletions src/api/extensions.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2019-2024 The Tekton Authors
Copyright 2019-2025 The Tekton 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
Expand Down Expand Up @@ -27,7 +27,6 @@ export function useExtensions(params, queryConfig) {
data: (data || []).map(({ spec }) => {
const {
disableResourceDetailsLinks,
displayname, // keep for backwards compatibility for a few releases
displayName,
name,
namespaced
Expand All @@ -37,7 +36,7 @@ export function useExtensions(params, queryConfig) {
apiGroup,
apiVersion,
disableResourceDetailsLinks,
displayName: displayName || displayname,
displayName,
name,
namespaced
};
Expand Down
36 changes: 1 addition & 35 deletions src/api/extensions.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2019-2024 The Tekton Authors
Copyright 2019-2025 The Tekton 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
Expand Down Expand Up @@ -47,37 +47,3 @@ it('useExtensions', () => {
]
});
});

it('useExtensions displayname backwards compatibility', () => {
const name = 'fake_name';
const group = 'fake_group';
const version = 'fake_version';
const apiVersion = `${group}/${version}`;
const displayName = 'fake_displayName';
const namespaced = true;
const query = {
data: [{ spec: { apiVersion, displayname: displayName, name, namespaced } }]
};
const params = { fake: 'params' };
vi.spyOn(utils, 'useCollection').mockImplementation(() => query);
const extensions = API.useExtensions(params);
expect(utils.useCollection).toHaveBeenCalledWith(
expect.objectContaining({
group: utils.dashboardAPIGroup,
kind: 'extensions',
params,
version: 'v1alpha1'
})
);
expect(extensions).toEqual({
data: [
{
apiGroup: group,
apiVersion: version,
displayName,
name,
namespaced
}
]
});
});

0 comments on commit 957aefc

Please sign in to comment.