Skip to content
Snippets Groups Projects
Commit 508b5d83 authored by Martin's avatar Martin
Browse files

Merge remote-tracking branch 'origin/main' into OZG-7510-statistic-edit-delete-fields

parents f892b9ea fceb6a33
No related branches found
No related tags found
1 merge request!63Ozg 7510 statistic edit delete fields
Showing
with 17 additions and 2 deletions
...@@ -39,6 +39,7 @@ describe('AdminOrganisationsEinheitRepository', () => { ...@@ -39,6 +39,7 @@ describe('AdminOrganisationsEinheitRepository', () => {
(group: GroupRepresentation): AdminOrganisationsEinheit => ({ (group: GroupRepresentation): AdminOrganisationsEinheit => ({
name: group.name, name: group.name,
id: group.id, id: group.id,
attributes: group.attributes,
}), }),
); );
...@@ -63,6 +64,7 @@ describe('AdminOrganisationsEinheitRepository', () => { ...@@ -63,6 +64,7 @@ describe('AdminOrganisationsEinheitRepository', () => {
const organisationsEinheit: AdminOrganisationsEinheit = { const organisationsEinheit: AdminOrganisationsEinheit = {
name: groupRep.name, name: groupRep.name,
id: groupRep.id, id: groupRep.id,
attributes: groupRep.attributes,
}; };
beforeEach(() => { beforeEach(() => {
......
...@@ -40,6 +40,7 @@ export class AdminOrganisationsEinheitRepository { ...@@ -40,6 +40,7 @@ export class AdminOrganisationsEinheitRepository {
return { return {
id: group.id, id: group.id,
name: group.name, name: group.name,
attributes: group.attributes,
}; };
} }
} }
...@@ -24,4 +24,5 @@ ...@@ -24,4 +24,5 @@
export interface AdminOrganisationsEinheit { export interface AdminOrganisationsEinheit {
id?: string; id?: string;
name: string; name: string;
attributes: { [key: string]: string[] };
} }
...@@ -29,6 +29,9 @@ export function createAdminOrganisationsEinheit(): AdminOrganisationsEinheit { ...@@ -29,6 +29,9 @@ export function createAdminOrganisationsEinheit(): AdminOrganisationsEinheit {
return { return {
id: faker.string.uuid(), id: faker.string.uuid(),
name: faker.lorem.word(), name: faker.lorem.word(),
attributes: {
organisationseinheitId: [faker.string.uuid()],
},
}; };
} }
......
...@@ -152,7 +152,10 @@ describe('OrganisationsEinheitContainerComponent', () => { ...@@ -152,7 +152,10 @@ describe('OrganisationsEinheitContainerComponent', () => {
it('should call organisationsEinheitService create', () => { it('should call organisationsEinheitService create', () => {
component.handleDialogResponse(organisationsEinheitResource); component.handleDialogResponse(organisationsEinheitResource);
expect(organisationsEinheitService.create).toHaveBeenCalledWith({ name: organisationsEinheitResource.name }); expect(organisationsEinheitService.create).toHaveBeenCalledWith({
name: organisationsEinheitResource.name,
attributes: { organisationseinheitId: [organisationsEinheitResource.organisationEinheitId] },
});
}); });
it('should set createOrganisationsEinheitProgress$', () => { it('should set createOrganisationsEinheitProgress$', () => {
......
...@@ -80,6 +80,9 @@ export class OrganisationsEinheitContainerComponent implements OnInit, OnDestroy ...@@ -80,6 +80,9 @@ export class OrganisationsEinheitContainerComponent implements OnInit, OnDestroy
mapToAdminOrganisationsEinheit(organisationsEinheitResource: OrganisationsEinheitResource): AdminOrganisationsEinheit { mapToAdminOrganisationsEinheit(organisationsEinheitResource: OrganisationsEinheitResource): AdminOrganisationsEinheit {
return { return {
name: organisationsEinheitResource.name, name: organisationsEinheitResource.name,
attributes: {
organisationseinheitId: [organisationsEinheitResource.organisationEinheitId],
},
}; };
} }
} }
......
...@@ -438,7 +438,7 @@ describe('UserFormService', () => { ...@@ -438,7 +438,7 @@ describe('UserFormService', () => {
}); });
it('should return bauamt group when active', () => { it('should return bauamt group when active', () => {
const organisationsEinheit: AdminOrganisationsEinheit = { name: 'bauamt' }; const organisationsEinheit: AdminOrganisationsEinheit = createAdminOrganisationsEinheit();
organisationsEinheitenGroup.addControl(organisationsEinheit.name, new FormControl(true)); organisationsEinheitenGroup.addControl(organisationsEinheit.name, new FormControl(true));
const result: string[] = formService._getActiveOrganisationsEinheiten(); const result: string[] = formService._getActiveOrganisationsEinheiten();
......
...@@ -27,6 +27,7 @@ import { Resource } from '@ngxp/rest'; ...@@ -27,6 +27,7 @@ import { Resource } from '@ngxp/rest';
export interface OrganisationsEinheit { export interface OrganisationsEinheit {
name: string; name: string;
anschrift: Anschrift; anschrift: Anschrift;
organisationEinheitId: string;
} }
export interface Anschrift { export interface Anschrift {
......
...@@ -45,6 +45,7 @@ export function createOrganisationsEinheit(): OrganisationsEinheit { ...@@ -45,6 +45,7 @@ export function createOrganisationsEinheit(): OrganisationsEinheit {
return { return {
name: faker.word.sample(), name: faker.word.sample(),
anschrift: createAnschrift(), anschrift: createAnschrift(),
organisationEinheitId: faker.string.uuid(),
}; };
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment