Skip to content

Commit

Permalink
Remove some unrelated refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
twschiller committed Sep 22, 2024
1 parent 955553c commit dc76c27
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 21 deletions.
25 changes: 9 additions & 16 deletions src/activation/mapModComponentDefinitionToActivatedModComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,6 @@ export type ActivateModComponentParam = {
integrationDependencies: IntegrationDependency[];
};

function mapDeploymentToDeploymentMetadata(
deployment: Deployment,
): NonNullable<ActivatedModComponent["_deployment"]> {
return {
id: deployment.id,
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- This should be defined in practice
timestamp: deployment.updated_at!,
active: deployment.active,
...(deployment.organization
? { organization: deployment.organization }
: { isPersonalDeployment: true }),
};
}

/**
* Transform a given ModComponentDefinition into an ActivatedModComponent.
*
Expand Down Expand Up @@ -105,8 +91,15 @@ export function mapModComponentDefinitionToActivatedModComponent<
// here makes testing harder because we then have to account for the normalized value in assertions.

if (deployment) {
activatedModComponent._deployment =
mapDeploymentToDeploymentMetadata(deployment);
activatedModComponent._deployment = {
id: deployment.id,
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- This should be defined in practice
timestamp: deployment.updated_at!,
active: deployment.active,
...(deployment.organization
? { organization: deployment.organization }
: { isPersonalDeployment: true }),
};
}

if (modComponentDefinition.services) {
Expand Down
2 changes: 1 addition & 1 deletion src/activation/wizardTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export type WizardStep = {
}>;
};

export type ActivationWizardValues = {
export type WizardValues = {
/**
* Integration dependencies for the mod
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,15 @@ import { render } from "@/extensionConsole/testHelpers";
import { waitForEffect } from "@/testUtils/testHelpers";
import { screen, waitFor } from "@testing-library/react";
import registerDefaultWidgets from "@/components/fields/schemaFields/widgets/registerDefaultWidgets";
import { type RegistryId } from "@/types/registryTypes";
import userEvent from "@testing-library/user-event";
import { MemoryRouter } from "react-router";
import { type ModDefinition } from "@/types/modDefinitionTypes";
import { appApiMock, mockAllApiEndpoints } from "@/testUtils/appApiMock";
import { validateRegistryId } from "@/types/helpers";
import { type RetrieveRecipeResponse } from "@/types/contract";
import {
modComponentDefinitionFactory,
defaultModDefinitionFactory,
modComponentDefinitionFactory,
} from "@/testUtils/factories/modDefinitionFactories";
import { metadataFactory } from "@/testUtils/factories/metadataFactory";
import useActivateMod, {
Expand Down
2 changes: 0 additions & 2 deletions src/extensionConsole/pages/activateMod/ActivateModPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ function useModNotFoundRedirectEffect(error: unknown): void {

/**
* Common page for activating a mod definition
*
* @param modDefinitionQuery The mod definition to activate
*/
const ActivateModPage: React.FC = () => {
const modId = useRegistryIdParam();
Expand Down

0 comments on commit dc76c27

Please sign in to comment.