Skip to content

Next

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
Minds Backend - Engine
Minds Backend - Engine
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
    • Insights
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
    • Locked Files
  • Issues 242
    • Issues 242
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 31
    • Merge Requests 31
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Security & Compliance
    • Security & Compliance
    • Dependency List
  • Packages
    • Packages
    • List
    • Container Registry
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Minds
  • Minds Backend - EngineMinds Backend - Engine
  • Merge Requests
  • !291

Closed
Opened 3 weeks ago by Emiliano Balbuena@edgebal
  • Report abuse
Report abuse

WIP: Minds Pro (stable branch)

Depends on front!481 (closed)

Edited 1 week ago by Mark Harding

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch origin
git checkout -b minds-pro-stable origin/minds-pro-stable

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git fetch origin
git checkout origin/master
git merge --no-ff minds-pro-stable

Step 4. Push the result of the merge to GitLab

git push origin master

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

Request to merge minds-pro-stable into master
  • Email patches
  • Plain diff
Pipeline #77407428 passed for 76af6b01 on minds-pro-stable
          Requires 2 more approvals from Devs and Deployers.
          Brian Hatchet
          Brian Hatchet
          Mark Harding
          Mark Harding
          Martin Santangelo
          Martin Santangelo
          Marcelo Rivera
          Marcelo Rivera
          Rami Albatal
          Rami Albatal

          Closed by Emiliano Balbuena 27 minutes ago

          The changes were not merged into master

          Deletes source branch

          • Discussion 13
          • Commits 24
          • Pipelines 3
          • Changes 28
          1/9 threads resolved
          • Loading...
          • Emiliano Balbuena @edgebal added Product::Pro Squad::Yellow scoped labels 3 weeks ago

            added Product::Pro Squad::Yellow scoped labels

          • Emiliano Balbuena @edgebal added 2 commits 3 weeks ago

            added 2 commits

            • 3c6712f0 - (feat): Tag list for Pro
            • 05d2acc9 - (feat): Scheme settings

            Compare with previous version

          • Emiliano Balbuena @edgebal added 16 commits 1 week ago

            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

            Compare with previous version

            Toggle commit list
          • Mark Harding
            Mark Harding @markeharding started a thread on the diff 1 week ago
            Api/Factory.php
            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)
            • Mark Harding
              Mark Harding @markeharding · 1 week ago
              Owner

              can we move this to the next possible elseif block to detach from existing flow?

            • Please register or sign in to reply
          • Mark Harding
            Mark Harding @markeharding started a thread on the diff 1 week ago
            Last updated by Emiliano Balbuena 6 days ago
            Controllers/api/v2/feeds/channel.php
            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
            • Mark Harding
              Mark Harding @markeharding · 1 week ago
              Owner

              why do we have this when we could use api/v2/feeds/container/...?

            • Emiliano Balbuena
              Emiliano Balbuena @edgebal · 6 days ago
              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 6 days ago
            • Please register or sign in to reply
          • Mark Harding
            Mark Harding @markeharding started a thread on the diff 1 week ago
            Last updated by Emiliano Balbuena 6 days ago
            Core/Feeds/Top/Repository.php
            338 349
            339 350 //
            340 351
            352 $esType = $opts['type'];
            353
            354 if ($esType === 'all') {
            355 $esType = 'object:image,object:video,object:blog';
            • Mark Harding
              Mark Harding @markeharding · 1 week ago
              Owner

              activity?

            • Emiliano Balbuena
              Emiliano Balbuena @edgebal · 6 days ago
              Developer

              Actually, we should rename it to object because it's meant to retrieve only images, videos or blogs.

            • Please register or sign in to reply
          • Mark Harding
            Mark Harding @markeharding started a thread on the diff 1 week ago
            Core/Pro/Channel/Manager.php
            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([
            • Mark Harding
              Mark Harding @markeharding · 1 week ago
              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 in Pro/Settings/Manager?

            • Please register or sign in to reply
          • Mark Harding
            Mark Harding @markeharding started a thread on the diff 1 week ago
            Core/Pro/Delegates/InitializeSettingsDelegate.php
            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");
            • Mark Harding
              Mark Harding @markeharding · 1 week ago
              Owner

              perhaps minds.com should be coming from $CONFIG?

            • Please register or sign in to reply
          • Mark Harding
            Mark Harding @markeharding started a thread on the diff 1 week ago
            Resolved by Emiliano Balbuena 6 days ago
          • Mark Harding
            Mark Harding @markeharding started a thread on the diff 1 week ago
            Core/Pro/Repository.php
            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([
            • Mark Harding
              Mark Harding @markeharding · 1 week ago
              Owner

              I think we do not want to use a JSON object here, but instead have explicit fields

            • Please register or sign in to reply
          • Mark Harding
            Mark Harding @markeharding started a thread on the diff 1 week ago
            Core/Pro/Repository.php
            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 }
            • Mark Harding
              Mark Harding @markeharding · 1 week ago
              Owner

              Looks like we're missing the get function via urn?

            • Please register or sign in to reply
          • Mark Harding
            Mark Harding @markeharding started a thread on the diff 1 week ago
            Core/Router/Manager.php
            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
            • Mark Harding
              Mark Harding @markeharding · 1 week ago
              Owner

              is this PSR-7 compliant?

            • Please register or sign in to reply
          • Mark Harding
            Mark Harding @markeharding · 1 week ago
            Owner

            Looks good so far from a quick run through. PHP7 return types would be awesome!

          • Mark Harding @markeharding changed the description 1 week ago

            changed the description

          • Emiliano Balbuena @edgebal closed 27 minutes ago

            closed

          • You're only seeing other activity in the feed. To add a comment, switch to one of the following options.
          Please register or sign in to reply
          Assignee
          Emiliano Balbuena's avatar
          Emiliano Balbuena @edgebal
          Assign to
          None
          Milestone
          None
          Assign milestone
          None
          Time tracking
          No estimate or time spent
          2
          Labels
          Product::Pro Squad::Yellow
          Assign labels
          • View project labels
          Lock merge request
          Unlocked
          7
          7 participants
          user avatar
          Brian Hatchet
          user avatar
          Mark Harding
          user avatar
          Martin Santangelo
          user avatar
          Marcelo Rivera
          user avatar
          Rami Albatal
          user avatar
          Ben Hayward
          user avatar
          Emiliano Balbuena
          Reference: minds/engine!291