"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/extensions/registries/kube-object-detail-registry.ts" between
lens-5.1.2.tar.gz and lens-5.1.3.tar.gz

About: Lens is a Kubernetes IDE.

kube-object-detail-registry.ts  (lens-5.1.2):kube-object-detail-registry.ts  (lens-5.1.3)
skipping to change at line 27 skipping to change at line 27
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHE R * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHE R
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
import type React from "react"; import type React from "react";
import type { KubeObjectDetailsProps } from "../renderer-api/components"; import type { KubeObjectDetailsProps } from "../renderer-api/components";
import type { KubeObject } from "../renderer-api/k8s-api"; import type { KubeObject } from "../renderer-api/k8s-api";
import { BaseRegistry } from "./base-registry"; import { BaseRegistry } from "./base-registry";
export interface KubeObjectDetailComponents { export interface KubeObjectDetailComponents<T extends KubeObject> {
Details: React.ComponentType<KubeObjectDetailsProps<KubeObject>>; Details: React.ComponentType<KubeObjectDetailsProps<T>>;
} }
export interface KubeObjectDetailRegistration { export interface KubeObjectDetailRegistration {
kind: string; kind: string;
apiVersions: string[]; apiVersions: string[];
components: KubeObjectDetailComponents; components: KubeObjectDetailComponents<KubeObject>;
priority?: number; priority?: number;
} }
export class KubeObjectDetailRegistry extends BaseRegistry<KubeObjectDetailRegis tration> { export class KubeObjectDetailRegistry extends BaseRegistry<KubeObjectDetailRegis tration> {
getItemsForKind(kind: string, apiVersion: string) { getItemsForKind(kind: string, apiVersion: string) {
const items = this.getItems().filter((item) => { const items = this.getItems().filter((item) => {
return item.kind === kind && item.apiVersions.includes(apiVersion); return item.kind === kind && item.apiVersions.includes(apiVersion);
}); });
return items.sort((a, b) => (b.priority ?? 50) - (a.priority ?? 50)); return items.sort((a, b) => (b.priority ?? 50) - (a.priority ?? 50));
 End of changes. 2 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)