Skip to content

Commit

Permalink
Merge branch 'main' into ny-innsending
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbjoern committed Dec 11, 2023
2 parents d560586 + a91aa3c commit 51e24da
Show file tree
Hide file tree
Showing 3 changed files with 504 additions and 426 deletions.
6 changes: 5 additions & 1 deletion components/fileupload/FileUpload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,18 @@ export const FileUpload = ({ søknadId, krav, addError, deleteError, onSuccess,
const [files, setFiles] = useState<Vedlegg[]>([]);
const [harLastetOppEttersending, setHarLastetOppEttersending] = useState<boolean>(false);
const [harEttersendingError, setHarEttersendingError] = useState<boolean>(false);
const [isUploading, setIsUploading] = useState<boolean>(false);

const kravErAnnet = krav === 'ANNET';
const successWrapperKlassenavn = kravErAnnet ? styles.successWrapperAnnet : styles.successWrapper;
const harFeilmeldinger = files.some((file) => file.errorMessage);
const visSendInnKnapp = !harLastetOppEttersending && files.length > 0;

const onClick = async () => {
setIsUploading(true);
if (harFeilmeldinger) {
setErrorSummaryFocus();
setIsUploading(false);
return;
}

Expand Down Expand Up @@ -66,6 +69,7 @@ export const FileUpload = ({ søknadId, krav, addError, deleteError, onSuccess,
console.log(err);
setHarEttersendingError(true);
}
setIsUploading(false);
};

return (
Expand Down Expand Up @@ -130,7 +134,7 @@ export const FileUpload = ({ søknadId, krav, addError, deleteError, onSuccess,
</Alert>
)}
{visSendInnKnapp && (
<Button onClick={onClick} className={styles.sendButton}>
<Button onClick={onClick} loading={isUploading} className={styles.sendButton}>
Send inn
</Button>
)}
Expand Down
50 changes: 25 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,55 +14,55 @@
},
"prettier": "@navikt/aap-felles-prettier",
"dependencies": {
"@grafana/faro-web-sdk": "^1.2.6",
"@navikt/aap-felles-css": "^0.0.91",
"@navikt/aap-felles-react": "^0.0.91",
"@navikt/aap-felles-utils": "^0.0.91",
"@navikt/aap-felles-utils-client": "^0.0.91",
"@navikt/aksel-icons": "^5.10.1",
"@navikt/ds-css": "^5.10.1",
"@navikt/ds-react": "^5.10.1",
"@navikt/nav-dekoratoren-moduler": "^2.1.0",
"@grafana/faro-web-sdk": "^1.3.2",
"@navikt/aap-felles-css": "^0.0.92",
"@navikt/aap-felles-react": "^0.0.92",
"@navikt/aap-felles-utils": "^0.0.92",
"@navikt/aap-felles-utils-client": "^0.0.92",
"@navikt/aksel-icons": "^5.11.4",
"@navikt/ds-css": "^5.11.4",
"@navikt/ds-react": "^5.11.4",
"@navikt/nav-dekoratoren-moduler": "^2.1.5",
"@navikt/next-api-proxy": "^3.4.0",
"@vercel/otel": "^0.3.0",
"cookie": "^0.6.0",
"date-fns": "^2.28.0",
"html-react-parser": "^5.0.6",
"jsdom": "^22.1.0",
"next": "^14.0.2",
"html-react-parser": "^5.0.7",
"jsdom": "^23.0.1",
"next": "^14.0.4",
"node-cache": "^5.1.2",
"playwright": "^1.39.0",
"playwright": "^1.40.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-intl": "^6.5.5"
},
"devDependencies": {
"@navikt/aap-felles-prettier": "^0.0.91",
"@navikt/eslint-config-aap": "^0.0.91",
"@playwright/test": "^1.39.0",
"@testing-library/jest-dom": "^6.1.4",
"@testing-library/react": "^14.1.0",
"@navikt/aap-felles-prettier": "^0.0.92",
"@navikt/eslint-config-aap": "^0.0.92",
"@playwright/test": "^1.40.1",
"@testing-library/jest-dom": "^6.1.5",
"@testing-library/react": "^14.1.2",
"@testing-library/user-event": "^14.5.1",
"@types/amplitude-js": "^8.16.5",
"@types/cookie": "^0.5.4",
"@types/cookie": "^0.6.0",
"@types/jest": "^29.5.8",
"@types/node": "^20.9.0",
"@types/react": "18.2.14",
"@types/react-dom": "^18.2.15",
"@types/uuid": "^9.0.7",
"@typescript-eslint/eslint-plugin": "^6.11.0",
"eslint": "^8.53.0",
"eslint-config-next": "^14.0.2",
"@typescript-eslint/eslint-plugin": "^6.13.2",
"eslint": "^8.55.0",
"eslint-config-next": "^14.0.4",
"eslint-plugin-jest": "^27.6.0",
"husky": ">=6",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-fetch-mock": "^3.0.3",
"json-diff": "^1.0.6",
"lint-staged": "^15.1.0",
"lint-staged": "^15.2.0",
"patch-package": "^8.0.0",
"prettier": "^3.1.0",
"typescript": "^5.2.2",
"prettier": "^3.1.1",
"typescript": "^5.3.3",
"uuid": "^9.0.1"
},
"lint-staged": {
Expand Down
Loading

0 comments on commit 51e24da

Please sign in to comment.