Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into prod
Browse files Browse the repository at this point in the history
  • Loading branch information
marco76tv committed Aug 29, 2024
2 parents df75fea + a66ff85 commit 58cabb8
Show file tree
Hide file tree
Showing 190 changed files with 1,944 additions and 1,655 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1.6.0
uses: dependabot/fetch-metadata@latest
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/duster-fix-blame.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ jobs:
ref: ${{ github.head_ref }}

- name: "Duster Fix"
uses: tighten/duster-action@v2
uses: tighten/duster-action@latest
with:
args: fix

- uses: stefanzweifel/git-auto-commit-action@v4
- uses: stefanzweifel/git-auto-commit-action@latest
id: auto_commit_action
with:
commit_message: Dusting
Expand All @@ -36,7 +36,7 @@ jobs:
if: steps.auto_commit_action.outputs.changes_detected == 'true'
run: echo ${{ steps.auto_commit_action.outputs.commit_hash }} >> .git-blame-ignore-revs

- uses: stefanzweifel/git-auto-commit-action@v4
- uses: stefanzweifel/git-auto-commit-action@latest
with:
commit_message: Ignore Dusting commit in git blame
commit_user_name: GitHub Action
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/fix-php-code-style-issues.bak
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ jobs:
ref: ${{ github.head_ref }}

- name: Fix PHP code style issues
uses: aglipanci/laravel-pint-action@2.2.0
uses: aglipanci/laravel-pint-action@latest

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@latest
with:
commit_message: Check & fix styling
2 changes: 1 addition & 1 deletion .github/workflows/php-cs-fixer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ jobs:
args: --config=.php-cs-fixer.dist.php --allow-risky=yes

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@latest
with:
commit_message: Lint
2 changes: 1 addition & 1 deletion .github/workflows/phpmd.bak
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
uses: actions/checkout@v3

- name: Setup PHP environment
uses: shivammathur/setup-php@v2
uses: shivammathur/setup-php@latest
with:
coverage: none
tools: phpmd
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ jobs:
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
uses: shivammathur/setup-php@latest
with:
php-version: '8.1'
coverage: none

- name: Install composer dependencies
uses: ramsey/composer-install@v2
uses: ramsey/composer-install@latest

- name: Run PHPStan
run: ./vendor/bin/phpstan --error-format=github
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
run: cd docs && echo "laraxot.github.io/module_activity" > ./build_production/CNAME

- name: gh-pages
uses: JamesIves/github-pages-deploy-action@v4
uses: JamesIves/github-pages-deploy-action@latest
with:
branch: gh-pages
folder: ./docs/build_production
6 changes: 3 additions & 3 deletions .github/workflows/rector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ jobs:
with:
token: "${{ secrets.ACCESS_TOKEN || secrets.GITHUB_TOKEN }}"

- uses: shivammathur/setup-php@v2
- uses: shivammathur/setup-php@latest
with:
php-version: 8.1

- uses: "ramsey/composer-install@v2"
- uses: "ramsey/composer-install@latest"

- run: vendor/bin/rector --ansi

- uses: EndBug/add-and-commit@v5.1.0
- uses: EndBug/add-and-commit@latest
with:
add: .
message: "[ci-review] Rector Rectify"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
uses: shivammathur/setup-php@latest
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
release-notes: ${{ github.event.release.body }}

- name: Commit updated CHANGELOG
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@latest
with:
branch: main
commit_message: Update CHANGELOG
Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,10 @@ package-lock.json
node_modules
.git-blame-ignore-revs
.git-blame-ignore-revs
node_modules
vendor
.git-blame-ignore-revs
build/
vendor/
build/
node_modules
66 changes: 66 additions & 0 deletions Actions/Block/GetAllBlocksAction.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?php

declare(strict_types=1);

namespace Modules\UI\Actions\Block;

use Illuminate\Support\Arr;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Str;
use Modules\Xot\Datas\ComponentFileData;
use Spatie\LaravelData\DataCollection;
use Spatie\QueueableAction\QueueableAction;

