issue-77 #105

Merged
sebastian merged 17 commits from issue-77 into master 2024-03-16 10:12:35 +01:00
11 changed files with 32 additions and 10 deletions
Showing only changes of commit a3723e3459 - Show all commits

View File

@ -1,5 +1,7 @@
package core.api.models.timemanager.tasks.repeatinginfo;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.time.LocalDate;
public class TaskRepeatDayInfo {
@ -7,7 +9,8 @@ public class TaskRepeatDayInfo {
private int offset;
private DeadlineStrategy deadlineStrategy;
private LocalDate endDate;
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXX")
private LocalDate endingDate;
public int getOffset() {
return offset;
@ -25,11 +28,11 @@ public class TaskRepeatDayInfo {
this.deadlineStrategy = deadlineStrategy;
}
public LocalDate getEndDate() {
return endDate;
public LocalDate getEndingDate() {
return endingDate;
}
public void setEndDate(LocalDate endDate) {
this.endDate = endDate;
public void setEndingDate(LocalDate endingDate) {
this.endingDate = endingDate;
}
}

View File

@ -30,7 +30,7 @@ public class TaskSeriesService {
LocalDate currentTaskDate = rootTask.getStartDate().plusDays(taskRepeatInfo.getOffset());
TaskSerie taskSerie = new TaskSerie();
int index = 1;
while(currentTaskDate.isBefore(taskRepeatInfo.getEndDate())) {
while(currentTaskDate.isBefore(taskRepeatInfo.getEndingDate())) {
Task task = Task.cloneTask(rootTask);
task.setStartDate(currentTaskDate);
if(taskRepeatInfo.getDeadlineStrategy() == DeadlineStrategy.DEADLINE_EQUAL_START) {
@ -45,6 +45,7 @@ public class TaskSeriesService {
index++;
}
taskSeriesRepository.save(taskSerie);
taskRepository.saveAll(taskSerie.getTasks());
return ServiceExitCode.OK;
}

View File

@ -10,6 +10,7 @@ api/properties.service.ts
api/schedule.service.ts
api/task.service.ts
api/taskgroup.service.ts
api/taskseries.service.ts
api/users.service.ts
configuration.ts
encoder.ts
@ -47,6 +48,7 @@ model/simpleStatusResponse.ts
model/taskEntityInfo.ts
model/taskFieldInfo.ts
model/taskOverviewInfo.ts
model/taskRepeatDayInfo.ts
model/taskScheduleStopResponse.ts
model/taskShortInfo.ts
model/taskTaskgroupInfo.ts

View File

@ -10,6 +10,7 @@ import { PropertiesService } from './api/properties.service';
import { ScheduleService } from './api/schedule.service';
import { TaskService } from './api/task.service';
import { TaskgroupService } from './api/taskgroup.service';
import { TaskseriesService } from './api/taskseries.service';
import { UsersService } from './api/users.service';
@NgModule({

View File

@ -14,6 +14,8 @@ export * from './task.service';
import { TaskService } from './task.service';
export * from './taskgroup.service';
import { TaskgroupService } from './taskgroup.service';
export * from './taskseries.service';
import { TaskseriesService } from './taskseries.service';
export * from './users.service';
import { UsersService } from './users.service';
export const APIS = [AccountService, HistoryService, LoginService, NtfyService, PropertiesService, ScheduleService, TaskService, TaskgroupService, UsersService];
export const APIS = [AccountService, HistoryService, LoginService, NtfyService, PropertiesService, ScheduleService, TaskService, TaskgroupService, TaskseriesService, UsersService];

View File

@ -29,6 +29,7 @@ export * from './simpleStatusResponse';
export * from './taskEntityInfo';
export * from './taskFieldInfo';
export * from './taskOverviewInfo';
export * from './taskRepeatDayInfo';
export * from './taskScheduleStopResponse';
export * from './taskShortInfo';
export * from './taskTaskgroupInfo';

View File

@ -23,7 +23,7 @@ export interface NtfyInformation {
/**
* username of ntfy account for publishing news
*/
ntfy_user: string;
ntfy_user?: string;
/**
* token to ntfy useraccount
*/

View File

@ -91,6 +91,8 @@ import {MatGridListModule} from "@angular/material/grid-list";
import { StopScheduleManuallyComponent } from './dashboard/active-schedule/stop-schedule-manually/stop-schedule-manually.component';
import { ConnectionSettingsComponent } from './user-settings/connection-settings/connection-settings.component';
import { NtfySettingsComponent } from './user-settings/connection-settings/ntfy-settings/ntfy-settings.component';
import { TaskSeriesCreatorComponent } from './tasks/task-series-creator/task-series-creator.component';
import {MatStepperModule} from "@angular/material/stepper";
@NgModule({
declarations: [
AppComponent,
@ -138,6 +140,7 @@ import { NtfySettingsComponent } from './user-settings/connection-settings/ntfy-
StopScheduleManuallyComponent,
ConnectionSettingsComponent,
NtfySettingsComponent,
TaskSeriesCreatorComponent,
],
imports: [
BrowserModule,
@ -181,6 +184,7 @@ import { NtfySettingsComponent } from './user-settings/connection-settings/ntfy-
NgApexchartsModule,
MatButtonToggleModule,
MatGridListModule,
MatStepperModule,
],
providers: [
HttpClientModule,

View File

@ -29,7 +29,7 @@
<button mat-flat-button class="borderless-btn" color="primary" [routerLink]="['/taskgroups', taskgroup!.taskgroupID, 'tasks', task!.taskID, 'schedule']">Schedule</button>
<button mat-flat-button class="yellowBtn" (click)="startTaskNow()">Start now</button>
<button mat-flat-button class="grayBtn" (click)="openTaskEditor()">Edit</button>
<!--<button mat-raised-button>Copy</button>-->
<button mat-flat-button class="lightBlueBtn" (click)="openRepeatingTaskEditor()">Copy</button>
<button mat-flat-button class="greenBtn" *ngIf="task!.finishable" (click)="finishTask()">{{task!.finished ? 'Reopen':'Finish'}}</button>
</div>

View File

@ -17,6 +17,7 @@ import {TaskEditorData} from "../task-editor/TaskEditorData";
import * as moment from "moment";
import {ScheduleDashboardComponent} from "../../schedules/schedule-dashboard/schedule-dashboard.component";
import {TaskStatusService} from "../task-status.service";
import {TaskSeriesCreatorComponent} from "../task-series-creator/task-series-creator.component";
@Component({
selector: 'app-task-detail-overview',
@ -158,4 +159,11 @@ export class TaskDetailOverviewComponent implements OnInit {
}
})
}
openRepeatingTaskEditor() {
const dialogRef = this.dialog.open(TaskSeriesCreatorComponent, {
data: this.task!,
minWidth: "400px"
})
}
}

View File

@ -24,7 +24,7 @@ export class NtfySettingsComponent {
next: resp => {
this.host_formCtrl.setValue(resp.ntfy_host);
this.topic_formCtrl.setValue(resp.ntfy_topic);
this.user_formCtrl.setValue(resp.ntfy_user);
this.user_formCtrl.setValue(resp.ntfy_user!);
this.token_formCtrl.setValue(resp.ntfy_token!);
}
})