Skip to content
Snippets Groups Projects
Commit e7fd0030 authored by Chris Wells's avatar Chris Wells Committed by Tim Plunkett
Browse files

Issue #3274897 by chrisfromredfin, tim.plunkett, fjgarlin: Resolve API naming

parent f4cffb3c
No related branches found
No related tags found
No related merge requests found
......@@ -97,8 +97,8 @@ like React or Vue.
### Project Browser
1. Add testing!
1. Add a lightbox to view multiple project images as full screen carousel
1. Fire event in DrupalOrgProxy allowing query to be modified before request to D.O.
1. Fire event in DrupalOrgProxy allowing projects to be modified sending response.
1. Fire event in ProjectBrowserEndpointController allowing query to be modified before request to D.O.
1. Fire event in ProjectBrowserEndpointController allowing projects to be modified sending response.
1. Move project to project_browser module namespace on Drupal.org.
1. Add a bunch of filters to the project browser as an advanced search option.
1. Add a "curated" or "suggested" modules section on top of the full module list.
......
......@@ -2,7 +2,7 @@ project_browser.api_project_get_all:
path: '/drupal-org-proxy/project'
methods: [GET]
defaults:
_controller: '\Drupal\project_browser\Controller\DrupalOrgProxyController::getAllProjects'
_controller: '\Drupal\project_browser\Controller\ProjectBrowserEndpointController::getAllProjects'
_title: 'Get all projects'
requirements:
_permission: 'administer modules'
......@@ -12,7 +12,7 @@ project_browser.api_project_get_releases:
path: '/drupal-org-proxy/project/releases'
methods: [GET]
defaults:
_controller: '\Drupal\project_browser\Controller\DrupalOrgProxyController::getProjectReleases'
_controller: '\Drupal\project_browser\Controller\ProjectBrowserEndpointController::getProjectReleases'
_title: 'Get all project releases'
requirements:
_permission: 'administer modules'
......
......@@ -20,7 +20,7 @@ use Symfony\Component\HttpFoundation\Response;
/**
* Controller for the proxy layer.
*/
class DrupalOrgProxyController extends ControllerBase {
class ProjectBrowserEndpointController extends ControllerBase {
/**
* A logger instance.
......@@ -63,7 +63,7 @@ class DrupalOrgProxyController extends ControllerBase {
protected $database;
/**
* DrupalOrgProxyController constructor.
* ProjectBrowserEndpointController constructor.
*
* @param \Psr\Log\LoggerInterface $logger
* A logger instance.
......
......@@ -7,7 +7,7 @@ use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Plugin\PluginBase;
use Drupal\project_browser\DrupalOrg\Taxonomy\MaintenanceStatus;
use Drupal\project_browser\Plugin\ProjectBrowserSourceInterface;
use Drupal\project_browser\ProjectBrowser\ProjectList;
use Drupal\project_browser\ProjectBrowser\Project;
use Drupal\project_browser\ProjectBrowser\ProjectsResultsPage;
use Psr\Log\LoggerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
......@@ -77,11 +77,11 @@ class MockDrupalDotOrg extends PluginBase implements ProjectBrowserSourceInterfa
$api_response = $this->fetchProjects($query);
// Iterate through and turn each into a
// \Drupal\project_browser\ProjectBrowser\ProjectList.
// \Drupal\project_browser\ProjectBrowser\Project.
$returned_list = [];
if ($api_response) {
foreach ($api_response['list'] as $project) {
$returned_list[] = new ProjectList($project);
$returned_list[] = new Project($project);
}
}
......
......@@ -14,7 +14,7 @@ use Drupal\Component\Utility\Unicode;
*
* These properties will be exposed to the frontend.
*/
class ProjectList implements ProjectListInterface {
class Project implements ProjectInterface {
/**
* Constructor.
......
......@@ -5,7 +5,7 @@ namespace Drupal\project_browser\ProjectBrowser;
/**
* Defines an interface for API parameters.
*/
interface ProjectListInterface {
interface ProjectInterface {
/**
* Author of Project.
......
......@@ -17,7 +17,7 @@ class ProjectsResultsPage {
* List of projects for one page of the query.
*
* @var array
* An array of \Drupal\project_browser\ProjectBrowser\ProjectList
* An array of \Drupal\project_browser\ProjectBrowser\Project
*/
public $list = [];
......
......@@ -34,7 +34,7 @@
async function load(_page) {
loading = true;
rowsCount = 0;
// Additional query parameters are hardcoded in DrupalOrgProxyController::getAll();
// Additional query parameters are hardcoded in ProjectBrowserEndpointController::getAll();
let url = drupalSettings.project_browser.origin_url + "/drupal-org-proxy/project?page=" + _page + "&limit=" + pageSize + "&tab=" + tab + "&sort=" + sort + "&direction=" + direction;
if (text) {
url = url + "&title=" + text;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment