diff --git a/src/assets/PlanningTool.css b/src/assets/PlanningTool.css index 2e90aa0..0588976 100644 --- a/src/assets/PlanningTool.css +++ b/src/assets/PlanningTool.css @@ -9,18 +9,6 @@ width: calc(100% - 30rem); } -.task_card { - background: #0000aa; -} - -.scheduled_wo { - background: #00aa00; -} - -.maintenance_wo { - background: #aa0000; -} - .rct-sidebar { position: relative; padding-right: 0.25rem; @@ -58,8 +46,13 @@ margin-bottom: 1.25rem; } -.explanatory-notes .note .color { - display: inline-block; +.explanatory-notes .note { + display: flex; + align-items: center; + padding: .2rem; +} + +.explanatory-notes .note .legend-color { background-color: #000; width: 1.5rem; height: 0.8rem; diff --git a/src/components/Legend.jsx b/src/components/Legend.jsx index 64b603f..b910bc5 100644 --- a/src/components/Legend.jsx +++ b/src/components/Legend.jsx @@ -1,6 +1,9 @@ import React from "react"; +import Constants from "../constants/Constants"; const Legend = ({ title, legendItems }) => { + let defaultItems = Constants.DEFAULT_LEGEND_ITEMS; + return (

{title}

@@ -8,11 +11,22 @@ const Legend = ({ title, legendItems }) => { {legendItems.map((item, index) => { return (
- - {item.name} +
+
{item.name}
+
+ ); + })} + {defaultItems.map((item, index) => { + return ( +
+
+
{item.name}
); })} diff --git a/src/constants/Constants.js b/src/constants/Constants.js index 14f4ef5..50a639d 100644 --- a/src/constants/Constants.js +++ b/src/constants/Constants.js @@ -7,4 +7,15 @@ export default class Constants{ static RESOURCE_REORDER = 'resource-reorder' static MILESTONE_ADD = 'milestone-add' static MILESTONE_EDIT = 'milestone-edit' + static DEFAULT_LEGEND_ITEMS = [ + { + name: "current selection & parents/children", + color: "#FFC107", + }, + { + name: "non movable item", + color: + "repeating-linear-gradient( -45deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0) 2px, #465298 2px, #465298 4px )", + }, + ]; } \ No newline at end of file