From 17ccee8f4755a19499749477021e2a31db3c3e5b Mon Sep 17 00:00:00 2001 From: Michael Sorensen Date: Tue, 6 Feb 2024 16:09:50 -0800 Subject: [PATCH 1/2] fixed issue with updating and adding tasks --- app/src/main/controllers/schedule.controller.ts | 15 +++++++++------ .../src/app/components/clock/clock.component.ts | 1 - .../components/task-card/task-card.component.html | 2 +- .../components/task-card/task-card.component.scss | 4 +++- .../components/task-logs/task-logs.component.ts | 2 -- .../src/app/scaffolding/main/main.component.ts | 1 - 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/app/src/main/controllers/schedule.controller.ts b/app/src/main/controllers/schedule.controller.ts index bf3c63af..ee4e6ceb 100644 --- a/app/src/main/controllers/schedule.controller.ts +++ b/app/src/main/controllers/schedule.controller.ts @@ -48,7 +48,9 @@ export class ScheduleController { * @param cb */ forEachTask(cb:(task:Readonly)=>Task | TaskGroup ){ + function recurse(taskGroup:Readonly):TaskGroup{ + // const _newTaskGroup = cb(taskGroup) as TaskGroup; return { ...taskGroup, tasks: taskGroup.tasks.reduce((acc, cur) => { @@ -72,11 +74,11 @@ export class ScheduleController { } - const newTaskGroup = cb(this.schedule); - if(newTaskGroup){ - return Object.freeze(newTaskGroup) as Schedule - } - const newSchedule:Schedule = recurse(this.schedule); + const _newSchedule = Object.freeze(cb(this.schedule) as TaskGroup); + + const newSchedule:Schedule = recurse(_newSchedule); + + return newSchedule; @@ -128,7 +130,6 @@ export class ScheduleController { this._schedule = this.forEachTask(taskGroup => { if(taskGroup.id === targetTaskGroup.id && taskGroup.type === 'taskGroup'){ - console.log("FOUND TASK GROUP TO UPDATE"); const id = uuid() return { ...taskGroup, @@ -155,6 +156,8 @@ export class ScheduleController { }, ] } + }else { + return taskGroup } diff --git a/app/src/renderer/src/app/components/clock/clock.component.ts b/app/src/renderer/src/app/components/clock/clock.component.ts index a0e5bb69..c59d3eee 100644 --- a/app/src/renderer/src/app/components/clock/clock.component.ts +++ b/app/src/renderer/src/app/components/clock/clock.component.ts @@ -17,7 +17,6 @@ export class ClockComponent { } toggleClock(){ - console.log('toggle clock triggered'); this.store.dispatch(toggleClock()); } } diff --git a/app/src/renderer/src/app/components/task-card/task-card.component.html b/app/src/renderer/src/app/components/task-card/task-card.component.html index 96508360..c2cb80f0 100644 --- a/app/src/renderer/src/app/components/task-card/task-card.component.html +++ b/app/src/renderer/src/app/components/task-card/task-card.component.html @@ -27,7 +27,7 @@ -

{{ task.command }}

+

{{ task.command }}

diff --git a/app/src/renderer/src/app/components/task-card/task-card.component.scss b/app/src/renderer/src/app/components/task-card/task-card.component.scss index 076c081e..a1c18a53 100644 --- a/app/src/renderer/src/app/components/task-card/task-card.component.scss +++ b/app/src/renderer/src/app/components/task-card/task-card.component.scss @@ -18,7 +18,9 @@ mat-card { text-overflow: ellipsis; position:relative; } - +.no-overflow{ + overflow: hidden; +} .active { animation: pulse 2s infinite; } diff --git a/app/src/renderer/src/app/components/task-logs/task-logs.component.ts b/app/src/renderer/src/app/components/task-logs/task-logs.component.ts index 704a1324..5ecd433f 100644 --- a/app/src/renderer/src/app/components/task-logs/task-logs.component.ts +++ b/app/src/renderer/src/app/components/task-logs/task-logs.component.ts @@ -42,7 +42,6 @@ export class TaskLogsComponent implements OnInit, AfterViewInit, OnDestroy{ async onTaskFileUpdated(event:Electron.IpcRendererEvent, text:string){ - console.log("TASK_LOG_FILE_UPDATED"); await new Promise((resolve, reject)=>{ this.term.write('\u001B[2J', ()=>resolve(true)); }) @@ -54,7 +53,6 @@ export class TaskLogsComponent implements OnInit, AfterViewInit, OnDestroy{ } startListeningToLogFile(task:Task){ - console.log("START LISTENING TO LOG FILE"); ipcRenderer.send(START_LISTENING_TO_LOG_FILE, task); } diff --git a/app/src/renderer/src/app/scaffolding/main/main.component.ts b/app/src/renderer/src/app/scaffolding/main/main.component.ts index ad784f0b..1741bf68 100644 --- a/app/src/renderer/src/app/scaffolding/main/main.component.ts +++ b/app/src/renderer/src/app/scaffolding/main/main.component.ts @@ -18,7 +18,6 @@ export class MainComponent { } handleSideNavResize(event:ResizeEvent){ - console.log(event); this.sideNavWidth = event.rectangle.width + "px"; } } From f6333369862e53a4ae066b7dda452c6c73f9184c Mon Sep 17 00:00:00 2001 From: Michael Sorensen Date: Tue, 6 Feb 2024 16:10:23 -0800 Subject: [PATCH 2/2] v0.0.33 --- app/package-lock.json | 2 +- app/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/package-lock.json b/app/package-lock.json index baa01dbd..47223ffa 100644 --- a/app/package-lock.json +++ b/app/package-lock.json @@ -1,6 +1,6 @@ { "name": "scheduler", - "version": "0.0.32", + "version": "0.0.33", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/app/package.json b/app/package.json index da42e7fe..f6a36c8c 100644 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "scheduler", - "version": "0.0.32", + "version": "0.0.33", "description": "Open source application for scheduling tasks (processes)", "main": "dist/main", "authors": "michael sorensen",