Skip to content

Commit

Permalink
- Lagt til mye oppsett for dolly-frontend tenor-organisasjon og fikse…
Browse files Browse the repository at this point in the history
…t noen bugs i form med Betsy

- Mindre update
#deploy-test-frontend
  • Loading branch information
stigus committed May 15, 2024
1 parent e6c79ac commit 8f971f8
Show file tree
Hide file tree
Showing 15 changed files with 119 additions and 119 deletions.
58 changes: 29 additions & 29 deletions apps/dolly-frontend/src/main/js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apps/dolly-frontend/src/main/js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dolly",
"version": "3.0.9",
"version": "3.0.10",
"type": "module",
"description": "",
"main": "index.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export const Datepicker = ({
excludeDates,
minDate,
maxDate,
format = null as unknown as string,
}) => {
const formMethods = useFormContext()

Expand All @@ -50,13 +51,13 @@ export const Datepicker = ({
disabled: excludeDates,
defaultSelected: getSelectedDay(),
})
const selectedDay = getSelectedDay()
const selectedDay = getSelectedDay() ? formatDate(getSelectedDay(), format) : ''

return (
<DatePicker {...datepickerProps} dropdownCaption={true} selected={selectedDay}>
<DatePicker.Input
{...inputProps}
value={selectedDay ? formatDate(selectedDay) : ''}
value={selectedDay}
placeholder={placeholder}
size={'small'}
disabled={disabled}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ interface MonthpickerProps {
isClearable?: boolean
minDate?: Date
maxDate?: Date
placeholder?: string
}

export const Monthpicker = ({
Expand All @@ -25,6 +26,7 @@ export const Monthpicker = ({
isClearable = false,
minDate = null,
maxDate = null,
placeholder = null,
...props
}: MonthpickerProps) => {
const formMethods = useFormContext()
Expand Down Expand Up @@ -64,7 +66,12 @@ export const Monthpicker = ({
<InputWrapper size={'small'}>
<Label name={name} label={label}>
<MonthPicker {...monthpickerProps} dropdownCaption={true} selected={formattedDate}>
<MonthPicker.Input label={null} size={'small'} placeholder={'yyyy-mm'} {...inputProps} />
<MonthPicker.Input
label={null}
size={'small'}
placeholder={placeholder || 'yyyy-mm'}
{...inputProps}
/>
</MonthPicker>
</Label>
</InputWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,33 @@ import {
import _ from 'lodash'
import FormFieldInput from '@/components/ui/form/inputs/textInput/FormFieldInput'

type TextInputProps = {
placeholder?: string
visHvisAvhuket?: boolean
name: string
label?: string
size?: string
type?: string
useOnChange?: boolean
onBlur?: (val: any) => void
useControlled?: boolean
defaultValue?: string
isDisabled?: boolean
onKeyPress?: (val: any) => void
autoFocus?: boolean
fieldName?: string
value?: any
style?: any
readOnly?: boolean
onKeyDown?: any
onSubmit?: Function
onChange?: Function
onPaste?: Function
className?: string
icon?: string
isDatepicker?: boolean
}

const StyledIcon = styled(Icon)`
pointer-events: none;
position: absolute;
Expand All @@ -31,16 +58,7 @@ export const TextInput = React.forwardRef(
icon,
isDisabled,
...props
}: {
name: string
fieldName: string
className?: string
icon?: string
placeholder?: string
isDisabled?: boolean
isDatepicker?: boolean
onChange?: any
},
}: TextInputProps,
ref,
) => {
const {
Expand Down Expand Up @@ -72,49 +90,15 @@ export const TextInput = React.forwardRef(
},
)

export const DollyTextInput = (props: {
fieldName?: string
name?: string
label?: string
value?: any
style?: any
size?: string
type?: string
readOnly?: boolean
onKeyDown?: any
useOnChange?: boolean
isDisabled?: boolean
onBlur?: Function
onSubmit?: Function
onChange?: Function
onPaste?: Function
onKeyPress?: Function
placeholder?: string
}) => (
export const DollyTextInput = (props: TextInputProps) => (
<InputWrapper {...props}>
<Label name={props.name} label={props.label}>
<TextInput {...props} />
</Label>
</InputWrapper>
)

export const FormTextInput = ({
visHvisAvhuket = true,
...props
}: {
visHvisAvhuket?: boolean
name: string
label?: string
size?: string
type?: string
useOnChange?: boolean
onBlur?: (val: any) => void
useControlled?: boolean
defaultValue?: string
isDisabled?: boolean
onKeyPress?: (val: any) => void
autoFocus?: boolean
}) =>
export const FormTextInput = ({ visHvisAvhuket = true, ...props }: TextInputProps) =>
visHvisAvhuket ? (
<Vis attributt={props.name}>
<FormFieldInput {...props} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ type HeaderProps = {
title: string
antall?: number
paths?: Array<string>
getValues: Function
emptyCategory: Function
getValues?: Function
emptyCategory?: Function
}

export const SoekefeltWrapper = styled.div`
Expand All @@ -29,6 +29,13 @@ export const SoekKategori = styled.div`
flex-wrap: wrap;
font-size: medium;
h4 {
display: flex;
align-items: center;
margin: 15px 0 10px;
width: 100%;
}
&& {
.dolly-form-input {
min-width: 0;
Expand All @@ -39,6 +46,7 @@ export const SoekKategori = styled.div`

export const Buttons = styled.div`
margin: 15px 0 10px 0;
&& {
button {
margin-right: 10px;
Expand All @@ -58,6 +66,7 @@ const KategoriCircle = styled.div`
border-radius: 50%;
margin-left: 10px;
background-color: #0067c5ff;
&& {
p {
margin: auto;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ export const OrganisasjonTenorSoekPage = () => {
state.seed,
)

useEffect(() => {
setState(initialState)
}, [request])

useEffect(() => {
if (response) {
const organisasjoner = response.data?.data?.organisasjoner || []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ export const SoekFormOrg = ({ setRequest, mutate }: any) => {
if (request[key] === '' || request[key] === null || request[key] === undefined) {
delete request[key]
} else if (typeof request[key] === 'object' && !(request[key] instanceof Date)) {
request[key] = getUpdatedRequest(request[key])
if (Object.keys(request[key]).length === 0) delete request[key]
if (Object.keys(request[key]).length === 0) {
delete request[key]
} else {
request[key] = getUpdatedRequest(request[key])
}
}
}
return Array.isArray(request) ? request.filter((val) => val) : request
Expand Down Expand Up @@ -138,8 +141,10 @@ export const SoekFormOrg = ({ setRequest, mutate }: any) => {
<Header
title="Arbeidsforhold"
antall={getAntallRequest([
'tenorRelasjoner.arbeidsforhold.startDato;',
'tenorRelasjoner.arbeidsforhold.sluttDato',
'tenorRelasjoner.arbeidsforhold.startDato.fraOgMed',
'tenorRelasjoner.arbeidsforhold.startDato.tilOgMed',
'tenorRelasjoner.arbeidsforhold.sluttDato.fraOgMed',
'tenorRelasjoner.arbeidsforhold.sluttDato.tilOgMed',
'tenorRelasjoner.arbeidsforhold.harPermisjoner',
'tenorRelasjoner.arbeidsforhold.harPermitteringer',
'tenorRelasjoner.arbeidsforhold.harTimerMedTimeloenn',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ export const OrganisasjonArbeidsforholdVisning = ({ data }: { data: TenorOrganis
return null
}

console.log('data: ', data) //TODO - SLETT MEG

return (
<>
<SubOverskriftExpandable label="Arbeidsforhold" iconKind="arbeid" isExpanded={true}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { FormCheckbox } from '@/components/ui/form/inputs/checbox/Checkbox'
import { AdresseKodeverk } from '@/config/kodeverk'
import { Option } from '@/service/SelectOptionsOppslag'

export const EnhetsregisteretForetaksregisteret = ({ handleChange, handleChangeList }: any) => {
export const EnhetsregisteretForetaksregisteret = ({ handleChange }: any) => {
const { domain: orgformOptions } = useTenorOrganisasjonDomain('Organisasjonsform')
const { domain: enhetStatusOptions } = useTenorOrganisasjonDomain('EnhetStatus')
return (
Expand Down
Loading

0 comments on commit 8f971f8

Please sign in to comment.