forked from uncch-rdmc/dataverse-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request IQSS#399 from IQSS/feature/340-collection-host-input
Feature/340 collection host input
- Loading branch information
Showing
12 changed files
with
143 additions
and
33 deletions.
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