debian-image-builder-frontend/src/Utilities
lucasgarfield c4b59374f2 Redux: Add clones slice
This commit updates the Redux store so that the new clone API end points
can be used. The composes slice is updated - composes now have a clones
property - and a clones slice is added.

Selectors are added as well. Although not used in this commit, the
selectors will allow us to significantly simplify our React components
that need to retreive data from the store.

We now must work with both `composes` and `clones`. `Composes` and `clones`
have slightly different schema in the Redux store because of differences
in their API responses (the store schema generally mirrors the API
response schema). Selectors are defined for `images` that work for
both `composes` and `clones`.

Using selectors allows our React components to interact with the Redux store
as if it were a database - components can simply query the store by id
using a selector. This hugely simplifies our React components - they no
longer need to accept multiple props related to a `compose` (or `clone`
or `image`). They can simply take a `composeId` (or `cloneId` or
`imageId`) prop and use an appropriate selector to obtain the necessary
information.

Selectors also encapsulate the store schema. Components no longer need to know
about the store schema to get information about an image - they simply
use a selector and in return receive a normalized (and flat) object.
This means that in the future we could easily migrate the API and slices
to RTK Query without the need to modify any of our React components.
2022-11-08 11:29:31 +01:00
..
isRhel.js update style across the project 2022-05-23 12:47:20 +02:00
path.js src/Router: use release as a basename in BrowserRouter 2022-10-17 15:53:21 +02:00
time.js Redux: Add clones slice 2022-11-08 11:29:31 +01:00