fix: update account wording with connection

This commit is contained in:
Ali BARIN
2022-08-08 18:24:36 +02:00
parent fa92375e33
commit b901a396bf
6 changed files with 54 additions and 54 deletions

View File

@@ -11,7 +11,7 @@ import type { IApp, IConnection, IStep, ISubstep } from '@automatisch/types';
import { GET_APP_CONNECTIONS } from 'graphql/queries/get-app-connections';
import { TEST_CONNECTION } from 'graphql/queries/test-connection';
type ChooseAccountSubstepProps = {
type ChooseConnectionSubstepProps = {
substep: ISubstep,
expanded?: boolean;
onExpand: () => void;
@@ -28,7 +28,7 @@ const optionGenerator = (connection: IConnection): { label: string; value: strin
const getOption = (options: Record<string, unknown>[], connectionId?: string) => options.find(connection => connection.value === connectionId) || null;
function ChooseAccountSubstep(props: ChooseAccountSubstepProps): React.ReactElement {
function ChooseConnectionSubstep(props: ChooseConnectionSubstepProps): React.ReactElement {
const {
substep,
expanded = false,
@@ -119,7 +119,7 @@ function ChooseAccountSubstep(props: ChooseAccountSubstepProps): React.ReactElem
disablePortal
disableClearable
options={connectionOptions}
renderInput={(params) => <TextField {...params} label="Choose account" />}
renderInput={(params) => <TextField {...params} label="Choose connection" />}
value={getOption(connectionOptions, connection?.id)}
onChange={handleChange}
loading={loading}
@@ -140,4 +140,4 @@ function ChooseAccountSubstep(props: ChooseAccountSubstepProps): React.ReactElem
);
}
export default ChooseAccountSubstep;
export default ChooseConnectionSubstep;

View File

@@ -19,7 +19,7 @@ import { StepExecutionsProvider } from 'contexts/StepExecutions';
import TestSubstep from 'components/TestSubstep';
import FlowSubstep from 'components/FlowSubstep';
import ChooseAppAndEventSubstep from 'components/ChooseAppAndEventSubstep';
import ChooseAccountSubstep from 'components/ChooseAccountSubstep';
import ChooseConnectionSubstep from 'components/ChooseConnectionSubstep';
import Form from 'components/Form';
import FlowStepContextMenu from 'components/FlowStepContextMenu';
import AppIcon from 'components/AppIcon';
@@ -251,8 +251,8 @@ export default function FlowStep(
index: number
) => (
<React.Fragment key={`${substep?.name}-${index}`}>
{substep.key === 'chooseAccount' && (
<ChooseAccountSubstep
{substep.key === 'chooseConnection' && (
<ChooseConnectionSubstep
expanded={currentSubstep === index + 1}
substep={substep}
onExpand={() => toggleSubstep(index + 1)}
@@ -275,7 +275,7 @@ export default function FlowStep(
/>
)}
{['chooseAccount', 'testStep'].includes(substep.key) ===
{['chooseConnection', 'testStep'].includes(substep.key) ===
false && (
<FlowSubstep
expanded={currentSubstep === index + 1}