mirror of
https://gitlab.com/MrFry/qmining-page
synced 2025-04-01 20:23:44 +02:00
Added git links to todo sidebar
This commit is contained in:
parent
91e4e24ff7
commit
57f0730f3e
10 changed files with 329 additions and 90 deletions
|
@ -2,10 +2,28 @@ import React from 'react'
|
|||
|
||||
import styles from './todoSidebar.module.css'
|
||||
|
||||
export default function Todos({ card, userId, categories, columns, voteOn }) {
|
||||
const { name, description, category, points, votes, id } = card
|
||||
export default function Todos({
|
||||
card,
|
||||
userId,
|
||||
categories,
|
||||
columns,
|
||||
voteOn,
|
||||
namedGroups,
|
||||
}) {
|
||||
const {
|
||||
name,
|
||||
description,
|
||||
category,
|
||||
points,
|
||||
votes,
|
||||
id,
|
||||
group,
|
||||
gitlink,
|
||||
} = card
|
||||
const voteable = columns[card.state].clickable
|
||||
|
||||
console.log(card)
|
||||
|
||||
// TODO: hide vote button if not voteable
|
||||
return (
|
||||
<div className={styles.container}>
|
||||
|
@ -27,6 +45,14 @@ export default function Todos({ card, userId, categories, columns, voteOn }) {
|
|||
</span>
|
||||
</div>
|
||||
<hr />
|
||||
{group && (
|
||||
<div className={styles.row}>
|
||||
<div>Csoport:</div>
|
||||
<div style={{ color: group }}>
|
||||
{namedGroups[group] ? namedGroups[group].name : group}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
<div className={styles.row} title={'Minél több a pont, annál nehezebb'}>
|
||||
<div>Nehézség:</div>
|
||||
<div>{points}</div>
|
||||
|
@ -39,6 +65,13 @@ export default function Todos({ card, userId, categories, columns, voteOn }) {
|
|||
<div>Szavazatok:</div>
|
||||
<div>{votes.length}</div>
|
||||
</div>
|
||||
{gitlink && (
|
||||
<div className={styles.row}>
|
||||
<a href={gitlink} target={'_blank'} rel={'noreferrer'}>
|
||||
Git link
|
||||
</a>
|
||||
</div>
|
||||
)}
|
||||
<hr />
|
||||
{description && (
|
||||
<>
|
||||
|
|
|
@ -152,6 +152,7 @@ export default function Todos() {
|
|||
userId={userId}
|
||||
categories={categories}
|
||||
columns={columns}
|
||||
namedGroups={namedGroups}
|
||||
voteOn={(card) => {
|
||||
fetch(`${constants.apiUrl}todos?id=${card.id}`, {
|
||||
credentials: 'include',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue