mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Respect hidden columns
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
1aa7561ccf
commit
ed17e064ce
@ -18,12 +18,17 @@
|
||||
|
||||
&.actionColumn {
|
||||
flex: 0 0 55px;
|
||||
|
||||
.line {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.line {
|
||||
width: 100%;
|
||||
width: 90%;
|
||||
max-width: 290px;
|
||||
height: 0px;
|
||||
padding: 3px;
|
||||
border-radius: 4px;
|
||||
|
||||
@ -7,13 +7,15 @@ import styles from "./placeholder.module.scss";
|
||||
|
||||
import React from "react";
|
||||
import type { TableCellProps } from "../table";
|
||||
import { UserStore } from "../../../common/user-store";
|
||||
|
||||
interface Props {
|
||||
renderTableHeader: TableCellProps[];
|
||||
showExtraColumn?: boolean;
|
||||
tableId: string;
|
||||
}
|
||||
|
||||
export function Placeholder({ renderTableHeader, showExtraColumn = true }: Props) {
|
||||
export function Placeholder({ renderTableHeader, showExtraColumn = true, tableId }: Props) {
|
||||
const linesNumber = 3;
|
||||
|
||||
function renderLines() {
|
||||
@ -28,9 +30,15 @@ export function Placeholder({ renderTableHeader, showExtraColumn = true }: Props
|
||||
return React.Children.toArray(lines);
|
||||
}
|
||||
|
||||
function showColumn({ id: columnId, showWithColumn }: TableCellProps): boolean {
|
||||
return !UserStore.getInstance().isTableColumnHidden(tableId, columnId, showWithColumn);
|
||||
}
|
||||
|
||||
const filteredColumns = renderTableHeader.filter(showColumn);
|
||||
|
||||
return (
|
||||
<div className={styles.placeholder}>
|
||||
{renderTableHeader.map((cellProps) => {
|
||||
<div className={styles.placeholder} aria-hidden="true">
|
||||
{filteredColumns.map((cellProps) => {
|
||||
return (
|
||||
<div key={cellProps.id} className={cellProps.className}>
|
||||
{renderLines()}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user