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

Commit

Permalink
feat: DIA-474: [FE] add new column for DE
Browse files Browse the repository at this point in the history
  • Loading branch information
yyassi-heartex committed Dec 21, 2023
1 parent 0d73070 commit ce4d86e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/components/CellViews/ProjectCell.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { getRoot } from "mobx-state-tree";

export const ProjectCell = (cell) => {
const { original, value } = cell;
const root = getRoot(original);
// TODO: turn this into a link to open the project later
const projectList = value
.map((projectRef) => (
root.taskStore.associatedList.find(proj => proj.id === projectRef.project_id)?.title
))
.filter(Boolean);

return (
<div
style={{
maxHeight: "100%",
overflow: "hidden",
fontSize: 12,
lineHeight: "16px",
}}
>
{projectList && projectList.join(", ")}
</div>
);
};
2 changes: 2 additions & 0 deletions src/components/CellViews/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ export { NumberCell as Number } from "./NumberCell";
export { StringCell as String } from "./StringCell";
export { StringCell as Text } from "./StringCell";
export { VideoCell as Video } from "./VideoCell";
export { ProjectCell as Project } from './ProjectCell';

0 comments on commit ce4d86e

Please sign in to comment.