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

Commit

Permalink
feat: DIA-820: [FE] Make List type columns display as intended type w…
Browse files Browse the repository at this point in the history
…ith out the ability for users to change type for Data Discovery (#289)
  • Loading branch information
yyassi-heartex authored Jan 17, 2024
1 parent 7e5b044 commit 18fac7b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
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" && col.original && getRoot(col.original)?.SDK?.type !== 'DE',
style: { width: 150, justifyContent: "center" },
},
{
resolver: (col) => col.type === "Image" && col.original && 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" && col.original && getRoot(col.original)?.SDK?.type !== 'DE',
style: { width: 150, justifyContent: "center" },
},
{
resolver: (col) => col.type === "Image" && col.original && getRoot(col.original)?.SDK?.type === 'DE',
style: { width: 150 },
},
{
resolver: (col) => ["Date", "Datetime"].includes(col.type),
style: { width: 240 },
Expand Down

0 comments on commit 18fac7b

Please sign in to comment.