add tags display
This commit is contained in:
parent
26c535c419
commit
70edd998ed
@ -57,6 +57,17 @@ const KanbanCard = ({
|
||||
iconClassName={'w-5'}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{item.tags && item.tags.length > 0 && (
|
||||
<div className="flex flex-wrap mt-2">
|
||||
{item.tags.map((tag: any) => (
|
||||
<span key={tag.id} className="text-xs bg-blue-200 text-blue-800 rounded px-1 py-0.5 mr-1 mb-1">
|
||||
{tag.name}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@ -90,7 +90,7 @@ const KanbanColumn = ({
|
||||
|
||||
const loadData = useCallback(
|
||||
(page: number, filters = '') => {
|
||||
const query = `?page=${page}&limit=${perPage}&field=createdAt&sort=desc&${columnFieldName}=${column.id}&${filters}`;
|
||||
const query = `?page=${page}&limit=${perPage}&populate=tags&field=createdAt&sort=desc&${columnFieldName}=${column.id}&${filters}`;
|
||||
setLoading(true);
|
||||
Axios.get(`${entityName}${query}`)
|
||||
.then((res) => {
|
||||
|
||||
@ -162,16 +162,20 @@ const CardTasks = ({
|
||||
</dd>
|
||||
</div>
|
||||
|
||||
<div className='flex justify-between gap-x-4 py-3'>
|
||||
<dt className=' text-gray-500 dark:text-dark-600'>Tags</dt>
|
||||
<dt className='text-gray-500 dark:text-dark-600'>Tags</dt>
|
||||
<dd className='flex items-start gap-x-2'>
|
||||
<div className='font-medium line-clamp-4'>
|
||||
{dataFormatter
|
||||
.tagsManyListFormatter(item.tags)
|
||||
.join(', ')}
|
||||
<div className='flex flex-wrap gap-1'>
|
||||
{item.tags && item.tags.length > 0 ? (
|
||||
item.tags.map((tag) => (
|
||||
<span key={tag.id || tag.name} className="bg-blue-100 text-blue-800 text-xs font-medium px-2.5 py-0.5 rounded-full">
|
||||
{tag.name}
|
||||
</span>
|
||||
))
|
||||
) : (
|
||||
<span className='font-medium'>No Tags</span>
|
||||
)}
|
||||
</div>
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</li>
|
||||
))}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user