Skip to content

Commit

Permalink
SHIBUI-1576 Fixed issue with incomplete sources
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathis committed Nov 5, 2019
1 parent 4b9d2d1 commit 31a73f4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ export class MetadataSourceBase implements Wizard<MetadataResolver> {
};

parser(changes: Partial<MetadataResolver>, schema?: any): any {
if (!changes.organization) {
changes.organization = {};
}
return changes;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ import * as actions from '../action/draft.action';
import { EntityDraftService } from '../../domain/service/draft.service';
import * as fromResolver from '../reducer';
import { Store } from '@ngrx/store';
import { Clear } from '../action/entity.action';
import { ClearWizard } from '../../../wizard/action/wizard.action';
import { MetadataResolver } from '../../domain/model';

export const getPayload = (action: any) => action.payload;

Expand Down
23 changes: 10 additions & 13 deletions ui/src/app/metadata/resolver/effect/wizard.effect.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { Injectable } from '@angular/core';
import { Effect, Actions, ofType } from '@ngrx/effects';
import { ActivatedRoute, Router } from '@angular/router';
import { map, filter, tap, withLatestFrom } from 'rxjs/operators';
import { Store } from '@ngrx/store';
import { map, filter, withLatestFrom } from 'rxjs/operators';

import {
Clear,
Expand All @@ -13,11 +11,10 @@ import {
ResolverCollectionActionTypes,
AddResolverSuccess
} from '../action/collection.action';

import * as fromResolver from '../reducer';

import { EntityDraftService } from '../../domain/service/draft.service';
import { UpdateDraftRequest } from '../action/draft.action';
import * as fromRoot from '../../../app.reducer';
import { Store } from '@ngrx/store';
import { getSelectedDraftId } from '../reducer';

@Injectable()
export class WizardEffects {
Expand All @@ -27,7 +24,10 @@ export class WizardEffects {
ofType<UpdateChangesSuccess>(ResolverEntityActionTypes.UPDATE_CHANGES_SUCCESS),
map(action => action.payload),
filter(provider => !provider.createdDate),
map((provider) => new UpdateDraftRequest({ ...provider }))
withLatestFrom(this.store.select(getSelectedDraftId)),
map(([provider, id]) => {
return new UpdateDraftRequest({ id, ...provider });
})
);

@Effect()
Expand All @@ -38,10 +38,7 @@ export class WizardEffects {
);

constructor(
private store: Store<fromResolver.State>,
private actions$: Actions,
private draftService: EntityDraftService,
private activatedRoute: ActivatedRoute,
private router: Router
private store: Store<fromRoot.State>,
private actions$: Actions
) { }
}

0 comments on commit 31a73f4

Please sign in to comment.