Skip to content

Commit

Permalink
feat(migrateV1): add basic data for issues
Browse files Browse the repository at this point in the history
  • Loading branch information
johannesjo committed Dec 16, 2018
1 parent e4252ad commit 36b02c6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/app/core/migrate/migrate.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export class MigrateService {
checkForUpdate() {
const isMigrated = loadFromLs(LS_IS_V1_MIGRATE);
const currentProjectData = loadFromLs(STORAGE_CURRENT_PROJECT);
console.log(currentProjectData);

if (currentProjectData) {
this._matDialog.open(DialogConfirmComponent, {
Expand Down Expand Up @@ -110,7 +109,6 @@ export class MigrateService {
private _transformTasks(oldTasks: OldTask[]): EntityState<Task> {
// remove null entries
const cleanOldTasks = oldTasks.filter(ot => !!ot);
console.log(cleanOldTasks);

const transformedSubTasks = [];
const transformedMainTasks = cleanOldTasks.map((ot, i) => {
Expand Down Expand Up @@ -141,6 +139,8 @@ export class MigrateService {

title: ot.title,
id: ot.id,
issueId: ot.originalId,
issueType: ot.originalType,
isDone: ot.isDone,
notes: ot.notes,
subTaskIds: (ot.subTasks && ot.subTasks.length > 0) ? ot.subTasks.map(t => t.id) : [],
Expand Down
2 changes: 1 addition & 1 deletion src/app/tasks/store/task.selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { TaskWithSubTasks } from '../task.model';

const mapIssueDataToTask = (tasks_, issueEntityMap) => {
return tasks_ && tasks_.map((task) => {
const issueData = (task.issueId && task.issueType) && issueEntityMap[task.issueType][task.issueId];
const issueData = (task.issueId && task.issueType) && issueEntityMap[task.issueType] && issueEntityMap[task.issueType][task.issueId];
return issueData ? {...task, issueData: issueData} : task;
});
};
Expand Down

0 comments on commit 36b02c6

Please sign in to comment.