-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Søknadvedlegginfo instead of Vedlegg in Søknad #72
Merged
Merged
Changes from 10 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
35ae223
Isolate Attachment state
frodehansen2 1d711e6
Change SendSøknad to send only meta about Vedlegg
frodehansen2 869812c
æøå
frodehansen2 065e78d
Add skjemanummer to metadata for Vedlegg
frodehansen2 0fb8cd7
Merge branch 'master' into storage2
frodehansen2 cbddcce
Move mapAttachmentTilSøknadsvedlegginfo to vedleggUtil
frodehansen2 b47cf6d
Refactor mapLogic for SøknadsvedleggInfo
frodehansen2 1033af8
Reduce use of type Attachment in app components
frodehansen2 dfcf3f8
Delete unused interface
frodehansen2 80f6918
Remove logic from api
frodehansen2 a244582
Add missing bind
frodehansen2 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import * as React from 'react'; | ||
import AttachmentUploader from 'storage/attachment/connected-components/attachment-uploader/AttachmentUploader'; | ||
import { SøknadsvedleggType } from '../../types/søknad/Søknad'; | ||
|
||
export interface Props { | ||
type: SøknadsvedleggType; | ||
} | ||
|
||
const Søknadsvedlegg: React.StatelessComponent<Props> = ({ type }) => ( | ||
<AttachmentUploader group={type} /> | ||
); | ||
|
||
export default Søknadsvedlegg; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 4 additions & 41 deletions
45
src/app/connected-components/sider/vedlegg/VedleggSide.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,24 @@ | ||
import * as React from 'react'; | ||
import Applikasjonsside from '../Applikasjonsside'; | ||
import DocumentTitle from 'react-document-title'; | ||
import { connect } from 'react-redux'; | ||
import { AppState } from '../../../redux/reducers'; | ||
import { DispatchProps } from 'common/redux/types'; | ||
import Søknadsvedlegg from '../../../types/søknad/Søknadsvedlegg'; | ||
import søknadActions from './../../../redux/actions/søknad/søknadActionCreators'; | ||
import AttachmentUploader from 'storage/attachment/connected-components/attachment-uploader/AttachmentUploader'; | ||
|
||
export interface StateProps { | ||
vedlegg: Søknadsvedlegg; | ||
} | ||
|
||
export type Props = StateProps & DispatchProps; | ||
|
||
class VedleggSide extends React.Component<Props, {}> { | ||
class VedleggSide extends React.Component<{}, {}> { | ||
render() { | ||
const { vedlegg } = this.props; | ||
return ( | ||
<Applikasjonsside visSpråkvelger={true}> | ||
<DocumentTitle title="Vedlegg" /> | ||
<div className="blokk-m"> | ||
<h2>Adopsjonsvedtak</h2> | ||
<AttachmentUploader | ||
group="adopsjonsvedtak" | ||
attachments={vedlegg.adopsjonsvedtak} | ||
onChange={(files) => { | ||
this.props.dispatch( | ||
søknadActions.updateVedlegg({ | ||
adopsjonsvedtak: files | ||
}) | ||
); | ||
}} | ||
/> | ||
<AttachmentUploader group="adopsjonsvedtak" /> | ||
</div> | ||
<div className="blokk-m"> | ||
<h2>Fødselsattest</h2> | ||
<AttachmentUploader | ||
group="fødselsattest" | ||
attachments={vedlegg.fødselsattest} | ||
onChange={(files) => { | ||
this.props.dispatch( | ||
søknadActions.updateVedlegg({ | ||
fødselsattest: files | ||
}) | ||
); | ||
}} | ||
/> | ||
<AttachmentUploader group="fødselsattest" /> | ||
</div> | ||
</Applikasjonsside> | ||
); | ||
} | ||
} | ||
const mapStateToProps = (state: AppState): StateProps => { | ||
return { | ||
vedlegg: state.søknad.vedlegg | ||
}; | ||
}; | ||
|
||
export default connect(mapStateToProps)(VedleggSide); | ||
export default VedleggSide; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Er dette bare for typingens skyld? Foreslår å heller legge inn typen (evt. generic om det lar seg gjøre) i common enn å lage en wrapperkomponent i hvert prosjekt for dette behovet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ja, det er i utgangspunktet kun for typing, og jeg tror det gir større verdi enn det koster å lage en egen for hvert prosjekt. Men skal se mer på generic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
microsoft/TypeScript#3960
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Det blir vel omfattende å få inn typing på gruppen i hele attachments, så velger å holde det so det er enn så lenge