Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1805 #1806

Merged
merged 2 commits into from
Dec 5, 2024
Merged

1805 #1806

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
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ const Property = ({
controlType,
custom,
description,
expressionEnabled,
hidden,
label,
languageId,
Expand Down Expand Up @@ -737,18 +738,20 @@ const Property = ({
setShowInputTypeSwitchButton(false);
}

if (controlType === 'JSON_SCHEMA_BUILDER') {
setShowInputTypeSwitchButton(true);
}
if (expressionEnabled) {
if (controlType === 'JSON_SCHEMA_BUILDER') {
setShowInputTypeSwitchButton(true);
}

if (controlType === 'SELECT') {
setShowInputTypeSwitchButton(true);
if (controlType === 'SELECT') {
setShowInputTypeSwitchButton(true);
}
}

if (controlType === 'NULL') {
setShowInputTypeSwitchButton(false);
}
}, [controlType]);
}, [controlType, expressionEnabled]);

// update propertyParameterValue when workflow definition changes
useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {WorkflowTestConfigurationKeys} from '@/shared/queries/platform/workflowT
import {useQueryClient} from '@tanstack/react-query';
import {PlusIcon} from 'lucide-react';
import {useEffect, useState} from 'react';
import {twMerge} from 'tailwind-merge';

const ConnectionTabConnectionSelect = ({
workflowConnection,
Expand Down Expand Up @@ -125,18 +126,24 @@ const ConnectionTabConnectionSelect = ({
value={connectionId ? connectionId.toString() : undefined}
>
<div className="flex space-x-2">
<SelectTrigger>
<SelectValue placeholder={`${connections?.length ? 'Choose' : 'Create'} a Connection...`} />
</SelectTrigger>
{connections && connections.length > 0 && (
<SelectTrigger>
<SelectValue placeholder="Choose Connection..." />
</SelectTrigger>
)}

{componentDefinition && (
<ConnectionDialog
componentDefinition={componentDefinition}
connectionTagsQueryKey={ConnectionKeys!.connectionTags}
connectionsQueryKey={ConnectionKeys!.connections}
triggerNode={
<Button className="mt-auto p-2" title="Create a new connection" variant="outline">
<PlusIcon className="size-5" />
<Button
className={twMerge('mt-auto p-2', !connections?.length && 'w-full')}
title="Create a new connection"
variant="outline"
>
<PlusIcon className="size-5" /> {!connections?.length && 'Create Connection'}
</Button>
}
useCreateConnectionMutation={useCreateConnectionMutation}
Expand Down
Loading