Skip to content

Commit

Permalink
fix(buttons-actions): edit code link
Browse files Browse the repository at this point in the history
  • Loading branch information
RemiBonnet committed Dec 29, 2022
1 parent 9507336 commit 7b4dbba
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 11 deletions.
Expand Up @@ -9,8 +9,8 @@ import {
postApplicationActionsStop,
} from '@qovery/domains/application'
import { postEnvironmentActionsCancelDeployment } from '@qovery/domains/environment'
import { getServiceType, isApplication } from '@qovery/shared/enums'
import { ApplicationEntity, GitApplicationEntity } from '@qovery/shared/interfaces'
import { getServiceType, isApplication, isContainer } from '@qovery/shared/enums'
import { ApplicationEntity, GitApplicationEntity, JobApplicationEntity } from '@qovery/shared/interfaces'
import {
APPLICATION_LOGS_URL,
APPLICATION_SETTINGS_GENERAL_URL,
Expand Down Expand Up @@ -234,12 +234,18 @@ export function ApplicationButtonsActions(props: ApplicationButtonsActionsProps)
onClick: () => navigate(APPLICATION_LOGS_URL(organizationId, projectId, environmentId, application.id)),
},
{
name: 'Edit code',
contentLeft: <Icon name={IconAwesomeEnum.CODE} className="text-sm text-brand-400" />,
link: {
url: urlCodeEditor((application as GitApplicationEntity)?.git_repository) || '',
external: true,
},
...(!isContainer(application) && {
name: 'Edit code',
contentLeft: <Icon name={IconAwesomeEnum.CODE} className="text-sm text-brand-400" />,
link: {
url:
urlCodeEditor(
(application as GitApplicationEntity)?.git_repository ||
(application as JobApplicationEntity).source?.docker?.git_repository
) || '',
external: true,
},
}),
},
{
name: 'Copy identifiers',
Expand Down
11 changes: 8 additions & 3 deletions libs/shared/ui/src/lib/components/menu/menu-group/menu-group.tsx
Expand Up @@ -85,9 +85,14 @@ export function MenuGroup(props: MenuGroupProps) {
)}
{currentItems.length > 0 && (
<div style={paddingStyle} className="overflow-y-auto max-h-80">
{currentItems.map((item, index) => (
<MenuItem key={index} {...item} />
))}
{currentItems.map((item, index) => {
// if object empty not return item
if (Object.keys(item).length === 0) {
return null
} else {
return <MenuItem key={index} {...item} />
}
})}
</div>
)}
{!isFilter && !isLast && currentItems.length > 0 && (
Expand Down

0 comments on commit 7b4dbba

Please sign in to comment.