From 8a24bffee6c7731493da727a0aaddbb873e652d4 Mon Sep 17 00:00:00 2001 From: Johannes Millan Date: Sat, 28 Mar 2020 20:29:15 +0100 Subject: [PATCH] feat(project): remove outdated model --- src/app/features/config/global-config.model.ts | 2 +- .../project/migrate-projects-state.util.ts | 15 ++++++--------- src/app/features/project/project.const.ts | 2 -- src/app/features/project/project.model.ts | 1 - 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/app/features/config/global-config.model.ts b/src/app/features/config/global-config.model.ts index 4e4c5ac650..cf56ebc8f3 100644 --- a/src/app/features/config/global-config.model.ts +++ b/src/app/features/config/global-config.model.ts @@ -125,7 +125,7 @@ export type GlobalConfigState = Readonly<{ pomodoro: PomodoroConfig; googleDriveSync: GoogleDriveSyncConfig; keyboard: KeyboardConfig; - localBackup: LocalBackupConfig, + localBackup: LocalBackupConfig; _googleSession: GoogleSession; }>; diff --git a/src/app/features/project/migrate-projects-state.util.ts b/src/app/features/project/migrate-projects-state.util.ts index 05cce5dc9b..0eec81e891 100644 --- a/src/app/features/project/migrate-projects-state.util.ts +++ b/src/app/features/project/migrate-projects-state.util.ts @@ -3,8 +3,6 @@ import {Dictionary} from '@ngrx/entity'; import {Project} from './project.model'; import {DEFAULT_PROJECT} from './project.const'; import {DEFAULT_ISSUE_PROVIDER_CFGS, issueProviderKeys} from '../issue/issue.const'; -import {getWorklogStr} from '../../util/get-work-log-str'; -import {getYesterdaysDate} from '../../util/get-yesterdays-date'; import {MODEL_VERSION_KEY, THEME_COLOR_MAP, WORKLOG_DATE_STR_FORMAT} from '../../app.constants'; import {isMigrateModel} from '../../util/model-version'; import * as moment from 'moment'; @@ -13,6 +11,7 @@ import {LS_ISSUE_STATE, LS_PROJECT_PREFIX} from '../../core/persistence/ls-keys. import {IssueProviderKey} from '../issue/issue.model'; import * as localForage from 'localforage'; import {WORK_CONTEXT_DEFAULT_THEME} from '../work-context/work-context.const'; +import {dirtyDeepCopy} from '../../util/dirtyDeepCopy'; const MODEL_VERSION = 4; @@ -55,13 +54,11 @@ const _extendProjectDefaults = (project: Project): Project => { }; const _removeOutdatedData = (project: Project): Project => { - return project; - - // TODO use this after a some period to give people time to complain about the missing feature - // const copy: any = dirtyDeepCopy(project); - // delete copy.advancedCfg.googleTimeSheetExport; - // delete copy.advancedCfg.simpleSummarySettings; - // return copy; + const copy: any = dirtyDeepCopy(project); + delete copy.advancedCfg.googleTimeSheetExport; + delete copy.advancedCfg.simpleSummarySettings; + delete copy.timeWorkedWithoutBreak; + return copy; }; diff --git a/src/app/features/project/project.const.ts b/src/app/features/project/project.const.ts index 759ef0f847..05faeb06f2 100644 --- a/src/app/features/project/project.const.ts +++ b/src/app/features/project/project.const.ts @@ -8,8 +8,6 @@ export const DEFAULT_PROJECT: Project = { title: '', themeColor: '', isArchived: false, - // TODO move to global cfg - timeWorkedWithoutBreak: null, issueIntegrationCfgs: DEFAULT_ISSUE_PROVIDER_CFGS, taskIds: [], backlogTaskIds: [], diff --git a/src/app/features/project/project.model.ts b/src/app/features/project/project.model.ts index 39c655a3d6..776be84f53 100644 --- a/src/app/features/project/project.model.ts +++ b/src/app/features/project/project.model.ts @@ -22,7 +22,6 @@ export interface ProjectBasicCfg { /** @deprecated use new theme model instead. */ isReducedTheme?: boolean; isArchived: boolean; - timeWorkedWithoutBreak: number; taskIds: string[]; backlogTaskIds: string[];