Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions resources/lang/en/custom-fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
'default' => [
'new_section' => 'New Section',
],
'default_section_name' => 'Default',
],

'field' => [
Expand Down Expand Up @@ -66,12 +65,6 @@
],
'add_field' => 'Add Field',
'system_defined_cannot_delete' => 'System-defined fields cannot be deleted.',
'allow_multiple' => 'Allow Multiple Values',
'allow_multiple_help' => 'When enabled, users can enter multiple values for this field.',
'max_values' => 'Maximum Values',
'max_values_help' => 'The maximum number of values that can be entered.',
'unique_per_entity_type' => 'Unique Per Entity Type',
'unique_per_entity_type_help' => 'Each value can only be assigned to one record of this entity type.',
'validation' => [
'label' => 'Validation',
'rules' => 'Validation Rules',
Expand Down Expand Up @@ -322,7 +315,6 @@
'multi_parameter_missing' => 'This validation rule requires multiple parameters. Please add all required parameters.',
'parameter_missing' => 'This validation rule requires exactly :count parameter(s). Please add all required parameters.',
'invalid_rule_for_field_type' => 'The selected rule is not valid for this field type.',
'unique_value' => 'The value ":value" is already assigned to another record.',
],

'empty_states' => [
Expand All @@ -336,19 +328,9 @@
'description' => 'Drag and drop fields here or click the button below to add your first field.',
'icon' => 'heroicon-o-squares-plus',
],
'fields_no_sections' => [
'heading' => 'No custom fields yet',
'description' => 'Click the button below to add your first custom field.',
'icon' => 'heroicon-o-squares-plus',
],
],

'common' => [
'inactive' => 'Inactive',
],

'email' => [
'add_email_placeholder' => 'Add email address...',
],

];
78 changes: 32 additions & 46 deletions resources/views/filament/pages/custom-fields-management.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,57 +9,43 @@
</x-filament::tabs>

<div class="custom-fields-component">
@if($this->isSectionsDisabled)
{{-- Sections disabled mode: show flat field list with new component --}}
@if($this->sections->first())
@livewire('manage-fields-without-sections', [
'entityType' => $this->currentEntityType,
'section' => $this->sections->first(),
], key('fields-without-sections-' . $this->currentEntityType))
@endif
@else
{{-- Normal sections mode --}}
<div
x-sortable
wire:end.stop="updateSectionsOrder($event.target.sortable.toArray())"
class="flex flex-col gap-y-6"
>
@foreach ($this->sections as $section)
@livewire('manage-custom-field-section', [
'entityType' => $this->currentEntityType,
'section' => $section,
], key($section->id . str()->random(16)))
@endforeach
<div
x-sortable
wire:end.stop="updateSectionsOrder($event.target.sortable.toArray())"
class="flex flex-col gap-y-6"
>
@foreach ($this->sections as $section)
@livewire('manage-custom-field-section', ['entityType' => $this->currentEntityType, 'section' => $section], key($section->id . str()->random(16)))
@endforeach

@if(!count($this->sections))
<div class="px-6 py-16">
<div class="mx-auto grid max-w-md justify-items-center text-center">
<div class="fi-ta-empty-state-icon-ctn mb-6 rounded-full bg-primary-50 p-4 dark:bg-primary-950/50">
<x-filament::icon
icon="{{ __('custom-fields::custom-fields.empty_states.sections.icon') }}"
class="fi-ta-empty-state-icon h-8 w-8 text-primary-500 dark:text-primary-400"
/>
</div>
@if(!count($this->sections))
<div class="fi-ta-empty-state px-6 py-16">
<div class="fi-ta-empty-state-content mx-auto grid max-w-md justify-items-center text-center">
<div class="fi-ta-empty-state-icon-ctn mb-6 rounded-full bg-primary-50 p-4 dark:bg-primary-950/50">
<x-filament::icon
icon="{{ __('custom-fields::custom-fields.empty_states.sections.icon') }}"
class="fi-ta-empty-state-icon h-8 w-8 text-primary-500 dark:text-primary-400"
/>
</div>

<h3 class="fi-ta-empty-state-heading text-lg font-semibold leading-7 text-gray-950 dark:text-white mb-2">
{{ __('custom-fields::custom-fields.empty_states.sections.heading') }}
</h3>
<h3 class="fi-ta-empty-state-heading text-lg font-semibold leading-7 text-gray-950 dark:text-white mb-2">
{{ __('custom-fields::custom-fields.empty_states.sections.heading') }}
</h3>

