Skip to content

Commit

Permalink
Lock all nodes from being dragged when timer page timer is running
Browse files Browse the repository at this point in the history
This will be temporary. Ideally, we only want to lock the one that is being timed.
  • Loading branch information
Kyjor committed Jan 4, 2024
1 parent 9c1367d commit 1a4fe54
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/components/KanbanBoard/KanbanBoard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,14 @@ class KanbanBoard extends Component {
>
{this.props.parentOrder.map((parentId, index) => {
const parent = this.props.parents[parentId];

return (
parent && (
<BoardInnerList
className="ignoreParent"
createNewNode={this.props.createNewNode}
deleteNode={this.props.deleteNode}
index={index}
isTimerRunning={this.props.isTimerRunning}
key={parent.id}
mustFocusNodeTitle={this.props.mustFocusNodeTitle}
mustFocusParentTitle={this.props.mustFocusParentTitle}
Expand Down
2 changes: 1 addition & 1 deletion src/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ function createTimerWindow(node, projectName, stateInit, timerPrefs) {
width: 275,
height: 175,
titleBarStyle: 'customButtonsOnHover',
frame: false,
frame: true,
alwaysOnTop: true,
show: false,
// resizable: false,
Expand Down
2 changes: 2 additions & 0 deletions src/pages/ProjectPage/BoardInnerList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class BoardInnerList extends React.PureComponent {
const {
createNewNode,
deleteNode,
isTimerRunning,
showParentModal,
showModal,
updateNodeTitle,
Expand All @@ -22,6 +23,7 @@ class BoardInnerList extends React.PureComponent {
nodes={nodes}
index={index}
createNewNode={createNewNode}
isTimerRunning={isTimerRunning}
mustFocusNodeTitle={mustFocusNodeTitle}
saveTime={this.props.saveTime}
mustFocusParentTitle={mustFocusParentTitle}
Expand Down
1 change: 1 addition & 0 deletions src/pages/ProjectPage/ProjectPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ class ProjectPage extends Component {
createNewNode={this.createNewNode}
deleteNode={this.deleteNode}
handleAddParent={() => this.createNewParent('New Parent')}
isTimerRunning={this.state.isTimerRunning}
mustFocusNodeTitle={this.state.mustFocusNodeTitle}
mustFocusParentTitle={this.state.mustFocusParentTitle}
nodes={this.state.nodes}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ProjectPage/node.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const Node = (props) => {
<Draggable
draggableId={node.id}
index={props.index}
isDragDisabled={isDragDisabled}
isDragDisabled={isDragDisabled || props.isTimerRunning}
>
{(provided, snapshot) => (
<div
Expand Down
2 changes: 2 additions & 0 deletions src/pages/ProjectPage/parent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class ParentInnerList extends React.Component {
<>
{node && (
<Node
isTimerRunning={this.props.isTimerRunning}
key={node.id}
node={node}
index={index}
Expand Down Expand Up @@ -159,6 +160,7 @@ const Parent = (props) => {
isDraggingOver={snapshot.isDraggingOver}
>
<ParentInnerList
isTimerRunning={props.isTimerRunning}
nodes={nodes}
mustFocusNodeTitle={mustFocusNodeTitle}
updateNodeTitle={updateNodeTitle}
Expand Down
6 changes: 3 additions & 3 deletions src/pages/Timer/TimerPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class TimerPage extends Component {
);

sharedIndividualProjectState.setState((state) => {
state.timerRunning = false;
state.isTimerRunning = false;
});
};

Expand All @@ -155,7 +155,7 @@ class TimerPage extends Component {
);

sharedIndividualProjectState.setState((state) => {
state.timerRunning = true;
state.isTimerRunning = true;
});
};

Expand Down Expand Up @@ -211,7 +211,7 @@ class TimerPage extends Component {
nodes={this.buildTreeData()}
updateSelectedNode={this.updateSelectedNode}
currentNode={this.state.currentNodeSelectedInTimer}
isTimerRunning={this.state.timerRunning}
isTimerRunning={this.state.isTimerRunning}
/>
<Timer
endSession={this.endSession}
Expand Down

0 comments on commit 1a4fe54

Please sign in to comment.