Skip to content

Commit

Permalink
AKR(Backend & Frontend) review fixes [deploy]
Browse files Browse the repository at this point in the history
  • Loading branch information
jrkkp committed Mar 1, 2024
1 parent 312d246 commit 56437fe
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import fi.oph.akr.api.dto.clerk.ClerkTranslatorAddressDTO;
import fi.oph.akr.api.dto.translator.TranslatorAddressDTO;
import fi.oph.akr.config.Constants;
import fi.oph.akr.onr.dto.ContactDetailsGroupDTO;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,6 @@ export const NewTranslatorBasicInformation = ({
handleFieldChange(field, event.target.value);
};

/*
const handleComboBoxChange =
(field: keyof ClerkTranslatorBasicInformation) => (value?: string) => {
handleFieldChange(field, value);
};
*/

const handleCheckBoxChange =
(field: keyof ClerkTranslatorBasicInformation) =>
(_event: ChangeEvent<HTMLInputElement>, checked: boolean) => {
Expand Down Expand Up @@ -65,9 +58,6 @@ export const NewTranslatorBasicInformation = ({
handleTextFieldChange(field)
}
onAddressChange={handleAddressChange}
// onComboBoxChange={(field: keyof ClerkTranslatorBasicInformation) =>
// handleComboBoxChange(field)
// }
onCheckBoxChange={(field: keyof ClerkTranslatorBasicInformation) =>
handleCheckBoxChange(field)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ import { WithId } from 'interfaces/with';
type ClerkTranslatorAddressRow = ClerkTranslatorAddress & WithId;

const textFieldMaxLengths = {
[ClerkTranslatorAddressFieldEnum.Street]: 4096,
[ClerkTranslatorAddressFieldEnum.PostalCode]: 4096,
[ClerkTranslatorAddressFieldEnum.Town]: 4096,
[ClerkTranslatorAddressFieldEnum.Country]: 4096,
[ClerkTranslatorAddressFieldEnum.Street]: 255,
[ClerkTranslatorAddressFieldEnum.PostalCode]: 255,
[ClerkTranslatorAddressFieldEnum.Town]: 255,
[ClerkTranslatorAddressFieldEnum.Country]: 255,
};

const getTextFieldMaxLength = (field: ClerkTranslatorAddressFieldEnum) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,13 @@ const emptyAddress = {
postalCode: '',
town: '',
country: '',
source: 'alkupera8',
source: ClerkTranslatorAddressSource.AKR,
type: 'yhteystietotyyppi14',
selected: false,
};

const findAkrAddress = (addresses: Array<ClerkTranslatorAddress>) =>
addresses
.filter((addr) => addr.source === ClerkTranslatorAddressSource.AKR)
.shift();
addresses.find((addr) => addr.source === ClerkTranslatorAddressSource.AKR);

const ClerkTranslatorDetailsTextField = ({
translator,
Expand Down Expand Up @@ -238,22 +236,6 @@ export const ClerkTranslatorDetailsFields = ({
)
: [...addresses, address];

// const countryCodeToLabel = (code: string) => {
// const label = translateCountry(code);

// const labelKosovoFixedDuplicate =
// code === 'XKK' || code === 'XKX' ? `${label} ${code}` : label;

// return {
// label: labelKosovoFixedDuplicate,
// value: code,
// };
// };

// const comboBoxCountryValues: { label: string; value: string }[] = Object.keys(
// koodistoCountriesFI?.akr?.koodisto?.countries
// ).map(countryCodeToLabel);

return (
<>
<div className="columns margin-top-lg">
Expand Down
4 changes: 1 addition & 3 deletions frontend/packages/akr/src/interfaces/clerkPerson.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import {
ClerkTranslatorAddress,
} from 'interfaces/clerkTranslator';
import { ClerkTranslatorAddress } from 'interfaces/clerkTranslator';

export interface ClerkPerson {
onrId: string;
Expand Down

0 comments on commit 56437fe

Please sign in to comment.