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

Merge branch 'master' into OZG-5698-ShowFileNameInUpload

parents 6166ace9 98ffa546
No related branches found
No related tags found
No related merge requests found
Showing
with 88 additions and 82 deletions
......@@ -149,7 +149,7 @@
<ods-button-card
class="w-72"
[isLoading]="false"
text="Bescheid-Dokument"
text="Bescheiddokument"
subText="automatisch erstellen"
>
<ods-bescheid-generate-icon icon />
......@@ -160,7 +160,7 @@
<ods-button-card
class="w-72"
[isLoading]="true"
text="Bescheid-Dokument"
text="Bescheiddokument"
subText="automatisch erstellen"
>
<ods-bescheid-generate-icon icon />
......@@ -171,7 +171,7 @@
<ods-button-card
class="w-72"
[isLoading]="true"
text="Bescheid-Dokument"
text="Bescheiddokument"
subText="automatisch erstellen"
>
<ods-bescheid-generate-icon icon />
......@@ -182,7 +182,7 @@
<ods-button-card
class="w-96"
[isLoading]="true"
text="Bescheid-Dokument und noch mehr"
text="Bescheiddokument und noch mehr"
subText="Subtext in der 2ten Reihe"
>
<ods-bescheid-generate-icon icon />
......@@ -190,7 +190,7 @@
</div>
<div class="mt-4">
<ods-button-card class="w-72" [isLoading]="true" text="Bescheid-Dokument">
<ods-button-card class="w-72" [isLoading]="true" text="Bescheiddokument">
<ods-bescheid-generate-icon icon />
</ods-button-card>
</div>
......@@ -199,14 +199,14 @@
<ods-file-upload-button class="w-72" [isLoading]="false" id="upload117">
<ods-bescheid-upload-icon icon />
<ods-spinner-icon spinner size="extra-large" />
<p text class="text-center">Bescheid-Dokument<br />hochladen</p></ods-file-upload-button
<p text class="text-center">Bescheiddokument<br />hochladen</p></ods-file-upload-button
>
</div>
<div class="mt-4">
<ods-file-upload-button class="w-72" [isLoading]="true" id="upload117">
<ods-bescheid-upload-icon icon />
<ods-spinner-icon spinner size="extra-large" />
<p text class="text-center">Bescheid-Dokument<br />hochladen</p></ods-file-upload-button
<p text class="text-center">Bescheiddokument<br />hochladen</p></ods-file-upload-button
>
</div>
......
......@@ -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);
......
......@@ -23,7 +23,7 @@
unter der Lizenz sind dem Lizenztext zu entnehmen.
-->
<ng-container *ngIf="!isVorgangInBearbeitung && vorgang | hasLink: linkRel.ABSCHLIESSEN">
<ng-container *ngIf="vorgang | hasLink: linkRel.ABSCHLIESSEN">
<ozgcloud-stroked-button-with-spinner
*ngIf="!showAsIconButton"
data-test-id="abschliessen-button"
......
......@@ -134,18 +134,6 @@ describe('AbschliessenButtonComponent', () => {
expect(buttonElement).not.toBeInstanceOf(HTMLElement);
});
it('should be hidden if in bearbeitung', () => {
component.vorgang = {
...createVorgangWithEingangResource([VorgangWithEingangLinkRel.ABSCHLIESSEN]),
status: VorgangStatus.IN_BEARBEITUNG,
};
fixture.detectChanges();
const buttonElement = fixture.nativeElement.querySelector(abschliessenButton);
expect(buttonElement).not.toBeInstanceOf(HTMLElement);
});
it('should be visible', () => {
component.vorgang = createVorgangWithEingangResource([
VorgangWithEingangLinkRel.ABSCHLIESSEN,
......@@ -173,17 +161,6 @@ describe('AbschliessenButtonComponent', () => {
expect(buttonElement).not.toBeInstanceOf(HTMLElement);
});
it('should be hidden if in bearbeitung', () => {
component.vorgang = {
...createVorgangWithEingangResource([VorgangWithEingangLinkRel.ABSCHLIESSEN]),
status: VorgangStatus.IN_BEARBEITUNG,
};
fixture.detectChanges();
const buttonElement = fixture.nativeElement.querySelector(abschliessenIconButton);
expect(buttonElement).not.toBeInstanceOf(HTMLElement);
});
it('should be visible', () => {
component.vorgang = createVorgangWithEingangResource([
......
......@@ -55,8 +55,4 @@ export class AbschliessenButtonComponent implements OnInit {
public abschliessen(): void {
this.commandStateResource$ = this.vorgangCommandService.abschliessen(this.vorgang);
}
get isVorgangInBearbeitung(): boolean {
return this.vorgang.status === 'IN_BEARBEITUNG';
}
}
......@@ -5,7 +5,7 @@
[uploadInProgress]="uploadInProgress$ | async"
(newFile)="uploadFile($event)"
[fileLinkList]="getFileLinkList()"
label="Attachment hochladen"
label="Anhang hochladen"
>
</ods-file-upload-editor>
</div>
......@@ -9,6 +9,6 @@
>
<ods-bescheid-upload-icon icon></ods-bescheid-upload-icon>
<ods-spinner-icon spinner size="extra-large"></ods-spinner-icon>
<div text class="text-center">Bescheid Dokument hochladen</div>
<div text class="text-center">Bescheiddokument hochladen</div>
</ods-single-file-upload-editor>
</div>
<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