Skip to content

Commit 603de96

Browse files
committed
feat: remove checks for hiding diff from tile in case of last deployed config
1 parent 665a1ae commit 603de96

File tree

3 files changed

+6
-28
lines changed

3 files changed

+6
-28
lines changed

src/components/app/details/triggerView/PipelineConfigDiff/PipelineConfigDiffStatusTile.tsx

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import {
18-
DeploymentConfigDiffRadioSelect,
19-
DeploymentWithConfigType,
20-
Progressing,
21-
Tooltip,
22-
} from '@devtron-labs/devtron-fe-common-lib'
17+
import { DeploymentConfigDiffRadioSelect, Icon, Tooltip } from '@devtron-labs/devtron-fe-common-lib'
2318

2419
import { ReactComponent as ICWarning } from '@Icons/ic-warning.svg'
2520

@@ -33,13 +28,9 @@ export const PipelineConfigDiffStatusTile = ({
3328
noLastDeploymentConfig,
3429
onClick,
3530
canReviewConfig,
36-
urlFilters,
3731
renderConfigNotAvailableTooltip,
3832
radioSelectConfig,
3933
}: PipelineConfigDiffStatusTileProps) => {
40-
const { deploy } = urlFilters
41-
const lastDeployedOptionSelected = deploy === DeploymentWithConfigType.LATEST_TRIGGER_CONFIG
42-
const lastSavedConfigOptionSelected = deploy === DeploymentWithConfigType.LAST_SAVED_CONFIG
4334
const _canReviewConfig = canReviewConfig && !noLastDeploymentConfig
4435

4536
// RENDERERS
@@ -68,20 +59,12 @@ export const PipelineConfigDiffStatusTile = ({
6859
const renderConfigViewState = () => (_canReviewConfig ? renderDiffState() : renderConfigNotAvailableState())
6960

7061
const renderReviewState = () =>
71-
_canReviewConfig || lastDeployedOptionSelected || noLastDeploymentConfig ? (
72-
<span className="cb-5 mt-3 mb-3">REVIEW</span>
73-
) : null
62+
_canReviewConfig || noLastDeploymentConfig ? <span className="cb-5 mt-3 mb-3">REVIEW</span> : null
7463

7564
const renderLoadingState = () => (
7665
<span className="dc__border-radius-24 flex dc__gap-4 py-3 px-12 fs-12 fw-6 lh-20 cn-0 bcb-5">
7766
<span>Checking diff</span>
78-
<Progressing
79-
size={16}
80-
fillColor="white"
81-
styles={{
82-
width: 'auto',
83-
}}
84-
/>
67+
<Icon name="ic-circle-loader" color="N0" />
8568
</span>
8669
)
8770

@@ -92,7 +75,7 @@ export const PipelineConfigDiffStatusTile = ({
9275
<DeploymentConfigDiffRadioSelect radioSelectConfig={radioSelectConfig} position="top" />
9376
</div>
9477
<Tooltip
95-
alwaysShowTippyOnHover={!isLoading && !lastDeployedOptionSelected && !noLastDeploymentConfig}
78+
alwaysShowTippyOnHover={!isLoading && !noLastDeploymentConfig}
9679
content={
9780
noLastDeploymentConfig
9881
? renderConfigNotAvailableTooltip()
@@ -107,11 +90,7 @@ export const PipelineConfigDiffStatusTile = ({
10790
disabled={isLoading || !canReviewConfig}
10891
onClick={onClick}
10992
>
110-
{!lastDeployedOptionSelected &&
111-
!noLastDeploymentConfig &&
112-
(isLoading && !lastSavedConfigOptionSelected
113-
? renderLoadingState()
114-
: renderConfigViewState())}
93+
{!noLastDeploymentConfig && (isLoading ? renderLoadingState() : renderConfigViewState())}
11594
{renderReviewState()}
11695
</button>
11796
</div>

src/components/app/details/triggerView/PipelineConfigDiff/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export type PipelineConfigDiffProps = Pick<
4848
}
4949

5050
export interface PipelineConfigDiffStatusTileProps
51-
extends Pick<PipelineConfigDiffProps, 'isLoading' | 'radioSelectConfig' | 'urlFilters'> {
51+
extends Pick<PipelineConfigDiffProps, 'isLoading' | 'radioSelectConfig'> {
5252
hasDiff?: boolean
5353
noLastDeploymentConfig?: boolean
5454
onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1795,7 +1795,6 @@ const CDMaterial = ({
17951795
onClick={() => onClickSetInitialParams('review-config')}
17961796
noLastDeploymentConfig={noLastDeploymentConfig}
17971797
canReviewConfig={canReviewConfig()}
1798-
urlFilters={urlFilters}
17991798
renderConfigNotAvailableTooltip={renderTippyContent}
18001799
/>
18011800
) : (

0 commit comments

Comments
 (0)