Skip to content

Commit e85f159

Browse files
committed
update canvas store correctly to render react flow with latest changes
1 parent 646f7e6 commit e85f159

5 files changed

Lines changed: 197 additions & 111 deletions

File tree

src/components/atoms/Editor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const hideScrollbar = EditorView.theme({
4646
export const Editor = ({ ...props }) => {
4747
const editor = useRef();
4848
const [view, setView] = useState(null);
49-
const [dynamicOptions, setDynamicOptions] = useState([]);
49+
const [dynamicOptions, setDynamicOptions] = useState(props.completionOptions || []);
5050

5151
if (view) {
5252
if (!isEqual(dynamicOptions, props.completionOptions)) {

src/components/atoms/common/TextEditor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ const highlightStyle = EditorView.baseTheme({
100100
export const TextEditor = ({ placeHolder, onChangeHandler, value, disableState, completionOptions, styles }) => {
101101
const editor1 = useRef();
102102
const [view, setView] = useState(null);
103-
const [dynamicOptions, setDynamicOptions] = useState([]);
103+
const [dynamicOptions, setDynamicOptions] = useState(completionOptions);
104104

105105
if (view) {
106106
if (!isEqual(dynamicOptions, completionOptions)) {

src/components/molecules/flow/graph/compute/requestnode.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class requestNode extends Node {
3232

3333
const res = await this.runHttpRequest(options);
3434

35-
if (this.nodeData.requestBody.type === 'form-data') {
35+
if (this.nodeData?.requestBody?.type === 'form-data') {
3636
options.data.value = '<BASE64_ENCODED_FILE_DATA>';
3737
}
3838

@@ -111,7 +111,7 @@ class requestNode extends Node {
111111
data: requestData,
112112
};
113113

114-
if (this.auth && this.auth.type === 'basic-auth') {
114+
if (this.auth && this.auth?.type === 'basic-auth') {
115115
options.auth = {};
116116
options.auth.username = this.auth.username;
117117
options.auth.password = this.auth.password;

src/components/molecules/flow/utils.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@ export const initFlowData = {
119119
id: '1',
120120
type: 'authNode',
121121
description: 'Define authentication for the requests',
122-
data: {},
122+
data: {
123+
type: 'no-auth',
124+
},
123125
position: {
124126
x: 400,
125127
y: 150,

0 commit comments

Comments
 (0)