-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Refactor]: Dynamic Columns PR (#3852)
* fix: remove the space and fix the classname * refactor: made the dynamicColumnsTable-items responsive * fix: setcolumndata to a separate function * fix: handle invalid CreatedOrUpdateTime * fix: hyphenate classname and bme * refactor: move the implementation to separate component * refactor: removed the bydefault render * refactor: remove render * refactor: removed unwanted imports * fix: remove the space and fix the classname * refactor: made the dynamicColumnsTable-items responsive * fix: setcolumndata to a separate function * fix: handle invalid CreatedOrUpdateTime * fix: hyphenate classname and bme * refactor: move the implementation to separate component * refactor: removed the bydefault render * refactor: remove render * fix: the classname
- Loading branch information
Rajat Dabade
committed
Nov 1, 2023
1 parent
b958a06
commit ec3eba6
Showing
13 changed files
with
143 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
.Dropdown-button { | ||
.dropdown-button { | ||
color: #fff; | ||
} | ||
|
||
.Dropdown-button--dark { | ||
.dropdown-button--dark { | ||
color: #000; | ||
} | ||
|
||
.Dropdown-icon { | ||
.dropdown-icon { | ||
font-size: 1.2rem; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
frontend/src/components/ResizeTable/TableComponent/DateComponent.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Typography } from 'antd'; | ||
|
||
import Time from './Time'; | ||
|
||
function DateComponent( | ||
CreatedOrUpdateTime: string | number | Date, | ||
): JSX.Element { | ||
if (CreatedOrUpdateTime === null) { | ||
return <Typography> - </Typography>; | ||
} | ||
|
||
return <Time CreatedOrUpdateTime={CreatedOrUpdateTime} />; | ||
} | ||
|
||
export default DateComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 7 additions & 6 deletions
13
frontend/src/components/TableRenderer/LabelColumn.styles.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
.LabelColumn { | ||
.LabelColumn-label-tag { | ||
.label-column { | ||
|
||
display: flex; | ||
flex-wrap: wrap; | ||
|
||
.label-column--tag { | ||
white-space: normal; | ||
margin: 0.2rem 0.2rem; | ||
} | ||
|
||
} | ||
.labelColumn-popover { | ||
margin: 0.5rem 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { Tag, Tooltip } from 'antd'; | ||
|
||
import { getLabelRenderingValue } from './utils'; | ||
|
||
function TagWithToolTip({ | ||
label, | ||
value, | ||
color, | ||
}: TagWithToolTipProps): JSX.Element { | ||
const tooltipTitle = | ||
value && value[label] ? `${label}: ${value[label]}` : label; | ||
return ( | ||
<div key={label}> | ||
<Tooltip title={tooltipTitle}> | ||
<Tag className="label-column--tag" color={color}> | ||
{getLabelRenderingValue(label, value && value[label])} | ||
</Tag> | ||
</Tooltip> | ||
</div> | ||
); | ||
} | ||
|
||
type TagWithToolTipProps = { | ||
label: string; | ||
color?: string; | ||
value?: { | ||
[key: string]: string; | ||
}; | ||
}; | ||
|
||
TagWithToolTip.defaultProps = { | ||
value: undefined, | ||
color: undefined, | ||
}; | ||
|
||
export default TagWithToolTip; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters