Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ const conf: Config = {
// The list of providers for which to disable setting the 'Execute Now Options' field
providersDisabledExecuteOptions: ["metal"],

// The list of execution option fields to disable for the providers in 'providersDisabledExecuteOptions'
providersExecuteOptionsDisabledFields: ["shutdown_instances"],

// The list of the users to hide in the UI
hiddenUsers: ["barbican", "coriolis"],

Expand Down
1 change: 1 addition & 0 deletions src/@types/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export type Config = {
providerSortPriority: { [providerName in ProviderTypes]: number };
providerNames: { [providerName in ProviderTypes]: string };
providersDisabledExecuteOptions: [ProviderTypes];
providersExecuteOptionsDisabledFields: string[];
hiddenUsers: string[];
hiddenUserRoles: string[];
passwordFields: string[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import FieldInput from "@src/components/ui/FieldInput";

import LabelDictionary from "@src/utils/LabelDictionary";
import KeyboardManager from "@src/utils/KeyboardManager";
import configLoader from "@src/utils/Config";
import { executionOptions } from "@src/constants";
import type { Field } from "@src/@types/Field";

Expand Down Expand Up @@ -128,9 +129,17 @@ class TransferExecutionOptions extends React.Component<Props, State> {
value={this.getFieldValue(field)}
label={LabelDictionary.get(field.name)}
onChange={value => this.handleValueChange(field, value)}
disabled={this.props.disableExecutionOptions}
disabled={
this.props.disableExecutionOptions &&
configLoader.config.providersExecuteOptionsDisabledFields.includes(
field.name,
)
}
description={
this.props.disableExecutionOptions
this.props.disableExecutionOptions &&
configLoader.config.providersExecuteOptionsDisabledFields.includes(
field.name,
)
? "The execution options are disabled for the source provider"
: LabelDictionary.getDescription(field.name)
}
Expand Down