Skip to content

Commit e4fd7c6

Browse files
committed
feat: add feature flag for log segregation
1 parent 136675d commit e4fd7c6

File tree

6 files changed

+18
-13
lines changed

6 files changed

+18
-13
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtron-labs/devtron-fe-common-lib",
3-
"version": "0.1.8-beta-13",
3+
"version": "0.1.8-beta-15",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Shared/Components/CICDHistory/LogStageAccordion.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ const LogStageAccordion = ({
1717
status,
1818
handleStageClose,
1919
handleStageOpen,
20-
accordionIndex,
21-
areEventsProgressing,
20+
stageIndex,
21+
isLoading,
2222
}: LogStageAccordionProps) => {
2323
const handleAccordionToggle = () => {
2424
if (isOpen) {
25-
handleStageClose(accordionIndex)
25+
handleStageClose(stageIndex)
2626
} else {
27-
handleStageOpen(accordionIndex)
27+
handleStageOpen(stageIndex)
2828
}
2929
}
3030

@@ -73,7 +73,7 @@ const LogStageAccordion = ({
7373
</LogsItemContainer>
7474
))}
7575

76-
{areEventsProgressing && (
76+
{isLoading && (
7777
<LogsItemContainer>
7878
<span />
7979
<div className="dc__loading-dots cn-0" />

src/Shared/Components/CICDHistory/LogsRenderer.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,8 @@ export const LogsRenderer = ({
184184
const [logsList, setLogsList] = useState<string[]>([])
185185
const { searchKey, handleSearch } = useUrlFilters()
186186

187-
const areStagesAvailable = streamDataList[0]?.startsWith(LOGS_STAGE_IDENTIFIER) || false
187+
const areStagesAvailable =
188+
(window._env_.FEATURE_STEP_WISE_LOGS_ENABLE && streamDataList[0]?.startsWith(LOGS_STAGE_IDENTIFIER)) || false
188189

189190
function createMarkup(log: string, targetSearchKey: string = searchKey): CreateMarkupReturnType {
190191
let isSearchKeyPresent = false
@@ -431,8 +432,8 @@ export const LogsRenderer = ({
431432
status={status}
432433
handleStageClose={handleStageClose}
433434
handleStageOpen={handleStageOpen}
434-
accordionIndex={index}
435-
areEventsProgressing={areEventsProgressing}
435+
stageIndex={index}
436+
isLoading={index === stageList.length - 1 && areEventsProgressing}
436437
/>
437438
))}
438439
</div>

src/Shared/Components/CICDHistory/types.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -696,8 +696,11 @@ export interface StageDetailType extends Pick<StageInfoDTO, 'stage' | 'startTime
696696
export interface LogStageAccordionProps extends StageDetailType {
697697
handleStageClose: (index: number) => void
698698
handleStageOpen: (index: number) => void
699-
accordionIndex: number
700-
areEventsProgressing: boolean
699+
stageIndex: number
700+
/**
701+
* A stage is loading if it is last in current stage list and event is not closed
702+
*/
703+
isLoading: boolean
701704
}
702705

703706
export interface CreateMarkupReturnType {

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ export interface customEnv {
7272
HIDE_RESOURCE_WATCHER?: boolean
7373
ORGANIZATION_NAME?: string
7474
FEATURE_SCOPED_VARIABLE_ENVIRONMENT_LIST_ENABLE?: boolean
75+
FEATURE_STEP_WISE_LOGS_ENABLE?: boolean
7576
}
7677
declare global {
7778
interface Window {

0 commit comments

Comments
 (0)