class GetAllBlocksAction
{
use QueueableAction;

/**
* @return DataCollection<ComponentFileData>
*/
public function execute(string $context = 'form'): DataCollection
{
$files = File::glob(base_path('Modules').'/*/Filament/Blocks/*.php');
$blocks = Arr::map($files,
function ($path) {
$class = Str::of($path)
->after(base_path('Modules'))
->prepend('\Modules')
->before('.php')
->replace('/', '\\')
->toString();

$name = Str::of(class_basename($class))->snake()->toString();
if (Str::endsWith($name, '_block')) {
$name = Str::before($name, '_block');
}

$module = Str::of($class)->between('Modules\\', '\Filament\\')->toString();

/*
$name2 = $ns::make()->getName();
if ($name !== $name2) {
dddx([
'ns' => $ns,
'block' => $block,
'name' => $name,
'test' => $name2,
]);
}
// */
// return $ns::make(name: $name, context: $context);
return [
'name' => $name,
'class' => $class,
'module' => $module,
'path' => $path,
];
}
);

return ComponentFileData::collection($blocks);
}
}
63 changes: 63 additions & 0 deletions Actions/Icon/GetAllIconsAction.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?php

declare(strict_types=1);

namespace Modules\UI\Actions\Icon;

use BladeUI\Icons\Factory as IconFactory;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\File;
use Spatie\QueueableAction\QueueableAction;

class GetAllIconsAction
{
use QueueableAction;

/**
* @return array
*/
public function execute(string $context = 'form')
{
$iconsFactory = App::make(IconFactory::class);
$icons = $iconsFactory->all();
/*
* "heroicons" => array:5 [▼
* "prefix" => "heroicon"
* "fallback" => ""
* "class" => ""
* "attributes" => []
* "paths" => array:1 [▼
* 0 => "F:\var\www\_bases\base_fixcity_fila3\laravel\vendor\blade-ui-kit\blade-heroicons\src/../resources/svg"
* ]
]
*/
$icons = Arr::map($icons, function ($set, $name) {
$set['name'] = $name;
$icons = [];

foreach ($set['paths'] as $path) {
foreach (File::allFiles($path) as $file) {
// Simply ignore files that aren't SVGs
if ('svg' !== $file->getExtension()) {
continue;
}

// $iconName = $this->getIconName($file, parentPath: $path, prefix: $prefix);
$iconName = str($file->getPathname())
->after($path.DIRECTORY_SEPARATOR)
->replace(DIRECTORY_SEPARATOR, '.')
->basename('.svg')
->toString();

$icons[] = $set['prefix'].'-'.$iconName;
}
}
$set['icons'] = $icons;

return $set;
});

return $icons;
}
}
66 changes: 66 additions & 0 deletions Enums/CornerPositionEnum.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?php

declare(strict_types=1);

namespace Modules\UI\Enums;

use Filament\Support\Contracts\HasColor;
use Filament\Support\Contracts\HasIcon;
use Filament\Support\Contracts\HasLabel;

enum CornerPositionEnum: string implements HasColor, HasIcon, HasLabel
{
case TOP_LEFT = 'top-left';
case TOP_RIGHT = 'top-right';
case BOTTOM_LEFT = 'bottom-left';
case BOTTOM_RIGHT = 'bottom-right';

public function getLabel(): ?string
{
// return $this->name;
return trans('ui::corner-position.'.$this->value.'.label');

// or
/*
return match ($this) {
self::Draft => 'Draft',
self::Reviewing => 'Reviewing',
self::Published => 'Published',
self::Rejected => 'Rejected',
};
*/
}

public function getColor(): string|array|null
{
return match ($this) {
self::TOP_LEFT => 'gray',
self::TOP_RIGHT => 'gray',
self::BOTTOM_LEFT => 'gray',
self::BOTTOM_RIGHT => 'gray',
};
}

public function getIcon(): ?string
{
return match ($this) {
self::TOP_LEFT => 'heroicon-o-arrow-up-left',
self::TOP_RIGHT => 'heroicon-o-arrow-up-right',
self::BOTTOM_LEFT => 'heroicon-o-arrow-down-left',
self::BOTTOM_RIGHT => 'heroicon-o-arrow-down-right',
};
}

/**
* ---.
*/
public function getCssClass(): ?string
{
return match ($this) {
self::TOP_LEFT => 'top-0 left-0',
self::TOP_RIGHT => 'top-0 right-0',
self::BOTTOM_LEFT => 'bottom-0 left-0',
self::BOTTOM_RIGHT => 'bottom-0 right-0',
};
}
}
Loading

0 comments on commit 58cabb8

Please sign in to comment.