Skip to content

Commit

Permalink
Show disabled or unconfigured services as disabled dropdowns
Browse files Browse the repository at this point in the history
  • Loading branch information
carterworks committed Oct 29, 2024
1 parent f697335 commit 9523a00
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
26 changes: 13 additions & 13 deletions src/view/components/overrides/overrideInput.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
*/
import { Picker, Item } from "@adobe/react-spectrum";
import PropTypes from "prop-types";
import React from "react";
import DataElementSelector from "../dataElementSelector";
Expand Down Expand Up @@ -40,27 +41,26 @@ const OverrideInput = ({
allowsCustomValue = false,
...otherProps
}) => {
if (isDisabled) {
return (
<Picker selectedKey="Disabled" isDisabled {...otherProps}>
<Item key="Disabled">Disabled</Item>
</Picker>
);
}
if (useManualEntry) {
return (
<DataElementSelector isDisabled={isDisabled}>
<FormikTextField isDisabled={isDisabled} {...otherProps} />
<DataElementSelector>
<FormikTextField {...otherProps} />
</DataElementSelector>
);
}
if (!allowsCustomValue) {
return (
<FormikPicker isDisabled={isDisabled} {...otherProps}>
{children}
</FormikPicker>
);
return <FormikPicker {...otherProps}>{children}</FormikPicker>;
}
return (
<DataElementSelector isDisabled={isDisabled}>
<FormikComboBox
isDisabled={isDisabled}
allowsCustomValue={allowsCustomValue}
{...otherProps}
>
<DataElementSelector>
<FormikComboBox allowsCustomValue={allowsCustomValue} {...otherProps}>
{children}
</FormikComboBox>
</DataElementSelector>
Expand Down
5 changes: 2 additions & 3 deletions src/view/components/overrides/overrides.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ const Overrides = ({
) &&
!isDisabled(
"com_adobe_experience_platform.enabled",
serviceStatus.com_adobe_experience_platform_ode
serviceStatus.com_adobe_experience_platform
.value,
) && (
<OverrideInput
Expand Down Expand Up @@ -627,8 +627,7 @@ const Overrides = ({
) &&
!isDisabled(
"com_adobe_experience_platform.enabled",
serviceStatus
.com_adobe_experience_platform_edge_segmentation
serviceStatus.com_adobe_experience_platform
.value,
) && (
<OverrideInput
Expand Down

0 comments on commit 9523a00

Please sign in to comment.