diff --git a/web/components/gantt-chart/blocks/blocks-list.tsx b/web/components/gantt-chart/blocks/blocks-list.tsx index b65f04bb6..1bc75ea8f 100644 --- a/web/components/gantt-chart/blocks/blocks-list.tsx +++ b/web/components/gantt-chart/blocks/blocks-list.tsx @@ -20,6 +20,7 @@ export type GanttChartBlocksProps = { enableBlockLeftResize: boolean; enableBlockRightResize: boolean; enableBlockMove: boolean; + enableAddBlock: boolean; showAllBlocks: boolean; }; @@ -32,6 +33,7 @@ export const GanttChartBlocksList: FC = observer((props) enableBlockLeftResize, enableBlockRightResize, enableBlockMove, + enableAddBlock, showAllBlocks, } = props; // store hooks @@ -120,7 +122,7 @@ export const GanttChartBlocksList: FC = observer((props) enableBlockMove={enableBlockMove} /> ) : ( - + enableAddBlock && )} diff --git a/web/components/gantt-chart/chart/main-content.tsx b/web/components/gantt-chart/chart/main-content.tsx index 950f3550c..35bd6bc07 100644 --- a/web/components/gantt-chart/chart/main-content.tsx +++ b/web/components/gantt-chart/chart/main-content.tsx @@ -27,6 +27,7 @@ type Props = { enableBlockMove: boolean; enableBlockRightResize: boolean; enableReorder: boolean; + enableAddBlock: boolean; itemsContainerWidth: number; showAllBlocks: boolean; sidebarToRender: (props: any) => React.ReactNode; @@ -45,6 +46,7 @@ export const GanttChartMainContent: React.FC = (props) => { enableBlockMove, enableBlockRightResize, enableReorder, + enableAddBlock, itemsContainerWidth, showAllBlocks, sidebarToRender, @@ -111,6 +113,7 @@ export const GanttChartMainContent: React.FC = (props) => { enableBlockLeftResize={enableBlockLeftResize} enableBlockRightResize={enableBlockRightResize} enableBlockMove={enableBlockMove} + enableAddBlock={enableAddBlock} showAllBlocks={showAllBlocks} /> )} diff --git a/web/components/gantt-chart/chart/root.tsx b/web/components/gantt-chart/chart/root.tsx index 961cb2fee..4cb6bc10e 100644 --- a/web/components/gantt-chart/chart/root.tsx +++ b/web/components/gantt-chart/chart/root.tsx @@ -28,6 +28,7 @@ type ChartViewRootProps = { enableBlockRightResize: boolean; enableBlockMove: boolean; enableReorder: boolean; + enableAddBlock: boolean; bottomSpacing: boolean; showAllBlocks: boolean; }; @@ -45,6 +46,7 @@ export const ChartViewRoot: FC = (props) => { enableBlockRightResize, enableBlockMove, enableReorder, + enableAddBlock, bottomSpacing, showAllBlocks, } = props; @@ -192,6 +194,7 @@ export const ChartViewRoot: FC = (props) => { enableBlockMove={enableBlockMove} enableBlockRightResize={enableBlockRightResize} enableReorder={enableReorder} + enableAddBlock={enableAddBlock} itemsContainerWidth={itemsContainerWidth} showAllBlocks={showAllBlocks} sidebarToRender={sidebarToRender} diff --git a/web/components/gantt-chart/chart/views/month.tsx b/web/components/gantt-chart/chart/views/month.tsx index 13f60c2b4..c559e9688 100644 --- a/web/components/gantt-chart/chart/views/month.tsx +++ b/web/components/gantt-chart/chart/views/month.tsx @@ -14,63 +14,61 @@ export const MonthChartView: FC = () => { const monthBlocks: IMonthBlock[] = renderView; return ( - <> -
- {monthBlocks?.map((block, rootIndex) => ( -
-
-
-
- {block?.title} -
-
-
- {block?.children?.map((monthDay, index) => ( -
-
- {monthDay.dayData.shortTitle[0]}{" "} - - {monthDay.day} - -
-
- ))} +
+ {monthBlocks?.map((block, rootIndex) => ( +
+
+
+
+ {block?.title}
-
+
{block?.children?.map((monthDay, index) => (
- {["sat", "sun"].includes(monthDay?.dayData?.shortTitle) && ( -
- )} +
+ {monthDay.dayData.shortTitle[0]}{" "} + + {monthDay.day} + +
))}
- ))} -
- +
+ {block?.children?.map((monthDay, index) => ( +
+ {["sat", "sun"].includes(monthDay?.dayData?.shortTitle) && ( +
+ )} +
+ ))} +
+
+ ))} +
); }; diff --git a/web/components/gantt-chart/root.tsx b/web/components/gantt-chart/root.tsx index c8576436e..2e9a8aca1 100644 --- a/web/components/gantt-chart/root.tsx +++ b/web/components/gantt-chart/root.tsx @@ -16,6 +16,7 @@ type GanttChartRootProps = { enableBlockRightResize?: boolean; enableBlockMove?: boolean; enableReorder?: boolean; + enableAddBlock?: boolean; bottomSpacing?: boolean; showAllBlocks?: boolean; }; @@ -29,10 +30,11 @@ export const GanttChartRoot: FC = (props) => { blockUpdateHandler, sidebarToRender, blockToRender, - enableBlockLeftResize = true, - enableBlockRightResize = true, - enableBlockMove = true, - enableReorder = true, + enableBlockLeftResize = false, + enableBlockRightResize = false, + enableBlockMove = false, + enableReorder = false, + enableAddBlock = false, bottomSpacing = false, showAllBlocks = false, } = props; @@ -51,6 +53,7 @@ export const GanttChartRoot: FC = (props) => { enableBlockRightResize={enableBlockRightResize} enableBlockMove={enableBlockMove} enableReorder={enableReorder} + enableAddBlock={enableAddBlock} bottomSpacing={bottomSpacing} showAllBlocks={showAllBlocks} /> diff --git a/web/components/gantt-chart/sidebar/root.tsx b/web/components/gantt-chart/sidebar/root.tsx index ceefb5809..b76112059 100644 --- a/web/components/gantt-chart/sidebar/root.tsx +++ b/web/components/gantt-chart/sidebar/root.tsx @@ -18,7 +18,7 @@ export const GanttChartSidebar: React.FC = (props) => {
= observer((props: IBaseGan enableBlockRightResize={isAllowed} enableBlockMove={isAllowed} enableReorder={appliedDisplayFilters?.order_by === "sort_order" && isAllowed} + enableAddBlock={isAllowed} showAllBlocks />
diff --git a/web/components/modules/gantt-chart/modules-list-layout.tsx b/web/components/modules/gantt-chart/modules-list-layout.tsx index a3f37df5c..8384c164e 100644 --- a/web/components/modules/gantt-chart/modules-list-layout.tsx +++ b/web/components/modules/gantt-chart/modules-list-layout.tsx @@ -52,6 +52,7 @@ export const ModulesListGanttChartView: React.FC = observer(() => { enableBlockRightResize={isAllowed} enableBlockMove={isAllowed} enableReorder={isAllowed} + enableAddBlock={isAllowed} showAllBlocks />