Skip to content

Error transforming component with a helper that does not use positional params as an attribute #249

@devotox

Description

@devotox

Original

{{#ct-input
        classNames="flex-grow"
        type="time"
        label="Arrive between"
        clearable=(not readOnly)
        disabled=readOnly
        defaultDate=(luxon hour=8 minute=0)
        placeholder="Now"
        date=stop.timeWindowEarliestTime

        onClear=(pipe
          (action (mut stop.timeWindowEarliestTime) null)
          (ct-orm "saveStopOfPlan" stop)
        )

        onSave=(pipe
          (action (mut stop.timeWindowEarliestTime))
          (ct-orm "saveStopOfPlan" stop)
        )
        as |input|
      }}

Transformation

 <CtInput 
    @classNames="flex-grow" 
    @type="time" 
    @label="Arrive between" 
    @clearable={{not readOnly}} 
    @disabled={{readOnly}} 
    @defaultDate=<Luxon @hour={{8}} @minute={{0}} /> 
    @placeholder="Now" 
    @date={{stop.timeWindowEarliestTime}} 
    @onClear={{pipe (action (mut stop.timeWindowEarliestTime) ) (ct-orm "saveStopOfPlan" stop)}} 
    @onSave={{pipe (action (mut stop.timeWindowEarliestTime)) (ct-orm "saveStopOfPlan" stop)
}} as |input|>

As you can see the issue here is with defaultDate

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions