-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extracts the Dashboard routes #2075
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of Cachet. | ||
* | ||
* (c) Alt Three Services Limited | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace CachetHQ\Cachet\Http\Routes\Dashboard; | ||
|
||
use Illuminate\Contracts\Routing\Registrar; | ||
|
||
/** | ||
* This is the dashboard api routes class. | ||
* | ||
* @author James Brooks <james@alt-three.com> | ||
* @author Connor S. Parks <connor@connorvg.tv> | ||
*/ | ||
class ApiRoutes | ||
{ | ||
/** | ||
* Define the dashboard api routes. | ||
* | ||
* @param \Illuminate\Contracts\Routing\Registrar $router | ||
* | ||
* @return void | ||
*/ | ||
public function map(Registrar $router) | ||
{ | ||
$router->group([ | ||
'middleware' => ['web', 'auth'], | ||
'namespace' => 'Dashboard', | ||
'as' => 'dashboard.api.', | ||
'prefix' => 'dashboard/api', | ||
], function (Registrar $router) { | ||
$router->get('incidents/templates', 'ApiController@getIncidentTemplate'); | ||
$router->post('components/groups/order', 'ApiController@postUpdateComponentGroupOrder'); | ||
$router->post('components/order', 'ApiController@postUpdateComponentOrder'); | ||
$router->post('components/{component}', 'ApiController@postUpdateComponent'); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of Cachet. | ||
* | ||
* (c) Alt Three Services Limited | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace CachetHQ\Cachet\Http\Routes\Dashboard; | ||
|
||
use Illuminate\Contracts\Routing\Registrar; | ||
|
||
/** | ||
* This is the dashboard base routes class. | ||
* | ||
* @author James Brooks <james@alt-three.com> | ||
* @author Connor S. Parks <connor@connorvg.tv> | ||
*/ | ||
class BaseRoutes | ||
{ | ||
/** | ||
* Define the dashboard base routes. | ||
* | ||
* @param \Illuminate\Contracts\Routing\Registrar $router | ||
* | ||
* @return void | ||
*/ | ||
public function map(Registrar $router) | ||
{ | ||
$router->group(['middleware' => ['web', 'auth'], 'namespace' => 'Dashboard'], function (Registrar $router) { | ||
$router->get('admin', 'DashboardController@redirectAdmin'); | ||
|
||
$router->group(['prefix' => 'dashboard', 'as' => 'dashboard.'], function (Registrar $router) { | ||
$router->get('/', [ | ||
'as' => 'index', | ||
'uses' => 'DashboardController@showDashboard', | ||
]); | ||
}); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of Cachet. | ||
* | ||
* (c) Alt Three Services Limited | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace CachetHQ\Cachet\Http\Routes\Dashboard; | ||
|
||
use Illuminate\Contracts\Routing\Registrar; | ||
|
||
/** | ||
* This is the dashboard component routes class. | ||
* | ||
* @author James Brooks <james@alt-three.com> | ||
* @author Connor S. Parks <connor@connorvg.tv> | ||
*/ | ||
class ComponentRoutes | ||
{ | ||
/** | ||
* Define the dashboard component routes. | ||
* | ||
* @param \Illuminate\Contracts\Routing\Registrar $router | ||
* | ||
* @return void | ||
*/ | ||
public function map(Registrar $router) | ||
{ | ||
$router->group([ | ||
'middleware' => ['web', 'auth'], | ||
'namespace' => 'Dashboard', | ||
'as' => 'dashboard.components.', | ||
'prefix' => 'dashboard/components', | ||
], function (Registrar $router) { | ||
$router->get('/', [ | ||
'as' => 'index', | ||
'uses' => 'ComponentController@showComponents', | ||
]); | ||
$router->get('add', [ | ||
'as' => 'add', | ||
'uses' => 'ComponentController@showAddComponent', | ||
]); | ||
$router->post('add', 'ComponentController@createComponentAction'); | ||
$router->get('groups', [ | ||
'as' => 'groups', | ||
'uses' => 'ComponentController@showComponentGroups', | ||
]); | ||
$router->get('groups/add', [ | ||
'as' => 'groups.add', | ||
'uses' => 'ComponentController@showAddComponentGroup', | ||
]); | ||
$router->get('groups/edit/{component_group}', [ | ||
'as' => 'groups.edit', | ||
'uses' => 'ComponentController@showEditComponentGroup', | ||
]); | ||
$router->post('groups/edit/{component_group}', 'ComponentController@updateComponentGroupAction'); | ||
$router->delete('groups/{component_group}/delete', 'ComponentController@deleteComponentGroupAction'); | ||
$router->post('groups/add', 'ComponentController@postAddComponentGroup'); | ||
$router->get('{component}/edit', [ | ||
'as' => 'edit', | ||
'uses' => 'ComponentController@showEditComponent', | ||
]); | ||
$router->delete('{component}/delete', 'ComponentController@deleteComponentAction'); | ||
$router->post('{component}/edit', 'ComponentController@updateComponentAction'); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of Cachet. | ||
* | ||
* (c) Alt Three Services Limited | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace CachetHQ\Cachet\Http\Routes\Dashboard; | ||
|
||
use Illuminate\Contracts\Routing\Registrar; | ||
|
||
/** | ||
* This is the dashboard incident routes class. | ||
* | ||
* @author James Brooks <james@alt-three.com> | ||
* @author Connor S. Parks <connor@connorvg.tv> | ||
*/ | ||
class IncidentRoutes | ||
{ | ||
/** | ||
* Define the dashboard incident routes. | ||
* | ||
* @param \Illuminate\Contracts\Routing\Registrar $router | ||
* | ||
* @return void | ||
*/ | ||
public function map(Registrar $router) | ||
{ | ||
$router->group([ | ||
'middleware' => ['web', 'auth'], | ||
'namespace' => 'Dashboard', | ||
'as' => 'dashboard.incidents.', | ||
'prefix' => 'dashboard/incidents', | ||
], function (Registrar $router) { | ||
$router->get('/', [ | ||
'as' => 'index', | ||
'uses' => 'IncidentController@showIncidents', | ||
]); | ||
$router->get('add', [ | ||
'as' => 'add', | ||
'uses' => 'IncidentController@showAddIncident', | ||
]); | ||
$router->post('add', 'IncidentController@createIncidentAction'); | ||
$router->delete('{incident}/delete', [ | ||
'as' => 'delete', | ||
'uses' => 'IncidentController@deleteIncidentAction', | ||
]); | ||
$router->get('{incident}/edit', [ | ||
'as' => 'edit', | ||
'uses' => 'IncidentController@showEditIncidentAction', | ||
]); | ||
$router->post('{incident}/edit', 'IncidentController@editIncidentAction'); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of Cachet. | ||
* | ||
* (c) Alt Three Services Limited | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace CachetHQ\Cachet\Http\Routes\Dashboard; | ||
|
||
use Illuminate\Contracts\Routing\Registrar; | ||
|
||
/** | ||
* This is the dashboard metric routes class. | ||
* | ||
* @author James Brooks <james@alt-three.com> | ||
* @author Connor S. Parks <connor@connorvg.tv> | ||
*/ | ||
class MetricRoutes | ||
{ | ||
/** | ||
* Define the dashboard metric routes. | ||
* | ||
* @param \Illuminate\Contracts\Routing\Registrar $router | ||
* | ||
* @return void | ||
*/ | ||
public function map(Registrar $router) | ||
{ | ||
$router->group([ | ||
'middleware' => ['web', 'auth'], | ||
'namespace' => 'Dashboard', | ||
'as' => 'dashboard.metrics.', | ||
'prefix' => 'dashboard/metrics', | ||
], function (Registrar $router) { | ||
$router->get('/', [ | ||
'as' => 'index', | ||
'uses' => 'MetricController@showMetrics', | ||
]); | ||
$router->get('add', [ | ||
'as' => 'add', | ||
'uses' => 'MetricController@showAddMetric', | ||
]); | ||
$router->post('add', 'MetricController@createMetricAction'); | ||
$router->delete('{metric}/delete', 'MetricController@deleteMetricAction'); | ||
$router->get('{metric}/edit', [ | ||
'as' => 'edit', | ||
'uses' => 'MetricController@showEditMetricAction', | ||
]); | ||
$router->post('{metric}/edit', 'MetricController@editMetricAction'); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of Cachet. | ||
* | ||
* (c) Alt Three Services Limited | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace CachetHQ\Cachet\Http\Routes\Dashboard; | ||
|
||
use Illuminate\Contracts\Routing\Registrar; | ||
|
||
/** | ||
* This is the dashboard schedule routes class. | ||
* | ||
* @author James Brooks <james@alt-three.com> | ||
* @author Connor S. Parks <connor@connorvg.tv> | ||
*/ | ||
class ScheduleRoutes | ||
{ | ||
/** | ||
* Define the dashboard schedule routes. | ||
* | ||
* @param \Illuminate\Contracts\Routing\Registrar $router | ||
* | ||
* @return void | ||
*/ | ||
public function map(Registrar $router) | ||
{ | ||
$router->group([ | ||
'middleware' => ['web', 'auth'], | ||
'namespace' => 'Dashboard', | ||
'as' => 'dashboard.schedule.', | ||
'prefix' => 'dashboard/schedule', | ||
], function (Registrar $router) { | ||
$router->get('/', [ | ||
'as' => 'index', | ||
'uses' => 'ScheduleController@showIndex', | ||
]); | ||
$router->get('add', [ | ||
'as' => 'add', | ||
'uses' => 'ScheduleController@showAddSchedule', | ||
]); | ||
$router->post('add', 'ScheduleController@addScheduleAction'); | ||
$router->get('{incident}/edit', [ | ||
'as' => 'edit', | ||
'uses' => 'ScheduleController@showEditSchedule', | ||
]); | ||
$router->post('{incident}/edit', 'ScheduleController@editScheduleAction'); | ||
$router->delete('{incident}/delete', [ | ||
'as' => 'delete', | ||
'uses' => 'ScheduleController@deleteScheduleAction', | ||
]); | ||
}); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably a better way to do this. I might just change it after merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I was unsure where to go on this. So I went trusty
GLOB_BRACE
for one/two depth routes. Would probably be nicer going finder but w/e.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll probably make a small package to do this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While you're at it. Make your analysis test trait a package 😁
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It already is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/AltThree/TestBench/blob/master/src/AnalysisTrait.php
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😱