issue-31 #33
@ -5,23 +5,9 @@
 | 
			
		||||
  </component>
 | 
			
		||||
  <component name="ChangeListManager">
 | 
			
		||||
    <list default="true" id="3a869f59-290a-4ab2-b036-a878ce801bc4" name="Changes" comment="Load worked minutes when reloading dashboard">
 | 
			
		||||
      <change afterPath="$PROJECT_DIR$/src/main/java/core/api/models/timemanager/taskSchedule/ForgottenActivity.java" afterDir="false" />
 | 
			
		||||
      <change afterPath="$PROJECT_DIR$/src/main/java/core/api/models/timemanager/taskSchedule/ForgottenActivityMode.java" afterDir="false" />
 | 
			
		||||
      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
 | 
			
		||||
      <change beforePath="$PROJECT_DIR$/src/main/java/core/api/controller/ScheduleController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/core/api/controller/ScheduleController.java" afterDir="false" />
 | 
			
		||||
      <change beforePath="$PROJECT_DIR$/src/main/java/core/api/controller/TaskController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/core/api/controller/TaskController.java" afterDir="false" />
 | 
			
		||||
      <change beforePath="$PROJECT_DIR$/src/main/java/core/api/models/timemanager/tasks/TaskShortInfo.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/core/api/models/timemanager/tasks/TaskShortInfo.java" afterDir="false" />
 | 
			
		||||
      <change beforePath="$PROJECT_DIR$/src/main/java/core/entities/timemanager/Task.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/core/entities/timemanager/Task.java" afterDir="false" />
 | 
			
		||||
      <change beforePath="$PROJECT_DIR$/src/main/java/core/entities/timemanager/Taskgroup.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/core/entities/timemanager/Taskgroup.java" afterDir="false" />
 | 
			
		||||
      <change beforePath="$PROJECT_DIR$/src/main/java/core/repositories/timemanager/BasicTaskScheduleRepository.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/core/repositories/timemanager/BasicTaskScheduleRepository.java" afterDir="false" />
 | 
			
		||||
      <change beforePath="$PROJECT_DIR$/src/main/java/core/repositories/timemanager/TaskRepository.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/core/repositories/timemanager/TaskRepository.java" afterDir="false" />
 | 
			
		||||
      <change beforePath="$PROJECT_DIR$/src/main/java/core/services/TaskScheduleService.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/core/services/TaskScheduleService.java" afterDir="false" />
 | 
			
		||||
      <change beforePath="$PROJECT_DIR$/src/main/java/core/services/TaskService.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/core/services/TaskService.java" afterDir="false" />
 | 
			
		||||
      <change beforePath="$PROJECT_DIR$/../frontend/src/api/api/task.service.ts" beforeDir="false" afterPath="$PROJECT_DIR$/../frontend/src/api/api/task.service.ts" afterDir="false" />
 | 
			
		||||
      <change beforePath="$PROJECT_DIR$/../frontend/src/app/app.module.ts" beforeDir="false" afterPath="$PROJECT_DIR$/../frontend/src/app/app.module.ts" afterDir="false" />
 | 
			
		||||
      <change beforePath="$PROJECT_DIR$/../frontend/src/app/dashboard/active-schedule/active-schedule.component.html" beforeDir="false" afterPath="$PROJECT_DIR$/../frontend/src/app/dashboard/active-schedule/active-schedule.component.html" afterDir="false" />
 | 
			
		||||
      <change beforePath="$PROJECT_DIR$/../frontend/src/app/dashboard/active-schedule/active-schedule.component.ts" beforeDir="false" afterPath="$PROJECT_DIR$/../frontend/src/app/dashboard/active-schedule/active-schedule.component.ts" afterDir="false" />
 | 
			
		||||
      <change beforePath="$PROJECT_DIR$/../openapi.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/../openapi.yaml" afterDir="false" />
 | 
			
		||||
      <change beforePath="$PROJECT_DIR$/../frontend/src/app/dashboard/forgotten-task-start-dialog/forgotten-task-start-dialog.component.ts" beforeDir="false" afterPath="$PROJECT_DIR$/../frontend/src/app/dashboard/forgotten-task-start-dialog/forgotten-task-start-dialog.component.ts" afterDir="false" />
 | 
			
		||||
    </list>
 | 
			
		||||
    <option name="SHOW_DIALOG" value="false" />
 | 
			
		||||
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
 | 
			
		||||
@ -295,6 +281,11 @@
 | 
			
		||||
          <line>94</line>
 | 
			
		||||
          <option name="timeStamp" value="6" />
 | 
			
		||||
        </line-breakpoint>
 | 
			
		||||
        <line-breakpoint enabled="true" type="java-line">
 | 
			
		||||
          <url>file://$PROJECT_DIR$/src/main/java/core/services/TaskScheduleService.java</url>
 | 
			
		||||
          <line>202</line>
 | 
			
		||||
          <option name="timeStamp" value="10" />
 | 
			
		||||
        </line-breakpoint>
 | 
			
		||||
      </breakpoints>
 | 
			
		||||
    </breakpoint-manager>
 | 
			
		||||
  </component>
 | 
			
		||||
 | 
			
		||||
@ -200,14 +200,17 @@ public class TaskScheduleService {
 | 
			
		||||
                    basicTaskSchedule.setFinishedTime(timeReference);
 | 
			
		||||
                    basicTaskScheduleRepository.save(basicTaskSchedule);
 | 
			
		||||
                    taskRepository.save(task);
 | 
			
		||||
                    new ServiceResult<>(minutesSpent);
 | 
			
		||||
                    return new ServiceResult<>(minutesSpent);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            case PLANNED -> {
 | 
			
		||||
                //Does not make sense until advanced schedule/moderate schedule is implemented
 | 
			
		||||
                return new ServiceResult<>(0);
 | 
			
		||||
            }
 | 
			
		||||
            default -> {
 | 
			
		||||
                throw new RuntimeException("INVALID MODE");
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        throw new RuntimeException("INVALID MODE");
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -1,10 +1,11 @@
 | 
			
		||||
import {Component, OnInit} from '@angular/core';
 | 
			
		||||
import {ScheduleService, TaskService, TaskShortInfo} from "../../../api";
 | 
			
		||||
import {ForgottenActivityRequest, ScheduleService, TaskService, TaskShortInfo} from "../../../api";
 | 
			
		||||
import {MatSnackBar} from "@angular/material/snack-bar";
 | 
			
		||||
import {DialogRef} from "@angular/cdk/dialog";
 | 
			
		||||
import {MatDialogRef} from "@angular/material/dialog";
 | 
			
		||||
import {filter, map, Observable, startWith} from "rxjs";
 | 
			
		||||
import {FormControl} from "@angular/forms";
 | 
			
		||||
import ModeEnum = ForgottenActivityRequest.ModeEnum;
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'app-forgotten-task-start-dialog',
 | 
			
		||||
@ -53,7 +54,7 @@ export class ForgottenTaskStartDialogComponent implements OnInit{
 | 
			
		||||
    const task = this.tasks.find(task => task.taskName === this.myControl.value);
 | 
			
		||||
    if(task != undefined) {
 | 
			
		||||
      this.scheduleService.schedulesTaskIDForgottenPost(task.taskID, {
 | 
			
		||||
        mode: "MANUAL",
 | 
			
		||||
        mode: this.determineRegisterMode(),
 | 
			
		||||
        minutesSpent: this.minutesSpentControl.value
 | 
			
		||||
      }).subscribe({
 | 
			
		||||
        next: resp => {
 | 
			
		||||
@ -74,7 +75,13 @@ export class ForgottenTaskStartDialogComponent implements OnInit{
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  private determineRegisterMode(): string {
 | 
			
		||||
    return "MANUAL";
 | 
			
		||||
  private determineRegisterMode(): ModeEnum {
 | 
			
		||||
    if(this.lastSchedule) {
 | 
			
		||||
      return "LAST";
 | 
			
		||||
    } else if(this.plannedSchedule) {
 | 
			
		||||
      return "PLANNED";
 | 
			
		||||
    } else {
 | 
			
		||||
      return "MANUAL";
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user