Skip to content

Commit 1b54375

Browse files
committed
feat: Add empty state rendering for material list in DeployImageContent and update dependency in DeployImageModal
1 parent b515400 commit 1b54375

File tree

2 files changed

+34
-27
lines changed

2 files changed

+34
-27
lines changed

src/components/app/details/triggerView/DeployImageModal/DeployImageContent.tsx

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,32 @@ const DeployImageContent = ({
515515
)
516516
})
517517

518+
const renderMaterialListEmptyState = () => (
519+
<div className="flexbox-col flex-grow-1 dc__overflow-auto h-100">
520+
<MaterialListEmptyState
521+
isRollbackTrigger={isRollbackTrigger}
522+
stageType={stageType}
523+
appId={appId}
524+
isSearchApplied={isSearchApplied}
525+
policyConsequences={policyConsequences}
526+
isTriggerBlockedDueToPlugin={isTriggerBlockedDueToPlugin}
527+
configurePluginURL={configurePluginURL}
528+
isConsumedImagePresent={consumedImage.length > 0}
529+
envName={envName}
530+
materialResponse={materialResponse}
531+
isExceptionUser={isExceptionUser}
532+
isLoadingMore={isLoadingOlderImages}
533+
viewAllImages={viewAllImages}
534+
triggerType={triggerType}
535+
loadOlderImages={loadOlderImages}
536+
onSearchApply={onSearchApply}
537+
eligibleImagesCount={eligibleImagesCount}
538+
handleEnableFiltersView={handleShowConfiguredFilters}
539+
handleAllImagesView={handleAllImagesView}
540+
/>
541+
</div>
542+
)
543+
518544
const renderContent = () => {
519545
if (isBulkTrigger) {
520546
if (showFiltersView) {
@@ -596,33 +622,9 @@ const DeployImageContent = ({
596622
</div>
597623
</div>
598624

599-
{materialList.length === 0 ? (
600-
<div className="flexbox-col flex-grow-1 dc__overflow-auto h-100">
601-
<MaterialListEmptyState
602-
isRollbackTrigger={isRollbackTrigger}
603-
stageType={stageType}
604-
appId={appId}
605-
isSearchApplied={isSearchApplied}
606-
policyConsequences={policyConsequences}
607-
isTriggerBlockedDueToPlugin={isTriggerBlockedDueToPlugin}
608-
configurePluginURL={configurePluginURL}
609-
isConsumedImagePresent={consumedImage.length > 0}
610-
envName={envName}
611-
materialResponse={materialResponse}
612-
isExceptionUser={isExceptionUser}
613-
isLoadingMore={isLoadingOlderImages}
614-
viewAllImages={viewAllImages}
615-
triggerType={triggerType}
616-
loadOlderImages={loadOlderImages}
617-
onSearchApply={onSearchApply}
618-
eligibleImagesCount={eligibleImagesCount}
619-
handleEnableFiltersView={handleShowConfiguredFilters}
620-
handleAllImagesView={handleAllImagesView}
621-
/>
622-
</div>
623-
) : (
624-
renderMaterialList(materialList, false)
625-
)}
625+
{materialList.length === 0
626+
? renderMaterialListEmptyState()
627+
: renderMaterialList(materialList, false)}
626628

627629
{!areNoMoreImagesPresent && !!materialList?.length && (
628630
<button
@@ -656,6 +658,10 @@ const DeployImageContent = ({
656658
return renderConfiguredFilters()
657659
}
658660

661+
if (materials.length === 0 && !isBulkTrigger) {
662+
return renderMaterialListEmptyState()
663+
}
664+
659665
return (
660666
<>
661667
{!showFiltersView &&

src/components/app/details/triggerView/DeployImageModal/DeployImageModal.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ const DeployImageModal = ({
130130
initialSearch: searchImageTag,
131131
}),
132132
[searchImageTag],
133+
!isTriggerBlockedDueToPlugin,
133134
)
134135

135136
const [, moduleInfoRes] = useAsync(() => getModuleInfo(ModuleNameMap.SECURITY))

0 commit comments

Comments
 (0)