8000 refactor: Modules list refactor by KonradPietocha · Pull Request #3760 · kyma-project/busola · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

refactor: Modules list refactor #3760

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

KonradPietocha
Copy link
Contributor
@KonradPietocha KonradPietocha commented Mar 12, 2025

Description

Changes proposed in this pull request:

  • Separating components from KymaModulesList and moving them to separate files.
  • Refactoring to typeScript.
  • Refactoring delete box.

Related issue(s)
Closes #3741

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

@KonradPietocha KonradPietocha marked this pull request as ready for review March 18, 2025 09:18
@dbadura dbadura self-assigned this Mar 18, 2025
Copy link
Contributor
@akucharska akucharska left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -124,7 +134,8 @@ export const findModuleStatus = (
moduleName: string,
) => {
return kymaResource?.status?.modules?.find(
(module: { name: string; version: string }) => moduleName === module?.name,
(module: { name: string; version?: string; state?: string }) =>
Copy link
Contributor

Choose a reason for hiding this comment

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

Why adding more field if those are not used?

    (module: { name: string }) => moduleName === module?.name,

Should be enought

Copy link
Contributor Author
@KonradPietocha KonradPietocha Mar 20, 2025

Choose a reason for hiding this comment

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

This is probably because of typeScript error in another place saying that this is data with wrong type but I will check it.

Comment on lines 208 to 270
return [
// Name
<>
{showDetailsLink ? (
<Text style={{ fontWeight: 'bold', color: 'var(--sapLinkColor)' }}>
{resource.name}
</Text>
) : (
resource.name
)}
{checkBeta(currentModuleTemplate, currentModuleReleaseMeta) ? (
<Tag
className="sap-margin-begin-tiny"
hideStateIcon
colorScheme="3"
design="Set2"
>
{t('kyma-modules.beta')}
</Tag>
) : null}
</>,
// Namespace
moduleStatus?.resource?.metadata?.namespace || EMPTY_TEXT_PLACEHOLDER,
// Channel
<>
{moduleStatus?.channel
? moduleStatus?.channel
: kymaResource?.spec?.modules?.[moduleIndex]?.channel ||
kymaResource?.spec?.channel}
{isChannelOverriden ? (
<Tag
hideStateIcon
design="Set2"
colorScheme="5"
className="sap-margin-begin-tiny"
>
{t('kyma-modules.channel-overridden')}
</Tag>
) : (
''
)}
</>,
// Version
moduleStatus?.version || EMPTY_TEXT_PLACEHOLDER,
// Module State
<ModuleStatus key="module-state" resource={resource} />,
// Installation State
<StatusBadge
key="installation-state"
resourceKind="kymas"
type={resolveType(moduleStatus?.state ?? '')}
tooltipContent={moduleStatus?.message}
>
{moduleStatus?.state || 'Unknown'}
</StatusBadge>,
// Documentation
moduleDocs ? (
<ExternalLink url={moduleDocs}>{t('common.headers.link')}</ExternalLink>
) : (
EMPTY_TEXT_PLACEHOLDER
),
];
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Can it be also extrated to separate Component?

@KonradPietocha KonradPietocha merged commit bdb3eeb into kyma-project:main Mar 20, 2025
19 checks passed
@KonradPietocha KonradPietocha deleted the modules-list-refactor branch March 20, 2025 12:02
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.

Refactor of the Modules view
3 participants
0