added Product::Pro Squad::Yellow scoped labels
added 2 commits
added 16 commits
- 05d2acc9...f0a2ec8a - 9 commits from branch
master
- e45b6a7c - (feat): Featured content entities
- 218a2fe9 - (feat): support filtering by hashtags
- b8d55a17 - (feat): Pro homepage content aggregator
- f62228be - (feat): Pro users to have up to 12 pinned posts
- 68c78916 - (wip): Pro standalone mode
- a045a6c7 - (feat): Pro Channel homepage categories endpoint
- 76af6b01 - Merge remote-tracking branch 'origin/master' into epic/minds-pro
Toggle commit list- 05d2acc9...f0a2ec8a - 9 commits from branch
78 80 */ 79 81 public static function pamCheck($request, $response) 80 82 { 81 if ( $request->getAttribute('oauth_user_id') 82 || Security\XSRF::validateRequest() 83 /** @var Domain $proDomain */ 84 $proDomain = Di::_()->get('Pro\Domain'); 85 86 if ( 87 $request->getAttribute('oauth_user_id') || 88 Security\XSRF::validateRequest() || 89 $proDomain->validateRequest($request) - Owner
can we move this to the next possible
elseif
block to detach from existing flow?
- Last updated by Emiliano Balbuena
2 /** 3 * @author: eiennohi. 4 */ 5 6 namespace Minds\Controllers\api\v2\feeds; 7 8 use Minds\Api\Exportable; 9 use Minds\Api\Factory; 10 use Minds\Common\Repository\Response; 11 use Minds\Core; 12 use Minds\Core\Di\Di; 13 use Minds\Entities\Factory as EntitiesFactory; 14 use Minds\Entities\User; 15 use Minds\Interfaces; 16 17 class channel implements Interfaces\Api - Owner
why do we have this when we could use
api/v2/feeds/container/...
? - Developer
There are several features that we're not using. We're going to strip out and move this endpoint to
/v2/pro/content
(or something similar).Edited by Emiliano Balbuena
- Last updated by Emiliano Balbuena
338 349 339 350 // 340 351 352 $esType = $opts['type']; 353 354 if ($esType === 'all') { 355 $esType = 'object:image,object:video,object:blog'; - Owner
activity?
- Developer
Actually, we should rename it to
object
because it's meant to retrieve only images, videos or blogs.
46 $this->user = $user; 47 return $this; 48 } 49 50 /** 51 * @return array 52 * @throws Exception 53 */ 54 public function getAllCategoriesContent() 55 { 56 if (!$this->user) { 57 throw new Exception('No user set'); 58 } 59 60 /** @var Settings $settings */ 61 $settings = $this->repository->getList([ - Owner
This looks to be returning settings, but I'd expect it to just return a pro channel entity as its in
Pro/Channel/Manager
? Perhaps this should be inPro/Settings/Manager
?
33 */ 34 public function onEnable(User $user) 35 { 36 /** @var Settings|null $settings */ 37 $settings = $this->repository 38 ->getList(['user_guid' => $user->guid]) 39 ->first(); 40 41 if (!$settings) { 42 $settings = new Settings(); 43 $settings 44 ->setUserGuid($user->guid); 45 } 46 47 if (!$settings->getDomain()) { 48 $settings->setDomain("pro-{$user->guid}.minds.com"); - Owner
perhaps minds.com should be coming from $CONFIG?
- Resolved by Emiliano Balbuena
118 /** 119 * @param Settings $settings 120 * @return bool 121 * @throws Exception 122 */ 123 public function add(Settings $settings) 124 { 125 if (!$settings->getUserGuid()) { 126 throw new Exception('Invalid user GUID'); 127 } 128 129 $cql = "INSERT INTO pro (user_guid, domain, json_data) VALUES (?, ?, ?)"; 130 $settings = [ 131 new Bigint($settings->getUserGuid()), 132 $settings->getDomain(), 133 json_encode([ - Owner
I think we do not want to use a JSON object here, but instead have explicit fields
171 { 172 if (!$settingsRef->getUserGuid()) { 173 throw new Exception('Invalid user GUID'); 174 } 175 176 $cql = "DELETE FROM pro WHERE user_guid = ?"; 177 $settingsRef = [ 178 new Bigint($settingsRef->getUserGuid()), 179 ]; 180 181 $prepared = new Custom(); 182 $prepared->query($cql, $settingsRef); 183 184 return (bool) $this->db->request($prepared, true); 185 } 186 } - Owner
Looks like we're missing the
get
function via urn?
1 <?php 2 /** 3 * Manager 4 * @author edgebal 5 */ 6 7 namespace Minds\Core\Router; 8 9 use Minds\Core\Router\Middleware; 10 use Zend\Diactoros\Response\JsonResponse; 11 use Zend\Diactoros\ServerRequest; 12 13 class Manager - Owner
is this PSR-7 compliant?
- Owner
Looks good so far from a quick run through. PHP7 return types would be awesome!
changed the description
closed