Skip to content

refactor: Rework kyma modules list#3867

Merged
akucharska merged 16 commits intokyma-project:mainfrom
akucharska:rewrite-kyma-modules-list
May 5, 2025
Merged

refactor: Rework kyma modules list#3867
akucharska merged 16 commits intokyma-project:mainfrom
akucharska:rewrite-kyma-modules-list

Conversation

@akucharska
Copy link
Contributor

@akucharska akucharska commented Apr 16, 2025

Description

Changes proposed in this pull request:

  • Make kyma modules list independent of Kyma CR

Related issue(s)

Definition of done

  • The PR's title starts with one of the following prefixes:
    • feat: A new feature
    • fix: A bug fix
    • docs: Documentation only changes
    • refactor: A code change that neither fixes a bug nor adds a feature
    • test: Adding tests
    • revert: Revert commit
    • chore: Maintainance changes to the build process or auxiliary tools, libraries, workflows, etc.
  • Related issues are linked. To link internal trackers, use the issue IDs like backlog#4567
  • Explain clearly why you created the PR and what changes it introduces
  • All necessary steps are delivered, for example, tests, documentation, merging

@akucharska akucharska changed the title Rework kyma modules list feat: Rework kyma modules list Apr 17, 2025
@akucharska akucharska changed the title feat: Rework kyma modules list refactor: Rework kyma modules list Apr 17, 2025
@akucharska akucharska enabled auto-merge (squash) April 28, 2025 10:51
@KonradPietocha KonradPietocha self-assigned this Apr 29, 2025
import { useEffect, useState } from 'react';
import { clusterState } from './clusterAtom';

export async function useGetModuleTemplatesCount() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Custom hook as an asynchronous function may not be a good practice. Is it possible to change it? We can use useEffect to get asynchronous and we can also use asynchronous function inside custom hook.

setKymaResource,
props,
}) {
export default function KymaModulesAddModule({ props }) {
Copy link
Contributor

@KonradPietocha KonradPietocha Apr 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this has been done before, but it looks weird to have a props object inside a props object :-) We can change it by using it that way: <KymaModulesAddModule {...renderProps} /> (or list them all) in kymaModules.routes.js and then: KymaModulesAddModule(props).

handleResourceDelete,
showDeleteDialog,
}) => {
const ColumnWraper = ({ defaultColumn = 'list', namespaced = false }) => {
Copy link
Contributor

@KonradPietocha KonradPietocha Apr 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameters from useDeleteResource are passed to <ColumnWraper />, but they are not consumed here. I also noticed that the delete box started shaking sometimes again.

scope: Scope,
configFeatures: ConfigFeatureList,
kymaResources: any,
moduleTemplatesCount: any,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's better to change this type from any to number | null now?

@akucharska akucharska merged commit 14ca124 into kyma-project:main May 5, 2025
20 checks passed
@akucharska akucharska deleted the rewrite-kyma-modules-list branch May 5, 2025 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rewrite Modules List View to Enable Community Modules Support

2 participants