-
Notifications
You must be signed in to change notification settings - Fork 16
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
Feature/340 collection host input #399
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
91abd21
Use current collection to create the dataset, instead of root
ekraffmiller b37768c
Feat: add HostCollectionForm to CreateDataset.tsx
ekraffmiller 65c7c5c
feat: add Edit Host Collection button
ekraffmiller ea050a5
feat: add test for HostCollectionForm to CreateDataset.spec.tsx
ekraffmiller 4c2e803
fix: lint error
ekraffmiller a22e52d
Merge branch 'feature/376-add-dynamic-field-types-to-create-dataset-f…
ekraffmiller 4bb55f5
fix: replace 'dataverse' with 'collection' in help text
ekraffmiller 580fd60
refactor: move NotImplementedModel to CreateDataset.tsx
ekraffmiller a14ea1e
fix: layout styles for button and input
ekraffmiller fa97a7b
fix: remove debug styles
ekraffmiller a6866c3
fix: remove console.log()
ekraffmiller e849a3d
fix: lint errors
ekraffmiller 9e65bf7
fix: flex styles
ekraffmiller fb95ff9
fix: move NotImplementedModel outside of article
ekraffmiller 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
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
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
25 changes: 25 additions & 0 deletions
25
src/sections/create-dataset/HostCollectionForm/HostCollectionForm.module.scss
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,25 @@ | ||
.input-button-wrapper { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1rem; | ||
|
||
@media (min-width: 768px) { | ||
flex-direction: row; | ||
gap: 0; | ||
|
||
button { | ||
width: 100%; | ||
} | ||
} | ||
} | ||
|
||
.edit-button-wrapper { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
justify-content: flex-end; | ||
|
||
@media (min-width: 768px) { | ||
padding-left: 1rem; | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
src/sections/create-dataset/HostCollectionForm/HostCollectionForm.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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { Button, Col } from '@iqss/dataverse-design-system' | ||
import { Form } from '@iqss/dataverse-design-system' | ||
import { useTranslation } from 'react-i18next' | ||
import { useNotImplementedModal } from '../../not-implemented/NotImplementedModalContext' | ||
import styles from './HostCollectionForm.module.scss' | ||
|
||
interface HostCollectionFormProps { | ||
collectionId: string | ||
} | ||
|
||
export function HostCollectionForm({ collectionId }: HostCollectionFormProps) { | ||
const { t } = useTranslation('createDataset') | ||
const { showModal } = useNotImplementedModal() | ||
|
||
return ( | ||
<> | ||
<Form.Group controlId="host-collection"> | ||
<Form.Group.Label message={t('hostCollection.description')} column sm={3} required> | ||
{t('hostCollection.label')} | ||
</Form.Group.Label> | ||
<Col sm={9} className={styles['input-button-wrapper']}> | ||
<Col md={9}> | ||
<Form.Group.Text>{t('hostCollection.helpText')}</Form.Group.Text> | ||
<Form.Group.Input type="text" disabled defaultValue={collectionId} /> | ||
</Col> | ||
<Col className={styles['edit-button-wrapper']} md={3}> | ||
<Button type={'button'} onClick={showModal} variant="secondary"> | ||
{t('hostCollection.buttonLabel')} | ||
</Button> | ||
</Col> | ||
</Col> | ||
</Form.Group> | ||
</> | ||
) | ||
} |
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.
Should live outside the article element, you can use a react fragment like this: