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

Merge branch 'OZG-6305-AnzeigeOrganisationsEinheit' of...

Merge branch 'OZG-6305-AnzeigeOrganisationsEinheit' of git.ozg-sh.de:ozgcloud-app/alfa into OZG-6305-AnzeigeOrganisationsEinheit
parents d26a2b02 9a2dd231
Branches
Tags
No related merge requests found
Showing with 106 additions and 13 deletions
...@@ -73,3 +73,4 @@ tests: ...@@ -73,3 +73,4 @@ tests:
content: content:
name: my_test_environment_name name: my_test_environment_name
value: "A test value" value: "A test value"
import { CommandResource } from '@alfa-client/command-shared'; import { CommandResource } from '@alfa-client/command-shared';
import { AbstractFormService, EMPTY_STRING, StateResource } from '@alfa-client/tech-shared'; import { AbstractFormService, StateResource } from '@alfa-client/tech-shared';
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { FormBuilder, FormControl, FormGroup } from '@angular/forms'; import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
import { ResourceUri } from '@ngxp/rest'; import { ResourceUri } from '@ngxp/rest';
...@@ -11,6 +11,8 @@ export class CollaborationRequestFormService extends AbstractFormService { ...@@ -11,6 +11,8 @@ export class CollaborationRequestFormService extends AbstractFormService {
public static readonly FIELD_TITLE: string = 'titel'; public static readonly FIELD_TITLE: string = 'titel';
public static readonly FIELD_NACHRICHT: string = 'nachricht'; public static readonly FIELD_NACHRICHT: string = 'nachricht';
private static readonly PATH_PREFIX: string = 'command.body';
constructor(formBuilder: FormBuilder) { constructor(formBuilder: FormBuilder) {
super(formBuilder); super(formBuilder);
} }
...@@ -31,6 +33,6 @@ export class CollaborationRequestFormService extends AbstractFormService { ...@@ -31,6 +33,6 @@ export class CollaborationRequestFormService extends AbstractFormService {
} }
protected getPathPrefix(): string { protected getPathPrefix(): string {
return EMPTY_STRING; return CollaborationRequestFormService.PATH_PREFIX;
} }
} }
...@@ -25,22 +25,22 @@ describe('OrganisationsEinheitComponent', () => { ...@@ -25,22 +25,22 @@ describe('OrganisationsEinheitComponent', () => {
}); });
describe('set organisationsEinheit', () => { describe('set organisationsEinheit', () => {
it('should call handle organisationsEinehit', () => { it('should call update by organisationsEinehit', () => {
component.handleOrganisationsEinheit = jest.fn(); component.updateByOrganisationsEinheit = jest.fn();
component.organisationsEinheitResource = organisationsEinheitResource; component.organisationsEinheitResource = organisationsEinheitResource;
expect(component.handleOrganisationsEinheit).toHaveBeenCalledWith( expect(component.updateByOrganisationsEinheit).toHaveBeenCalledWith(
organisationsEinheitResource, organisationsEinheitResource,
); );
}); });
}); });
describe('handle organisationsEinheit', () => { describe('update by organisationsEinheit', () => {
it('should set name', () => { it('should set name', () => {
component.name = null; component.name = null;
component.handleOrganisationsEinheit(organisationsEinheitResource); component.updateByOrganisationsEinheit(organisationsEinheitResource);
expect(component.name).toEqual(organisationsEinheitResource.name); expect(component.name).toEqual(organisationsEinheitResource.name);
}); });
...@@ -48,7 +48,7 @@ describe('OrganisationsEinheitComponent', () => { ...@@ -48,7 +48,7 @@ describe('OrganisationsEinheitComponent', () => {
it('should set address', () => { it('should set address', () => {
component.address = null; component.address = null;
component.handleOrganisationsEinheit(organisationsEinheitResource); component.updateByOrganisationsEinheit(organisationsEinheitResource);
expect(component.address).toEqual( expect(component.address).toEqual(
`${organisationsEinheitResource.anschrift.strasse} ${organisationsEinheitResource.anschrift.hausnummer}, ${organisationsEinheitResource.anschrift.plz} ${organisationsEinheitResource.anschrift.ort}`, `${organisationsEinheitResource.anschrift.strasse} ${organisationsEinheitResource.anschrift.hausnummer}, ${organisationsEinheitResource.anschrift.plz} ${organisationsEinheitResource.anschrift.ort}`,
......
...@@ -9,13 +9,13 @@ export class OrganisationsEinheitComponent { ...@@ -9,13 +9,13 @@ export class OrganisationsEinheitComponent {
@Input() public set organisationsEinheitResource( @Input() public set organisationsEinheitResource(
organisationsEinheit: OrganisationsEinheitResource, organisationsEinheit: OrganisationsEinheitResource,
) { ) {
this.handleOrganisationsEinheit(organisationsEinheit); this.updateByOrganisationsEinheit(organisationsEinheit);
} }
public name: string; public name: string;
public address: string; public address: string;
handleOrganisationsEinheit(organisationsEinheit: OrganisationsEinheitResource): void { updateByOrganisationsEinheit(organisationsEinheit: OrganisationsEinheitResource): void {
this.name = organisationsEinheit.name; this.name = organisationsEinheit.name;
this.address = this.buildAddress(organisationsEinheit.anschrift); this.address = this.buildAddress(organisationsEinheit.anschrift);
} }
......
...@@ -109,6 +109,10 @@ spec: ...@@ -109,6 +109,10 @@ spec:
value: {{ ((.Values.ozgcloud).xdomea).behoerdenschluesselUri}} value: {{ ((.Values.ozgcloud).xdomea).behoerdenschluesselUri}}
- name: ozgcloud_xdomea_behoerdenschluesselVersion - name: ozgcloud_xdomea_behoerdenschluesselVersion
value: {{ ((.Values.ozgcloud).xdomea).behoerdenschluesselVersion | quote }} value: {{ ((.Values.ozgcloud).xdomea).behoerdenschluesselVersion | quote }}
{{- if ((.Values.ozgcloud).feature).collaborationEnabled }}
- name: ozgcloud_feature_collaborationEnabled
value: {{ ((.Values.ozgcloud).feature).collaborationEnabled | quote }}
{{- end }}
image: "{{ .Values.image.repo }}/{{ .Values.image.name }}:{{ coalesce (.Values.image).tag "latest" }}" image: "{{ .Values.image.repo }}/{{ .Values.image.name }}:{{ coalesce (.Values.image).tag "latest" }}"
imagePullPolicy: Always imagePullPolicy: Always
......
...@@ -21,6 +21,18 @@ spec: ...@@ -21,6 +21,18 @@ spec:
{{ toYaml . | indent 2 }} {{ toYaml . | indent 2 }}
{{- end }} {{- end }}
egress: egress:
{{- if ((.Values.ozgcloud).feature).collaborationEnabled }}
- to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: {{ required "zufiManager.namespace must be set if zufiManager server is enabled" (.Values.zufiManager).namespace }}
podSelector:
matchLabels:
component: zufi-server
ports:
- port: 9090
protocol: TCP
{{- end }}
- to: - to:
- podSelector: - podSelector:
matchLabels: matchLabels:
......
suite: deployment collaboration env
release:
name: alfa
namespace: sh-helm-test
templates:
- templates/deployment.yaml
set:
baseUrl: test.company.local
ozgcloud:
environment: test
bundesland: sh
bezeichner: helm
sso:
serverUrl: https://sso.company.local
imagePullSecret: image-pull-secret
tests:
- it: should enable collaboration
set:
ozgcloud:
feature:
collaborationEnabled: true
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: ozgcloud_feature_collaborationEnabled
value: "true"
- it: should not enable collaboration
set:
ozgcloud:
feature:
collaborationEnabled: false
asserts:
- notContains:
path: spec.template.spec.containers[0].env
content:
name: ozgcloud_feature_collaborationEnabled
any: true
\ No newline at end of file
...@@ -224,3 +224,39 @@ tests: ...@@ -224,3 +224,39 @@ tests:
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 1 count: 1
- it: should set egress for zufi if configured
set:
networkPolicy:
ssoPublicIp: 1.1.1.1
dnsServerNamespace: test-dns-server-namespace
ozgcloud:
feature:
collaborationEnabled: true
zufiManager:
namespace: by-zufi-dev
asserts:
- contains:
path: spec.egress
content:
to:
- podSelector:
matchLabels:
component: zufi-server
namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: by-zufi-dev
ports:
- port: 9090
protocol: TCP
- it: should fail to set egress for zufi if namespace is missing
set:
networkPolicy:
ssoPublicIp: 1.1.1.1
dnsServerNamespace: test-dns-server-namespace
ozgcloud:
feature:
collaborationEnabled: true
asserts:
- failedTemplate:
errorMessage: zufiManager.namespace must be set if zufiManager server is enabled
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment