Skip to content

Commit

Permalink
Feature/wp press wiki (#695)
Browse files Browse the repository at this point in the history
* init

* wip

* Fix styling

* Fix styling

* wip

* wip package

* added plugin

* fix translations booting

* Fix styling

* init

* wip

* Fix styling

* Fix styling

* wip

* wip package

* added plugin

* Fix styling

* Fix styling

* rename Thema ->Topic

* wip cleaning

* Fix styling

* wip cleanup

* Fix styling

* wip press-wiki package

---------

Co-authored-by: Kim-the-Diamond <Kim-the-Diamond@users.noreply.github.com>
  • Loading branch information
Kim-the-Diamond and Kim-the-Diamond committed Aug 22, 2024
1 parent af9db2f commit 38c5511
Show file tree
Hide file tree
Showing 63 changed files with 1,033 additions and 1,157 deletions.
1 change: 1 addition & 0 deletions .github/workflows/monorepo-split-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
- user
- user-device
- user-session
- press-wiki

steps:
- uses: actions/checkout@v4
Expand Down
10 changes: 4 additions & 6 deletions app/Providers/Filament/PressPanelProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,6 @@ public function panel(Panel $panel): Panel
\Moox\Press\WpTermTaxonomyPlugin::make(),
\Moox\Press\WpTermRelationshipPlugin::make(),

// Press custom plugins - should be moved to separate packages
\Moox\Press\WpWikiPlugin::make(),
\Moox\Press\WpThemaPlugin::make(),
\Moox\Press\WpSchulungPlugin::make(),
\Moox\Press\WpRubrikPlugin::make(),

// Notification plugin
\Moox\Notification\NotificationPlugin::make(),

Expand Down Expand Up @@ -114,6 +108,10 @@ public function panel(Panel $panel): Panel
\Moox\Training\TrainingInvitationPlugin::make(),
\Moox\Training\TrainingDatePlugin::make(),
\Moox\Training\TrainingTypePlugin::make(),

\Moox\PressWiki\WpWikiPlugin::make(),
\Moox\PressWiki\WpTopicPlugin::make(),

]);
}
}
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"moox/passkey": "*",
"moox/permission": "*",
"moox/press": "*",
"moox/press-wiki": "*",
"moox/security": "*",
"moox/sync": "*",
"moox/trainings": "*",
Expand Down
1 change: 1 addition & 0 deletions config/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
'passkey' => 'Moox Passkey',
'permission' => 'Moox Permission',
'press' => 'Moox Press',
'press-wiki' => 'Moox Press Wiki',
'security' => 'Moox Security',
'sync' => 'Moox Sync',
'training' => 'Moox Trainings',
Expand Down
184 changes: 184 additions & 0 deletions config/press-wiki.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
<?php

/*
|--------------------------------------------------------------------------
| Moox Configuration
|--------------------------------------------------------------------------
|
| This configuration file uses translatable strings. If you want to
| translate the strings, you can do so in the language files
| published from moox_core. Example:
|
| 'trans//core::core.all',
| loads from common.php
| outputs 'All'
|
*/

return [

/*
|--------------------------------------------------------------------------
| Resources
|--------------------------------------------------------------------------
|
| The following configuration is done per Filament resource.
|
*/

'resources' => [
'topic' => [

/*
|--------------------------------------------------------------------------
| Title
|--------------------------------------------------------------------------
|
| The translatable title of the Resource in singular and plural.
|
*/

'single' => 'trans//press-wiki::translations.topic',
'plural' => 'trans//press-wiki::translations.topics',

/*
|--------------------------------------------------------------------------
| Tabs
|--------------------------------------------------------------------------
|
| Define the tabs for the Expiry table. They are optional, but
| pretty awesome to filter the table by certain values.
| You may simply do a 'tabs' => [], to disable them.
|
*/

'tabs' => [
'all' => [
'label' => 'trans//core::core.all',
'icon' => 'gmdi-filter-list',
'query' => [],
],
/*
'error' => [
'label' => 'trans//core::core.error',
'icon' => 'gmdi-text-snippet',
'query' => [
[
'field' => 'subject_type',
'operator' => '=',
'value' => 'Error',
],
],
],
*/
],
],
'wiki' => [

/*
|--------------------------------------------------------------------------
| Title
|--------------------------------------------------------------------------
|
| The translatable title of the Resource in singular and plural.
|
*/

'single' => 'trans//press-wiki::translations.wiki',
'plural' => 'trans//press-wiki::translations.wikis',

/*
|--------------------------------------------------------------------------
| Tabs
|--------------------------------------------------------------------------
|
| Define the tabs for the Expiry table. They are optional, but
| pretty awesome to filter the table by certain values.
| You may simply do a 'tabs' => [], to disable them.
|
*/

'tabs' => [
'all' => [
'label' => 'trans//core::core.all',
'icon' => 'gmdi-filter-list',
'query' => [],
],

'published' => [
'label' => 'trans//core::core.published',
'icon' => 'gmdi-text-snippet',
'query' => [
[
'field' => 'post_status',
'operator' => '=',
'value' => 'publish',
],
],
],
'drafts' => [
'label' => 'trans//core::core.draft',
'icon' => 'gmdi-text-snippet',
'query' => [
[
'field' => 'post_status',
'operator' => '=',
'value' => 'draft',
],
],
],
'trash' => [
'label' => 'trans//core::core.trash',
'icon' => 'gmdi-text-snippet',
'query' => [
[
'field' => 'post_status',
'operator' => '=',
'value' => 'trash',
],
],
],
/*
'error' => [
'label' => 'trans//core::core.error',
'icon' => 'gmdi-text-snippet',
'query' => [
[
'field' => 'subject_type',
'operator' => '=',
'value' => 'Error',
],
],
],
*/
],
],
],

/*
|--------------------------------------------------------------------------
| Navigation Group
|--------------------------------------------------------------------------
|
| The translatable title of the navigation group in the
| Filament Admin Panel. Instead of a translatable
| string, you may also use a simple string.
|
*/

'temp_navigation_group' => 'trans//press-wiki::translations.wiki',

/*
|--------------------------------------------------------------------------
| PressWiki - Navigation Sort
|--------------------------------------------------------------------------
|
| This value is the sort order of the navigation item in the
| Filament Admin Panel. If you use a bunch of Moox
| plugins, everything should be in order.
|
*/

'temp_navigation_sort' => 999,

];
37 changes: 19 additions & 18 deletions packages/core/config/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,28 @@
|
| This config array registers all known Moox packages. You may add own
| packages to this array. If you use Moox Builder, these packages
| work out of the box. Otherwise check the builder config.
| work out of the box. Adding a non-compatible package fails.
|
*/

'packages' => [
'audit',
'builder',
'core',
'expiry',
'jobs',
'login-link',
'notifications',
'page',
'passkey',
'permission',
'press',
'security',
'sync',
'training',
'user',
'user-device',
'user-session',
'audit' => 'Moox Audit',
'builder' => 'Moox Builder',
'core' => 'Moox Core',
'expiry' => 'Moox Expiry',
'jobs' => 'Moox Jobs',
'login-link' => 'Moox Login Link',
'notifications' => 'Moox Notifications',
'page' => 'Moox Page',
'passkey' => 'Moox Passkey',
'permission' => 'Moox Permission',
'press' => 'Moox Press',
'press-wiki' => 'Moox Press Wiki',
'security' => 'Moox Security',
'sync' => 'Moox Sync',
'training' => 'Moox Trainings',
'user' => 'Moox User',
'user-device' => 'Moox User Device',
'user-session' => 'Moox User Session',
],
];
3 changes: 3 additions & 0 deletions packages/core/resources/lang/cs/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,8 @@
'meta_value' => 'Meta Value',
'term_taxonomy_id' => 'Term Taxonomy ID',
'taxonomy' => 'Taxonomy',
'published' => 'Published',
'draft' => 'Draft',
'trash' => 'Trash',

];
3 changes: 3 additions & 0 deletions packages/core/resources/lang/de/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,7 @@
'meta_value' => 'Metawert',
'term_taxonomy_id' => 'Term Taxonomy ID',
'taxonomy' => 'Taxonomie',
'published' => 'Veröffentlicht',
'draft' => 'Entwurf',
'trash' => 'Papierkorb',
];
7 changes: 3 additions & 4 deletions packages/core/resources/lang/en/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,14 @@
'options' => 'Options',
'option_name' => 'Option Name',
'option_value' => 'Option Value',
'wiki' => 'Wiki',
'wikis' => 'Wikis',
'training' => 'Training',
'trainings' => 'Trainings',
'theme' => 'Theme',
'themes' => 'Themes',
'rubrik' => 'Rubrik',
'rubriks' => 'Rubriks',
'autoload' => 'Autoload',
'drop' => 'Drop',
'published' => 'Published',
'draft' => 'Draft',
'trash' => 'Trash',

];
3 changes: 3 additions & 0 deletions packages/core/resources/lang/es/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,8 @@
'meta_value' => 'Meta Value',
'term_taxonomy_id' => 'Term Taxonomy ID',
'taxonomy' => 'Taxonomy',
'published' => 'Published',
'draft' => 'Draft',
'trash' => 'Trash',

];
3 changes: 3 additions & 0 deletions packages/core/resources/lang/nl/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,7 @@
'meta_value' => '',
'term_taxonomy_id' => '',
'taxonomy' => '',
'published' => 'Published',
'draft' => 'Draft',
'trash' => 'Trash',
];
3 changes: 3 additions & 0 deletions packages/core/resources/lang/pl/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,7 @@
'meta_value' => 'Meta Value',
'term_taxonomy_id' => 'Term Taxonomy ID',
'taxonomy' => 'Taxonomy',
'published' => 'Published',
'draft' => 'Draft',
'trash' => 'Trash',
];
5 changes: 4 additions & 1 deletion packages/core/src/CoreServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ public function boot()
// TODO: Uncomment this line to enable policies
//$this->setPolicies();
$this->useGoogleIcons();
$this->translateConfigurations();

$this->app->booted(function () {
$this->translateConfigurations();
});
}

public function configurePackage(Package $package): void
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/Traits/TranslatableConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ trait TranslatableConfig
*/
protected function translateConfig(array $config): array
{

array_walk_recursive($config, function (&$value) {
if (is_string($value) && str_starts_with($value, 'trans//')) {
$key = str_replace('trans//', '', $value);
Expand Down
13 changes: 13 additions & 0 deletions packages/press-wiki/.github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# These are supported funding model platforms

github: [mooxphp]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
Loading

0 comments on commit 38c5511

Please sign in to comment.