Skip to content

Commit

Permalink
backoffice[authors]: show all tickets
Browse files Browse the repository at this point in the history
  • Loading branch information
DonHaul committed Mar 6, 2025
1 parent 78fbb7f commit 8dc66bc
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 10 deletions.
26 changes: 16 additions & 10 deletions ui/src/backoffice/authors/containers/AuthorDetailPageContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -306,16 +306,22 @@ const AuthorDetailPageContainer = ({
subTitle="SNow information"
>
{tickets && (
<p className="mb0">
See related ticket
<a
href={tickets?.first()?.get('ticket_url')}
target="_blank"
>
{' '}
#{tickets?.first()?.get('ticket_id')}
</a>
</p>
<>
<p className="mb0">See related tickets</p>
<ul className="mb0">
{tickets.map((ticket: any) => (
<li className="mb0">
<a
key={ticket.get('ticket_id')}
href={ticket.get('ticket_url')}
target="_blank"
>
#{ticket.get('ticket_id')}
</a>
</li>
))}
</ul>
</>
)}
</ContentBox>
{isSuperUserLoggedIn && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ describe('AuthorDetailPageContainer', (ids: any = []) => {
ids: [{ schema: 'ORCID', value: '0000-0002-6357-9297' }, ...ids],
},
status: 'approval',
tickets: [
{ ticket_id: 'ticket1', ticket_url: 'www.ticket1.com' },
{ ticket_id: 'ticket2', ticket_url: 'www.ticket2.com' },
],
}),
}),
});
Expand Down Expand Up @@ -160,6 +164,21 @@ describe('AuthorDetailPageContainer', (ids: any = []) => {

expect(screen.getByText('Loading ...')).toBeInTheDocument();
});

it('should not show all the tickets', () => {
renderComponent();

expect(
screen.getByRole('link', {
name: '#ticket1',
})
).toBeInTheDocument();
expect(
screen.getByRole('link', {
name: '#ticket2',
})
).toBeInTheDocument();
});
});

describe('AuthorDetailPageContainer - Name Fields and control number', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,68 @@ exports[`AuthorDetailPageContainer should render the AuthorDetailPageContainer 1
</div>
</div>
</div>
<div
class="__ContentBox__ mb3"
>
<div
class="ant-card ant-card-bordered h-100"
>
<div
class="ant-card-body"
>
<div
class="pa2 mb3"
>
<h3
class="pb1"
>
SNow information
</h3>
<div>
<p
class="mb0"
>
See related tickets
</p>
<ul
class="mb0"
>
<li
class="mb0"
>
<a
href="www.ticket1.com"
target="_blank"
>
#ticket1
</a>
</li>
<li
class="mb0"
>
<a
href="www.ticket2.com"
target="_blank"
>
#ticket2
</a>
</li>
</ul>
</div>
</div>
<div
class="ant-row ant-row-space-between actions ph2"
>
<div
class="ant-col"
/>
<div
class="ant-col"
/>
</div>
</div>
</div>
</div>
<div
class="__ContentBox__ mb3"
>
Expand Down

0 comments on commit 8dc66bc

Please sign in to comment.