Open shanthisa opened 2 years ago
ENUM - Convert Category ENUM to text so that we can allow Beverages or any future requirement. Also it will be useful for localisation Units - Add units table and make measures refer to unit. This will enable supporting unit conversion later. If we ship it with text then introducing specific units will become difficult
After selecting meals, the cell in the table on hover should change to a different color. Also the mouse should show a different pointer The delete button should be in the same line as the meal. Only on hover, or on focus only, the delete button should appear next to the meal. By default it should be hidden The background colours of the meals and meal button should be inversed.
Upgrade relay to the latest version.
We are using an older version of Relay and the deprecated component style for query renderers, fragment containers and refetch containers. The latest version of relay uses hooks and is better suited with the latest version of React with support for Suspense and Concurrent fetching.
We need to upgrade to the latest version of Relay to suppor the subsequent story to implement local state with Relay.
Implement local state with relay
When using relay, it is beneficial to stuff local state also into Relay. This allows us to reuse the local state in multiple fragments without having to rely on props drilling as we are currently doing in the code base. This is also better than using a state framework like Redux as we can use Relay as a single source of truth. The components can mix server state and client state and can seamlessly respond when the data behind these components change.
New features:
Tech impact
List of changes🤘
Upgrading Relay as we are going to use hooks such as PreLoadedQuery as the version 9.1.0 used in the current code doesn’t support.
@deleteEdge
on the commit mutation to automatically drop the edge and avoid a refetch.@prependEdge
and@appendEdge
to automatically add the record to the combo box. We can also use@refetchable
directives to places where the data requires additional fields.@deleteEdge
with connections.props.children
and merge catalogue and catalogueGridList into the same component./meal/id
This link renders the DisplayMeal component reading the route from App.jsx. In DisplayMeal use useQuery hook instead of QueryRenderer.