Skip to content

Commit

Permalink
expiry tabs visibility is dynamacilly controlled by platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
AzGasim committed Sep 30, 2024
1 parent ff9c102 commit 5e7becc
Show file tree
Hide file tree
Showing 12 changed files with 62 additions and 28 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/monorepo-split-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

env:
GITHUB_TOKEN: ${{ secrets.BOT }}
CORE_VERSION: "^2.1.4"
CORE_VERSION: "^2.1.6"

jobs:
packages_split:
Expand Down Expand Up @@ -40,13 +40,13 @@ jobs:
steps:
- uses: actions/checkout@v4

# Search and replace "moox/core": "*" with "moox/core": "^2.1.4" in composer.json
# Search and replace "moox/core": "*" with "moox/core": "^2.1.6" in composer.json
- name: Replace core version in composer.json
working-directory: packages/${{ matrix.package }}
run: |
if [ -f composer.json ]; then
echo "Updating moox/core version in ${{ matrix.package }}"
sed -i 's/"moox\/core": "\*"/"moox\/core": "^2.1.4"/g' composer.json
sed -i 's/"moox\/core": "\*"/"moox\/core": "^2.1.6"/g' composer.json
fi
# Commit the updated composer.json (if there was a change)
Expand All @@ -57,7 +57,7 @@ jobs:
git config --global user.name "mooxbot"
git config --global user.email "[email protected]"
git add composer.json
git commit -m "Update moox/core dependency to ^^2.1.4" || echo "No changes to commit"
git commit -m "Update moox/core dependency to ^^2.1.6" || echo "No changes to commit"
fi
- if: "!startsWith(github.ref, 'refs/tags/')"
Expand Down
15 changes: 15 additions & 0 deletions config/expiry.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@
'value' => 'Documents',
],
],
'visible' => in_array(rtrim(env('APP_URL'), '/'), [
config('app.url'),
]),
],
'articles' => [
'label' => 'trans//core::core.articles',
Expand All @@ -79,6 +82,9 @@
'value' => 'Articles',
],
],
'visible' => in_array(rtrim(env('APP_URL'), '/'), [
config('app.url'),
]),
],
'tasks' => [
'label' => 'trans//core::core.tasks',
Expand All @@ -90,6 +96,9 @@
'value' => 'Tasks',
],
],
'visible' => in_array(rtrim(env('APP_URL'), '/'), [
config('app.url'),
]),
],
'no-user' => [
'label' => 'trans//core::expiry.no_assignee',
Expand All @@ -101,6 +110,9 @@
'value' => 'No assignee',
],
],
'visible' => in_array(rtrim(env('APP_URL'), '/'), [
config('app.url'),
]),
],
'no-date' => [
'label' => 'trans//core::expiry.no_expiry_date',
Expand All @@ -112,6 +124,9 @@
'value' => 'No expiry date',
],
],
'visible' => in_array(rtrim(env('APP_URL'), '/'), [
config('app.url'),
]),
],
],
],
Expand Down
4 changes: 4 additions & 0 deletions packages/core/src/Traits/HasDynamicTabs.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ public function getDynamicTabs(string $configKey, string $modelClass): array
$tabs = [];

foreach ($tabsConfig as $key => $tabConfig) {
if (isset($tabConfig['visible']) && ! $tabConfig['visible']) {
continue;
}

$tab = Tab::make($tabConfig['label'])
->icon($tabConfig['icon']);

Expand Down
15 changes: 15 additions & 0 deletions packages/expiry/config/expiry.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@
'value' => 'Documents',
],
],
'visible' => in_array(rtrim(env('APP_URL'), '/'), [
config('app.url'),
]),
],
'articles' => [
'label' => 'trans//core::core.articles',
Expand All @@ -79,6 +82,9 @@
'value' => 'Articles',
],
],
'visible' => in_array(rtrim(env('APP_URL'), '/'), [
config('app.url'),
]),
],
'tasks' => [
'label' => 'trans//core::core.tasks',
Expand All @@ -90,6 +96,9 @@
'value' => 'Tasks',
],
],
'visible' => in_array(rtrim(env('APP_URL'), '/'), [
config('app.url'),
]),
],
'no-user' => [
'label' => 'trans//core::expiry.no_assignee',
Expand All @@ -101,6 +110,9 @@
'value' => 'No assignee',
],
],
'visible' => in_array(rtrim(env('APP_URL'), '/'), [
config('app.url'),
]),
],
'no-date' => [
'label' => 'trans//core::expiry.no_expiry_date',
Expand All @@ -112,6 +124,9 @@
'value' => 'No expiry date',
],
],
'visible' => in_array(rtrim(env('APP_URL'), '/'), [
config('app.url'),
]),
],
],
],
Expand Down
2 changes: 1 addition & 1 deletion public/css/filament/filament/app.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/css/filament/forms/forms.css

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

2 changes: 1 addition & 1 deletion public/js/filament/forms/components/date-time-picker.js

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions public/js/filament/forms/components/file-upload.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/js/filament/forms/components/markdown-editor.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions public/js/filament/forms/components/rich-editor.js

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

16 changes: 8 additions & 8 deletions public/js/filament/support/support.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions public/js/filament/widgets/components/chart.js

Large diffs are not rendered by default.

0 comments on commit 5e7becc

Please sign in to comment.