Skip to content
Snippets Groups Projects
Commit df8faa19 authored by OZGCloud's avatar OZGCloud
Browse files

Merge branch 'refs/heads/release'

# Conflicts:
#	alfa-client/pom.xml
#	alfa-server/pom.xml
#	alfa-service/pom.xml
#	alfa-xdomea/pom.xml
#	pom.xml
parents 6bf07d4e 82f0e2fa
Branches
Tags
No related merge requests found
......@@ -9,10 +9,10 @@ import {
import { BinaryFileResource } from '@alfa-client/binary-file-shared';
import { CommandLinkRel, CommandResource } from '@alfa-client/command-shared';
import {
createStateResource,
EMPTY_STRING,
formatForDatabase,
StateResource,
createStateResource,
formatForDatabase,
} from '@alfa-client/tech-shared';
import { Mock, mock, useFromMock } from '@alfa-client/test-utils';
import { VorgangWithEingangResource } from '@alfa-client/vorgang-shared';
......@@ -114,6 +114,22 @@ describe('BescheidenFormService', () => {
expect(service.sendByManual.value).toBeFalsy();
});
it('should not emit if value not changed', () => {
service.sendByManual.next(true);
service.sendByManual.next = jest.fn();
service.updateSendByManual(BescheidSendBy.MANUAL);
expect(service.sendByManual.next).not.toHaveBeenCalled();
});
it('should emit on value change', () => {
service.sendByManual.next(false);
service.sendByManual.next = jest.fn();
service.updateSendByManual(BescheidSendBy.MANUAL);
expect(service.sendByManual.next).toHaveBeenCalled();
});
});
describe('initializeFormChanges', () => {
......
......@@ -10,14 +10,14 @@ import { BinaryFileResource } from '@alfa-client/binary-file-shared';
import { CommandResource, tapOnCommandSuccessfullyDone } from '@alfa-client/command-shared';
import {
AbstractFormService,
convertToBoolean,
EMPTY_STRING,
formatForDatabase,
HttpError,
StateResource,
convertToBoolean,
formatForDatabase,
isLoaded,
isNotEmpty,
isNotNil,
StateResource,
} from '@alfa-client/tech-shared';
import { VorgangWithEingangResource } from '@alfa-client/vorgang-shared';
import { Injectable, OnDestroy } from '@angular/core';
......@@ -28,18 +28,18 @@ import {
UntypedFormControl,
UntypedFormGroup,
} from '@angular/forms';
import { getUrl, hasLink, Resource, ResourceUri } from '@ngxp/rest';
import { Resource, ResourceUri, getUrl, hasLink } from '@ngxp/rest';
import { isEmpty, isNil, isUndefined } from 'lodash-es';
import {
BehaviorSubject,
Observable,
Subject,
Subscription,
combineLatest,
filter,
first,
map,
Observable,
startWith,
Subject,
Subscription,
} from 'rxjs';
@Injectable()
......@@ -92,7 +92,8 @@ export class BescheidenFormService extends AbstractFormService implements OnDest
}
updateSendByManual(sendBy: BescheidSendBy): void {
this.sendByManual.next(sendBy === BescheidSendBy.MANUAL);
const isSendByManual = sendBy === BescheidSendBy.MANUAL;
if (isSendByManual !== this.sendByManual.value) this.sendByManual.next(isSendByManual);
}
initializeFormChanges(): void {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment