1886/fix/dont show unhideable files in fields menu (#1931)
* in compaines>fields Name fields is hided. * in Opputunities>Options>Fieds make closeData dragable * close data (first colum) make hideable * added size field * added filter in fields with index and size * index updated
This commit is contained in:
@ -47,17 +47,7 @@ export const ViewFieldsVisibilityDropdownSection = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const getIconButtons = (index: number, field: ViewFieldForVisibility) => {
|
const getIconButtons = (index: number, field: ViewFieldForVisibility) => {
|
||||||
const isFirstColumn = isDraggable && index === 0;
|
if (field.infoTooltipContent) {
|
||||||
if (isFirstColumn && field.infoTooltipContent) {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
Icon: IconInfoCircle,
|
|
||||||
onClick: () => handleInfoButtonClick(index),
|
|
||||||
isActive: openToolTipIndex === index,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
}
|
|
||||||
if (!isFirstColumn && field.infoTooltipContent) {
|
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
Icon: IconInfoCircle,
|
Icon: IconInfoCircle,
|
||||||
@ -70,7 +60,7 @@ export const ViewFieldsVisibilityDropdownSection = ({
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
if (!isFirstColumn && !field.infoTooltipContent) {
|
if (!field.infoTooltipContent) {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
Icon: field.isVisible ? IconMinus : IconPlus,
|
Icon: field.isVisible ? IconMinus : IconPlus,
|
||||||
@ -98,25 +88,27 @@ export const ViewFieldsVisibilityDropdownSection = ({
|
|||||||
onDragEnd={handleOnDrag}
|
onDragEnd={handleOnDrag}
|
||||||
draggableItems={
|
draggableItems={
|
||||||
<>
|
<>
|
||||||
{fields.map((field, index) => (
|
{fields
|
||||||
<DraggableItem
|
.filter(({ index, size }) => index !== 0 || !size)
|
||||||
key={field.key}
|
.map((field, index) => (
|
||||||
draggableId={field.key}
|
<DraggableItem
|
||||||
index={index}
|
key={field.key}
|
||||||
isDragDisabled={index === 0}
|
draggableId={field.key}
|
||||||
itemComponent={
|
index={index + 1}
|
||||||
<MenuItemDraggable
|
itemComponent={
|
||||||
key={field.key}
|
<MenuItemDraggable
|
||||||
LeftIcon={field.Icon}
|
key={field.key}
|
||||||
iconButtons={getIconButtons(index, field)}
|
LeftIcon={field.Icon}
|
||||||
isTooltipOpen={openToolTipIndex === index}
|
iconButtons={getIconButtons(index + 1, field)}
|
||||||
text={field.name}
|
isTooltipOpen={openToolTipIndex === index + 1}
|
||||||
isDragDisabled={index === 0}
|
text={field.name}
|
||||||
className={`${title}-draggable-item-tooltip-anchor-${index}`}
|
className={`${title}-draggable-item-tooltip-anchor-${
|
||||||
/>
|
index + 1
|
||||||
}
|
}`}
|
||||||
/>
|
/>
|
||||||
))}
|
}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -7,4 +7,5 @@ export type ViewFieldForVisibility = Pick<
|
|||||||
> & {
|
> & {
|
||||||
isVisible?: boolean;
|
isVisible?: boolean;
|
||||||
index: number;
|
index: number;
|
||||||
|
size?: number | undefined;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user