You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(assume that AppRoute type implements leptos_struct_table::CellValue to render a hyperlink)
on the driver detail page, it is useful to display the table without driver column (all values are same, all link to the driver detail page itself).
on the car detail page, it is useful to display the table without car column (all values are same, all link to the car detail page itself).
on the list of road trips page, both driver and car columns are displayed.
Current solution is to duplicate the table as RoadTripRowFromDriver and RoadTripRowFromCar, and delete (or #[table(skip)]) one row in each copy.
It works, but maintenance is not ideal. With more relations in the system, it requires extra effort to keep all three table structures (for every relation) in sync,
It would be nice improvement, if something like the following were possible:
enumRoadTripRowMode{All,FromDriver,FromCar,}#[derive(leptos_struct_table::TableRow,Clone)]#[table(sortable, impl_vec_data_provider)]structRoadTripRow{#[table(skip_if=RoadTripRowMode::FromDriver)]pubdriver:AppRoute,#[table(skip_if=RoadTripRowMode::FromCar)]pubcar:AppRoute,#[table(format(string = "[year]-[month]-[day]T[hour]:[minute]:[second]"))]pubtrip_begin:Option<OffsetDateTime>,#[table(format(string = "[year]-[month]-[day]T[hour]:[minute]:[second]"))]pubtrip_end:Option<OffsetDateTime>,
...
}
...// on driver detail page// <Table mode=RoadTripRowMode::FromDriver ... />// on car detail page// <Table mode=RoadTripRowMode::FromCar ... />// on list of all road trips page// <Table mode=RoadTripRowMode::All ... />
The text was updated successfully, but these errors were encountered:
Data which represent a relation are often displayed in multiple places, but often without a column representing one side of the relation.
Example:
(assume that
AppRoute
type implementsleptos_struct_table::CellValue
to render a hyperlink)driver
detail page, it is useful to display the table withoutdriver
column (all values are same, all link to thedriver
detail page itself).car
detail page, it is useful to display the table withoutcar
column (all values are same, all link to thecar
detail page itself).driver
andcar
columns are displayed.Current solution is to duplicate the table as
RoadTripRowFromDriver
andRoadTripRowFromCar
, and delete (or#[table(skip)]
) one row in each copy.It works, but maintenance is not ideal. With more relations in the system, it requires extra effort to keep all three table structures (for every relation) in sync,
It would be nice improvement, if something like the following were possible:
The text was updated successfully, but these errors were encountered: