Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

UI tweaks #452

Merged
merged 8 commits into from
Feb 5, 2025
2 changes: 1 addition & 1 deletion cypress/e2e/workContainer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('workContainer with usage', () => {
it('cite as', () => {
cy.get('.cite-as')
.select('ieee')
.get('.formatted-citation', { timeout: 30000 })
.get('#formatted-citation', { timeout: 30000 })
.should('contain', 'NEXUS Head CT')
})

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.formattedCitation {
overflow-wrap: break-word;
}
3 changes: 2 additions & 1 deletion src/components/CitationFormatter/CitationFormatter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Col from 'react-bootstrap/Col'
import Alert from 'react-bootstrap/Alert'
import ReactHtmlParser from 'html-react-parser'
import { useFormattedCitationQuery } from 'src/data/queries/formattedCitationQuery'
import styles from './CitationFormatter.module.scss'

type Props = {
id: string
Expand Down Expand Up @@ -35,7 +36,7 @@ export default function CitationFormatter({ id, style, locale }: Props) {
<Col xs={12}>
<h3 className="member-results">Cite as</h3>
</Col>
<Col xs={12} className="formatted-citation">
<Col xs={12} className={styles.formattedCitation} id="formatted-citation">
{ReactHtmlParser(formatted)}
</Col>
</ >
Expand Down
7 changes: 1 addition & 6 deletions src/components/Claim/Claim.module.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
.claimDisabled {
color: #1abc9c !important;
width: 100%;
}

.claimWarning {
color: #1abc9c !important;
width: 100%;
}
}
2 changes: 1 addition & 1 deletion src/components/Claim/Claim.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export default function Claim({ doi_id }: Props) {
return null

if (loading) {
return <Button variant='warning' className={styles.claimWarning} disabled title="Checking claim status...">
return <Button variant='primary' className={styles.claimDisabled} disabled title="Checking claim status...">
Checking claim status...
</Button>
}
Expand Down
9 changes: 3 additions & 6 deletions src/components/ProductionChart/ProductionChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export default function ProductionChart({ title, data, lowerBoundYear, color }:
transform: [
{
calculate: 'toNumber(datum.title)',
as: 'period'
as: 'year'
},
{
calculate: 'toNumber(datum.title)+1',
Expand All @@ -91,7 +91,7 @@ export default function ProductionChart({ title, data, lowerBoundYear, color }:
},
encoding: {
x: {
field: 'period',
field: 'year',
bin: {
binned: true,
step: 1,
Expand All @@ -106,14 +106,11 @@ export default function ProductionChart({ title, data, lowerBoundYear, color }:
domain: [lowerBoundYear, thisYear]
}
},
x2: {
field: 'bin_end'
},
y: {
field: 'count',
type: 'quantitative',
axis: {
format: ',f',
format: ',d',
tickMinStep: 1
}
},
Expand Down
4 changes: 4 additions & 0 deletions src/components/RepositoryDetail/RepositoryDetail.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@
flex-direction: column;
align-items: flex-start;
margin-top: 3em;

a {
width: 100%;
}
}
.share {
display: flex;
Expand Down
15 changes: 6 additions & 9 deletions src/components/RepositoryDetail/RepositoryDetail.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react'
import Link from 'next/link'
import Button from 'react-bootstrap/Button'
import Badge from 'react-bootstrap/Badge'
import { faNewspaper } from '@fortawesome/free-solid-svg-icons'
Expand All @@ -21,20 +20,18 @@ export function RepositorySidebar({ repo }: Props) {
return (
<>
{repo.url && (
<Button id="go-to-repo" variant="default" href={repo.url} className="w-100">
<Button id="go-to-repo" variant="default" href={repo.url} className="mb-2">
<FontAwesomeIcon icon={faSignInAlt} />
&nbsp;
Go to Repository
</Button>
)}
{repo.works && (repo.works.totalCount > 0) && (
<Link prefetch={false} href={"/doi.org?query=client.uid:" + repo.clientId}>
<Button variant="primary" id="find-related">
<FontAwesomeIcon icon={faNewspaper} />
&nbsp;
Find Related Works
</Button>
</Link>
<Button variant="primary" href={"/doi.org?query=client.uid:" + repo.clientId} id="find-related">
<FontAwesomeIcon icon={faNewspaper} />
&nbsp;
Find Related Works
</Button>
)}
</>
)
Expand Down
Loading