Skip to content

Commit

Permalink
feat: add assign in cards with links for each person (#549)
Browse files Browse the repository at this point in the history
  • Loading branch information
MikaelVallenet authored Aug 3, 2022
1 parent fe428f3 commit c05469a
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 5 deletions.
28 changes: 25 additions & 3 deletions web/src/ui/Visualizer/InfoBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { User } from 'react-feather'
import Issue from '../components/icons/Issue'
import Pr from '../components/icons/Pr'
import './infoBox.scss'
import {element} from "prop-types";

const InfoBox = ({ data }) => {
const openWebLink = () => {
Expand All @@ -24,7 +25,11 @@ const InfoBox = ({ data }) => {
default:
break
}
const auhorLink = data.has_author
const authorLink = data.has_author
let assignLength = 0
if (data.has_assignee !== undefined) {
assignLength = data.has_assignee.length
}
return (
<Draggable>
<div className="info-box">
Expand All @@ -43,10 +48,27 @@ const InfoBox = ({ data }) => {
<div className="info-box-body">
{data.title ? data.title.replace(/"/gi, '\'') : 'No title'}
</div>
{auhorLink && (
{assignLength !== 0 && authorLink && (
<div>
<div className="info-box-assign-link">
<User size={16} />
Assign:&nbsp;
{data.has_assignee.map((element, i) => <a href={element} target="_blank" rel="noopener noreferrer">{element.toString().replace('https://github.com/', '')}
{i !== assignLength-1? ', ' : ''}
</a>)}
</div>
<div className="info-box-assign-link">
<User size={16} />
Author:&nbsp;
<a href={`${authorLink}`} target="_blank" rel="noopener noreferrer">{authorLink.replace('https://github.com/', '')}</a>
</div>
</div>
)}
{authorLink && assignLength === 0 && (
<div className="info-box-author-link">
<User size={16} />
<a href={`${auhorLink}`} target="_blank" rel="noopener noreferrer">{auhorLink.replace('https://github.com/', '')}</a>
Author:&nbsp;
<a href={`${authorLink}`} target="_blank" rel="noopener noreferrer">{authorLink.replace('https://github.com/', '')}</a>
</div>
)}
<div className="info-box-actions">
Expand Down
12 changes: 10 additions & 2 deletions web/src/ui/Visualizer/infoBox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
position: absolute;
left: 0.5rem;
top: 0.5rem;
width: 320px;
height: 160px;
width: 360px;
height: 180px;
color: #383B62;
background-color: #ffffff;
border-radius: 6px;
Expand Down Expand Up @@ -54,11 +54,19 @@
}
.info-box-author-link {
display: flex;
margin-top: 1.5rem;
align-items: center;
svg {
margin-right: 0.35rem;
}
}
.info-box-assign-link {
display: flex;
align-items: center;
svg {
margin-right: 0.35rem;
}
}
}
.info-box-actions {
position: absolute;
Expand Down

0 comments on commit c05469a

Please sign in to comment.