Add ConfigurationAdapterBase and extension points for trash bin

Adds the new abstract class ConfigurationAdapterBase to simplify the creation of global configuration views. In addition there is some cleanup, interfaces and extension points for the repository trash bin plugin.

Committed-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
Co-authored-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
This commit is contained in:
Eduard Heimbuch
2023-01-12 14:01:04 +01:00
parent 5c4c759bd2
commit ac419daa3f
34 changed files with 879 additions and 84 deletions

View File

@@ -51,7 +51,7 @@ export const useConfigLink = <C extends HalRepresentation>(link: string) => {
const {
isLoading: isUpdating,
error: mutationError,
mutate,
mutateAsync,
data: updateResponse,
} = useMutation<Response, Error, MutationVariables<C>>(
(vars: MutationVariables<C>) => apiClient.put(vars.link, vars.configuration, vars.contentType),
@@ -67,7 +67,7 @@ export const useConfigLink = <C extends HalRepresentation>(link: string) => {
const update = useCallback(
(configuration: C) => {
if (data && !isReadOnly) {
mutate({
return mutateAsync({
configuration,
contentType: data.contentType,
link: (data.configuration._links.update as Link).href,
@@ -76,7 +76,7 @@ export const useConfigLink = <C extends HalRepresentation>(link: string) => {
},
// eslint means we should add C to the dependency array, but C is only a type
// eslint-disable-next-line react-hooks/exhaustive-deps
[mutate, data, isReadOnly]
[mutateAsync, data, isReadOnly]
);
return {