<p class="fi-ta-empty-state-description text-sm text-gray-600 dark:text-gray-400 mb-6 leading-relaxed">
{{ __('custom-fields::custom-fields.empty_states.sections.description') }}
</p>
<p class="fi-ta-empty-state-description text-sm text-gray-600 dark:text-gray-400 mb-6 leading-relaxed">
{{ __('custom-fields::custom-fields.empty_states.sections.description') }}
</p>

<div class="fi-ta-empty-state-action">
{{ $this->createSectionAction }}
</div>
<div class="fi-ta-empty-state-action">
{{ $this->createSectionAction }}
</div>
</div>
@else
<div class="mt-6 flex justify-center">
{{ $this->createSectionAction }}
</div>
@endif
</div>
@endif
</div>
@else
<div class="mt-6 flex justify-center">
{{ $this->createSectionAction }}
</div>
@endif
</div>
</div>
</x-filament-panels::page>
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
<x-filament::icon-button
icon="heroicon-m-bars-4"
color="gray"
class="text-gray-500"
size="xs"
x-sortable-handle
/>

Expand All @@ -32,7 +30,7 @@ class="text-gray-500"
x-sortable-group="fields"
data-section-id="{{ $section->id }}"
default="12"
class="fi-sc fi-sc-has-gap fi-sc-dense fi-grid lg:fi-grid-cols"
class="fi-sc fi-sc-has-gap fi-grid lg:fi-grid-cols"
style="--cols-lg: repeat(12, minmax(0, 12fr)); --cols-default: repeat(2, minmax(0, 1fr));"
@end.stop="$wire.updateFieldsOrder($event.to.getAttribute('data-section-id'), $event.to.sortable.toArray())"
>
Expand All @@ -42,8 +40,8 @@ class="fi-sc fi-sc-has-gap fi-sc-dense fi-grid lg:fi-grid-cols"

@if(!count($this->fields))
<div class="fi-grid-col" style="--col-span-default: span 12 / span 12;">
<div class="py-12">
<div class="mx-auto grid max-w-xs justify-items-center text-center">
<div class="fi-ta-empty-state py-12">
<div class="fi-ta-empty-state-content mx-auto grid max-w-xs justify-items-center text-center">
<div class="fi-ta-empty-state-icon-ctn mb-4 rounded-full bg-gray-50 p-3 dark:bg-gray-800/50">
<x-filament::icon
icon="{{ __('custom-fields::custom-fields.empty_states.fields.icon') }}"
Expand Down
6 changes: 3 additions & 3 deletions resources/views/livewire/manage-custom-field-width.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class="relative"
<template x-for="(width, index) in widths" :key="index">
<div
wire:click="$parent.setWidth(fieldId, width)"
class="h-6 flex-1 cursor-pointer bg-gray-200 hover:bg-gray-300 dark:bg-gray-700 dark:hover:bg-gray-600 transition-colors"
class="h-6 flex-1 cursor-pointer bg-gray-200 hover:bg-gray-300 transition-colors"
:class="{
'rounded-s-md': index === 0,
'rounded-e-md': index === widths.length - 1
Expand All @@ -26,12 +26,12 @@ class="h-full w-full border-gray-300 transition-colors duration-200"
'bg-primary-600 hover:bg-primary-600/80': isSelected(width),
'rounded-s-md': index === 0 && isSelected(width),
'rounded-e-md': index === widths.length - 1 && isSelected(width),
'border-s': index !== widths.length && index !== 0,
'border-s': index !== widths.length - 1
}"
></div>
</div>
</template>
</div>
<div class="absolute w-full h-full font-semibold text-sm flex items-center justify-center text-gray-900 dark:text-white">{{ $selectedWidth }}%</div>
<div class="absolute w-full h-full font-semibold text-sm flex items-center justify-center text-black">{{ $selectedWidth }}%</div>
</div>
</div>
4 changes: 1 addition & 3 deletions resources/views/livewire/manage-custom-field.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@ class="fi-section !px-2 fi-compact !py-2 shadow-none fi-grid-col flex justify-be
<x-filament::icon-button
icon="heroicon-m-bars-3"
color="gray"
class="ml-0.5 text-gray-500"
size="xs"
/>

<x-filament::icon
:icon="$field->typeData?->icon ?? 'heroicon-o-document-text'"
class="h-4.5 w-4.5 text-neutral-700 dark:text-neutral-400 ml-2"
class="h-5 w-5 text-gray-500 dark:text-gray-400"
:aria-label="$field->name"
/>

Expand Down
44 changes: 0 additions & 44 deletions resources/views/livewire/manage-fields-without-sections.blade.php

This file was deleted.

121 changes: 0 additions & 121 deletions src/Console/Commands/MigrateEmailFieldValuesCommand.php

This file was deleted.

Loading