Skip to content

Commit

Permalink
removing a field from the tenzir modal that is not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
satti-hari-krishna-reddy committed May 22, 2024
1 parent e461589 commit 431af54
Showing 1 changed file with 24 additions and 32 deletions.
56 changes: 24 additions & 32 deletions frontend/src/views/AngularWorkflow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1362,7 +1362,7 @@ const AngularWorkflow = (defaultprops) => {
const topic = document.getElementById('topic')?.value;
const bootstrapServers = document.getElementById('bootstrap_servers')?.value;
const groupId = document.getElementById('group_id')?.value;
const autoOffsetReset = document.getElementById('auto_offset_reset')?.value;
//const autoOffsetReset = document.getElementById('auto_offset_reset')?.value;

if(topic) {
trigger.parameters.push({
Expand Down Expand Up @@ -1391,12 +1391,12 @@ const AngularWorkflow = (defaultprops) => {
});
}

if (autoOffsetReset) {
trigger.parameters.push({
name: "auto_offset_reset",
value: autoOffsetReset
});
}
// if (autoOffsetReset) {
// trigger.parameters.push({
// name: "auto_offset_reset",
// value: autoOffsetReset
// });
// }

setTenzirConfigModalOpen(false);
};
Expand Down Expand Up @@ -7488,12 +7488,6 @@ const AngularWorkflow = (defaultprops) => {
const data = usecase;
data.start_node = mappedStartnode

if (data.type === "create") {
toast("Creating pipeline");
} else if (data.type === "stop") {
toast("stopping pipeline");
}

const url = `${globalUrl}/api/v1/triggers/pipeline`;
fetch(url, {
method: "POST",
Expand All @@ -7512,12 +7506,8 @@ const AngularWorkflow = (defaultprops) => {
return response.json();
})
.then((responseJson) => {
if (!responseJson.success) {
if (responseJson.reason !== undefined) {
toast("Failed to set pipeline: " + responseJson.reason);
} else {
toast.error("Failed to stop pipeline")
}
if (!responseJson.success && data.type !== "delete") {
toast("Failed to set pipeline: " + responseJson.reason);
} else {
if (data.type === "create") {
toast("Pipeline will be created!");
Expand Down Expand Up @@ -8026,7 +8016,7 @@ const AngularWorkflow = (defaultprops) => {
/*
if (trigger.trigger_type === "PIPELINE") {
if (userdata.support !== true) {
return null
return null
}
}
*/
Expand Down Expand Up @@ -9059,7 +9049,7 @@ const AngularWorkflow = (defaultprops) => {
return null
}

if (app.trigger_type === "PIPELINE" && userdata.support !== true) {
if (globalUrl.includes("shuffler.io") && app.trigger_type === "PIPELINE" && userdata.support !== true) {
return null
}

Expand Down Expand Up @@ -14183,7 +14173,7 @@ const AngularWorkflow = (defaultprops) => {
return null
}

const PipelineSidebar = Object.getOwnPropertyNames(selectedTrigger).length === 0 || workflow.triggers[selectedTriggerIndex] === undefined && selectedTrigger.trigger_type !== "SCHEDULE" ? null : !userdata.support === true ? null :
const PipelineSidebar = Object.getOwnPropertyNames(selectedTrigger).length === 0 || workflow.triggers[selectedTriggerIndex] === undefined && selectedTrigger.trigger_type !== "SCHEDULE" ? null : !userdata.support === true && globalUrl.includes("shuffler.io") ? null :
<div style={appApiViewStyle}>
<h3 style={{ marginBottom: "5px" }}>
{selectedTrigger.app_name}: {selectedTrigger.status}
Expand Down Expand Up @@ -14381,7 +14371,7 @@ const AngularWorkflow = (defaultprops) => {
const topic = (selectedTrigger?.parameters?.find(param => param.name === "topic")?.value) || ''
const bootstrapServers = (selectedTrigger?.parameters?.find(param => param.name === "bootstrap_servers")?.value) || ''
const groupId = (selectedTrigger?.parameters?.find(param => param.name === "group_id")?.value) || ''
const autoOffsetReset = (selectedTrigger?.parameters?.find(param => param.name === "auto_offset_reset")?.value) || ''
// const autoOffsetReset = (selectedTrigger?.parameters?.find(param => param.name === "auto_offset_reset")?.value) || ''
let command = "from kafka"

if(topic) {
Expand All @@ -14402,11 +14392,13 @@ const AngularWorkflow = (defaultprops) => {
} else {
command = `${command},group.id=${selectedTrigger.id}`
}
if(autoOffsetReset) {
command = `${command},auto.offset.reset=${autoOffsetReset}`
} else {
command = `${command},auto.offset.reset=earliest`
}
// if(autoOffsetReset) {
// command = `${command},auto.offset.reset=${autoOffsetReset}`
// } else {
// command = `${command},auto.offset.reset=earliest`

// }
command = `${command},auto.offset.reset=earliest`
command = `${command},client.id=${selectedTrigger.id},enable.auto.commit=true,auto.commit.interval.ms=1`
command = `${command} read json | to ${globalUrl}/api/v1/pipelines/pipeline_${selectedTrigger.id}`

Expand Down Expand Up @@ -19462,8 +19454,8 @@ const AngularWorkflow = (defaultprops) => {
pointerEvents: "auto",
color: "white",
minWidth: 600,
minHeight: 500,
maxHeight: 500,
minHeight: 450,
maxHeight: 450,
padding: 15,
overflow: "hidden",
zIndex: 10012,
Expand Down Expand Up @@ -19532,7 +19524,7 @@ const AngularWorkflow = (defaultprops) => {
placeholder={"tenzir"}
defaultValue={(selectedTrigger?.parameters?.find(param => param.name === "group_id")?.value) || ''}
/>
<b>auto.offest.reset</b>
{/* <b>auto.offest.reset</b>
<TextField
id="auto_offset_reset"
style={{
Expand All @@ -19546,7 +19538,7 @@ const AngularWorkflow = (defaultprops) => {
color="primary"
placeholder={"earliest"}
defaultValue={(selectedTrigger?.parameters?.find(param => param.name === "auto_offset_reset")?.value) || ''}
/>
/> */}
</>
)}
</DialogContent>
Expand Down

0 comments on commit 431af54

Please sign in to comment.