Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 29 additions & 30 deletions components/statsCard/statsCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,36 +55,35 @@ const StatsCard = ({
{description}
</Card.Description>
</div>
{tempDisabled ? (
<div>{tempDisabled}</div>
) : (
<>
<div>
{loading ? (
<div className={styles.loadingContainer}>
<div className={styles.loadingStroke} />
</div>
) : (
<div className={styles.innerContent}>
<p className={countClassName || styles.subFooter}>
{formatNumber(count || 0)}
</p>
</div>
)}
</div>
<div className={styles.footerWrapper}>
{showAction && !checkBillingType && (
<Button
onClick={onActionClick || undefined}
href={actionHref}
variant="contained"
>
{actionText}
</Button>
)}
</div>
</>
)}
<>
<div>
{loading ? (
<div className={styles.loadingContainer}>
<div className={styles.loadingStroke} />
</div>
) : (
<div className={styles.innerContent}>
<p className={classNames.use(styles.subFooter, countClassName)}>
{formatNumber(count || 0)}
</p>
</div>
)}
</div>
<div className={styles.footerWrapper}>
{showAction && !checkBillingType && (
<Button
onClick={onActionClick || undefined}
// href={actionHref}
{...(tempDisabled && count === 0
? { disabled: true }
: { href: actionHref })}
variant="contained"
>
{actionText}
</Button>
)}
</div>
</>
</Card>
)

Expand Down
2 changes: 1 addition & 1 deletion templates/das/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const DasPageTemplate = observer(
actionHref="#dasTable"
showInfo
infoText={dasText.reviewCard.info}
countClassName={styles.inputCount}
countClassName={styles.inputDark}
/>
<PdfUploadChecker
pdfLoading={globalStore.dataProvider.dasPdfLoading}
Expand Down
4 changes: 4 additions & 0 deletions templates/das/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -288,3 +288,7 @@
background-color: #f2f2f2;
border-radius: 2px;
}

.input-dark {
color: #ff5f52;
}
25 changes: 15 additions & 10 deletions templates/research-software/components/notificationModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Button, Modal } from '@oacore/design'

import styles from './styles.module.css'
import Markdown from '../../../components/markdown'
import email from '../../../components/upload/assets/emailConfirmation.svg'

const NotificationModal = ({
title,
Expand All @@ -12,18 +13,22 @@ const NotificationModal = ({
}) => (
<div>
<Modal aria-label="modal" hideManually>
<div className={styles.modalWrapper}>
<div className={styles.successContent}>
<h5 className={styles.modalTitle}>{title}</h5>
<Markdown className={styles.modalDescription}>{description}</Markdown>
<div className={styles.endButton}>
<Button
onClick={handleButtonClose}
variant="contained"
className={styles.button}
>
{action}
</Button>
<div className={styles.imgWrapper}>
<img src={email} alt="email" />
</div>
<Markdown className={styles.modalDescription}>{description}</Markdown>
</div>

<div className={styles.buttonGroup}>
<Button
onClick={handleButtonClose}
variant="contained"
className={styles.closeButton}
>
{action}
</Button>
</div>
</Modal>
</div>
Expand Down
15 changes: 14 additions & 1 deletion templates/research-software/components/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,22 @@
letter-spacing: 0.01px;
}

.end-button {
.img-wrapper {
display: flex;
align-items: center;
justify-content: center;
}

.img-wrapper img {
width: 128px;
height: auto;
}

.button-group {
display: flex;
align-items: flex-end;
justify-content: flex-end;
width: 100%;
gap: 10px;
margin-top: 24px;
}
45 changes: 5 additions & 40 deletions templates/research-software/index.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { useContext, useEffect, useState } from 'react'
import { classNames } from '@oacore/design/lib/utils'
import { observer } from 'mobx-react-lite'
import { Button } from '@oacore/design'

import styles from './styles.module.css'
import texts from '../../texts/sw/sw.yml'
Expand Down Expand Up @@ -219,29 +218,12 @@ const SwPageTemplate = observer(
wholeWidthCard
actionHref="#sendSwTable"
onActionClick={() => handleStatsCardClick('sent')}
countClassName={styles.inputCount}
tempDisabled={
<div className={styles.settingsDescriptionWrapper}>
<Icon src="#alert" className={styles.cardIconWarning} />
<div className={styles.settingsDescriptionTextWrapper}>
<div className={styles.settingsDescriptionText}>
Your repository is not configured to support the automatic
notification of software mentions, please go to{' '}
<Button
className={styles.clickAction}
variant="text"
onClick={toggleDescription}
>
Settings
</Button>{' '}
to activate it.
</div>
</div>
</div>
}
countClassName={styles.sendCount}
tempDisabled
/>
<StatsCard
title={texts.statsCards.responded.title}
description={texts.statsCards.responded.description}
actionText={texts.statsCards.responded.action}
showInfo
infoText={texts.statsCards.responded.tooltip}
Expand All @@ -250,25 +232,8 @@ const SwPageTemplate = observer(
count={globalStore.dataProvider.swData.counts?.responded}
actionHref="#respondSwTable"
onActionClick={() => handleStatsCardClick('responded')}
tempDisabled={
<div className={styles.settingsDescriptionWrapper}>
<Icon src="#alert" className={styles.cardIconWarning} />
<div className={styles.settingsDescriptionTextWrapper}>
<div className={styles.settingsDescriptionText}>
Your repository is not configured to support the automatic
notification of software mentions, please go to{' '}
<Button
className={styles.clickAction}
variant="text"
onClick={toggleDescription}
>
Settings
</Button>{' '}
to activate it.
</div>
</div>
</div>
}
countClassName={styles.respondedCount}
tempDisabled
/>
</div>
</div>
Expand Down
8 changes: 8 additions & 0 deletions templates/research-software/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -352,3 +352,11 @@
width: 10%;
max-width: 5rem;
}

.send-count {
color: #c6a700;
}

.responded-count {
color: #424242;
}
2 changes: 1 addition & 1 deletion templates/rrs-policy/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const RrsPageTemplate = ({
actionHref="#rrsTable"
showInfo
infoText={rrs.reviewCard.info}
countClassName={styles.inputCount}
countClassName={styles.inputDark}
/>
<PdfUploadChecker
pdfLoading={rrsPdfLoading}
Expand Down
4 changes: 4 additions & 0 deletions templates/rrs-policy/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@
color: #ff5f52;
}

.input-dark {
color: #ff5f52;
}

.item-count-indicator {
margin-bottom: 14px;
font-size: 14px;
Expand Down
4 changes: 2 additions & 2 deletions texts/sw/sw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ actions:
key: outputUrl

notificationModal:
title: Automatic notification of software mentions
title: Notification successfully sent
description: |
This functionality uses [COAR Notify](https://coar-notify.net) to enable the automatic enrichment of software mentions in your repository record. It is currently in beta version, if you are interested in enabling it please contact us at **theteam@core.ac.uk**
The software mention should now be in your repository inbox.
action: Close