Skip to content

Commit

Permalink
Merged in bugfix/SHIBUI-1576 (pull request #408)
Browse files Browse the repository at this point in the history
SHIBUI-1576 Fixed issue with incomplete sources
  • Loading branch information
rmathis committed Nov 5, 2019
2 parents 4b9d2d1 + b380c70 commit 9bfc527
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component } from '@angular/core';
import { Observable, of } from 'rxjs';
import { Observable } from 'rxjs';
import { Store } from '@ngrx/store';
import {
ConfigurationState,
Expand Down Expand Up @@ -36,9 +36,7 @@ export class RestoreEditComponent {

constructor(
private store: Store<ConfigurationState>
) {
// this.status$.subscribe(console.log);
}
) {}

save() {
this.store.dispatch(new RestoreVersionRequest());
Expand Down
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 @@ -94,10 +94,7 @@ export class ProviderEditStepComponent implements OnDestroy {
});
}),
filter(({ model, definition }) => definition && model),
map(({ model, definition }) => {
// console.log(model, definition.formatter(model));
return definition ? definition.formatter(model) : {};
})
map(({ model, definition }) => definition ? definition.formatter(model) : {})
);

this.valueChangeEmitted$.pipe(
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 9bfc527

Please sign in to comment.