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

Merge pull request 'OZG-5167: fix Nachricht update' (#624) from...

Merge pull request 'OZG-5167: fix Nachricht update' (#624) from OZG-5167-fix-nachricht-update into master

Reviewed-on: https://git.ozg-sh.de/ozgcloud-app/alfa/pulls/624


Reviewed-by: default avatarOZGCloud <ozgcloud@mgm-tp.com>
parents 6e68f488 bc7240f4
No related branches found
No related tags found
No related merge requests found
......@@ -977,7 +977,7 @@ describe('BescheidService', () => {
it('should set create beschied document in progress', () => {
service.createBescheidDocument();
expect(service.createBescheidDocumentInProgress$.value.loading).toBeTruthy();
expect(service.createBescheidDocumentInProgress$.value).toEqual(commandStateResource);
});
it('should set upload beschied document in progress loading false', () => {
......
......@@ -9,7 +9,7 @@ import {
CommandResourceService,
CommandService,
getEffectedResourceUrl,
hasCommandError,
notHasCommandError,
tapOnCommandSuccessfullyDone,
} from '@alfa-client/command-shared';
import {
......@@ -429,9 +429,8 @@ export class BescheidService {
private handleCreateBescheidDocumentResponse(
commandStateResource: StateResource<CommandResource>,
): void {
if (hasCommandError(commandStateResource.resource)) {
this.createBescheidDocumentInProgress$.next(commandStateResource);
} else {
if (notHasCommandError(commandStateResource.resource)) {
const documentUri: ResourceUri = getEffectedResourceUrl(commandStateResource.resource);
this.bescheidDocumentUri$.next(documentUri);
this.loadBescheidDocumentByUri(documentUri);
......
......@@ -21,23 +21,11 @@
* Die sprachspezifischen Genehmigungen und Beschränkungen
* unter der Lizenz sind dem Lizenztext zu entnehmen.
*/
import {
createCommandErrorResource,
createCommandListResource,
createCommandResource,
} from 'libs/command-shared/test/command';
import { createCommandErrorResource, createCommandListResource, createCommandResource, } from 'libs/command-shared/test/command';
import { CommandLinkRel } from './command.linkrel';
import { CommandErrorMessage } from './command.message';
import { CommandListResource, CommandResource } from './command.model';
import {
getPendingCommandByOrder,
hasCommandError,
isConcurrentModification,
isDone,
isPending,
isRevokeable,
isSuccessfulDone,
} from './command.util';
import { getPendingCommandByOrder, hasCommandError, isConcurrentModification, isDone, isPending, isRevokeable, isSuccessfulDone, notHasCommandError, } from './command.util';
describe('CommandUtil', () => {
describe('isRevokeable', () => {
......@@ -172,4 +160,18 @@ describe('CommandUtil', () => {
expect(isDoneSuccessfuly).toBeFalsy();
});
});
describe('notHasCommandError', () => {
it('should return true', () => {
const hasError: boolean = notHasCommandError(createCommandResource());
expect(hasError).toBeTruthy();
});
it('should return false', () => {
const hasError: boolean = notHasCommandError(createCommandErrorResource());
expect(hasError).toBeFalsy();
});
});
});
......@@ -21,7 +21,7 @@
* Die sprachspezifischen Genehmigungen und Beschränkungen
* unter der Lizenz sind dem Lizenztext zu entnehmen.
*/
import { ResourceUri, getEmbeddedResource, getUrl, hasLink } from '@ngxp/rest';
import { getEmbeddedResource, getUrl, hasLink, ResourceUri } from '@ngxp/rest';
import { isEmpty, isNil, isObject } from 'lodash-es';
import { CommandLinkRel, CommandListLinkRel } from './command.linkrel';
import { CommandErrorMessage } from './command.message';
......@@ -47,6 +47,10 @@ export function hasCommandError(commandResource: CommandResource): boolean {
return hasErrorMessage(commandResource) && !isPending(commandResource);
}
export function notHasCommandError(commandResource: CommandResource): boolean {
return !hasCommandError(commandResource);
}
export function getPendingCommandByOrder(
pendingCommands: CommandListResource,
commandOrder: any[],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment