TSK-1305: Adapt classification type when entering a deep link
This commit is contained in:
parent
288b30ef58
commit
db9175a3f6
|
@ -6,7 +6,8 @@ import { takeUntil } from 'rxjs/operators';
|
|||
import { ClassificationSelectors } from '../../../shared/store/classification-store/classification.selectors';
|
||||
import { ClassificationDefinition } from '../../../shared/models/classification-definition';
|
||||
import { ACTION } from '../../../shared/models/action';
|
||||
import { SelectClassification,
|
||||
import { GetClassifications,
|
||||
SelectClassification,
|
||||
SetActiveAction } from '../../../shared/store/classification-store/classification.actions';
|
||||
|
||||
@Component({
|
||||
|
@ -35,7 +36,8 @@ export class ClassificationOverviewComponent implements OnInit, OnDestroy {
|
|||
|
||||
if (this.routerParams.id) {
|
||||
this.showDetail = true;
|
||||
this.store.dispatch(new SelectClassification(this.routerParams.id));
|
||||
this.store.dispatch(new SelectClassification(this.routerParams.id))
|
||||
.subscribe(() => this.store.dispatch(new GetClassifications()));
|
||||
}
|
||||
if (this.routerParams.id && this.routerParams.id.indexOf('new-classification') !== -1) {
|
||||
this.store.dispatch(new SetActiveAction(ACTION.CREATE));
|
||||
|
|
|
@ -52,7 +52,8 @@ export class ClassificationState implements NgxsAfterBootstrap {
|
|||
selectedClassification => {
|
||||
ctx.patchState({
|
||||
selectedClassification,
|
||||
action: ACTION.DEFAULT
|
||||
action: ACTION.DEFAULT,
|
||||
selectedClassificationType: selectedClassification.type
|
||||
});
|
||||
}
|
||||
));
|
||||
|
|
Loading…
Reference in New Issue