Skip to content

Commit

Permalink
Merge branch 'release/2.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
adrenth committed Apr 10, 2020
2 parents 7d9f345 + 5e466d4 commit 65e1e23
Show file tree
Hide file tree
Showing 16 changed files with 75 additions and 17 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 2.2.0

* Add "Cache-Control: no-store" header. This will prevent (modern) web browsers to cache the redirects. Very convenient when testing your redirects.
* Add extra tab "Event logs" to Redirect update page. This tab shows a list with the related event logs of the redirect.
* UI improvements

# 2.1.1

* Update CHANGELOG
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Vdlp.Redirect

> **IMPORTANT**: This plugin was formerly known as `Adrenth.Redirect`. The plugin has been renamed to `Vdlp.Redirect`. Please install this plugin which automatically migrates data and settings from `Adrenth.Redirect`. The current version of `Adrenth.Redirect` will stay available for users which have it installed, but will be hidden from the October CMS marketplace. Upgrade to `Vdlp.Redirect` as soon as possible.
> **IMPORTANT**: As of version 2.0 PHP 7.0 support is dropped.
> This plugin was formerly known as `Adrenth.Redirect`. The plugin has been renamed to `Vdlp.Redirect`. Please install this plugin which automatically migrates data and settings from `Adrenth.Redirect`. The current version of `Adrenth.Redirect` will stay available for users which have it installed, but will be hidden from the October CMS marketplace. Upgrade to `Vdlp.Redirect` as soon as possible.
## The #1 Redirect plugin for October CMS

Expand Down Expand Up @@ -37,14 +39,14 @@ This plugin adds a 'Redirects' section to the main menu of October CMS. This plu
* Number of redirects per month
* And more...
* Multilingual ***(Need help translating! Contact us at [email protected])***
* Supports MySQL, SQLite and PostgreSQL
* Supports MySQL, SQLite and Postgres
* HTTP status codes 301, 302, 303, 404, 410
* Caching

## Supported database platforms

* MySQL
* PostgreSQL
* Postgres
* SQLite

