Skip to content

Commit 07f1c9c

Browse files
authored
Merge pull request #554 from IQSS/feat/553-collection-page-share
Share Collection and Share Dataset features
2 parents 8283782 + 0dbc485 commit 07f1c9c

File tree

21 files changed

+420
-39
lines changed

21 files changed

+420
-39
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,10 @@ The environment is accessible through the following URLs:
223223
> #### Account Page BreadCrumbs
224224
>
225225
> The Account Page has been updated to remove breadcrumbs, as the page is not part of the main navigation.
226+
>
227+
> #### Share Collection and Dataset feature
228+
>
229+
> Links to share a collection or a dataset via LinkedIn, X or Facebook will now open in a new tab instead of a popup.
226230
227231
</details>
228232

package-lock.json

Lines changed: 16 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"lodash": "^4.17.21",
3535
"moment-timezone": "0.5.43",
3636
"react-bootstrap": "2.7.2",
37-
"react-bootstrap-icons": "1.10.3",
37+
"react-bootstrap-icons": "1.11.4",
3838
"react-hook-form": "7.51.2",
3939
"react-i18next": "12.1.5",
4040
"react-infinite-scroll-hook": "4.1.1",

packages/design-system/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"@types/react": "18.0.27",
5151
"bootstrap": "5.2.3",
5252
"react-bootstrap": "2.7.2",
53-
"react-bootstrap-icons": "1.10.3",
53+
"react-bootstrap-icons": "1.11.4",
5454
"sass": "1.58.1",
5555
"typescript": "4.9.5",
5656
"vite-plugin-istanbul": "4.0.1"

packages/design-system/src/lib/stories/button-group/ButtonGroup.stories.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,12 @@ export const NestedButtonGroups: Story = {
5555
render: () => (
5656
<ButtonToolbar ariaLabel="Toolbar with button groups">
5757
<ButtonGroup vertical>
58-
<DropdownButton asButtonGroup withSpacing title="Access File" id="access-file">
58+
<DropdownButton asButtonGroup title="Access File" id="access-file">
5959
<DropdownButtonItem href="/item-1">Item 1</DropdownButtonItem>
6060
<DropdownButtonItem href="/item-2">Item 2</DropdownButtonItem>
6161
<DropdownButtonItem href="/item-3">Item 3</DropdownButtonItem>
6262
</DropdownButton>
63-
<DropdownButton
64-
asButtonGroup
65-
withSpacing
66-
title="Edit File"
67-
id="edit-file"
68-
variant="secondary">
63+
<DropdownButton asButtonGroup title="Edit File" id="edit-file" variant="secondary">
6964
<DropdownButtonItem href="/item-1">Item 1</DropdownButtonItem>
7065
<DropdownButtonItem href="/item-2">Item 2</DropdownButtonItem>
7166
<DropdownButtonItem href="/item-3">Item 3</DropdownButtonItem>

public/locales/en/collection.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@
3131
"error": "There was an error publishing your collection."
3232
},
3333
"publishedAlert": "Your collection is now public.",
34+
"share": {
35+
"shareCollection": "Share Collection",
36+
"helpText": "Share this collection on your favorite social media networks."
37+
},
3438
"editedAlert": "You have successfully updated your collection!",
3539
"editCollection": {
3640
"edit": "Edit",

public/locales/en/dataset.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,12 @@
5959
"archivalZip": "Archival Format (.tab) ZIP"
6060
}
6161
},
62-
"uploadFiles": "Upload Files"
62+
"uploadFiles": "Upload Files",
63+
"share": {
64+
"shareDataset": "Share Dataset",
65+
"helpText": "Share this dataset on your favorite social media networks."
66+
},
67+
"contactOwner": "Contact Owner"
6368
},
6469
"alerts": {
6570
"publishInProgress": {

public/locales/en/shared.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
"remove": "Remove",
44
"add": "Add",
55
"cancel": "Cancel",
6+
"close": "Close",
67
"continue": "Continue",
8+
"share": "Share",
79
"pageNumberNotFound": {
810
"heading": "Page Number Not Found",
911
"message": "The page number you requested does not exist. Please try a different page number."

src/sections/collection/Collection.module.scss

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,19 @@
1111
gap: 10px;
1212
}
1313

14-
.action-buttons {
14+
.metrics-actions-container {
1515
display: flex;
16-
justify-content: flex-end;
17-
margin-bottom: 1rem;
16+
flex-wrap: wrap;
17+
align-items: center;
18+
justify-content: space-between;
19+
margin-bottom: 2rem;
20+
21+
.right-content {
22+
display: flex;
23+
flex-wrap: wrap;
24+
gap: 0.5rem;
25+
align-items: center;
26+
}
1827
}
1928

2029
.subtext {

src/sections/collection/Collection.tsx

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { useTranslation } from 'react-i18next'
22
import { Alert, ButtonGroup, Col, Row } from '@iqss/dataverse-design-system'
3-
43
import { CollectionRepository } from '../../collection/domain/repositories/CollectionRepository'
54
import { useCollection } from './useCollection'
65
import { useScrollTop } from '../../shared/hooks/useScrollTop'
@@ -14,6 +13,7 @@ import { CollectionSkeleton } from './CollectionSkeleton'
1413
import { PageNotFound } from '../page-not-found/PageNotFound'
1514
import { CreatedAlert } from './CreatedAlert'
1615
import { PublishCollectionButton } from './publish-collection/PublishCollectionButton'
16+
import { ShareCollectionButton } from './share-collection-button/ShareCollectionButton'
1717
import { EditCollectionDropdown } from './edit-collection-dropdown/EditCollectionDropdown'
1818
import styles from './Collection.module.scss'
1919

@@ -81,19 +81,28 @@ export function Collection({
8181
{t('publishedAlert')}
8282
</Alert>
8383
)}
84-
{(showPublishButton || showEditButton) && (
85-
<div className={styles['action-buttons']}>
86-
<ButtonGroup>
87-
{showPublishButton && (
88-
<PublishCollectionButton
89-
repository={collectionRepository}
90-
collectionId={collection.id}
91-
/>
92-
)}
93-
{showEditButton && <EditCollectionDropdown collection={collection} />}
94-
</ButtonGroup>
84+
85+
<div className={styles['metrics-actions-container']}>
86+
<div className={styles.metrics}></div>
87+
<div className={styles['right-content']}>
88+
{/* 👇 Here should go Contact button also */}
89+
{/* <ContactButton /> */}
90+
91+
<ShareCollectionButton />
92+
93+
{(showPublishButton || showEditButton) && (
94+
<ButtonGroup>
95+
{showPublishButton && (
96+
<PublishCollectionButton
97+
repository={collectionRepository}
98+
collectionId={collection.id}
99+
/>
100+
)}
101+
{showEditButton && <EditCollectionDropdown collection={collection} />}
102+
</ButtonGroup>
103+
)}
95104
</div>
96-
)}
105+
</div>
97106

98107
<CollectionItemsPanel
99108
key={collection.id}

0 commit comments

Comments
 (0)