Skip to content

feat: add assign in cards with links for each person #549

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 3, 2022
Merged
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
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