## PHP requirements
Expand Down
5 changes: 5 additions & 0 deletions assets/css/redirect.css
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,8 @@ div.actions .btn {
.scoreboard-item.title-value p {
font-size: 20px;
}

ul.nav li a:focus, table.data tr:focus {
outline:0 !important;
box-shadow: none !important;
}
1 change: 1 addition & 0 deletions classes/RedirectManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ public function redirectWithRule(RedirectRule $rule, string $requestUri): void
header(self::$headers[$statusCode], true, $statusCode);
header('X-Redirect-By: Vdlp.Redirect');
header('X-Redirect-Id: ' . $rule->getId());
header('Cache-Control: no-store');
header('Location: ' . $toUrl, true, $statusCode);

exit(0);
Expand Down
2 changes: 2 additions & 0 deletions controllers/Categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ public function __construct()
{
parent::__construct();

$this->addCss('/plugins/vdlp/redirect/assets/css/redirect.css');

BackendMenu::setContext('Vdlp.Redirect', 'redirect', 'categories');
}
}
2 changes: 2 additions & 0 deletions controllers/Logs.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ public function __construct(Request $request, Translator $translator, LoggerInte

BackendMenu::setContext('Vdlp.Redirect', 'redirect', 'logs');

$this->addCss('/plugins/vdlp/redirect/assets/css/redirect.css');

$this->request = $request;
$this->translator = $translator;
$this->flash = resolve('flash');
Expand Down
11 changes: 9 additions & 2 deletions controllers/Redirects.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
* @mixin Behaviors\ListController
* @mixin Behaviors\ReorderController
* @mixin Behaviors\ImportExportController
* @mixin Behaviors\RelationController
*/
final class Redirects extends Controller
{
Expand All @@ -45,7 +46,8 @@ final class Redirects extends Controller
Behaviors\FormController::class,
Behaviors\ListController::class,
Behaviors\ReorderController::class,
Behaviors\ImportExportController::class
Behaviors\ImportExportController::class,
Behaviors\RelationController::class,
];

/**
Expand All @@ -71,6 +73,11 @@ final class Redirects extends Controller
*/
public $importExportConfig = 'config_import_export.yaml';

/**
* @var string
*/
public $relationConfig = 'config_relation.yaml';

/**
* {@inheritDoc}
*/
Expand Down Expand Up @@ -115,7 +122,7 @@ public function __construct(

BackendMenu::setContext('Vdlp.Redirect', 'redirect', $sideMenuItemCode);

$this->addCss('/plugins/vdlp/redirect/assets/css/redirect.css', 'Vdlp.Redirect');
$this->addCss('/plugins/vdlp/redirect/assets/css/redirect.css');

$this->vars['match'] = null;
$this->vars['statisticsHelper'] = new StatisticsHelper();
Expand Down
1 change: 1 addition & 0 deletions controllers/Statistics.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public function __construct()
$this->addJs('https://cdnjs.cloudflare.com/ajax/libs/vis/4.21.0/vis.min.js');
$this->addCss('https://cdnjs.cloudflare.com/ajax/libs/vis/4.21.0/vis.min.css');
$this->addJs('/plugins/vdlp/redirect/assets/javascript/statistics.js');
$this->addCss('/plugins/vdlp/redirect/assets/css/redirect.css');
$this->addCss('/plugins/vdlp/redirect/assets/css/statistics.css');

$this->helper = new StatisticsHelper();
Expand Down
5 changes: 3 additions & 2 deletions controllers/TestLab.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ public function index(): void
{
$this->pageTitle = 'vdlp.redirect::lang.title.test_lab';

$this->addCss('/plugins/vdlp/redirect/assets/css/test-lab.css', 'Vdlp.Redirect');
$this->addJs('/plugins/vdlp/redirect/assets/javascript/test-lab.js', 'Vdlp.Redirect');
$this->addCss('/plugins/vdlp/redirect/assets/css/redirect.css');
$this->addCss('/plugins/vdlp/redirect/assets/css/test-lab.css');
$this->addJs('/plugins/vdlp/redirect/assets/javascript/test-lab.js');

$this->vars['redirectCount'] = $this->getRedirectCount();
}
Expand Down
1 change: 1 addition & 0 deletions controllers/redirects/_tab_logs.htm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?= $this->relationRender('logs') ?>
13 changes: 13 additions & 0 deletions controllers/redirects/config_relation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# ===================================
# Relation Behavior Config
# ===================================

logs:
label: Log
view:
list: $/vdlp/redirect/models/redirectlog/columns.yaml
toolbarButtons: delete
showSearch: true
showSorting: true
recordsPerPage: 10
defaultSort: date_time
7 changes: 4 additions & 3 deletions lang/en/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
'categories' => 'Manage categories',
'create_category' => 'Create category',
'edit_category' => 'Edit category',
'view_redirect_log' => 'View redirect log',
'view_redirect_log' => 'Event log',
'statistics' => 'Statistics',
'test_lab' => 'TestLab (beta)',
],
Expand All @@ -228,8 +228,8 @@
'categories' => 'Categories',
'new_category' => 'New category',
'reset_statistics' => 'Reset statistics',
'logs' => 'Redirect log',
'empty_redirect_log' => 'Empty redirect log',
'logs' => 'Event log',
'empty_redirect_log' => 'Empty event log',
'clear_cache' => 'Clear cache',
'stop' => 'Stop',
'reset_all' => 'Reset statistics for all redirects',
Expand All @@ -243,6 +243,7 @@
'tab_scheduling' => 'Scheduling',
'tab_test_lab' => 'TestLab',
'tab_advanced' => 'Advanced',
'tab_logs' => 'Event log',
],
'flash' => [
'success_created_redirects' => 'Successfully created :count redirects',
Expand Down
7 changes: 4 additions & 3 deletions lang/nl/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@
'categories' => 'Beheer categorieën',
'create_category' => 'Maak category',
'edit_category' => 'Bewerk category',
'view_redirect_log' => 'Toon redirect log',
'view_redirect_log' => 'Logboek',
'statistics' => 'Statistieken',
'test_lab' => 'TestLab (beta)',
],
Expand All @@ -223,8 +223,8 @@
'categories' => 'Categorieën',
'new_category' => 'Nieuwe category',
'reset_statistics' => 'Herstel statistieken',
'logs' => 'Redirect log',
'empty_redirect_log' => 'Leeg redirect log',
'logs' => 'Logboek',
'empty_redirect_log' => 'Leeg logboek',
'clear_cache' => 'Leeg cache',
'stop' => 'Stop',
'reset_all' => 'Alle statistische informatie wissen',
Expand All @@ -238,6 +238,7 @@
'tab_scheduling' => 'Tijdschema',
'tab_test_lab' => 'TestLab',
'tab_advanced' => 'Geavanceerd',
'tab_logs' => 'Logboek',
],
'flash' => [
'success_created_redirects' => 'Er zijn :count redirect(s) gecreëerd', // since 2.0.3
Expand Down
1 change: 1 addition & 0 deletions models/Redirect.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ final class Redirect extends Model
*/
public $hasMany = [
'clients' => Client::class,
'logs' => RedirectLog::class,
];

/**
Expand Down
20 changes: 16 additions & 4 deletions models/redirect/fields.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,22 @@ fields:
dependsOn:
- target_type
- status_code

tabs:
defaultTab: vdlp.redirect::lang.tab.tab_general
lazy:
- vdlp.redirect::lang.tab.tab_logs
icons:
vdlp.redirect::lang.tab.tab_general: icon-mouse-pointer
vdlp.redirect::lang.tab.tab_requirements:
vdlp.redirect::lang.tab.tab_test: icon-bug
vdlp.redirect::lang.tab.tab_scheduling: icon-calendar-o
vdlp.redirect::lang.tab.tab_test_lab: icon-flask
vdlp.redirect::lang.tab.tab_advanced: icon-cog
vdlp.redirect::lang.tab.tab_logs: icon-file-text-o
fields:
#
# General
#

is_enabled:
label: vdlp.redirect::lang.redirect.enabled
comment: vdlp.redirect::lang.redirect.enabled_comment
Expand All @@ -94,7 +102,6 @@ tabs:
type: text
span: right
context: update

#
# Requirements
#
Expand Down Expand Up @@ -194,6 +201,12 @@ tabs:
field: match_type
condition: value[placeholders]
#
# Logs
#
tab_logs:
tab: vdlp.redirect::lang.tab.tab_logs
type: partial
#
# Advanced
#
from_scheme:
Expand Down Expand Up @@ -221,7 +234,6 @@ tabs:
https: https
auto: vdlp.redirect::lang.redirect.scheme_auto
dependsOn: status_code

secondaryTabs:
fields:
_statistics@update:
Expand Down
2 changes: 2 additions & 0 deletions updates/version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,5 @@
- "Added support for October CMS L6 build, improved caching and more -- See: https://github.com/vdlp/oc-redirect-plugin/releases/tag/2.1.0"
2.1.1:
- "Update CHANGELOG"
2.2.0:
- "Add cache control header and UI improvements -- See: https://github.com/vdlp/oc-redirect-plugin/releases/tag/2.2.0"

0 comments on commit 65e1e23

Please sign in to comment.