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

OZG-2139 impl PR comments

parent e38b1e40
No related branches found
No related tags found
No related merge requests found
...@@ -44,7 +44,6 @@ main { ...@@ -44,7 +44,6 @@ main {
position: relative; position: relative;
flex-grow: 1; flex-grow: 1;
max-width: calc(100vw - (20px + 256px)); max-width: calc(100vw - (20px + 256px));
//overflow-x: hidden;
transition: max-width 0.3s ease-in-out; transition: max-width 0.3s ease-in-out;
transition-delay: 0s; transition-delay: 0s;
background-color: #fff; background-color: #fff;
...@@ -71,8 +70,4 @@ main { ...@@ -71,8 +70,4 @@ main {
width: 20px; width: 20px;
z-index: 1; z-index: 1;
height: calc(100vh - $header-height); height: calc(100vh - $header-height);
@include media('>largeDesktop') {
//width: 360px;
}
} }
...@@ -93,6 +93,12 @@ describe('VorgangDetailAntragstellerComponent', () => { ...@@ -93,6 +93,12 @@ describe('VorgangDetailAntragstellerComponent', () => {
expect(element).not.toBeInstanceOf(HTMLElement); expect(element).not.toBeInstanceOf(HTMLElement);
}); });
it('should trim multiple spaces to one space', () => {
component.antragsteller = { ...antragsteller, anrede: 'huhu', vorname: null, nachname: 'duda' };
expect(component.name).toStrictEqual('huhu duda');
});
}); });
describe('email', () => { describe('email', () => {
......
...@@ -32,10 +32,12 @@ import { Antragsteller } from '@goofy-client/vorgang-shared'; ...@@ -32,10 +32,12 @@ import { Antragsteller } from '@goofy-client/vorgang-shared';
}) })
export class VorgangDetailAntragstellerComponent { export class VorgangDetailAntragstellerComponent {
private readonly TRIM_TO_ONE_SPACE = /\s{2,}/g;
@Input() antragsteller: Antragsteller; @Input() antragsteller: Antragsteller;
get name(): string { get name(): string {
return [this.antragsteller.anrede, this.antragsteller.vorname, this.antragsteller.nachname].join(' ').trim(); return [this.antragsteller.anrede, this.antragsteller.vorname, this.antragsteller.nachname].join(' ').trim().replace(this.TRIM_TO_ONE_SPACE, ' ');
} }
get antragstellerStrasseHausnummer(): string { get antragstellerStrasseHausnummer(): string {
......
...@@ -4,16 +4,19 @@ import java.lang.reflect.Field; ...@@ -4,16 +4,19 @@ import java.lang.reflect.Field;
import java.util.Arrays; import java.util.Arrays;
import java.util.Optional; import java.util.Optional;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
@Log4j2 @Log4j2
public class ReflectionUtil { // NOSONAR @NoArgsConstructor(access = AccessLevel.PRIVATE)
public class ReflectionUtil {
public static boolean doesObjectContainsNullOnly(Object objToCheck) { public static boolean doesObjectContainsNullOnly(Object objToCheck) {
return Arrays.asList(objToCheck.getClass().getDeclaredFields()).stream()// return Arrays.asList(objToCheck.getClass().getDeclaredFields()).stream()
.map(field -> getFieldValue(field, objToCheck))// .map(field -> getFieldValue(field, objToCheck))
.filter(Optional::isPresent)// .filter(Optional::isPresent)
.toList()// .toList()
.isEmpty(); .isEmpty();
} }
......
...@@ -7,6 +7,6 @@ import org.mapstruct.Mapper; ...@@ -7,6 +7,6 @@ import org.mapstruct.Mapper;
public interface StringToNullMapper { public interface StringToNullMapper {
default String fromString(String value) { default String fromString(String value) {
return StringUtils.isEmpty(value) ? null : value; return StringUtils.trimToNull(value);
} }
} }
\ 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