Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…common-lib into feat/hibernation-patch
  • Loading branch information
arunjaindev committed Feb 20, 2025
2 parents c187ec4 + 41d2add commit c8504c9
Show file tree
Hide file tree
Showing 49 changed files with 342 additions and 149 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@devtron-labs/devtron-fe-common-lib",
"version": "1.7.6-beta-1",
"version": "1.7.10",
"description": "Supporting common component library",
"type": "module",
"main": "dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion src/Assets/Icon/ic-error.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/Assets/Icon/ic-info-filled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/Assets/Icon/ic-success.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/Assets/Icon/ic-warning-y5.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/Assets/Icon/ic-warning.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions src/Assets/IconV2/ic-info-filled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 19 additions & 3 deletions src/Assets/IconV2/ic-warning.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/Common/CodeEditor/CodeEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ const CodeEditor: React.FC<CodeEditorInterface> & CodeEditorComposition = React.
inherit: true,
rules: [
// @ts-ignore
{ background: '#0B0F22' },
{ background: '#181920' },
],
colors: {
'editor.background': '#0B0F22',
'editor.background': '#181920',
},
})

Expand Down
1 change: 1 addition & 0 deletions src/Common/Constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ export const ROUTES = {
TELEMETRY_EVENT: 'telemetry/event',
SERVER_INFO_API: 'server',
ATTRIBUTES_USER: 'attributes/user',
GET: 'get',
UPDATE: 'update',
ENVIRONMENT_LIST_MIN: 'env/autocomplete',
CLUSTER: 'cluster',
Expand Down
1 change: 1 addition & 0 deletions src/Common/Drawer/Drawer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
}
&.right {
right: 0;
border-left: 1px solid var(--border-primary);
}
&.left {
left: 0;
Expand Down
4 changes: 2 additions & 2 deletions src/Common/EmptyState/GenericEmptyState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,19 @@ const GenericEmptyState = ({
className={imageClassName || ''}
src={image || AppNotDeployed}
style={{
...imageStyles,
width: `${getImageSize().width}`,
height: `${getImageSize().height}`,
...imageStyles,
}}
alt="empty-state"
/>
)
) : (
<SvgImage
style={{
...imageStyles,
width: `${getImageSize().width}`,
height: `${getImageSize().height}`,
...imageStyles,
}}
/>
)}
Expand Down
2 changes: 2 additions & 0 deletions src/Common/SegmentedControl/SegmentedControl.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const SegmentedControl = ({
name,
variant = SegmentedControlVariant.WHITE_ON_GRAY,
size = ComponentSizeType.medium,
isControlled = false,
}: SegmentedControlProps) => (
<StyledRadioGroup
className={`${variant} ${SEGMENTED_CONTROL_SIZE_TO_CLASS_MAP[size]} ${rootClassName}`}
Expand All @@ -45,6 +46,7 @@ const SegmentedControl = ({
showTippy={!!tooltips?.[index]}
tippyContent={tooltips?.[index] ?? ''}
dataTestId={`${name}-${tab.value}`}
canSelect={!isControlled}
>
{tab.label}
</StyledRadioGroup.Radio>
Expand Down
4 changes: 4 additions & 0 deletions src/Common/SegmentedControl/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,8 @@ export interface SegmentedControlProps {
* @default ComponentSizeType.medium
*/
size?: ComponentSizeType.medium | ComponentSizeType.large
/**
* @default false
*/
isControlled?: boolean
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const BuildAndTaskSummaryTooltipCard = memo(
const executionInfo = sanitizeWorkflowExecutionStages(workflowExecutionStages)

return (
<div className="shadow__overlay p-16 br-4 w-350 bg__overlay border__primary mxh-300 dc__overflow-auto flexbox-col dc__gap-16">
<div className="shadow__overlay p-16 br-4 w-350 bg__overlay--primary border__primary mxh-300 dc__overflow-auto flexbox-col dc__gap-16">
{/* Info section */}
<div className="dc__icon-text-layout">
<ICCalendar className={`scn-7 ${BASE_ICON_CLASS}`} />
Expand Down
89 changes: 47 additions & 42 deletions src/Shared/Components/CICDHistory/History.components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import { useCallback, useEffect } from 'react'
import { useLocation } from 'react-router-dom'
import { AppThemeType, getComponentSpecificThemeClass } from '@Shared/Providers'
import {
ClipboardButton,
GenericEmptyState,
Expand Down Expand Up @@ -60,54 +61,58 @@ export const LogResizeButton = ({

return (
showButton && (
<Tooltip
placement="left"
shortcutKeyCombo={{
text: fullScreenView ? 'Exit fullscreen' : 'Enter fullscreen',
combo: shortcutCombo,
}}
>
<button
type="button"
aria-label="Enter/Exit fullscreen view"
className="zoom dc__zi-4 flex dc__no-border log-resize-button"
onClick={toggleFullScreen}
<div className={getComponentSpecificThemeClass(AppThemeType.dark)}>
<Tooltip
placement="left"
shortcutKeyCombo={{
text: fullScreenView ? 'Exit fullscreen' : 'Enter fullscreen',
combo: shortcutCombo,
}}
>
{fullScreenView ? (
<ZoomOut className="icon-dim-16 dc__no-shrink" />
) : (
<ZoomIn className="icon-dim-16 dc__no-shrink" />
)}
</button>
</Tooltip>
<button
type="button"
aria-label="Enter/Exit fullscreen view"
className="zoom dc__zi-4 flex log-resize-button"
onClick={toggleFullScreen}
>
{fullScreenView ? (
<ZoomOut className="icon-dim-16 dc__no-shrink" />
) : (
<ZoomIn className="icon-dim-16 dc__no-shrink" />
)}
</button>
</Tooltip>
</div>
)
)
}

export const Scroller = ({ scrollToTop, scrollToBottom, style }: ScrollerType): JSX.Element => (
<div style={style} className="dc__element-scroller flex column top br-4">
<Tooltip alwaysShowTippyOnHover content="Scroll to Top" placement="left">
<button
className="flex"
disabled={!scrollToTop}
type="button"
onClick={scrollToTop}
aria-label="scroll-to-top"
>
<DropDownIcon className="rotate" style={{ ['--rotateBy' as any]: '180deg' }} />
</button>
</Tooltip>
<Tooltip alwaysShowTippyOnHover content="Scroll to Bottom" placement="left">
<button
className="flex"
disabled={!scrollToBottom}
type="button"
onClick={scrollToBottom}
aria-label="scroll-to-button"
>
<DropDownIcon className="rotate" />
</button>
</Tooltip>
<div className={getComponentSpecificThemeClass(AppThemeType.dark)}>
<div style={style} className="dc__element-scroller flex column top br-4">
<Tooltip alwaysShowTippyOnHover content="Scroll to Top" placement="left">
<button
className="flex"
disabled={!scrollToTop}
type="button"
onClick={scrollToTop}
aria-label="scroll-to-top"
>
<DropDownIcon className="rotate" style={{ ['--rotateBy' as any]: '180deg' }} />
</button>
</Tooltip>
<Tooltip alwaysShowTippyOnHover content="Scroll to Bottom" placement="left">
<button
className="flex"
disabled={!scrollToBottom}
type="button"
onClick={scrollToBottom}
aria-label="scroll-to-button"
>
<DropDownIcon className="rotate" />
</button>
</Tooltip>
</div>
</div>
)

Expand Down
4 changes: 2 additions & 2 deletions src/Shared/Components/CICDHistory/LogStageAccordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,13 @@ const LogStageAccordion = ({
>
<span
ref={scrollIntoView}
className="cn-4 col-2 lh-20 dc__text-align-end dc__word-break mono fs-14 dc__user-select-none"
className="cn-5 col-2 lh-20 dc__text-align-end dc__word-break mono fs-14 dc__user-select-none"
data-contains-match={doesLineContainSearchMatch}
>
{logsIndex + 1}
</span>
<pre
className="mono fs-14 mb-0-imp text__white dc__word-break lh-20 dc__unset-pre"
className="mono fs-14 mb-0-imp text__white dc__word-break lh-20 dc__unset-pre dc__transparent--imp"
// eslint-disable-next-line react/no-danger
dangerouslySetInnerHTML={{
__html: DOMPurify.sanitize(log),
Expand Down
12 changes: 6 additions & 6 deletions src/Shared/Components/CICDHistory/LogsRenderer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,29 +52,29 @@
}

&__stage-accordion {
background-color: #0c1021;
background-color: var(--transparent);

&:not(&--open-stage):hover {
background-color: rgba(44, 51, 84, 0.5);
background-color: var(--bg-hover);
}

&--open-stage {
background-color: #2c3354;
background-color: var(--bg-overlay-primary);
}
}

&__log-item {
grid-template-columns: 36px auto;
&:hover {
background-color: var(--white-20);
background-color: var(--bg-hover);
}
}

&__filters-border-bottom {
border-bottom: 1px solid #2c3354;
border-bottom: 1px solid var(--border-secondary);

& > :not(:first-child) {
border-left: 1px solid #2C3354;
border-left: 1px solid var(--border-secondary);
}
}
}
Expand Down
Loading

0 comments on commit c8504c9

Please sign in to comment.