mirror of
https://github.com/LBRYFoundation/lbry.com.git
synced 2025-09-13 14:09:52 +00:00
Fix/292 roadmap render (#344)
* Change the media type from json to html + json * Date to quarter Asana
This commit is contained in:
parent
88739eb779
commit
2e1ebb3c4a
3 changed files with 14 additions and 3 deletions
9
lib/thirdparty/Asana.class.php
vendored
9
lib/thirdparty/Asana.class.php
vendored
|
@ -48,7 +48,8 @@ class Asana
|
||||||
'body' => nl2br($fullTask['notes']),
|
'body' => nl2br($fullTask['notes']),
|
||||||
'group' => $tagLabel,
|
'group' => $tagLabel,
|
||||||
'project_id' => $projectId,
|
'project_id' => $projectId,
|
||||||
'assignee' => $fullTask['assignee'] ? ucwords($fullTask['assignee']['name']) : ''
|
'assignee' => $fullTask['assignee'] ? ucwords($fullTask['assignee']['name']) : '',
|
||||||
|
'quarter_date' => 'Q' . self::dateToQuarter($fullTask['due_on']) . ' ' . (string) date('Y', strtotime($fullTask['due_on']))
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -89,6 +90,12 @@ class Asana
|
||||||
$responseData = CurlWithCache::get('https://app.asana.com/api/1.0' . $endpoint, $data, $options);
|
$responseData = CurlWithCache::get('https://app.asana.com/api/1.0' . $endpoint, $data, $options);
|
||||||
return $responseData['data'] ?? [];
|
return $responseData['data'] ?? [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Converts date to quarter
|
||||||
|
protected static function dateToQuarter($date)
|
||||||
|
{
|
||||||
|
return $quarter = (string)ceil(date('m', strtotime($date))/3);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class AsanaException extends Exception
|
class AsanaException extends Exception
|
||||||
|
|
4
lib/thirdparty/Github.class.php
vendored
4
lib/thirdparty/Github.class.php
vendored
|
@ -108,7 +108,7 @@ class Github
|
||||||
{
|
{
|
||||||
$twoHoursInSeconds = 7200;
|
$twoHoursInSeconds = 7200;
|
||||||
return CurlWithCache::get('https://api.github.com' . $endpoint . '?' . http_build_query($params), [],
|
return CurlWithCache::get('https://api.github.com' . $endpoint . '?' . http_build_query($params), [],
|
||||||
['user_agent' => 'LBRY', 'json_response' => true, 'cache' => $cache === true ? $twoHoursInSeconds : $cache]);
|
['headers' => ['Accept: application/vnd.github.v3.html+json'],'user_agent' => 'LBRY', 'json_response' => true, 'cache' => $cache === true ? $twoHoursInSeconds : $cache]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function listRoadmapChangesets($cache = true)
|
public static function listRoadmapChangesets($cache = true)
|
||||||
|
@ -163,7 +163,7 @@ class Github
|
||||||
'patch_version' => (int)isset($matches[3]) ? $matches[3] : 0,
|
'patch_version' => (int)isset($matches[3]) ? $matches[3] : 0,
|
||||||
'sort_key' => (int)$matches[1] * 1000000 + (int)$matches[2] * 1000 + (int)($matches[3] ?? 0),
|
'sort_key' => (int)$matches[1] * 1000000 + (int)$matches[2] * 1000 + (int)($matches[3] ?? 0),
|
||||||
'version' => $matches[1] . '.' . $matches[2] . '.' . (isset($matches[3]) ? $matches[3] : ''),
|
'version' => $matches[1] . '.' . $matches[2] . '.' . (isset($matches[3]) ? $matches[3] : ''),
|
||||||
'body' => ParsedownExtra::instance()->text($release['body'])
|
'body' => $release['body_html']
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,11 @@
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</h3>
|
</h3>
|
||||||
<div class="roadmap-item-date">
|
<div class="roadmap-item-date">
|
||||||
|
<?php if (isset($item['quarter_date'])): ?>
|
||||||
|
<?php echo $item['quarter_date'] ?>
|
||||||
|
<?php else: ?>
|
||||||
<?php echo $item['date'] ? date('m-d-Y', strtotime($item['date'])) : '' ?>
|
<?php echo $item['date'] ? date('m-d-Y', strtotime($item['date'])) : '' ?>
|
||||||
|
<?php endif ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="roadmap-item-content">
|
<div class="roadmap-item-content">
|
||||||
<?php echo $item['body'] ?: '<em class="no-results">No description</em>' ?>
|
<?php echo $item['body'] ?: '<em class="no-results">No description</em>' ?>
|
||||||
|
|
Loading…
Add table
Reference in a new issue