Skip to content

Commit

Permalink
Merge pull request #5488 from getkirby/v4/release/alpha.7
Browse files Browse the repository at this point in the history
4.0.0-alpha.7
  • Loading branch information
distantnative authored Aug 17, 2023
2 parents f0d0448 + 73b8abe commit 29889f8
Show file tree
Hide file tree
Showing 132 changed files with 2,110 additions and 1,769 deletions.
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ For bug fixes, please create a new branch following the name scheme: `fix/issue_
- Every bug fix should include a [unit test](#tests) to avoid future regressions. Let us know if you need help with that.
- Make sure your code [style](#style) matches ours and includes [comments/in-code documentation](#documentation).
- Make sure your branch is up to date with the latest state on the `develop` branch. [Rebase](https://help.github.com/articles/about-pull-request-merges/) changes before you send the PR.
- Please *don't* commit updated dist files in the `panel/dist` folder to avoid merge conflicts. We only build the dist files on release. Your branch should only contain changes to the source files.

### Features

Expand All @@ -41,6 +42,7 @@ For features create a new branch following the name scheme: `feature/issue_numbe
- New features should include [unit tests](#tests). Let us know if you need help with that.
- Make your code [style](#style) matches ours and includes [comments/in-code documentation](#documentation).
- Make sure your branch is up to date with the latest state on the `develop` branch. [Rebase](https://help.github.com/articles/about-pull-request-merges/) changes before you send the PR.
- Please *don't* commit updated dist files in the `panel/dist` folder to avoid merge conflicts. We only build the dist files on release. Your branch should only contain changes to the source files.

We try to bundle features in our major releases, e.g. `3.x`. That is why we might only review and, if accepted, merge your PR once an appropriate release is upcoming. Please understand that we cannot merge all feature ideas or that it might take a while. Check out the [roadmap](https://roadmap.getkirby.com) to see upcoming releases.

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "The Kirby core",
"license": "proprietary",
"type": "kirby-cms",
"version": "4.0.0-alpha.6",
"version": "4.0.0-alpha.7",
"keywords": [
"kirby",
"cms",
Expand Down Expand Up @@ -36,9 +36,9 @@
"ext-libxml": "*",
"ext-mbstring": "*",
"ext-openssl": "*",
"claviska/simpleimage": "4.0.5",
"claviska/simpleimage": "4.0.6",
"composer/semver": "3.3.2",
"filp/whoops": "2.15.2",
"filp/whoops": "2.15.3",
"getkirby/composer-installer": "^1.2.1",
"laminas/laminas-escaper": "2.12.0",
"michelf/php-smartypants": "1.8.1",
Expand Down
26 changes: 13 additions & 13 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 15 additions & 7 deletions config/api/collections.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,22 @@
/**
* Api Collection Definitions
*/

use Kirby\Cms\Files;
use Kirby\Cms\Languages;
use Kirby\Cms\Pages;
use Kirby\Cms\Roles;
use Kirby\Cms\Translations;
use Kirby\Cms\Users;

return [

/**
* Children
*/
'children' => [
'model' => 'page',
'type' => 'Kirby\Cms\Pages',
'type' => Pages::class,
'view' => 'compact'
],

Expand All @@ -19,23 +27,23 @@
*/
'files' => [
'model' => 'file',
'type' => 'Kirby\Cms\Files'
'type' => Files::class,
],

/**
* Languages
*/
'languages' => [
'model' => 'language',
'type' => 'Kirby\Cms\Languages'
'type' => Languages::class,
],

/**
* Pages
*/
'pages' => [
'model' => 'page',
'type' => 'Kirby\Cms\Pages',
'type' => Pages::class,
'view' => 'compact'
],

Expand All @@ -44,7 +52,7 @@
*/
'roles' => [
'model' => 'role',
'type' => 'Kirby\Cms\Roles',
'type' => Roles::class,
'view' => 'compact'
],

Expand All @@ -53,7 +61,7 @@
*/
'translations' => [
'model' => 'translation',
'type' => 'Kirby\Cms\Translations',
'type' => Translations::class,
'view' => 'compact'
],

Expand All @@ -63,7 +71,7 @@
'users' => [
'default' => fn () => $this->users(),
'model' => 'user',
'type' => 'Kirby\Cms\Users',
'type' => Users::class,
'view' => 'compact'
]

Expand Down
2 changes: 1 addition & 1 deletion config/api/models/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
'url' => fn (File $file) => $file->url(),
'uuid' => fn (File $file) => $file->uuid()?->toString()
],
'type' => 'Kirby\Cms\File',
'type' => File::class,
'views' => [
'default' => [
'content',
Expand Down
5 changes: 2 additions & 3 deletions config/api/models/FileBlueprint.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
'tabs' => fn (FileBlueprint $blueprint) => $blueprint->tabs(),
'title' => fn (FileBlueprint $blueprint) => $blueprint->title(),
],
'type' => 'Kirby\Cms\FileBlueprint',
'views' => [
],
'type' => FileBlueprint::class,
'views' => [],
];
2 changes: 1 addition & 1 deletion config/api/models/FileVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
'type' => fn (FileVersion $file) => $file->type(),
'url' => fn (FileVersion $file) => $file->url(),
],
'type' => 'Kirby\Cms\FileVersion',
'type' => FileVersion::class,
'views' => [
'default' => [
'dimensions',
Expand Down
2 changes: 1 addition & 1 deletion config/api/models/Language.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
'rules' => fn (Language $language) => $language->rules(),
'url' => fn (Language $language) => $language->url(),
],
'type' => 'Kirby\Cms\Language',
'type' => Language::class,
'views' => [
'default' => [
'code',
Expand Down
2 changes: 1 addition & 1 deletion config/api/models/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
'url' => fn (Page $page) => $page->url(),
'uuid' => fn (Page $page) => $page->uuid()?->toString()
],
'type' => 'Kirby\Cms\Page',
'type' => Page::class,
'views' => [
'compact' => [
'id',
Expand Down
5 changes: 2 additions & 3 deletions config/api/models/PageBlueprint.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
'tabs' => fn (PageBlueprint $blueprint) => $blueprint->tabs(),
'title' => fn (PageBlueprint $blueprint) => $blueprint->title(),
],
'type' => 'Kirby\Cms\PageBlueprint',
'views' => [
],
'type' => PageBlueprint::class,
'views' => [],
];
2 changes: 1 addition & 1 deletion config/api/models/Role.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
'permissions' => fn (Role $role) => $role->permissions()->toArray(),
'title' => fn (Role $role) => $role->title(),
],
'type' => 'Kirby\Cms\Role',
'type' => Role::class,
'views' => [
'compact' => [
'description',
Expand Down
2 changes: 1 addition & 1 deletion config/api/models/Site.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
'title' => fn (Site $site) => $site->title()->value(),
'url' => fn (Site $site) => $site->url(),
],
'type' => 'Kirby\Cms\Site',
'type' => Site::class,
'views' => [
'compact' => [
'title',
Expand Down
2 changes: 1 addition & 1 deletion config/api/models/SiteBlueprint.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
'tabs' => fn (SiteBlueprint $blueprint) => $blueprint->tabs(),
'title' => fn (SiteBlueprint $blueprint) => $blueprint->title(),
],
'type' => 'Kirby\Cms\SiteBlueprint',
'type' => SiteBlueprint::class,
'views' => [],
];
2 changes: 1 addition & 1 deletion config/api/models/System.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
return null;
}
],
'type' => 'Kirby\Cms\System',
'type' => System::class,
'views' => [
'login' => [
'authStatus',
Expand Down
2 changes: 1 addition & 1 deletion config/api/models/Translation.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
'id' => fn (Translation $translation) => $translation->id(),
'name' => fn (Translation $translation) => $translation->name(),
],
'type' => 'Kirby\Cms\Translation',
'type' => Translation::class,
'views' => [
'compact' => [
'direction',
Expand Down
2 changes: 1 addition & 1 deletion config/api/models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
'username' => fn (User $user) => $user->username(),
'uuid' => fn (User $user) => $user->uuid()?->toString()
],
'type' => 'Kirby\Cms\User',
'type' => User::class,
'views' => [
'default' => [
'avatar',
Expand Down
5 changes: 2 additions & 3 deletions config/api/models/UserBlueprint.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
'tabs' => fn (UserBlueprint $blueprint) => $blueprint->tabs(),
'title' => fn (UserBlueprint $blueprint) => $blueprint->title(),
],
'type' => 'Kirby\Cms\UserBlueprint',
'views' => [
],
'type' => UserBlueprint::class,
'views' => [],
];
5 changes: 4 additions & 1 deletion config/api/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
// only add the language routes if the
// multi language setup is activated
if ($kirby->option('languages', false) !== false) {
$routes = array_merge($routes, include __DIR__ . '/routes/languages.php');
$routes = array_merge(
$routes,
include __DIR__ . '/routes/languages.php'
);
}

return $routes;
Expand Down
53 changes: 25 additions & 28 deletions config/areas/languages/views.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
use Kirby\Toolkit\Escape;
use Kirby\Toolkit\I18n;

$routes = [];

// check language variables editor is disabled
if (App::instance()->option('languages.variables', true) !== false) {
$routes['language'] = [
return [
'language' => [
'pattern' => 'languages/(:any)',
'when' => function (): bool {
return App::instance()->option('languages.variables', true) !== false;
},
'action' => function (string $code) {
$language = Find::language($code);
$link = '/languages/' . $language->code();
Expand Down Expand Up @@ -98,28 +98,25 @@
]
];
}
];
}

$routes['languages'] = [
'pattern' => 'languages',
'action' => function () {
$kirby = App::instance();
],
'languages' => [
'pattern' => 'languages',
'action' => function () {
$kirby = App::instance();

return [
'component' => 'k-languages-view',
'props' => [
'languages' => $kirby->languages()->values(fn ($language) => [
'deletable' => $language->isDeletable(),
'default' => $language->isDefault(),
'id' => $language->code(),
'info' => Escape::html($language->code()),
'text' => Escape::html($language->name()),
]),
'variables' => $kirby->option('languages.variables', true)
]
];
}
return [
'component' => 'k-languages-view',
'props' => [
'languages' => $kirby->languages()->values(fn ($language) => [
'deletable' => $language->isDeletable(),
'default' => $language->isDefault(),
'id' => $language->code(),
'info' => Escape::html($language->code()),
'text' => Escape::html($language->name()),
]),
'variables' => $kirby->option('languages.variables', true)
]
];
}
]
];

return $routes;
Loading

0 comments on commit 29889f8

Please sign in to comment.