Skip to content
This repository was archived by the owner on Apr 14, 2026. It is now read-only.

Commit c2b3487

Browse files
Sandeep KumarSandeep Kumar
authored andcommitted
updated registry information
1 parent ee7b895 commit c2b3487

8 files changed

Lines changed: 253 additions & 37 deletions

File tree

fe/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"@testing-library/jest-dom": "^5.11.4",
77
"@testing-library/react": "^11.1.0",
88
"@testing-library/user-event": "^12.1.10",
9+
"airtable": "^0.11.4",
910
"antd": "^4.17.3",
1011
"dagre": "^0.8.5",
1112
"react": "^17.0.2",

fe/src/components/airtable.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
var Airtable = require("airtable");
2+
var base = new Airtable({ apiKey: "keygKHhjbCGBdYajk" }).base(
3+
"app2rePfeFD3Ltom9"
4+
);
5+
6+
const airtable = (data) => {
7+
base("User Entries").create(
8+
[
9+
{
10+
fields: data,
11+
},
12+
],
13+
function (err, records) {
14+
if (err) {
15+
console.error(err);
16+
return;
17+
}
18+
records.forEach(function (record) {
19+
console.log(record.getId());
20+
});
21+
}
22+
);
23+
};
24+
25+
export default airtable;

fe/src/components/processDefinition.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const processDefinition = (definition) => {
88
const links = [];
99
let ids = 1;
1010
let started;
11-
let loopLimit = 0
11+
let loopLimit = 0;
1212

1313
try {
1414
// Add Boxes
@@ -41,12 +41,10 @@ const processDefinition = (definition) => {
4141

4242
// loop function to iterate the definition
4343
const loopTheData = (data, dataKey, parallelStateEnd) => {
44-
4544
// avoid recursive loop
46-
loopLimit++
47-
if (loopLimit === 20)
48-
throw "loop limit exceeded"
49-
45+
loopLimit++;
46+
if (loopLimit === 20) throw new Error({ message: "loop limit exceeded" });
47+
5048
// add step, condition to skip addition of step
5149
if (!boxIds[dataKey]) {
5250
addBox(ids.toString(), dataKey);
@@ -118,10 +116,8 @@ const processDefinition = (definition) => {
118116
addBoxLink("Start", definition.StartAt, true, "black");
119117
}
120118
return finalJson;
121-
122119
} catch (error) {
123-
return "ERROR"
120+
return "ERROR";
124121
}
125-
126122
};
127123
export { processDefinition };

fe/src/components/processStepFunction.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,13 @@ const ProcessStepFunction = (props) => {
108108
const processedDefinition = processDefinition(
109109
JSON.parse(props.data.definition)
110110
);
111-
if (processDefinition === "ERROR")
112-
setDisplayState("error");
113-
else{
111+
console.log(processedDefinition, "ADF");
112+
if (processedDefinition === "ERROR") setDisplayState("error");
113+
else {
114114
setCurrentGraph(processedDefinition);
115115
setBaseGraph(processedDefinition);
116116
setDisplayState("success");
117117
}
118-
119118
}
120119
});
121120
}

fe/src/comps/Intro/Intro-Mid.jsx

Lines changed: 151 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,180 @@
1-
import { Steps, Collapse, Button } from "antd";
1+
import { Steps, Collapse, Button, Form, Input } from "antd";
22
import { useState } from "react";
3+
import airtable from "../../components/airtable";
4+
import Schema from "async-validator";
5+
Schema.warning = function () {}; // to avoid async validator warning
6+
37
const { Step } = Steps;
48
const { Panel } = Collapse;
59

6-
const stepData = {
7-
"SEGG Access":
8-
"SEGG uses an AWS Lambda to temporarily assume an IAM Role on your AWS Account to fetch the Step Function Information and their corresponding Cloudwatch Logs",
10+
const IAMData = {
911
"IAM Role - Assume Role Policy":
10-
"The IAM Role requires an Assume Role Policy that allows access to SEGG Account",
12+
"The IAM Role requires an Assume Role Policy that allows access to SEGG AWS Account to assume the role",
1113
"IAM Role - Managed Policies":
12-
"The IAM Role needs to have permission to get Step Functions and Cloudwatch Logs",
14+
"The IAM Role that is assumed needs to have permission to get Step Functions and Cloudwatch Logs",
15+
};
16+
const stepData = {
17+
"SEGG Access": (
18+
<>
19+
<p>
20+
SEGG uses an AWS Lambda to temporarily assume an IAM Role from your AWS
21+
Account to fetch the Step Function Information and their corresponding
22+
Cloudwatch Logs. The IAM Role to be created in your account has 2 parts
23+
as mentioned below:
24+
</p>
25+
<Steps progressDot current={4} direction="vertical">
26+
{Object.keys(IAMData).map((e) => {
27+
return <Step title={e} key={e} description={IAMData[e]} />;
28+
})}
29+
</Steps>
30+
</>
31+
),
32+
1333
"1 Click Deploy": (
14-
<Button
15-
target="_blank"
16-
rel="noreferrer"
17-
href="https://console.aws.amazon.com/cloudformation/home?region=ap-south-1#/stacks/new?stackName=SEGG-IAMRole&templateURL=https://oss-1click-deployments.s3.ap-south-1.amazonaws.com/iam-one-click-template.yaml"
18-
>
19-
Create IAM Role
20-
</Button>
34+
<>
35+
<p>
36+
{" "}
37+
Click the button below to create the cloudformation for the required
38+
accesss
39+
</p>
40+
<Button
41+
type="primary"
42+
target="_blank"
43+
rel="noreferrer"
44+
href="https://console.aws.amazon.com/cloudformation/home?region=ap-south-1#/stacks/new?stackName=SEGG-IAMRole&templateURL=https://oss-1click-deployments.s3.ap-south-1.amazonaws.com/iam-one-click-template.yaml"
45+
>
46+
Create IAM Role
47+
</Button>
48+
</>
2149
),
2250
};
2351

2452
const IntroMid = () => {
25-
const [width, setWidth] = useState("100px");
53+
const [width, setWidth] = useState("120px");
54+
const [panel, setPanel] = useState("registerPart1");
55+
const [activeKey, setActiveKey] = useState("");
2656

2757
const changeWidth = () => {
28-
if (width === "100px") {
58+
if (width === "120px") {
2959
setWidth("75%");
60+
setActiveKey("1");
3061
} else {
3162
setTimeout(() => {
32-
setWidth("100px");
63+
setWidth("120px");
64+
setActiveKey();
3365
}, 200);
3466
}
3567
};
68+
const formStyle = {};
3669

37-
return (
38-
<Collapse style={{ width: width }} onChange={changeWidth}>
39-
<Panel showArrow={false} header="Register AWS Account" key="1">
70+
const formUpdate = (values) => {
71+
console.log(values);
72+
airtable(values);
73+
setPanel("registerPart2");
74+
setActiveKey("2");
75+
};
76+
77+
const panelJSX = {
78+
registerPart1: (
79+
<Panel
80+
showArrow={false}
81+
header="Step 1 : Register and Link AWS Account"
82+
key="1"
83+
>
84+
<Form
85+
key="formItem"
86+
layout="vertical"
87+
onFinish={(values) => {
88+
formUpdate(values);
89+
}}
90+
>
91+
<Form.Item
92+
label="Name"
93+
name="Name"
94+
style={formStyle}
95+
rules={[
96+
{
97+
required: true,
98+
message: "Please enter your Name",
99+
},
100+
]}
101+
>
102+
<Input />
103+
</Form.Item>
104+
<Form.Item
105+
label="Email"
106+
style={formStyle}
107+
name="Email"
108+
rules={[
109+
{
110+
type: "email",
111+
message: "Please enter a valid Email",
112+
},
113+
{
114+
required: true,
115+
message: "Please enter your Email",
116+
},
117+
]}
118+
>
119+
<Input />
120+
</Form.Item>
121+
<Form.Item
122+
label="Organisation"
123+
style={formStyle}
124+
name="Organisation"
125+
rules={[
126+
{
127+
required: true,
128+
message: "Please enter your Organisation",
129+
},
130+
]}
131+
>
132+
<Input />
133+
</Form.Item>
134+
<Form.Item
135+
label="Designation"
136+
style={formStyle}
137+
name="Designation"
138+
rules={[
139+
{
140+
required: true,
141+
message: "Please enter your Designation",
142+
},
143+
]}
144+
>
145+
<Input />
146+
</Form.Item>
147+
148+
<Form.Item style={formStyle}>
149+
<Button type="primary" htmlType="submit">
150+
Register
151+
</Button>
152+
</Form.Item>
153+
</Form>
154+
</Panel>
155+
),
156+
registerPart2: (
157+
<Panel
158+
showArrow={false}
159+
header="Step 1 : Register and Link AWS Account"
160+
key="2"
161+
>
40162
<Steps progressDot current={4} direction="vertical">
41163
{Object.keys(stepData).map((e) => {
42164
return <Step title={e} key={e} description={stepData[e]} />;
43165
})}
44166
</Steps>
45167
</Panel>
168+
),
169+
};
170+
171+
return (
172+
<Collapse
173+
activeKey={activeKey}
174+
style={{ width: width }}
175+
onChange={changeWidth}
176+
>
177+
{panelJSX[panel]}
46178
</Collapse>
47179
);
48180
};

fe/src/comps/Intro/Intro-Right.jsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ const formStyle = {};
1010
const IntroRight = () => {
1111
const [cookies, setCookie] = useCookies(["awsInfo"]);
1212
const navigate = useNavigate();
13-
const [width, setWidth] = useState("100px");
13+
const [width, setWidth] = useState("120px");
1414

1515
const changeWidth = () => {
16-
if (width === "100px") {
16+
if (width === "120px") {
1717
setWidth("75%");
1818
} else {
1919
setTimeout(() => {
20-
setWidth("100px");
20+
setWidth("120px");
2121
}, 200);
2222
}
2323
};
@@ -31,7 +31,11 @@ const IntroRight = () => {
3131

3232
return (
3333
<Collapse style={{ width: width }} onChange={changeWidth}>
34-
<Panel showArrow={false} header="Enter AWS Account Information" key="1">
34+
<Panel
35+
showArrow={false}
36+
header="Step 2 : Enter Linked AWS Account Information"
37+
key="1"
38+
>
3539
<Form
3640
key="formItem"
3741
layout="vertical"

fe/src/comps/Intro/Intro.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const introRight = {
2222
const bgVideo = {
2323
position: "fixed",
2424
zIndex: "-1",
25+
height: "calc((100vw/3)*2)",
2526
};
2627

2728
const introRightCol = {
@@ -42,7 +43,7 @@ const Intro = () => {
4243
{/* intro right */}
4344
<Col span={16}>
4445
<div style={introRight}>
45-
<video style={bgVideo} height="1000" autoPlay muted loop>
46+
<video style={bgVideo} autoPlay muted loop>
4647
<source src={WavyDots1000Comp} type="video/mp4" />
4748
</video>
4849
<Row>

0 commit comments

Comments
 (0)