Skip to content

Commit 5a4c1a4

Browse files
authoredJan 29, 2025··
isLoading -> isPending i mutations (#3627)
1 parent ae3d14b commit 5a4c1a4

File tree

13 files changed

+14
-42
lines changed

13 files changed

+14
-42
lines changed
 

‎src/client/app/avdelingsleder/behandlingskoerV3/SlettKøModal.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ interface OwnProps {
99
}
1010

1111
const SlettKøModal = ({ lukk, id, køTittel }: OwnProps) => {
12-
const { mutate, isLoading, isError } = useSlettKøMutation(lukk);
12+
const { mutate, isPending, isError } = useSlettKøMutation(lukk);
1313
return (
1414
<Modal open onClose={lukk} portal>
1515
<Modal.Body>
1616
<Heading size="medium">Slett kø</Heading>
1717
<BodyShort>{`Er du sikker på at du vil slette ${køTittel}?`}</BodyShort>
1818
{isError && <ErrorMessage>Noe gikk galt ved oppretting av kø.</ErrorMessage>}
1919
<div className="mt-8 flex gap-4">
20-
<Button loading={isLoading} onClick={() => mutate(id)}>
20+
<Button loading={isPending} onClick={() => mutate(id)}>
2121
Slett
2222
</Button>
2323
<Button variant="secondary" type="button" onClick={lukk}>

‎src/client/app/avdelingsleder/behandlingskoerV3/components/AksjonspunktVelger.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import SearchDropdownMedPredefinerteVerdier, {
66
import kodeverkTyper from 'kodeverk/kodeverkTyper';
77

88
const AksjonspunktVelger: FunctionComponent<
9-
SearchDropdownPredefinerteVerdierProps & { skjulValgteVerdierUnderDropdown: boolean }
9+
SearchDropdownPredefinerteVerdierProps & { skjulValgteVerdierUnderDropdown?: boolean }
1010
> = ({ onChange, feltdefinisjon, oppgavefilter, error, skjulValgteVerdierUnderDropdown }) => {
1111
const oppgavekoder = useKodeverk(kodeverkTyper.OPPGAVE_KODE);
1212
const formaterteOppgavekoder = oppgavekoder

‎src/client/app/avdelingsleder/bemanning/components/LeggTilSaksbehandlerForm.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const LeggTilSaksbehandlerForm: FunctionComponent = () => {
1515
isLoading: isLoadingSaksbehandlere,
1616
isSuccess: isSuccessSaksbehandlere,
1717
} = useHentSaksbehandlereAvdelingsleder();
18-
const { mutate: leggTilSaksbehandler, isLoading: isLoadingLeggTil } = useLeggTilSaksbehandler();
18+
const { mutate: leggTilSaksbehandler, isPending: isLoadingLeggTil } = useLeggTilSaksbehandler();
1919

2020
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2121
const addSaksbehandler = (epost: string, form: FormApi<any, Partial<any>>, meta: FieldMetaState<any>) => {

‎src/client/app/avdelingsleder/bemanning/components/SaksbehandlerInfo.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const SaksbehandlerInfo: FunctionComponent<OwnProps> = ({ saksbehandler }) => {
4747
isLoading: isLoadingKøerV3,
4848
isSuccess: isSuccessKøerV3,
4949
} = useHentAndreSaksbehandleresKøer(saksbehandler.id);
50-
const { mutate, isLoading: isLoadingSlett } = useSlettSaksbehandler();
50+
const { mutate, isPending: isLoadingSlett } = useSlettSaksbehandler();
5151
const slettSaksbehandler = () => mutate({ epost: saksbehandler.epost }, { onSuccess: lukkSlettModal });
5252

5353
return (

‎src/client/app/filter/AntallOppgaver.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const AntallOppgaver = ({ setQueryError }: OwnProps) => {
1414
const { oppgaveQuery } = useContext(FilterContext);
1515

1616
const [antallOppgaver, setAntallOppgaver] = useState('');
17-
const { mutate, isLoading } = useMutation<string, unknown, { url: string; body: OppgaveQuery }>({
17+
const { mutate, isPending } = useMutation<string, unknown, { url: string; body: OppgaveQuery }>({
1818
onSuccess: (respons) => {
1919
if (respons !== undefined) {
2020
setAntallOppgaver(respons);
@@ -32,15 +32,15 @@ export const AntallOppgaver = ({ setQueryError }: OwnProps) => {
3232
return (
3333
<div className="flex flex-col m-auto">
3434
<Label size="small">
35-
Antall oppgaver: {isLoading ? <Skeleton className="inline-block w-12" /> : antallOppgaver}
35+
Antall oppgaver: {isPending ? <Skeleton className="inline-block w-12" /> : antallOppgaver}
3636
</Label>
3737
<Button
3838
variant="tertiary"
3939
icon={<ArrowsCirclepathIcon aria-hidden />}
4040
size="small"
4141
onClick={hentOppgaver}
42-
loading={isLoading}
43-
disabled={isLoading}
42+
loading={isPending}
43+
disabled={isPending}
4444
>
4545
Oppdater antall
4646
</Button>

‎src/client/app/filter/parts/SearchDropdownMedPredefinerteVerdier.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export interface SearchDropdownPredefinerteVerdierProps extends Partial<SearchWi
77
onChange: (values: string[]) => void;
88
oppgavefilter: FeltverdiOppgavefilter;
99
error?: string;
10-
skjulValgteVerdierUnderDropdown: boolean;
10+
skjulValgteVerdierUnderDropdown?: boolean;
1111
}
1212

1313
const SearchDropdownMedPredefinerteVerdier = ({

‎src/client/app/form/finalFields/CheckboxField.tsx

-4
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,5 @@ const CheckboxField: FunctionComponent<OwnProps> = ({ name, label, validate, rea
4848
/>
4949
);
5050

51-
CheckboxField.defaultProps = {
52-
validate: null,
53-
readOnly: false,
54-
};
5551

5652
export default CheckboxField;

‎src/client/app/form/finalFields/DatepickerField.tsx

-8
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,4 @@ const DatepickerField: FunctionComponent<OwnProps> = ({
7676
/>
7777
);
7878

79-
DatepickerField.defaultProps = {
80-
label: '',
81-
readOnly: false,
82-
isEdited: false,
83-
format: (value) => value,
84-
parse: (value) => value,
85-
};
86-
8779
export default DatepickerField;

‎src/client/app/form/finalFields/RadioOption.tsx

-9
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,6 @@ export const RadioOption: FunctionComponent<OwnProps> = ({
5454
);
5555
};
5656

57-
RadioOption.defaultProps = {
58-
name: '',
59-
className: '',
60-
disabled: false,
61-
groupDisabled: false,
62-
onChange: () => undefined,
63-
manualHideChildren: false,
64-
};
65-
6657
RadioOption.displayName = 'RadioOption';
6758

6859
export default RadioOption;

‎src/client/app/form/finalFields/ReadOnlyField.tsx

-4
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,5 @@ export const ReadOnlyField: FunctionComponent<OwnProps> = ({ label, input, isEdi
3232
);
3333
};
3434

35-
ReadOnlyField.defaultProps = {
36-
label: undefined,
37-
isEdited: false,
38-
};
3935

4036
export default ReadOnlyField;

‎src/client/app/form/finalFields/TextAreaField.tsx

-3
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ const TextAreaWithBadge: FunctionComponent<TextAreaWithBadgeProps & WrappedCompo
4444
</div>
4545
);
4646

47-
TextAreaWithBadge.defaultProps = {
48-
badges: null,
49-
};
5047

5148
const renderNavTextArea = renderNavField(injectIntl(TextAreaWithBadge));
5249

‎src/client/app/saksbehandler/fagsakSearch/components/FagsakSearch.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const skalViseListe = (resultat) => {
3232
const FagsakSearch: FunctionComponent<OwnProps> = ({ setOppgave, goToFagsak }) => {
3333
const queryFraURL = queryString.parse(window.location?.search ? window.location.search : '');
3434
const erSokViaQueryParams = queryFraURL.sok && !hasValidSaksnummerEllerJournalpostFormat(queryFraURL.sok);
35-
const { data: resultat, mutate: sok, isSuccess, isLoading } = useSøk();
35+
const { data: resultat, mutate: sok, isSuccess, isPending } = useSøk();
3636
useEffect(() => {
3737
if (erSokViaQueryParams) {
3838
const paramToString = queryFraURL.sok.toString();
@@ -42,7 +42,7 @@ const FagsakSearch: FunctionComponent<OwnProps> = ({ setOppgave, goToFagsak }) =
4242

4343
return (
4444
<div>
45-
<SearchForm onSubmit={sok} searchStarted={isLoading} />
45+
<SearchForm onSubmit={sok} searchStarted={isPending} />
4646
{isSuccess && resultat && resultat.oppgaver.length === 0 && !resultat.ikkeTilgang && (
4747
<BodyShort className={styles.label}>
4848
<FormattedMessage id="FagsakSearch.ZeroSearchResults" />

‎src/client/app/saksbehandler/sokeboks/Søkeboks.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ import { SøkResultat } from 'saksbehandler/sokeboks/SøkResultat';
55
import VerticalSpacer from 'sharedComponents/VerticalSpacer';
66

77
export function Søkeboks() {
8-
const { isLoading, mutate: utførSøk, data, reset: nullstillSøk } = useSøkOppgaveV3();
8+
const { isPending, mutate: utførSøk, data, reset: nullstillSøk } = useSøkOppgaveV3();
99

1010
return (
1111
<>
12-
<SøkForm utførSøk={utførSøk} loading={isLoading} nullstillSøk={nullstillSøk} />
12+
<SøkForm utførSøk={utførSøk} loading={isPending} nullstillSøk={nullstillSøk} />
1313
<VerticalSpacer sixteenPx />
1414
<SøkResultat oppgaver={data} />
1515
</>

0 commit comments

Comments
 (0)
Please sign in to comment.