-
Notifications
You must be signed in to change notification settings - Fork 52
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
refactor: Modules list refactor #3760
Conversation
There was a problem hiding this 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 }) => |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
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 | ||
), | ||
]; | ||
}; |
There was a problem hiding this comment.
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?
Description
Changes proposed in this pull request:
Related issue(s)
Closes #3741
Definition of done
backlog#4567