Skip to content

Commit

Permalink
wip working session
Browse files Browse the repository at this point in the history
  • Loading branch information
gheorghelupu17 committed Dec 31, 2024
1 parent 7265336 commit d2bda7f
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 65 deletions.
59 changes: 16 additions & 43 deletions app/Filament/Organizations/Pages/ReportsPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
use Filament\Pages\Page;
use Illuminate\Contracts\Support\Htmlable;
use Illuminate\Contracts\View\View;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\HtmlString;
use function Filament\Support\get_color_css_variables;

class ReportsPage extends Page implements Forms\Contracts\HasForms, HasInfolists
{
Expand Down Expand Up @@ -82,70 +78,47 @@ protected function getFormSchema(): array
{
return [
Forms\Components\Section::make()
->columns(4)
->columns(12)
->schema([
Select::make('report_type')
->key('report_type')
->label(__('report.labels.report_type'))
->columnSpan(2)
->columnSpan(6)
->options(ReportType::options())
->searchable(),

DatePicker::make('start_date')
->label(__('report.labels.start_date'))
->default(now()->startOfMonth())
->columnSpan(3)
->maxDate(fn (Get $get) => $get('end_date') ? $get('end_date') : now())
->live(),

DatePicker::make('end_date')
->label(__('report.labels.end_date'))
->default(now())
->columnSpan(3)
->minDate(fn (Get $get) => $get('start_date') ?? null)
->maxDate(now())
->live(),

Checkbox::make('add_cases_in_monitoring')
->label(function () {
$icon = 'heroicon-o-information-circle';

$iconClasses = Arr::toCssClasses([
'fi-in-text-item-icon h-5 w-5 shrink-0',
'text-custom-500',
]);

$iconColor = 'grey';
$iconStyles = Arr::toCssStyles([
get_color_css_variables($iconColor, shades: [500]) => $iconColor !== 'gray',
]);

$label = Blade::render('
<div class="flex items-center gap-3">
<div class="flex-1 text-sm">
<span title="{{ $helper }}">{{ $label }}</span>
</div>
<span title="{{ $helper }}">
<x-filament::icon
:icon="$icon"
:class="$iconClasses"
:style="$iconStyles"
/>
</span>
</div>', [
'helper' => __('report.helpers.add_cases_in_monitoring'),
'label' => __('report.labels.add_cases_in_monitoring'),
'icon' => $icon,
'iconClasses' => $iconClasses,
'iconStyles' => $iconStyles,
]);

return new HtmlString($label);
})
->columnSpan(2),
->hintIcon('heroicon-o-information-circle', __('report.helpers.add_cases_in_monitoring'))
->hintColor('black')
->columnSpan(2)
->extraAttributes([
'class' => 'justify-start',
])
->label(__('report.labels.add_cases_in_monitoring'))
->default(true),

Checkbox::make('show_missing_values')
->label(__('report.labels.show_missing_values'))
->default(true)
->columnSpan(2),
->extraAttributes([
'class' => 'ml-16'
])
->columnSpan(4),
]),
];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@ public static function getSchema(?Beneficiary $recordParam = null): array
->label(__('beneficiary.section.close_file.labels.date'))
->required(),

TextInput::make('number')
->label(__('beneficiary.section.close_file.labels.number'))
->maxLength(50)
->required(),

DatePicker::make('admittance_date')
->label(__('beneficiary.section.close_file.labels.admittance_date'))
->required(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public static function getSchema(): array

RichEditor::make('close_situation')
->label(__('beneficiary.section.close_file.labels.close_situation'))
->placeholder(__('beneficiary.section.close_file.placeholder.close_situation'))->columnSpanFull()
->placeholder(__('beneficiary.section.close_file.placeholders.close_situation'))->columnSpanFull()
->maxLength(2500),

];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,6 @@ public function infolist(Infolist $infolist): Infolist
->schema([
DateEntry::make('date')
->label(__('beneficiary.section.close_file.labels.date')),

TextEntry::make('number')
->label(__('beneficiary.section.close_file.labels.number')),

DateEntry::make('admittance_date')
->label(__('beneficiary.section.close_file.labels.admittance_date')),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Filament\Forms\Components\Actions\Action;
use Filament\Forms\Components\Grid;
use Filament\Forms\Components\Placeholder;
use Filament\Forms\Components\RichEditor;
use Filament\Forms\Components\Section;
use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\TextInput;
Expand Down Expand Up @@ -190,8 +191,8 @@ function (Get $get, ?int $state) {
->maxLength(200),
]),

Textarea::make('service_details')
->label(__('intervention_plan.labels.service_details'))
RichEditor::make('service_details')
->label(__('intervention_plan.labels.intervention_details'))
->placeholder(__('intervention_plan.placeholders.service_details')),
]),
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public function infolist(Infolist $infolist): Infolist
]),

