Compare commits

..
1 Commits
Author SHA1 Message Date
deploy-bot d94473aff6 v0.10.0 2026-12-06 12:23:34 +00:00
26 changed files with 8 additions and 203 deletions

No files matched your search

-6
View File
@@ -4,12 +4,6 @@ Every release has a section here, named after its version (for example `v0.1.0 -
heading). The release pull request to `production` is stopped by PR CI when its section is missing, and the text of heading). The release pull request to `production` is stopped by PR CI when its section is missing, and the text of
the section is the text of the release in Gitea. the section is the text of the release in Gitea.
## v0.11.0 - 2026-12-06
- **Every module has a layer.** Core (`users`, `media`, `settings`, `audit`, `system`), content (`pages`, `posts`, `resources`, `revisions`), add-on (`leads`, `reviews`, `statistics`, `sharing`) and integration (`iriksit`), with `tier()` on the module (a module of a site that does not say is an add-on). A test fails the build when a module uses a layer it may not use. See ADR-0017 and "Layers of the manager" in the README.
- **The audit log is part of the core.** It is on by default for every site: who logged in, which actions were done, and the bans. A site can still say `'audit' => false`. On the web it stays off until its tables exist, so a site that updates and has not run `php artisan migrate` yet keeps working; run it to get the log.
- **The settings screen has no switch for the core**, and the switches for the rest are grouped as Content, Add-ons and "For customers of Iriks-IT".
## v0.10.0 - 2026-12-06 ## v0.10.0 - 2026-12-06
- **Laravel's own settings are on the settings screen.** The name, address, time zone and language of the site; the mail (how it is sent, from address and name, the SMTP server with port, secure connection, account and password) with a **Try it** button that sends a test mail to your own address; where the log goes; and the environment and debug mode. A change to the site or the mail works at once; the time zone and language are set on the running app, and the mailer is built again with the new values. - **Laravel's own settings are on the settings screen.** The name, address, time zone and language of the site; the mail (how it is sent, from address and name, the SMTP server with port, secure connection, account and password) with a **Try it** button that sends a test mail to your own address; where the log goes; and the environment and debug mode. A change to the site or the mail works at once; the time zone and language are set on the running app, and the mailer is built again with the new values.
-13
View File
@@ -315,19 +315,6 @@ const background = { none: '', sand: 'bg-sand-100', dark: 'bg-stone-900 text-whi
Write each class in full (Tailwind only finds classes that are spelled out in a file it scans), and a component of your own declares `style` in `defineProps`, or Vue puts it on the element as inline style. Write each class in full (Tailwind only finds classes that are spelled out in a file it scans), and a component of your own declares `style` in `defineProps`, or Vue puts it on the element as inline style.
## Layers of the manager
Every module belongs to a layer (`Support\Tier`, ADR-0017), and the layers say what a site can rely on:
| Layer | Modules | |
|---|---|---|
| core | `users`, `media`, `settings`, `audit`, `system` | On for every site, no switch on the settings screen. A core module uses nothing of another layer. |
| content | `pages`, `posts`, `resources`, `revisions` | The text and pictures of the site. May use the core. |
| add-on | `leads`, `reviews`, `statistics`, `sharing` | Optional, of general use. May use the core and content. |
| integration | `iriksit` | For customers of Iriks-IT; may use the core and content. |
A module of your own says its layer with `public function tier(): string` (`Tier::ADDON` when it does not). A test fails the build when a module uses a layer it may not. The audit log is part of the core: it is on unless a site says `'audit' => false`, and on the web it waits for its tables (`php artisan migrate`).
## Settings module ## Settings module
> Where this is going (Laravel's own settings, tiers of core and add-ons): `docs/vision.md`, ADR-0017 and ADR-0018. > Where this is going (Laravel's own settings, tiers of core and add-ons): `docs/vision.md`, ADR-0017 and ADR-0018.
+1 -1
View File
@@ -83,7 +83,7 @@ return [
'pages' => env('MANAGER_PAGES', true), 'pages' => env('MANAGER_PAGES', true),
'posts' => env('MANAGER_POSTS', true), 'posts' => env('MANAGER_POSTS', true),
'reviews' => env('MANAGER_REVIEWS', false), 'reviews' => env('MANAGER_REVIEWS', false),
'audit' => env('MANAGER_AUDIT', true), 'audit' => env('MANAGER_AUDIT', false),
'statistics' => env('MANAGER_STATISTICS', false), 'statistics' => env('MANAGER_STATISTICS', false),
'resources' => true, 'resources' => true,
'revisions' => env('MANAGER_REVISIONS', true), 'revisions' => env('MANAGER_REVISIONS', true),
+3 -2
View File
@@ -30,7 +30,7 @@ website, media, the IriksIT API and login.
| Tier proposed | Modules | Remark | | Tier proposed | Modules | Remark |
|---|---|---| |---|---|---|
| core | `users`, `settings`, `media`, `audit`, `system` | Decided on 6 December 2026: core, on by default (v0.11.0). | | core | `users`, `settings`, `media`, `audit`, `system` | `audit` is off by default today; making it core changes that, so it needs a decision. |
| content | `pages`, `posts`, `resources`, `revisions` | The page builder (blocks, preview, frontend mode) is the biggest piece of this tier. | | content | `pages`, `posts`, `resources`, `revisions` | The page builder (blocks, preview, frontend mode) is the biggest piece of this tier. |
| add-on | `leads`, `reviews`, `statistics`, `sharing`, `numbers`, `updates` | `sharing` needs `posts`; `numbers` needs `statistics`. | | add-on | `leads`, `reviews`, `statistics`, `sharing`, `numbers`, `updates` | `sharing` needs `posts`; `numbers` needs `statistics`. |
| integration | `support`, `costs`, the media disk `iriksit` | Tied to the IriksIT API (tickets, prices, files). | | integration | `support`, `costs`, the media disk `iriksit` | Tied to the IriksIT API (tickets, prices, files). |
@@ -78,7 +78,7 @@ Each step is a release branch with its own pull requests; nothing here is built
1. **v0.10.0, settings.** The definitions get `store` and `level`; the catalogue of ADR-0018 (Site, Mail with a test mail, Application, Logging), the right `settings.system`, 1. **v0.10.0, settings.** The definitions get `store` and `level`; the catalogue of ADR-0018 (Site, Mail with a test mail, Application, Logging), the right `settings.system`,
the screen shows where a value comes from, and `manager:settings` knows the new groups. Tests for every level and for the mail check. the screen shows where a value comes from, and `manager:settings` knows the new groups. Tests for every level and for the mail check.
2. **v0.11.0, tiers (built).** `tier()` on every module, the architecture test, the settings screen and the docs grouped by tier, and the integration tier named as such. Accept ADR-0017 first. 2. **v0.11.0, tiers.** `tier()` on every module, the architecture test, the settings screen and the docs grouped by tier, and the integration tier named as such. Accept ADR-0017 first.
3. **Audit of the move** (no release, a document): go through the table of section 5 line by line against the real code and data of `iriks-it.nl`, with a dry run of `manager:import` on a copy of its database. Output: a list with "covered", "add to the package", "stays in the site". 3. **Audit of the move** (no release, a document): go through the table of section 5 line by line against the real code and data of `iriks-it.nl`, with a dry run of `manager:import` on a copy of its database. Output: a list with "covered", "add to the package", "stays in the site".
4. **v0.12.0, what was missing** from step 3 (navigation, social links, the article inbox, ...), each as a resource, preset or small module in the right tier. 4. **v0.12.0, what was missing** from step 3 (navigation, social links, the article inbox, ...), each as a resource, preset or small module in the right tier.
5. **The move of `iriks-it.nl`**, as `bouwbedrijf` was done: on a branch, tables adopted, old code removed, checked in the simple and the full face. 5. **The move of `iriks-it.nl`**, as `bouwbedrijf` was done: on a branch, tables adopted, old code removed, checked in the simple and the full face.
@@ -86,6 +86,7 @@ Each step is a release branch with its own pull requests; nothing here is built
## 7. Open questions for the maintainer ## 7. Open questions for the maintainer
- Is `audit` core (on for every site) or an add-on? It changes nothing for a site that already turns it on.
- Should `support` and `costs` move out of the public package into a private one, or stay with a clear label? (ADR-0017 stays with a label.) - Should `support` and `costs` move out of the public package into a private one, or stay with a clear label? (ADR-0017 stays with a label.)
- Mail: may a normal editor change the "from" address, or is it `secret` level? (ADR-0018 says normal.) - Mail: may a normal editor change the "from" address, or is it `secret` level? (ADR-0018 says normal.)
- Is maintenance mode (down/up) a setting of the screen, or a command only? - Is maintenance mode (down/up) a setting of the screen, or a command only?
+1 -3
View File
@@ -660,7 +660,5 @@
"Put a failed job back on its queue": "Een mislukte job teruggezet in de wachtrij", "Put a failed job back on its queue": "Een mislukte job teruggezet in de wachtrij",
"Removed a failed job": "Een mislukte job verwijderd", "Removed a failed job": "Een mislukte job verwijderd",
"Opened a failed job": "Een mislukte job geopend", "Opened a failed job": "Een mislukte job geopend",
"This job cannot be put back: it is gone or its data cannot be read any more.": "Deze job kan niet worden teruggezet: hij bestaat niet meer of zijn gegevens zijn niet meer te lezen.", "This job cannot be put back: it is gone or its data cannot be read any more.": "Deze job kan niet worden teruggezet: hij bestaat niet meer of zijn gegevens zijn niet meer te lezen."
"Add-ons": "Extra onderdelen",
"For customers of Iriks-IT": "Voor klanten van Iriks-IT"
} }
-28
View File
@@ -9,13 +9,11 @@ use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Contracts\Http\Kernel; use Illuminate\Contracts\Http\Kernel;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Event; use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Schema;
use IriksIT\Manager\Models\AuditLog; use IriksIT\Manager\Models\AuditLog;
use IriksIT\Manager\Modules\BaseModule; use IriksIT\Manager\Modules\BaseModule;
use IriksIT\Manager\Support\AuditTrail; use IriksIT\Manager\Support\AuditTrail;
use IriksIT\Manager\Support\Names; use IriksIT\Manager\Support\Names;
use IriksIT\Manager\Support\Permission; use IriksIT\Manager\Support\Permission;
use IriksIT\Manager\Support\Tier;
/** /**
* The audit log and the bans: who logged in or failed to, who did what in the manager, and the * The audit log and the bans: who logged in or failed to, who did what in the manager, and the
@@ -29,41 +27,15 @@ class AuditModule extends BaseModule
return 'audit'; return 'audit';
} }
public function tier(): string
{
return Tier::CORE;
}
public function label(): string public function label(): string
{ {
return 'Audit log'; return 'Audit log';
} }
private static ?bool $ready = null;
/** Forgets whether the tables were there (a test, or a deploy that migrates within one process). */
public static function forgetReady(): void
{
self::$ready = null;
}
/**
* The audit log is part of the core, so it is on for every site that does not say otherwise. A site that has not migrated yet has no tables to
* write to: it stays off until `php artisan migrate` has run (which runs in the console, where the module is on, and so makes them), instead of
* failing every request.
*/
public function enabledByDefault(): bool public function enabledByDefault(): bool
{ {
if (app()->runningInConsole()) {
return true;
}
try {
return self::$ready ??= Schema::hasTable(Names::table('audit_logs'));
} catch (\Throwable) {
return false; return false;
} }
}
public function tables(): array public function tables(): array
{ {
-7
View File
@@ -3,7 +3,6 @@
namespace IriksIT\Manager\Modules; namespace IriksIT\Manager\Modules;
use IriksIT\Manager\Contracts\Module; use IriksIT\Manager\Contracts\Module;
use IriksIT\Manager\Support\Tier;
/** /**
* Convention over configuration: a module `Foo` lives in src/Modules/Foo, with * Convention over configuration: a module `Foo` lives in src/Modules/Foo, with
@@ -16,12 +15,6 @@ abstract class BaseModule implements Module
return false; return false;
} }
/** The layer of this module (ADR-0017, `Support\Tier`): a module that does not say is an add-on. */
public function tier(): string
{
return Tier::ADDON;
}
public function requires(): array public function requires(): array
{ {
return []; return [];
-6
View File
@@ -6,7 +6,6 @@ use IriksIT\Manager\Console\CostsPriceCommand;
use IriksIT\Manager\Modules\BaseModule; use IriksIT\Manager\Modules\BaseModule;
use IriksIT\Manager\Support\Names; use IriksIT\Manager\Support\Names;
use IriksIT\Manager\Support\Permission; use IriksIT\Manager\Support\Permission;
use IriksIT\Manager\Support\Tier;
/** /**
* What the work on the site has cost: the pieces of work of its `TOKENS.md` with the tokens of each in euros, next to the hours at an * What the work on the site has cost: the pieces of work of its `TOKENS.md` with the tokens of each in euros, next to the hours at an
@@ -19,11 +18,6 @@ class CostsModule extends BaseModule
return 'costs'; return 'costs';
} }
public function tier(): string
{
return Tier::INTEGRATION;
}
public function label(): string public function label(): string
{ {
return 'Costs'; return 'Costs';
-6
View File
@@ -9,7 +9,6 @@ use IriksIT\Manager\Modules\Support\SupportModule;
use IriksIT\Manager\Modules\Updates\UpdatesModule; use IriksIT\Manager\Modules\Updates\UpdatesModule;
use IriksIT\Manager\Support\IriksStorage\Client; use IriksIT\Manager\Support\IriksStorage\Client;
use IriksIT\Manager\Support\ModuleRegistry; use IriksIT\Manager\Support\ModuleRegistry;
use IriksIT\Manager\Support\Tier;
/** /**
* Iriks-IT (ADR-0017): what a customer of a project that Iriks-IT builds and hosts gets to see, for clarity and transparency. One module with * Iriks-IT (ADR-0017): what a customer of a project that Iriks-IT builds and hosts gets to see, for clarity and transparency. One module with
@@ -40,11 +39,6 @@ class IriksItModule extends BaseModule
return 'iriksit'; return 'iriksit';
} }
public function tier(): string
{
return Tier::INTEGRATION;
}
public function label(): string public function label(): string
{ {
return 'Iriks-IT'; return 'Iriks-IT';
-6
View File
@@ -9,7 +9,6 @@ use IriksIT\Manager\Console\LeadsPruneCommand;
use IriksIT\Manager\Modules\BaseModule; use IriksIT\Manager\Modules\BaseModule;
use IriksIT\Manager\Support\Names; use IriksIT\Manager\Support\Names;
use IriksIT\Manager\Support\Permission; use IriksIT\Manager\Support\Permission;
use IriksIT\Manager\Support\Tier;
/** /**
* The requests of visitors (callback requests, questions, quotes, a contact form): stored, screened into folders, handled and kept for * The requests of visitors (callback requests, questions, quotes, a contact form): stored, screened into folders, handled and kept for
@@ -23,11 +22,6 @@ class LeadsModule extends BaseModule
return 'leads'; return 'leads';
} }
public function tier(): string
{
return Tier::ADDON;
}
public function label(): string public function label(): string
{ {
return 'Requests'; return 'Requests';
-6
View File
@@ -8,7 +8,6 @@ use Illuminate\Support\Facades\RateLimiter;
use IriksIT\Manager\Modules\BaseModule; use IriksIT\Manager\Modules\BaseModule;
use IriksIT\Manager\Support\Names; use IriksIT\Manager\Support\Names;
use IriksIT\Manager\Support\Permission; use IriksIT\Manager\Support\Permission;
use IriksIT\Manager\Support\Tier;
class MediaModule extends BaseModule class MediaModule extends BaseModule
{ {
@@ -17,11 +16,6 @@ class MediaModule extends BaseModule
return 'media'; return 'media';
} }
public function tier(): string
{
return Tier::CORE;
}
public function label(): string public function label(): string
{ {
return 'Media'; return 'Media';
-6
View File
@@ -6,7 +6,6 @@ use IriksIT\Manager\Modules\BaseModule;
use IriksIT\Manager\Support\ModuleRegistry; use IriksIT\Manager\Support\ModuleRegistry;
use IriksIT\Manager\Support\Names; use IriksIT\Manager\Support\Names;
use IriksIT\Manager\Support\Permission; use IriksIT\Manager\Support\Permission;
use IriksIT\Manager\Support\Tier;
/** How the site is doing, in plain words for the owner of the business. No tables: it reads the statistics and the requests. */ /** How the site is doing, in plain words for the owner of the business. No tables: it reads the statistics and the requests. */
class NumbersModule extends BaseModule class NumbersModule extends BaseModule
@@ -16,11 +15,6 @@ class NumbersModule extends BaseModule
return 'numbers'; return 'numbers';
} }
public function tier(): string
{
return Tier::INTEGRATION;
}
public function label(): string public function label(): string
{ {
return 'Numbers'; return 'Numbers';
-6
View File
@@ -8,7 +8,6 @@ use IriksIT\Manager\Support\Frontend;
use IriksIT\Manager\Support\MediaUsage; use IriksIT\Manager\Support\MediaUsage;
use IriksIT\Manager\Support\Names; use IriksIT\Manager\Support\Names;
use IriksIT\Manager\Support\Permission; use IriksIT\Manager\Support\Permission;
use IriksIT\Manager\Support\Tier;
class PagesModule extends BaseModule class PagesModule extends BaseModule
{ {
@@ -17,11 +16,6 @@ class PagesModule extends BaseModule
return 'pages'; return 'pages';
} }
public function tier(): string
{
return Tier::CONTENT;
}
public function label(): string public function label(): string
{ {
return 'Pages'; return 'Pages';
-6
View File
@@ -7,7 +7,6 @@ use IriksIT\Manager\Modules\BaseModule;
use IriksIT\Manager\Support\MediaUsage; use IriksIT\Manager\Support\MediaUsage;
use IriksIT\Manager\Support\Names; use IriksIT\Manager\Support\Names;
use IriksIT\Manager\Support\Permission; use IriksIT\Manager\Support\Permission;
use IriksIT\Manager\Support\Tier;
class PostsModule extends BaseModule class PostsModule extends BaseModule
{ {
@@ -16,11 +15,6 @@ class PostsModule extends BaseModule
return 'posts'; return 'posts';
} }
public function tier(): string
{
return Tier::CONTENT;
}
public function label(): string public function label(): string
{ {
return 'Posts'; return 'Posts';
@@ -6,7 +6,6 @@ use IriksIT\Manager\Modules\BaseModule;
use IriksIT\Manager\Support\Names; use IriksIT\Manager\Support\Names;
use IriksIT\Manager\Support\Permission; use IriksIT\Manager\Support\Permission;
use IriksIT\Manager\Support\Resources; use IriksIT\Manager\Support\Resources;
use IriksIT\Manager\Support\Tier;
/** /**
* The lists a site defines in config (`manager.resources`): menu item, permissions and screens for each, with * The lists a site defines in config (`manager.resources`): menu item, permissions and screens for each, with
@@ -19,11 +18,6 @@ class ResourcesModule extends BaseModule
return 'resources'; return 'resources';
} }
public function tier(): string
{
return Tier::CONTENT;
}
public function label(): string public function label(): string
{ {
return 'Resources'; return 'Resources';
-6
View File
@@ -5,7 +5,6 @@ namespace IriksIT\Manager\Modules\Reviews;
use IriksIT\Manager\Modules\BaseModule; use IriksIT\Manager\Modules\BaseModule;
use IriksIT\Manager\Support\Names; use IriksIT\Manager\Support\Names;
use IriksIT\Manager\Support\Permission; use IriksIT\Manager\Support\Permission;
use IriksIT\Manager\Support\Tier;
class ReviewsModule extends BaseModule class ReviewsModule extends BaseModule
{ {
@@ -14,11 +13,6 @@ class ReviewsModule extends BaseModule
return 'reviews'; return 'reviews';
} }
public function tier(): string
{
return Tier::ADDON;
}
public function label(): string public function label(): string
{ {
return 'Reviews'; return 'Reviews';
@@ -5,7 +5,6 @@ namespace IriksIT\Manager\Modules\Revisions;
use IriksIT\Manager\Modules\BaseModule; use IriksIT\Manager\Modules\BaseModule;
use IriksIT\Manager\Support\Permission; use IriksIT\Manager\Support\Permission;
use IriksIT\Manager\Support\Revisions; use IriksIT\Manager\Support\Revisions;
use IriksIT\Manager\Support\Tier;
/** The history of posts and pages (and of what a site adds): see an earlier state and put it back. */ /** The history of posts and pages (and of what a site adds): see an earlier state and put it back. */
class RevisionsModule extends BaseModule class RevisionsModule extends BaseModule
@@ -15,11 +14,6 @@ class RevisionsModule extends BaseModule
return 'revisions'; return 'revisions';
} }
public function tier(): string
{
return Tier::CONTENT;
}
public function label(): string public function label(): string
{ {
return 'History'; return 'History';
-6
View File
@@ -5,7 +5,6 @@ namespace IriksIT\Manager\Modules\Settings;
use IriksIT\Manager\Modules\BaseModule; use IriksIT\Manager\Modules\BaseModule;
use IriksIT\Manager\Support\Names; use IriksIT\Manager\Support\Names;
use IriksIT\Manager\Support\Permission; use IriksIT\Manager\Support\Permission;
use IriksIT\Manager\Support\Tier;
/** /**
* The settings screen: which parts and features are on, and the keys and addresses of integrations, all changeable from the * The settings screen: which parts and features are on, and the keys and addresses of integrations, all changeable from the
@@ -19,11 +18,6 @@ class SettingsModule extends BaseModule
return 'settings'; return 'settings';
} }
public function tier(): string
{
return Tier::CORE;
}
public function label(): string public function label(): string
{ {
return 'Settings'; return 'Settings';
-6
View File
@@ -5,7 +5,6 @@ namespace IriksIT\Manager\Modules\Sharing;
use IriksIT\Manager\Modules\BaseModule; use IriksIT\Manager\Modules\BaseModule;
use IriksIT\Manager\Support\Names; use IriksIT\Manager\Support\Names;
use IriksIT\Manager\Support\Permission; use IriksIT\Manager\Support\Permission;
use IriksIT\Manager\Support\Tier;
/** /**
* Sharing posts on social networks: connect the owner's account of a platform (OAuth) and post a published post there with one * Sharing posts on social networks: connect the owner's account of a platform (OAuth) and post a published post there with one
@@ -19,11 +18,6 @@ class SharingModule extends BaseModule
return 'sharing'; return 'sharing';
} }
public function tier(): string
{
return Tier::ADDON;
}
public function label(): string public function label(): string
{ {
return 'Sharing'; return 'Sharing';
@@ -10,7 +10,6 @@ use Illuminate\Support\Facades\RateLimiter;
use IriksIT\Manager\Modules\BaseModule; use IriksIT\Manager\Modules\BaseModule;
use IriksIT\Manager\Support\Names; use IriksIT\Manager\Support\Names;
use IriksIT\Manager\Support\Permission; use IriksIT\Manager\Support\Permission;
use IriksIT\Manager\Support\Tier;
/** /**
* The site's own visitor statistics: page views, time on a page, where visitors came from, and the * The site's own visitor statistics: page views, time on a page, where visitors came from, and the
@@ -25,11 +24,6 @@ class StatisticsModule extends BaseModule
return 'statistics'; return 'statistics';
} }
public function tier(): string
{
return Tier::ADDON;
}
public function label(): string public function label(): string
{ {
return 'Statistics'; return 'Statistics';
-6
View File
@@ -6,7 +6,6 @@ use IriksIT\Manager\Modules\BaseModule;
use IriksIT\Manager\Support\Helpdesk; use IriksIT\Manager\Support\Helpdesk;
use IriksIT\Manager\Support\Names; use IriksIT\Manager\Support\Names;
use IriksIT\Manager\Support\Permission; use IriksIT\Manager\Support\Permission;
use IriksIT\Manager\Support\Tier;
/** /**
* Help from Iriks-IT: a form to ask a question or report a problem, which becomes a ticket at the IriksIT API with a number to follow it by, * Help from Iriks-IT: a form to ask a question or report a problem, which becomes a ticket at the IriksIT API with a number to follow it by,
@@ -19,11 +18,6 @@ class SupportModule extends BaseModule
return 'support'; return 'support';
} }
public function tier(): string
{
return Tier::INTEGRATION;
}
public function label(): string public function label(): string
{ {
return 'Help'; return 'Help';
-6
View File
@@ -6,7 +6,6 @@ use IriksIT\Manager\Modules\BaseModule;
use IriksIT\Manager\Support\Names; use IriksIT\Manager\Support\Names;
use IriksIT\Manager\Support\Permission; use IriksIT\Manager\Support\Permission;
use IriksIT\Manager\Support\System\ScheduleInfo; use IriksIT\Manager\Support\System\ScheduleInfo;
use IriksIT\Manager\Support\Tier;
/** What runs the site: PHP, its modules, the drivers, the disk and the last lines of the log. For who looks after it; no tables. */ /** What runs the site: PHP, its modules, the drivers, the disk and the last lines of the log. For who looks after it; no tables. */
class SystemModule extends BaseModule class SystemModule extends BaseModule
@@ -16,11 +15,6 @@ class SystemModule extends BaseModule
return 'system'; return 'system';
} }
public function tier(): string
{
return Tier::CORE;
}
public function label(): string public function label(): string
{ {
return 'System'; return 'System';
-6
View File
@@ -5,7 +5,6 @@ namespace IriksIT\Manager\Modules\Updates;
use IriksIT\Manager\Modules\BaseModule; use IriksIT\Manager\Modules\BaseModule;
use IriksIT\Manager\Support\Names; use IriksIT\Manager\Support\Names;
use IriksIT\Manager\Support\Permission; use IriksIT\Manager\Support\Permission;
use IriksIT\Manager\Support\Tier;
/** What changed on the site: the releases of its CHANGELOG.md, as a screen. No tables. */ /** What changed on the site: the releases of its CHANGELOG.md, as a screen. No tables. */
class UpdatesModule extends BaseModule class UpdatesModule extends BaseModule
@@ -15,11 +14,6 @@ class UpdatesModule extends BaseModule
return 'updates'; return 'updates';
} }
public function tier(): string
{
return Tier::INTEGRATION;
}
public function label(): string public function label(): string
{ {
return 'Updates'; return 'Updates';
-6
View File
@@ -5,7 +5,6 @@ namespace IriksIT\Manager\Modules\Users;
use IriksIT\Manager\Modules\BaseModule; use IriksIT\Manager\Modules\BaseModule;
use IriksIT\Manager\Support\Names; use IriksIT\Manager\Support\Names;
use IriksIT\Manager\Support\Permission; use IriksIT\Manager\Support\Permission;
use IriksIT\Manager\Support\Tier;
class UsersModule extends BaseModule class UsersModule extends BaseModule
{ {
@@ -14,11 +13,6 @@ class UsersModule extends BaseModule
return 'users'; return 'users';
} }
public function tier(): string
{
return Tier::CORE;
}
public function label(): string public function label(): string
{ {
return 'Users'; return 'Users';
+3 -4
View File
@@ -5,7 +5,6 @@ namespace IriksIT\Manager\Support\Settings;
use IriksIT\Manager\Modules\IriksIT\IriksItModule; use IriksIT\Manager\Modules\IriksIT\IriksItModule;
use IriksIT\Manager\Support\Features; use IriksIT\Manager\Support\Features;
use IriksIT\Manager\Support\ModuleRegistry; use IriksIT\Manager\Support\ModuleRegistry;
use IriksIT\Manager\Support\Tier;
/** /**
* What can be set from the settings screen. A definition is keyed by the config path it overrides (`manager.modules.reviews`) * What can be set from the settings screen. A definition is keyed by the config path it overrides (`manager.modules.reviews`)
@@ -78,8 +77,8 @@ class Definitions
$parts = []; $parts = [];
foreach ($this->modules->all() as $module) { foreach ($this->modules->all() as $module) {
// The core is on for every site (ADR-0017): without it there is no manager, so it has no switch on the screen. // Users and media are the core: without them there is no manager.
if (Tier::of($module) === Tier::CORE) { if (in_array($module->key(), ['users', 'media', 'settings'], true)) {
continue; continue;
} }
@@ -91,7 +90,7 @@ class Definitions
$parts['manager.modules.'.$module->key()] = [ $parts['manager.modules.'.$module->key()] = [
'label' => $module->label(), 'label' => $module->label(),
'type' => 'toggle', 'type' => 'toggle',
'group' => ['content' => 'Content', 'integration' => 'For customers of Iriks-IT'][Tier::of($module)] ?? 'Add-ons', 'group' => 'Parts of the manager',
'env' => 'MANAGER_'.strtoupper($module->key()), 'env' => 'MANAGER_'.strtoupper($module->key()),
]; ];
} }
-37
View File
@@ -1,37 +0,0 @@
<?php
namespace IriksIT\Manager\Support;
use IriksIT\Manager\Contracts\Module;
/**
* The layer a module belongs to (ADR-0017). The layers go from what every site relies on to what only some need:
*
* - `core`: accounts, the media library, the settings, the audit log and the system page. On for every site and not offered as a switch on the
* settings screen. A core module uses nothing of another layer.
* - `content`: what the site's text and pictures are made of (pages, posts, lists, history). May use the core.
* - `addon`: optional parts of general use (requests, reviews, statistics, sharing). May use the core and content; another add-on only when it says
* so in `requires()`, or checks at run time that it is on.
* - `integration`: the module for customers of Iriks-IT (`iriksit`), tied to the services of Iriks-IT. May use the core and content.
*/
final class Tier
{
public const CORE = 'core';
public const CONTENT = 'content';
public const ADDON = 'addon';
public const INTEGRATION = 'integration';
/** @var list<string> in the order of the layers */
public const ALL = [self::CORE, self::CONTENT, self::ADDON, self::INTEGRATION];
/** The layer of a module; a module of a site that does not say is an add-on. */
public static function of(Module $module): string
{
$tier = method_exists($module, 'tier') ? $module->tier() : self::ADDON;
return in_array($tier, self::ALL, true) ? $tier : self::ADDON;
}
}