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

8726 workflow add a test button in workflow code step #9016

Merged
merged 31 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
2f5b4a4
Clean code
martmull Dec 6, 2024
c690eb0
Clean code again and add tabs
martmull Dec 6, 2024
0b6fb07
Add Variables to renderFields
martmull Dec 6, 2024
1cb7109
Wip: Add ExecutionResult component
martmull Dec 9, 2024
b7d8f32
Fix button style
martmull Dec 9, 2024
252602b
Remove button from code tab
martmull Dec 9, 2024
d7ef96f
WIP: Improve functionInput computation
martmull Dec 10, 2024
984c7e6
Remove code introspection module
martmull Dec 10, 2024
7bd28e5
Simplify component
martmull Dec 10, 2024
285f352
Simplify component 2
martmull Dec 10, 2024
577afd9
Simplify useTabList
martmull Dec 11, 2024
2a13749
Add test button to code tab
martmull Dec 11, 2024
cfc4e17
Fix test
martmull Dec 11, 2024
d55144a
Fix outputSchema computing
martmull Dec 11, 2024
b41d42f
Remove Action command from footer
martmull Dec 11, 2024
e427018
Merge branch 'main' into 8726-workflow-add-a-test-button-in-workflow-…
martmull Dec 11, 2024
f12418a
Fix test tab redirect in settings
martmull Dec 11, 2024
601bee3
Fix lint
martmull Dec 11, 2024
096994f
Fix missing changes
martmull Dec 11, 2024
4136651
Code review returns: greptile
martmull Dec 11, 2024
3d0c160
Fix ci
martmull Dec 11, 2024
43366b9
Code review returns
martmull Dec 11, 2024
5d7b7a4
Fix ci
martmull Dec 11, 2024
1c19366
Fix memory heap for storybook build
martmull Dec 12, 2024
2a938f1
Code review returns
martmull Dec 12, 2024
c2cca64
Merge branch 'main' into 8726-workflow-add-a-test-button-in-workflow-…
martmull Dec 12, 2024
c83bb61
Fix tests
martmull Dec 12, 2024
70dc0a6
Code review returns
martmull Dec 13, 2024
8742e73
Export component instead of StyledComponent
martmull Dec 13, 2024
74d38f0
Fix main failing test
martmull Dec 13, 2024
c2907bd
Fix Workflow execution
martmull Dec 13, 2024
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
2 changes: 1 addition & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
"outputs": ["{projectRoot}/{options.output-dir}"],
"options": {
"cwd": "{projectRoot}",
"command": "VITE_DISABLE_ESLINT_CHECKER=true storybook build",
"command": "VITE_DISABLE_TYPESCRIPT_CHECKER=true VITE_DISABLE_ESLINT_CHECKER=true storybook build",
martmull marked this conversation as resolved.
Show resolved Hide resolved
"output-dir": "storybook-static",
"config-dir": ".storybook"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/twenty-front/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"test": {},
"storybook:build": {
"options": {
"env": { "NODE_OPTIONS": "--max_old_space_size=7000" }
"env": { "NODE_OPTIONS": "--max_old_space_size=8000" }
martmull marked this conversation as resolved.
Show resolved Hide resolved
},
"configurations": {
"docs": { "env": { "STORYBOOK_SCOPE": "ui-docs" } },
Expand Down
2 changes: 0 additions & 2 deletions packages/twenty-front/src/generated-metadata/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1569,8 +1569,6 @@ export type UpdateServerlessFunctionInput = {
};

export type UpdateWorkflowVersionStepInput = {
/** Boolean to check if we need to update stepOutput */
shouldUpdateStepOutput?: InputMaybe<Scalars['Boolean']['input']>;
/** Step to update in JSON format */
step: Scalars['JSON']['input'];
/** Workflow version ID */
Expand Down
2 changes: 0 additions & 2 deletions packages/twenty-front/src/generated/graphql.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1277,8 +1277,6 @@ export type UpdateServerlessFunctionInput = {
};

export type UpdateWorkflowVersionStepInput = {
/** Boolean to check if we need to update stepOutput */
shouldUpdateStepOutput?: InputMaybe<Scalars['Boolean']>;
/** Step to update in JSON format */
step: Scalars['JSON'];
/** Workflow version ID */
Expand Down
32 changes: 0 additions & 32 deletions packages/twenty-front/src/hooks/usePreventOverlapCallback.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { Button } from 'twenty-ui';
import { useScopedHotkeys } from '@/ui/utilities/hotkey/hooks/useScopedHotkeys';
import { Key } from 'ts-key-enum';
import { RightDrawerHotkeyScope } from '@/ui/layout/right-drawer/types/RightDrawerHotkeyScope';

export const CmdEnterActionButton = ({
title,
onClick,
}: {
title: string;
onClick: () => void;
}) => {
useScopedHotkeys(
[`${Key.Control}+${Key.Enter}`, `${Key.Meta}+${Key.Enter}`],
() => onClick(),
RightDrawerHotkeyScope.RightDrawer,
[onClick],
martmull marked this conversation as resolved.
Show resolved Hide resolved
);

return (
<Button
title={title}
variant="primary"
accent="blue"
size="medium"
onClick={onClick}
shortcut={'⌘⏎'}
martmull marked this conversation as resolved.
Show resolved Hide resolved
/>
);
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import styled from '@emotion/styled';
import { useRecoilValue } from 'recoil';
import {
AnimatedPlaceholder,
AnimatedPlaceholderEmptyContainer,
Expand Down Expand Up @@ -43,8 +42,7 @@ export const TaskGroups = ({ targetableObjects }: TaskGroupsProps) => {
activityObjectNameSingular: CoreObjectNameSingular.Task,
});

const { activeTabIdState } = useTabList(TASKS_TAB_LIST_COMPONENT_ID);
const activeTabId = useRecoilValue(activeTabIdState);
const { activeTabId } = useTabList(TASKS_TAB_LIST_COMPONENT_ID);

const isLoading =
(activeTabId !== 'done' && tasksLoading) ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ const SettingsServerlessFunctions = lazy(() =>
).then((module) => ({ default: module.SettingsServerlessFunctions })),
);

const SettingsServerlessFunctionDetailWrapper = lazy(() =>
const SettingsServerlessFunctionDetail = lazy(() =>
import(
'~/pages/settings/serverless-functions/SettingsServerlessFunctionDetailWrapper'
'~/pages/settings/serverless-functions/SettingsServerlessFunctionDetail'
).then((module) => ({
default: module.SettingsServerlessFunctionDetailWrapper,
default: module.SettingsServerlessFunctionDetail,
})),
);

Expand Down Expand Up @@ -353,7 +353,7 @@ export const SettingsRoutes = ({
/>
<Route
path={SettingsPath.ServerlessFunctionDetail}
element={<SettingsServerlessFunctionDetailWrapper />}
element={<SettingsServerlessFunctionDetail />}
/>
</>
)}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { FormCountrySelectInput } from '@/object-record/record-field/form-types/components/FormCountrySelectInput';
import { FormTextFieldInput } from '@/object-record/record-field/form-types/components/FormTextFieldInput';
import { StyledFormCompositeFieldInputContainer } from '@/object-record/record-field/form-types/components/StyledFormCompositeFieldInputContainer';
import { StyledFormFieldInputContainer } from '@/object-record/record-field/form-types/components/StyledFormFieldInputContainer';
import { FormNestedFieldInputContainer } from '@/object-record/record-field/form-types/components/FormNestedFieldInputContainer';
import { FormFieldInputContainer } from '@/object-record/record-field/form-types/components/FormFieldInputContainer';
import { VariablePickerComponent } from '@/object-record/record-field/form-types/types/VariablePickerComponent';
import { FieldAddressDraftValue } from '@/object-record/record-field/types/FieldInputDraftValue';
import { FieldAddressValue } from '@/object-record/record-field/types/FieldMetadata';
Expand Down Expand Up @@ -39,9 +39,9 @@ export const FormAddressFieldInput = ({
};

return (
<StyledFormFieldInputContainer>
<FormFieldInputContainer>
{label ? <InputLabel>{label}</InputLabel> : null}
<StyledFormCompositeFieldInputContainer>
<FormNestedFieldInputContainer>
<FormTextFieldInput
label="Address 1"
defaultValue={defaultValue?.addressStreet1 ?? ''}
Expand Down Expand Up @@ -88,7 +88,7 @@ export const FormAddressFieldInput = ({
readonly={readonly}
VariablePicker={VariablePicker}
/>
</StyledFormCompositeFieldInputContainer>
</StyledFormFieldInputContainer>
</FormNestedFieldInputContainer>
</FormFieldInputContainer>
);
};
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { StyledFormFieldInputContainer } from '@/object-record/record-field/form-types/components/StyledFormFieldInputContainer';
import { StyledFormFieldInputInputContainer } from '@/object-record/record-field/form-types/components/StyledFormFieldInputInputContainer';
import { StyledFormFieldInputRowContainer } from '@/object-record/record-field/form-types/components/StyledFormFieldInputRowContainer';
import { FormFieldInputContainer } from '@/object-record/record-field/form-types/components/FormFieldInputContainer';
import { FormFieldInputInputContainer } from '@/object-record/record-field/form-types/components/FormFieldInputInputContainer';
import { FormFieldInputRowContainer } from '@/object-record/record-field/form-types/components/FormFieldInputRowContainer';
import { VariableChip } from '@/object-record/record-field/form-types/components/VariableChip';
import { VariablePickerComponent } from '@/object-record/record-field/form-types/types/VariablePickerComponent';
import { BooleanInput } from '@/ui/field/input/components/BooleanInput';
Expand Down Expand Up @@ -80,11 +80,11 @@ export const FormBooleanFieldInput = ({
};

return (
<StyledFormFieldInputContainer>
<FormFieldInputContainer>
{label ? <InputLabel>{label}</InputLabel> : null}

<StyledFormFieldInputRowContainer>
<StyledFormFieldInputInputContainer
<FormFieldInputRowContainer>
<FormFieldInputInputContainer
hasRightElement={isDefined(VariablePicker)}
>
{draftValue.type === 'static' ? (
Expand All @@ -101,15 +101,15 @@ export const FormBooleanFieldInput = ({
onRemove={handleUnlinkVariable}
/>
)}
</StyledFormFieldInputInputContainer>
</FormFieldInputInputContainer>

{VariablePicker ? (
<VariablePicker
inputId={inputId}
onVariableSelect={handleVariableTagInsert}
/>
) : null}
</StyledFormFieldInputRowContainer>
</StyledFormFieldInputContainer>
</FormFieldInputRowContainer>
</FormFieldInputContainer>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import styled from '@emotion/styled';

const StyledFormFieldInputContainer = styled.div`
display: flex;
flex-direction: column;
width: 100%;
`;

export const FormFieldInputContainer = StyledFormFieldInputContainer;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { css } from '@emotion/react';
import styled from '@emotion/styled';

export const StyledFormFieldInputInputContainer = styled.div<{
const StyledFormFieldInputInputContainer = styled.div<{
hasRightElement: boolean;
multiline?: boolean;
readonly?: boolean;
Expand Down Expand Up @@ -29,3 +29,5 @@ export const StyledFormFieldInputInputContainer = styled.div<{
overflow: ${({ multiline }) => (multiline ? 'auto' : 'hidden')};
width: 100%;
`;

export const FormFieldInputInputContainer = StyledFormFieldInputInputContainer;
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import styled from '@emotion/styled';

export const LINE_HEIGHT = 24;

export const StyledFormFieldInputRowContainer = styled.div<{
const StyledFormFieldInputRowContainer = styled.div<{
multiline?: boolean;
}>`
display: flex;
Expand All @@ -21,3 +21,5 @@ export const StyledFormFieldInputRowContainer = styled.div<{
height: 32px;
`}
`;

export const FormFieldInputRowContainer = StyledFormFieldInputRowContainer;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FormTextFieldInput } from '@/object-record/record-field/form-types/components/FormTextFieldInput';
import { StyledFormCompositeFieldInputContainer } from '@/object-record/record-field/form-types/components/StyledFormCompositeFieldInputContainer';
import { StyledFormFieldInputContainer } from '@/object-record/record-field/form-types/components/StyledFormFieldInputContainer';
import { FormNestedFieldInputContainer } from '@/object-record/record-field/form-types/components/FormNestedFieldInputContainer';
import { FormFieldInputContainer } from '@/object-record/record-field/form-types/components/FormFieldInputContainer';
import { VariablePickerComponent } from '@/object-record/record-field/form-types/types/VariablePickerComponent';
import { FIRST_NAME_PLACEHOLDER_WITH_SPECIAL_CHARACTER_TO_AVOID_PASSWORD_MANAGERS } from '@/object-record/record-field/meta-types/input/constants/FirstNamePlaceholder';
import { LAST_NAME_PLACEHOLDER_WITH_SPECIAL_CHARACTER_TO_AVOID_PASSWORD_MANAGERS } from '@/object-record/record-field/meta-types/input/constants/LastNamePlaceholder';
Expand Down Expand Up @@ -37,9 +37,9 @@ export const FormFullNameFieldInput = ({
};

return (
<StyledFormFieldInputContainer>
<FormFieldInputContainer>
{label ? <InputLabel>{label}</InputLabel> : null}
<StyledFormCompositeFieldInputContainer>
<FormNestedFieldInputContainer>
<FormTextFieldInput
label="First Name"
defaultValue={defaultValue?.firstName}
Expand All @@ -60,7 +60,7 @@ export const FormFullNameFieldInput = ({
readonly={readonly}
VariablePicker={VariablePicker}
/>
</StyledFormCompositeFieldInputContainer>
</StyledFormFieldInputContainer>
</FormNestedFieldInputContainer>
</FormFieldInputContainer>
);
};
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import styled from '@emotion/styled';

export const StyledFormCompositeFieldInputContainer = styled.div`
const StyledFormNestedFieldInputContainer = styled.div`
display: flex;
flex-direction: column;
background: ${({ theme }) => theme.background.secondary};
Expand All @@ -9,3 +9,6 @@ export const StyledFormCompositeFieldInputContainer = styled.div`
gap: ${({ theme }) => theme.spacing(2)};
padding: ${({ theme }) => theme.spacing(2)};
`;

export const FormNestedFieldInputContainer =
StyledFormNestedFieldInputContainer;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { StyledFormFieldInputContainer } from '@/object-record/record-field/form-types/components/StyledFormFieldInputContainer';
import { StyledFormFieldInputInputContainer } from '@/object-record/record-field/form-types/components/StyledFormFieldInputInputContainer';
import { StyledFormFieldInputRowContainer } from '@/object-record/record-field/form-types/components/StyledFormFieldInputRowContainer';
import { FormFieldInputContainer } from '@/object-record/record-field/form-types/components/FormFieldInputContainer';
import { FormFieldInputInputContainer } from '@/object-record/record-field/form-types/components/FormFieldInputInputContainer';
import { FormFieldInputRowContainer } from '@/object-record/record-field/form-types/components/FormFieldInputRowContainer';
import { VariableChip } from '@/object-record/record-field/form-types/components/VariableChip';
import { VariablePickerComponent } from '@/object-record/record-field/form-types/types/VariablePickerComponent';
import { TextInput } from '@/ui/field/input/components/TextInput';
Expand Down Expand Up @@ -94,11 +94,11 @@ export const FormNumberFieldInput = ({
};

return (
<StyledFormFieldInputContainer>
<FormFieldInputContainer>
{label ? <InputLabel htmlFor={inputId}>{label}</InputLabel> : null}

<StyledFormFieldInputRowContainer>
<StyledFormFieldInputInputContainer
<FormFieldInputRowContainer>
<FormFieldInputInputContainer
hasRightElement={isDefined(VariablePicker)}
>
{draftValue.type === 'static' ? (
Expand All @@ -116,15 +116,15 @@ export const FormNumberFieldInput = ({
onRemove={handleUnlinkVariable}
/>
)}
</StyledFormFieldInputInputContainer>
</FormFieldInputInputContainer>

{VariablePicker ? (
<VariablePicker
inputId={inputId}
onVariableSelect={handleVariableTagInsert}
/>
) : null}
</StyledFormFieldInputRowContainer>
</StyledFormFieldInputContainer>
</FormFieldInputRowContainer>
</FormFieldInputContainer>
);
};
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { StyledFormFieldInputContainer } from '@/object-record/record-field/form-types/components/StyledFormFieldInputContainer';
import { StyledFormFieldInputInputContainer } from '@/object-record/record-field/form-types/components/StyledFormFieldInputInputContainer';
import { StyledFormFieldInputRowContainer } from '@/object-record/record-field/form-types/components/StyledFormFieldInputRowContainer';
import { FormFieldInputContainer } from '@/object-record/record-field/form-types/components/FormFieldInputContainer';
import { FormFieldInputInputContainer } from '@/object-record/record-field/form-types/components/FormFieldInputInputContainer';
import { FormFieldInputRowContainer } from '@/object-record/record-field/form-types/components/FormFieldInputRowContainer';
import { VariableChip } from '@/object-record/record-field/form-types/components/VariableChip';
import { VariablePickerComponent } from '@/object-record/record-field/form-types/types/VariablePickerComponent';
import { InlineCellHotkeyScope } from '@/object-record/record-inline-cell/types/InlineCellHotkeyScope';
Expand Down Expand Up @@ -204,11 +204,11 @@ export const FormSelectFieldInput = ({
];

return (
<StyledFormFieldInputContainer>
<FormFieldInputContainer>
{label ? <InputLabel>{label}</InputLabel> : null}

<StyledFormFieldInputRowContainer>
<StyledFormFieldInputInputContainer
<FormFieldInputRowContainer>
<FormFieldInputInputContainer
hasRightElement={isDefined(VariablePicker)}
>
{draftValue.type === 'static' ? (
Expand All @@ -234,7 +234,7 @@ export const FormSelectFieldInput = ({
onRemove={handleUnlinkVariable}
/>
)}
</StyledFormFieldInputInputContainer>
</FormFieldInputInputContainer>
<StyledSelectInputContainer>
{draftValue.type === 'static' &&
draftValue.editingMode === 'edit' && (
Expand All @@ -260,7 +260,7 @@ export const FormSelectFieldInput = ({
onVariableSelect={handleVariableTagInsert}
/>
)}
</StyledFormFieldInputRowContainer>
</StyledFormFieldInputContainer>
</FormFieldInputRowContainer>
</FormFieldInputContainer>
);
};
Loading
Loading