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

Merge branch 'master' into OZG-5769-nachrichten-verlauf-aktualisieren

parents ba936bd7 03e74011
No related branches found
No related tags found
No related merge requests found
Showing
with 78 additions and 45 deletions
......@@ -24,7 +24,7 @@
import { formatDate, registerLocaleData } from '@angular/common';
import localeDe from '@angular/common/locales/de';
import {
fixPartialYear,
add2000Years,
formatDateWithoutYearWithTime,
formatForDatabase,
formatFullDate,
......@@ -209,12 +209,12 @@ describe('Date Util', () => {
}
});
describe('fixPartialYear', () => {
describe('add2000Years', () => {
it('should return Date in the 2000 millennium for 2 digit year value', () => {
const dateInput: Date = new Date('0023-10-22');
const yearExpected: number = 2023;
const result: Date = fixPartialYear(dateInput);
const result: Date = add2000Years(dateInput);
expect(result.getFullYear()).toBe(yearExpected);
});
......@@ -222,7 +222,7 @@ describe('Date Util', () => {
it('should return Date unchanged for non 2 digit year value', () => {
const dateInput: Date = new Date('2023-10-22');
const result: Date = fixPartialYear(dateInput);
const result: Date = add2000Years(dateInput);
expect(result).toBe(dateInput);
});
......
......@@ -102,7 +102,8 @@ function convertGermanDateString(dateStr: string): Date {
return new Date(dateStr.replace(/(.*)\.(.*)\.(.*)/, '$3-$2-$1'));
}
export function fixPartialYear(date: Date) {
// Workaround, solange MatDatepicker genutzt wird.
export function add2000Years(date: Date): Date {
const year: number = date.getFullYear();
if (year.toString().length !== 2) {
return date;
......
......@@ -84,14 +84,14 @@ describe('DateEditorComponent', () => {
});
describe('onBlur', () => {
it('should not call fixPartialYear if input value is not Date object', () => {
it('should not call add2000Years if input value is not Date object', () => {
const inputValue: string = '12.12.2024';
component.fieldControl.setValue(inputValue);
const fixPartialYear = jest.spyOn(dateUtil, 'fixPartialYear');
const add2000Years = jest.spyOn(dateUtil, 'add2000Years');
component.onBlur();
expect(fixPartialYear).not.toHaveBeenCalled();
expect(add2000Years).not.toHaveBeenCalled();
});
describe('if input value is Date object', () => {
......@@ -101,12 +101,12 @@ describe('DateEditorComponent', () => {
component.fieldControl.setValue(inputValue);
});
it('should call fixPartialYear', () => {
const fixPartialYear = jest.spyOn(dateUtil, 'fixPartialYear');
it('should call add2000Years', () => {
const add2000Years = jest.spyOn(dateUtil, 'add2000Years');
component.onBlur();
expect(fixPartialYear).toHaveBeenCalledWith(inputValue);
expect(add2000Years).toHaveBeenCalledWith(inputValue);
});
it('should call fieldControl.patchValue', () => {
......
......@@ -21,7 +21,7 @@
* Die sprachspezifischen Genehmigungen und Beschränkungen
* unter der Lizenz sind dem Lizenztext zu entnehmen.
*/
import { fixPartialYear } from '@alfa-client/tech-shared';
import { add2000Years } from '@alfa-client/tech-shared';
import { Component, Input } from '@angular/core';
import { MatDatepickerInputEvent } from '@angular/material/datepicker';
import { isDate } from 'date-fns';
......@@ -44,7 +44,7 @@ export class DateEditorComponent extends FormControlEditorAbstractComponent {
return;
}
const value: Date = fixPartialYear(this.fieldControl.value);
const value: Date = add2000Years(this.fieldControl.value);
this.fieldControl.patchValue(value);
this.onChange(value);
......
<ods-button
*ngIf="showButton$ | async"
(click)="clickEmitter.emit($event)"
(clickEmitter)="clickEmitter.emit()"
variant="primary"
size="medium"
class="mt-8 flex"
......
......@@ -12,6 +12,8 @@ grpc:
user-manager:
address: static://127.0.0.1:9000
negotiationType: PLAINTEXT
vorgang-manager:
negotiationType: PLAINTEXT
ozgcloud:
feature:
......
......@@ -57,7 +57,7 @@ grpc:
client:
vorgang-manager:
address: static://127.0.0.1:9090
negotiationType: PLAINTEXT
negotiationType: TLS
user-manager:
address: static://127.0.0.1:9000
negotiationType: TLS
......
......@@ -72,6 +72,8 @@ spec:
value: "/bindings"
- name: grpc_client_vorgang-manager_address
value: {{ include "app.grpc_client_vorgang_manager_address" . }}
- name: grpc_client_vorgang-manager_negotiationType
value: {{ (.Values.vorgangManager).grpcClientNegotiationType | default "TLS" }}
- name: grpc_client_user-manager_address
value: {{ include "app.grpc_client_user-manager_address" . }}
- name: grpc_client_user-manager_negotiationType
......@@ -176,12 +178,6 @@ spec:
mountPath: "/bindings/ca-certificates/type"
subPath: type
readOnly: true
{{- if not .Values.disableUserManagerGrpcTls }}
- name: user-manager-tls-certificate
mountPath: "/bindings/ca-certificates/user-manager-tls-ca.pem"
subPath: ca.crt
readOnly: true
{{- end }}
- name: temp-dir
mountPath: "/tmp"
{{- if (.Values.sso).tlsCertName }}
......@@ -190,15 +186,13 @@ spec:
subPath: tls.crt
readOnly: true
{{- end }}
- name: namespace-ca-cert
mountPath: "/bindings/namespace-certificate"
readOnly: true
volumes:
- name: bindings
configMap:
name: alfa-bindings-type
{{- if not .Values.disableUserManagerGrpcTls }}
- name: user-manager-tls-certificate
secret:
secretName: user-manager-tls-cert
{{- end }}
- name: temp-dir
emptyDir: {}
{{- if (.Values.sso).tlsCertName }}
......@@ -206,6 +200,17 @@ spec:
secret:
secretName: {{ .Values.sso.tlsCertName }}
{{- end }}
- name: namespace-ca-cert
projected:
sources:
- secret:
name: {{ include "app.namespace" . }}-ca-cert
optional: true
items:
- key: ca.crt
path: ca.crt
- configMap:
name: alfa-bindings-type
dnsConfig: {}
dnsPolicy: ClusterFirst
imagePullSecrets:
......
......@@ -38,7 +38,7 @@ set:
baseUrl: test.company.local
imagePullSecret: image-pull-secret
tests:
- it: should have volumes
- it: should have volume mounts
set:
usermanagerName: user-manager
asserts:
......@@ -49,13 +49,6 @@ tests:
mountPath: "/bindings/ca-certificates/type"
subPath: type
readOnly: true
- contains:
path: spec.template.spec.containers[0].volumeMounts
content:
name: user-manager-tls-certificate
mountPath: "/bindings/ca-certificates/user-manager-tls-ca.pem"
subPath: ca.crt
readOnly: true
- contains:
path: spec.template.spec.containers[0].volumeMounts
content:
......@@ -68,7 +61,13 @@ tests:
mountPath: "/bindings/ca-certificates/ssl-tls-ca.pem"
subPath: ca.crt
readOnly: true
- it: should have volume mounts
- contains:
path: spec.template.spec.containers[0].volumeMounts
content:
name: namespace-ca-cert
mountPath: "/bindings/namespace-certificate"
readOnly: true
- it: should have volumes
set:
usermanagerName: user-manager
asserts:
......@@ -78,12 +77,6 @@ tests:
name: bindings
configMap:
name: alfa-bindings-type
- contains:
path: spec.template.spec.volumes
content:
name: user-manager-tls-certificate
secret:
secretName: user-manager-tls-cert
- contains:
path: spec.template.spec.volumes
content:
......@@ -93,6 +86,20 @@ tests:
path: spec.template.spec.volumes
content:
name: sso-tls-certificate
- contains:
path: spec.template.spec.volumes
content:
name: namespace-ca-cert
projected:
sources:
- secret:
items:
- key: ca.crt
path: ca.crt
name: sh-helm-test-ca-cert
optional: true
- configMap:
name: alfa-bindings-type
- it: should have sso tls cert mount
set:
usermanagerName: user-manager
......
......@@ -132,3 +132,21 @@ tests:
content:
name: grpc_client_user-manager_negotiationType
value: TLS
- it: should set vorgang-manager negotiationType plaintext
set:
vorgangManager.grpcClientNegotiationType: PLAINTEXT
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: grpc_client_vorgang-manager_negotiationType
value: PLAINTEXT
- it: should contain default vorgang-manager negotiationType tls
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: grpc_client_vorgang-manager_negotiationType
value: TLS
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment