Merge pull request #4256 from emanuelschuetze/workflowid
Fixed bug in getting workflow_id from config service.
This commit is contained in:
commit
a52db89288
@ -5,7 +5,6 @@ import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'
|
|||||||
import { MatDialog, MatExpansionPanel, MatSnackBar, MatCheckboxChange, ErrorStateMatcher } from '@angular/material';
|
import { MatDialog, MatExpansionPanel, MatSnackBar, MatCheckboxChange, ErrorStateMatcher } from '@angular/material';
|
||||||
|
|
||||||
import { BehaviorSubject, Subscription } from 'rxjs';
|
import { BehaviorSubject, Subscription } from 'rxjs';
|
||||||
import { takeWhile } from 'rxjs/operators';
|
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
|
|
||||||
import { AgendaRepositoryService } from 'app/core/repositories/agenda/agenda-repository.service';
|
import { AgendaRepositoryService } from 'app/core/repositories/agenda/agenda-repository.service';
|
||||||
@ -935,14 +934,8 @@ export class MotionDetailComponent extends BaseViewComponent implements OnInit {
|
|||||||
public updateWorkflowIdForCreateForm(): void {
|
public updateWorkflowIdForCreateForm(): void {
|
||||||
const isStatuteAmendment = !!this.contentForm.get('statute_amendment').value;
|
const isStatuteAmendment = !!this.contentForm.get('statute_amendment').value;
|
||||||
const configKey = isStatuteAmendment ? 'motions_statute_amendments_workflow' : 'motions_workflow';
|
const configKey = isStatuteAmendment ? 'motions_statute_amendments_workflow' : 'motions_workflow';
|
||||||
this.configService
|
const workflowID = this.configService.instant<string>(configKey);
|
||||||
.get<string>(configKey)
|
this.contentForm.patchValue({ workflow_id: +workflowID });
|
||||||
.pipe(takeWhile(id => !id)) // Wait for the id to be present.
|
|
||||||
.subscribe(id => {
|
|
||||||
this.contentForm.patchValue({
|
|
||||||
workflow_id: parseInt(id as string, 10)
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user