Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

feat: DIA-820: [FE] Make List type columns display as intended type with out the ability for users to change type for Data Discovery #289

Merged
merged 3 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/components/Common/Table/TableHead/TableHead.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { TableContext, TableElem } from "../TableContext";
import { getStyle } from "../utils";
import "./TableHead.styl";
import { FF_DEV_2984, FF_DEV_3873, FF_LOPS_E_10, isFF } from "../../../../utils/feature-flags";
import { getRoot } from "mobx-state-tree";

const { Block, Elem } = BemWithSpecifiContext();

Expand Down Expand Up @@ -120,9 +121,11 @@ const ColumnRenderer = observer(
);
}

const root = getRoot(column.original);
const isDE = root.SDK.type === "DE";
const canOrder = sortingEnabled && column.original?.canOrder;
const Decoration = decoration?.get?.(column);
const extra = columnHeaderExtra
const extra = !isDE && columnHeaderExtra
? columnHeaderExtra(column, Decoration)
: null;
const content = Decoration?.content
Expand Down Expand Up @@ -158,7 +161,7 @@ const ColumnRenderer = observer(
onResizeFinished={(width) => onResize?.(column, width)}
onReset={() => onReset?.(column)}
>
{column.parent ? (
{!isDE && column.parent ? (
<DropdownWrapper
column={column}
cellViews={cellViews}
Expand Down
7 changes: 5 additions & 2 deletions src/components/Common/TableOld/TableHead/TableHead.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { TableContext, TableElem } from "../TableContext";
import { getStyle } from "../utils";
import "./TableHead.styl";
import { FF_DEV_2984, FF_DEV_3873, isFF } from "../../../../utils/feature-flags";
import { getRoot } from "mobx-state-tree";

const { Block, Elem } = BemWithSpecifiContext();

Expand Down Expand Up @@ -110,9 +111,11 @@ const ColumnRenderer = observer(
);
}

const root = getRoot(column.original);
const isDE = root.SDK.type === "DE";
const canOrder = sortingEnabled && column.original?.canOrder;
const Decoration = decoration?.get?.(column);
const extra = columnHeaderExtra
const extra = !isDE && columnHeaderExtra
? columnHeaderExtra(column, Decoration)
: null;
const content = Decoration?.content
Expand Down Expand Up @@ -148,7 +151,7 @@ const ColumnRenderer = observer(
onResizeFinished={(width) => onResize?.(column, width)}
onReset={() => onReset?.(column)}
>
{column.parent ? (
{!isDE && column.parent ? (
<DropdownWrapper
column={column}
cellViews={cellViews}
Expand Down
6 changes: 5 additions & 1 deletion src/components/MainView/DataView/DataView.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,13 @@ export const DataView = injector(
},
},
{
resolver: (col) => col.type === "Image",
resolver: (col) => col.type === "Image" && getRoot(col.original).SDK.type !== 'DE',
yyassi-heartex marked this conversation as resolved.
Show resolved Hide resolved
style: { width: 150, justifyContent: "center" },
},
{
resolver: (col) => col.type === "Image" && getRoot(col.original).SDK.type === 'DE',
style: { width: 150 },
},
{
resolver: (col) => ["Date", "Datetime"].includes(col.type),
style: { width: 240 },
Expand Down
6 changes: 5 additions & 1 deletion src/components/MainView/DataViewOld/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,13 @@ export const DataView = injector(
},
},
{
resolver: (col) => col.type === "Image",
resolver: (col) => col.type === "Image" && getRoot(col.original).SDK.type !== 'DE',
style: { width: 150, justifyContent: "center" },
},
{
resolver: (col) => col.type === "Image" && getRoot(col.original).SDK.type === 'DE',
style: { width: 150 },
},
{
resolver: (col) => ["Date", "Datetime"].includes(col.type),
style: { width: 240 },
Expand Down