TextEntry::make('service_details')
->label(__('intervention_plan.labels.service_details'))
->label(__('intervention_plan.labels.intervention_details'))
->columnSpanFull(),
]),
]),
Expand Down
1 change: 0 additions & 1 deletion app/Models/CloseFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class CloseFile extends Model

protected $fillable = [
'date',
'number',
'admittance_date',
'exit_date',
'specialist_id',
Expand Down
1 change: 0 additions & 1 deletion database/factories/CloseFileFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ public function definition(): array

return [
'date' => $this->faker->date(),
'number' => $this->faker->randomNumber(),
'admittance_date' => $this->faker->date(),
'exit_date' => $this->faker->date(),
'admittance_reason' => $this->faker->randomElements(AdmittanceReason::values(), rand(0, 5)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public function up(): void
$table->foreignIdFor(Beneficiary::class)->constrained()->cascadeOnDelete();
$table->foreignIdFor(Specialist::class)->nullable()->constrained()->cascadeOnDelete();
$table->date('date')->nullable();
$table->string('number')->nullable();
$table->date('admittance_date')->nullable();
$table->date('exit_date')->nullable();
$table->string('admittance_reason')->nullable();
Expand Down
9 changes: 5 additions & 4 deletions lang/ro/beneficiary.php
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,9 @@
'admittance_reason' => 'Motivul admiterii în Centru',
'admittance_details' => 'Detalii motiv admitere',
'close_method' => 'Modalitatea de închidere a cazului',
'institution_name' => 'Numele instituției',
'beneficiary_request' => 'Descrie motivul beneficiarei',
'other_details' => 'Descrie altă situație',
'institution_name' => 'Specificǎ instituția/serviciul unde s-a realizat transferul',
'beneficiary_request' => 'Specificǎ motivul beneficiarei',
'other_details' => 'Specificǎ altă situație',
'close_situation' => 'Situația cazului la închidere',
'close_date' => 'Închis la data',
'close_method_widget' => 'Modalitatea de închidere',
Expand All @@ -440,9 +440,10 @@
],
'placeholders' => [
'admittance_details' => 'Adaugă detalii referitoare la motivul admiterii',
'institution_name' => 'Adaugă numele instituției la care s-a transferat beneficiara',
'institution_name' => 'Introdu instituția/serviciului',
'add_details' => 'Adaugă detalii',
'close_situation' => 'Descrieți situația cazului la închidere',
'',
],

'notifications' => [
Expand Down
3 changes: 1 addition & 2 deletions lang/ro/intervention_plan.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
'actions' => 'Acțiuni',
'selected_interval' => 'Interval selectat',
'service_details' => 'Detalii acordare serviciu',
'intervention_details' => 'Detalii acordare intervenții',
],

'headings' => [
Expand Down Expand Up @@ -334,8 +335,6 @@
'add_details' => 'Adaugă detalii',
'select_age' => 'Alege un an',



],

],
Expand Down

0 comments on commit d2bda7f

Please sign in to comment.