Skip to content

Commit

Permalink
feat: new linting #5
Browse files Browse the repository at this point in the history
  • Loading branch information
johannesjo committed Jul 2, 2020
1 parent 8851f8f commit 83ec7fd
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/app/core/error-handler/global-error-handler.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as newGithubIssueUrl from 'new-github-issue-url';

let isWasErrorAlertCreated = false;

async function _getStacktrace(err: Error): Promise<string> {
async function _getStacktrace(err: Error | any): Promise<string> {
const isHttpError = err && (err.url || err.headers);
const isErrorWithStack = err && err.stack;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class ConfigFormComponent {

T: any = T;
config: any;
@Input() sectionKey: string;
@Input() sectionKey: GlobalConfigSectionKey | ProjectCfgFormKey;
@Output() save: EventEmitter<{ sectionKey: GlobalConfigSectionKey | ProjectCfgFormKey, config: any }> = new EventEmitter();
fields: FormlyFieldConfig[];
form: FormGroup = new FormGroup({});
Expand Down
5 changes: 2 additions & 3 deletions src/app/features/pomodoro/store/pomodoro.effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,10 @@ export class PomodoroEffects {
this._pomodoroService.isBreak$,
),
filter(isEnabled),
filter(([action, cfg, isBreak]: [FinishPomodoroSession | PausePomodoro | SkipPomodoroBreak
, PomodoroConfig, boolean]) => {
filter(([action, cfg, isBreak]: [FinishPomodoroSession | PausePomodoro | SkipPomodoroBreak, PomodoroConfig, boolean]) => {
return ((action.type === PomodoroActionTypes.FinishPomodoroSession || action.type === PomodoroActionTypes.SkipPomodoroBreak)
&& (cfg.isPlaySound && isBreak) || (cfg.isPlaySoundAfterBreak && !cfg.isManualContinue && !isBreak))
|| (action.type === PomodoroActionTypes.PausePomodoro && action.payload.isBreakEndPause);
|| (action.type === PomodoroActionTypes.PausePomodoro && (action as PausePomodoro).payload.isBreakEndPause);
}),
tap(() => this._pomodoroService.playSessionDoneSound()),
);
Expand Down
23 changes: 16 additions & 7 deletions src/app/features/task-repeat-cfg/store/task-repeat-cfg.reducer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
import { createEntityAdapter, EntityAdapter } from '@ngrx/entity';
import { TaskRepeatCfgActions, TaskRepeatCfgActionTypes } from './task-repeat-cfg.actions';
import {
AddTaskRepeatCfgToTask,
DeleteTaskRepeatCfg,
DeleteTaskRepeatCfgs,
TaskRepeatCfgActions,
TaskRepeatCfgActionTypes,
UpdateTaskRepeatCfg,
UpdateTaskRepeatCfgs,
UpsertTaskRepeatCfg
} from './task-repeat-cfg.actions';
import { TaskRepeatCfg, TaskRepeatCfgState } from '../task-repeat-cfg.model';
import { createFeatureSelector, createSelector } from '@ngrx/store';
import { loadAllData } from '../../../root-store/meta/load-all-data.action';
Expand Down Expand Up @@ -36,31 +45,31 @@ export function taskRepeatCfgReducer(

switch (action.type) {
case TaskRepeatCfgActionTypes.AddTaskRepeatCfgToTask: {
return adapter.addOne(action.payload.taskRepeatCfg, state);
return adapter.addOne((action as AddTaskRepeatCfgToTask).payload.taskRepeatCfg, state);
}

case TaskRepeatCfgActionTypes.UpdateTaskRepeatCfg: {
return adapter.updateOne(action.payload.taskRepeatCfg, state);
return adapter.updateOne((action as UpdateTaskRepeatCfg).payload.taskRepeatCfg, state);
}

case TaskRepeatCfgActionTypes.UpdateTaskRepeatCfgs: {
const {ids, changes} = action.payload;
const {ids, changes} = (action as UpdateTaskRepeatCfgs).payload;
return adapter.updateMany(ids.map(id => ({
id,
changes,
})), state);
}

case TaskRepeatCfgActionTypes.UpsertTaskRepeatCfg: {
return adapter.upsertOne(action.payload.taskRepeatCfg, state);
return adapter.upsertOne((action as UpsertTaskRepeatCfg).payload.taskRepeatCfg, state);
}

case TaskRepeatCfgActionTypes.DeleteTaskRepeatCfg: {
return adapter.removeOne(action.payload.id, state);
return adapter.removeOne((action as DeleteTaskRepeatCfg).payload.id, state);
}

case TaskRepeatCfgActionTypes.DeleteTaskRepeatCfgs: {
return adapter.removeMany(action.payload.ids, state);
return adapter.removeMany((action as DeleteTaskRepeatCfgs).payload.ids, state);
}

default: {
Expand Down
2 changes: 1 addition & 1 deletion src/app/features/tasks/store/task-internal.effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export class TaskInternalEffects {
nextId = (isDone && isCurrent)

? ((isAutoStartNextTask)
? this._findNextTask(state, todaysTaskIds, oldId)
? this._findNextTask(state, todaysTaskIds, oldId as string)
: null)

: 'NO_UPDATE';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,6 @@ export class TaskAdditionalInfoComponent implements AfterViewInit, OnDestroy {
switchMap((id) => id ? this.taskService.getByIdWithSubTaskData$(id) : of(null))
);
localAttachments: TaskAttachment[];
issueAttachments$: Observable<TaskAttachmentCopy[]> = this.issueData$.pipe(
withLatestFrom(this.issueIdAndTypeShared$),
map(([data, {type}]) => (data && type)
? this._issueService.getMappedAttachments(type, data)
: [])
);
private _taskData: TaskWithSubTasks;
issueData$: Observable<IssueData> = this.issueDataTrigger$.pipe(
switchMap((args) => (args && args.id && args.type)
Expand All @@ -132,6 +126,13 @@ export class TaskAdditionalInfoComponent implements AfterViewInit, OnDestroy {
// expandable closed when the data is loaded
delay(0),
);
issueAttachments$: Observable<TaskAttachmentCopy[]> = this.issueData$.pipe(
withLatestFrom(this.issueIdAndTypeShared$),
map(([data, {type}]) => (data && type)
? this._issueService.getMappedAttachments(type, data)
: [])
);

private _focusTimeout: number;
private _subs: Subscription = new Subscription();

Expand Down
2 changes: 1 addition & 1 deletion src/app/features/work-view/split/split.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export class SplitComponent implements AfterViewInit {
this.eventSubs.add(mousemove$);
}

onMoveEnd(ev: TouchEvent): void {
onMoveEnd(ev: TouchEvent | MouseEvent): void {
if (this.eventSubs) {
this.eventSubs.unsubscribe();
this.eventSubs = undefined;
Expand Down

0 comments on commit 83ec7fd

Please sign in to comment.