Skip to content

Commit

Permalink
Merge pull request #168 from ECFMP/fm-mit
Browse files Browse the repository at this point in the history
fix(FlowMeasureResource): changes for value
  • Loading branch information
AndyTWF authored Jul 17, 2022
2 parents 31cc91d + 90cf164 commit 8550df7
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions app/Filament/Resources/FlowMeasureResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,16 +169,19 @@ public static function form(Form $form): Form
->required(),
Forms\Components\TextInput::make('value')
->columnSpan(2)
->disabled(fn (Closure $get) => $get('edit_mode') == FlowMeasureResource::PARTIAL_EDIT ||
in_array($get('type'), [
FlowMeasureType::MANDATORY_ROUTE->value,
FlowMeasureType::PROHIBIT->value,
])
->disabled(fn (Closure $get) => in_array($get('type'), [
FlowMeasureType::MANDATORY_ROUTE->value,
FlowMeasureType::PROHIBIT->value,
])
|| $get('type') == null)
->required(fn (Closure $get) => !in_array($get('type'), [
FlowMeasureType::MANDATORY_ROUTE->value,
FlowMeasureType::PROHIBIT->value,
]))
->numeric()
->minValue(1)
->maxValue(400)
->step(1)
->hidden(fn (Closure $get) => in_array($get('type'), [
FlowMeasureType::MINIMUM_DEPARTURE_INTERVAL->value,
FlowMeasureType::AVERAGE_DEPARTURE_INTERVAL->value,
Expand Down

0 comments on commit 8550df7

Please sign in to comment.