diff --git a/web/package/agama-web-ui.changes b/web/package/agama-web-ui.changes
index cf4e2281be..a7e69293c7 100644
--- a/web/package/agama-web-ui.changes
+++ b/web/package/agama-web-ui.changes
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Fri Jan 10 13:46:42 UTC 2025 - David Diaz
+
+- Drop the feature for deregistering a product
+ (gh#agama-project/agama#1882).
+-------------------------------------------------------------------
+
Fri Jan 10 13:22:27 UTC 2025 - Imobach Gonzalez Sosa
- Do not allow changing the storage setup when Agama is using the
diff --git a/web/src/api/software.ts b/web/src/api/software.ts
index 82f8650dc5..38a6f72bd9 100644
--- a/web/src/api/software.ts
+++ b/web/src/api/software.ts
@@ -27,7 +27,7 @@ import {
RegistrationInfo,
SoftwareProposal,
} from "~/types/software";
-import { del, get, post, put } from "~/api/http";
+import { get, post, put } from "~/api/http";
/**
* Returns the software configuration
@@ -67,11 +67,6 @@ const updateConfig = (config: SoftwareConfig) => put("/api/software/config", con
const register = ({ key, email }: { key: string; email?: string }) =>
post("/api/software/registration", { key, email });
-/**
- * Request deregistering selected product
- */
-const deregister = () => del("/api/software/registration");
-
export {
fetchConfig,
fetchPatterns,
@@ -80,5 +75,4 @@ export {
fetchRegistration,
updateConfig,
register,
- deregister,
};
diff --git a/web/src/components/product/ProductRegistrationPage.test.tsx b/web/src/components/product/ProductRegistrationPage.test.tsx
index 8e8832b96d..c83d411d35 100644
--- a/web/src/components/product/ProductRegistrationPage.test.tsx
+++ b/web/src/components/product/ProductRegistrationPage.test.tsx
@@ -42,12 +42,10 @@ const sle: Product = {
let selectedProduct: Product;
let registrationInfoMock: RegistrationInfo;
const registerMutationMock = jest.fn();
-const deregisterMutationMock = jest.fn();
jest.mock("~/queries/software", () => ({
...jest.requireActual("~/queries/software"),
useRegisterMutation: () => ({ mutate: registerMutationMock }),
- useDeregisterMutation: () => ({ mutate: deregisterMutationMock }),
useRegistration: (): ReturnType => registrationInfoMock,
useProduct: (): ReturnType => {
return {
@@ -128,13 +126,6 @@ describe("ProductRegistrationPage", () => {
screen.getByText(/\*?5678/);
});
- it("allows deregistering the product", async () => {
- const { user } = installerRender();
- const deregisterButton = screen.getByRole("button", { name: "deregister" });
- await user.click(deregisterButton);
- expect(deregisterMutationMock).toHaveBeenCalled();
- });
-
// describe("but at registration path already", () => {
// beforeEach(() => {
// mockRoutes(REGISTRATION.root);
diff --git a/web/src/components/product/ProductRegistrationPage.tsx b/web/src/components/product/ProductRegistrationPage.tsx
index b776faecb2..2aa23f4f8e 100644
--- a/web/src/components/product/ProductRegistrationPage.tsx
+++ b/web/src/components/product/ProductRegistrationPage.tsx
@@ -39,12 +39,7 @@ import {
import { Page, PasswordInput } from "~/components/core";
import textStyles from "@patternfly/react-styles/css/utilities/Text/text";
import spacingStyles from "@patternfly/react-styles/css/utilities/Spacing/spacing";
-import {
- useProduct,
- useRegistration,
- useRegisterMutation,
- useDeregisterMutation,
-} from "~/queries/software";
+import { useProduct, useRegistration, useRegisterMutation } from "~/queries/software";
import { isEmpty, mask } from "~/utils";
import { _ } from "~/i18n";
import { sprintf } from "sprintf-js";
@@ -55,29 +50,15 @@ const EMAIL_LABEL = "Email";
const RegisteredProductSection = () => {
const { selectedProduct: product } = useProduct();
- const { mutate: deregister } = useDeregisterMutation();
const registration = useRegistration();
const [showCode, setShowCode] = useState(false);
const toggleCodeVisibility = () => setShowCode(!showCode);
- const footer = _("For using a different registration code, please %s the product first.");
- const deregisterButtonLabel = _("deregister");
- const [footerStart, footerEnd] = footer.split("%s");
-
return (
- {footerStart}{" "}
- {" "}
- {footerEnd}
-
- }
>
diff --git a/web/src/queries/software.ts b/web/src/queries/software.ts
index 287154283d..72afd692e7 100644
--- a/web/src/queries/software.ts
+++ b/web/src/queries/software.ts
@@ -39,7 +39,6 @@ import {
SoftwareProposal,
} from "~/types/software";
import {
- deregister,
fetchConfig,
fetchPatterns,
fetchProducts,
@@ -142,25 +141,6 @@ const useRegisterMutation = () => {
return useMutation(query);
};
-/**
- * Hook that builds a mutation for deregistering a product
- *
- * @note it would trigger a general probing as a side-effect when mutation
- * includes a product.
- */
-const useDeregisterMutation = () => {
- const queryClient = useQueryClient();
-
- const query = {
- mutationFn: deregister,
- onSuccess: () => {
- queryClient.invalidateQueries({ queryKey: ["software/registration"] });
- startProbing();
- },
- };
- return useMutation(query);
-};
-
/**
* Returns available products and selected one, if any
*/
@@ -286,5 +266,4 @@ export {
useProposalChanges,
useRegistration,
useRegisterMutation,
- useDeregisterMutation,
};