Skip to content

Commit

Permalink
fix(client):disable default actions
Browse files Browse the repository at this point in the history
  • Loading branch information
yuval-hazaz committed Mar 15, 2024
1 parent 9713b51 commit 762816c
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { formatError } from "../util/error";
import { DeleteModuleAction } from "./DeleteModuleAction";
import ModuleActionForm from "./ModuleActionForm";
import useModuleAction from "./hooks/useModuleAction";
import { useModulesContext } from "../Modules/modulesContext";

type Props = AppRouteProps & {
match: match<{
Expand All @@ -35,6 +36,7 @@ type Props = AppRouteProps & {
const ModuleAction = ({ match }: Props) => {
const { moduleAction: moduleActionId } = match?.params ?? {};

const { customActionsLicenseEnabled } = useModulesContext();
const {
addEntity,
resetPendingChangesIndicator,
Expand Down Expand Up @@ -116,6 +118,7 @@ const ModuleAction = ({ match }: Props) => {
name={"enabled"}
onValueChange={onEnableChanged}
checked={data?.moduleAction?.enabled}
disabled={!customActionsLicenseEnabled}
></Toggle>
{data?.moduleAction && isCustomAction && (
<DeleteModuleAction moduleAction={data?.moduleAction} />
Expand All @@ -139,6 +142,7 @@ const ModuleAction = ({ match }: Props) => {
isCustomAction={isCustomAction}
onSubmit={handleSubmit}
defaultValues={data?.moduleAction}
disabled={!customActionsLicenseEnabled}
/>
)}
<Snackbar open={hasError} message={errorMessage} />
Expand Down

0 comments on commit 762816c

Please sign in to comment.