diff --git a/src/api/extensions.js b/src/api/extensions.js index 44b7ef00d..905651635 100644 --- a/src/api/extensions.js +++ b/src/api/extensions.js @@ -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 @@ -25,19 +25,14 @@ export function useExtensions(params, queryConfig) { return { ...query, data: (data || []).map(({ spec }) => { - const { - disableResourceDetailsLinks, - displayname, // keep for backwards compatibility for a few releases - displayName, - name, - namespaced - } = spec; + const { disableResourceDetailsLinks, displayName, name, namespaced } = + spec; const [apiGroup, apiVersion] = spec.apiVersion.split('/'); return { apiGroup, apiVersion, disableResourceDetailsLinks, - displayName: displayName || displayname, + displayName, name, namespaced }; diff --git a/src/api/extensions.test.js b/src/api/extensions.test.js index 99f5f2960..8b5fbf3cf 100644 --- a/src/api/extensions.test.js +++ b/src/api/extensions.test.js @@ -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 @@ -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 - } - ] - }); -});