Skip to content

Commit 4b83587

Browse files
committed
refactor: rename SYSTEM_SECTIONS_ENABLED to SYSTEM_SECTIONS
1 parent 28fe4d9 commit 4b83587

File tree

19 files changed

+24
-24
lines changed

19 files changed

+24
-24
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ All notable changes to `custom-fields` will be documented in this file.
1111
- **RichTextColumn**: Better rich editor display in tables
1212
- **Tags Filter**: Colored badges and filters for tags input
1313
- **Upgrade Command**: Automated migration tool (`vendor/bin/custom-fields-upgrade`)
14-
- **Optional Sections**: `SYSTEM_SECTIONS_ENABLED` feature flag for sectionless mode
14+
- **Optional Sections**: `SYSTEM_SECTIONS` feature flag for sectionless mode
1515
- **Field Search**: Search functionality in custom fields management page
1616
- **Field Deactivation**: Soft-disable non-system-defined fields and sections
1717
- **Avatar Configuration**: Display options for entity references

config/custom-fields.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
CustomFieldsFeature::UI_TABLE_FILTERS,
5757
CustomFieldsFeature::UI_FIELD_WIDTH_CONTROL,
5858
CustomFieldsFeature::SYSTEM_MANAGEMENT_INTERFACE,
59-
CustomFieldsFeature::SYSTEM_SECTIONS_ENABLED,
59+
CustomFieldsFeature::SYSTEM_SECTIONS,
6060
)
6161
->disable(
6262
CustomFieldsFeature::SYSTEM_MULTI_TENANCY,

database/migrations/create_custom_fields_table.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
{
1515
public function up(): void
1616
{
17-
$sectionsEnabled = FeatureManager::isEnabled(CustomFieldsFeature::SYSTEM_SECTIONS_ENABLED);
17+
$sectionsEnabled = FeatureManager::isEnabled(CustomFieldsFeature::SYSTEM_SECTIONS);
1818

1919
/**
20-
* Custom Field Sections (only created when SYSTEM_SECTIONS_ENABLED)
20+
* Custom Field Sections (only created when SYSTEM_SECTIONS)
2121
*/
2222
if ($sectionsEnabled) {
2323
Schema::create(config('custom-fields.database.table_names.custom_field_sections'), function (Blueprint $table): void {
@@ -170,7 +170,7 @@ public function down(): void
170170
Schema::dropIfExists(config('custom-fields.database.table_names.custom_field_options'));
171171
Schema::dropIfExists(config('custom-fields.database.table_names.custom_fields'));
172172

173-
if (FeatureManager::isEnabled(CustomFieldsFeature::SYSTEM_SECTIONS_ENABLED)) {
173+
if (FeatureManager::isEnabled(CustomFieldsFeature::SYSTEM_SECTIONS)) {
174174
Schema::dropIfExists(config('custom-fields.database.table_names.custom_field_sections'));
175175
}
176176
}

docs/content/2.essentials/1.configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ The package supports these features that can be enabled/disabled:
126126
| `UI_FIELD_WIDTH_CONTROL` | Custom field width per field |
127127
| `SYSTEM_MANAGEMENT_INTERFACE` | Enable the management interface |
128128
| `SYSTEM_MULTI_TENANCY` | Enable multi-tenant isolation |
129-
| `SYSTEM_SECTIONS_ENABLED` | Enable field grouping in sections |
129+
| `SYSTEM_SECTIONS` | Enable field grouping in sections |
130130

131131
::alert{type="info"}
132132
If your custom models include tenant-specific scoping logic, you'll need to register a [custom tenant resolver](#custom-tenant-resolution) to ensure validation works correctly.

resources/boost/skills/custom-fields-development/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ use Relaticle\CustomFields\FeatureSystem\FeatureConfigurator;
194194
CustomFieldsFeature::FIELD_OPTION_COLORS,
195195
CustomFieldsFeature::UI_TABLE_COLUMNS,
196196
CustomFieldsFeature::UI_TABLE_FILTERS,
197-
CustomFieldsFeature::SYSTEM_SECTIONS_ENABLED,
197+
CustomFieldsFeature::SYSTEM_SECTIONS,
198198
)
199199
->disable(
200200
CustomFieldsFeature::SYSTEM_MULTI_TENANCY,
@@ -214,7 +214,7 @@ use Relaticle\CustomFields\FeatureSystem\FeatureConfigurator;
214214
| `UI_TOGGLEABLE_COLUMNS` | Allow users to toggle column visibility |
215215
| `UI_FIELD_WIDTH_CONTROL` | Control field width in forms |
216216
| `SYSTEM_MANAGEMENT_INTERFACE` | Admin page for managing fields |
217-
| `SYSTEM_SECTIONS_ENABLED` | Organize fields into sections |
217+
| `SYSTEM_SECTIONS` | Organize fields into sections |
218218
| `SYSTEM_MULTI_TENANCY` | Tenant isolation for fields |
219219

220220
## Configuration

src/Enums/CustomFieldsFeature.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ enum CustomFieldsFeature: string
2929
// System-level features
3030
case SYSTEM_MANAGEMENT_INTERFACE = 'system_management_interface';
3131
case SYSTEM_MULTI_TENANCY = 'system_multi_tenancy';
32-
case SYSTEM_SECTIONS_ENABLED = 'system_sections_enabled';
32+
case SYSTEM_SECTIONS = 'system_sections';
3333
}

src/Filament/Integration/Builders/BaseBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function forModel(Model|string $model): static
5959
$this->explicitModel = $model;
6060

6161
// Only initialize sections query when sections are enabled
62-
if (FeatureManager::isEnabled(CustomFieldsFeature::SYSTEM_SECTIONS_ENABLED)) {
62+
if (FeatureManager::isEnabled(CustomFieldsFeature::SYSTEM_SECTIONS)) {
6363
$this->sections = CustomFields::newSectionModel()->query()
6464
->forEntityType($model::class)
6565
->orderBy('sort_order');
@@ -141,7 +141,7 @@ protected function getFieldsDirectly(): Collection
141141
*/
142142
protected function getAllFields(): Collection
143143
{
144-
if (! FeatureManager::isEnabled(CustomFieldsFeature::SYSTEM_SECTIONS_ENABLED)) {
144+
if (! FeatureManager::isEnabled(CustomFieldsFeature::SYSTEM_SECTIONS)) {
145145
return $this->getFieldsDirectly();
146146
}
147147

src/Filament/Integration/Builders/FormBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function values(): Collection
7373
);
7474

7575
// Return flat fields if sections are disabled or withoutSections is set
76-
$sectionsDisabled = ! FeatureManager::isEnabled(CustomFieldsFeature::SYSTEM_SECTIONS_ENABLED);
76+
$sectionsDisabled = ! FeatureManager::isEnabled(CustomFieldsFeature::SYSTEM_SECTIONS);
7777
if ($this->withoutSections || $sectionsDisabled) {
7878
return $allFields->map($createField);
7979
}

src/Filament/Integration/Builders/FormContainer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ private function generateSchema(): array
6666

6767
// Use explicit setting if provided, otherwise check feature flag
6868
$withoutSections = $this->withoutSections
69-
?? ! FeatureManager::isEnabled(CustomFieldsFeature::SYSTEM_SECTIONS_ENABLED);
69+
?? ! FeatureManager::isEnabled(CustomFieldsFeature::SYSTEM_SECTIONS);
7070

7171
$builder = app(FormBuilder::class);
7272

src/Filament/Integration/Builders/InfolistBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function values(null|(Model&HasCustomFields) $model = null): Collection
5959
->when($this->visibleWhenFilled, fn (Entry $field): Entry => $field->visible(fn (mixed $state): bool => filled($state)));
6060

6161
// Check if sections are disabled
62-
$sectionsDisabled = ! FeatureManager::isEnabled(CustomFieldsFeature::SYSTEM_SECTIONS_ENABLED);
62+
$sectionsDisabled = ! FeatureManager::isEnabled(CustomFieldsFeature::SYSTEM_SECTIONS);
6363

6464
// When sections disabled, get fields directly without section context
6565
if ($this->withoutSections || $sectionsDisabled) {

0 commit comments

Comments
 (0)