Skip to content

Commit

Permalink
fix: Issue creating cli driven worflow from the UI (#1341)
Browse files Browse the repository at this point in the history
* fix: Issue creating cli driven worflow from the UI
  • Loading branch information
alfespa17 authored Sep 27, 2024
1 parent 77b38bc commit bf83724
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ui/src/domain/Workspaces/Create.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export const CreateWorkspace = () => {
const [step2Hidden, setStep3Hidden] = useState(true);
const [sshKeysVisible, setSSHKeysVisible] = useState(false);
const [versionControlFlow, setVersionControlFlow] = useState(true);
const [requiredVcsPush, setRequiredVcsPush] = useState(true);
const organizationId = sessionStorage.getItem(ORGANIZATION_ARCHIVE);
const [iacTypes, setIacTypes] = useState([]);
const [iacType, setIacType] = useState({
Expand Down Expand Up @@ -156,6 +157,7 @@ export const CreateWorkspace = () => {
setVcsId(id);
}
setCurrent(3);
setRequiredVcsPush(true)
setStep3Hidden(false);
};

Expand Down Expand Up @@ -259,7 +261,8 @@ export const CreateWorkspace = () => {
setCurrent(2);
setStep4Hidden(false);
setSSHKeysVisible(false);
form.setFieldsValue({ source: "empty", branch: "remote-content" });
setRequiredVcsPush(false);
form.setFieldsValue({ source: "empty", branch: "remote-content"});
};

const onFinishFailed = (values, errorFields) => {
Expand Down Expand Up @@ -330,7 +333,7 @@ export const CreateWorkspace = () => {
}
}

if (isWebhooKEnabled) {
if (isWebhooKEnabled && versionControlFlow) {
const webhook_lid = uuid();
body["atomic:operations"].push({
op: "add",
Expand Down Expand Up @@ -734,7 +737,7 @@ export const CreateWorkspace = () => {
name="defaultTemplate"
label="Default template (VCS Push)"
tooltip="Template that will be executed by default when doing a git push to the repository."
rules={[{ required: true }]}
rules={[{ required: requiredVcsPush }]}
hidden={!versionControlFlow}
>
<Select onChange={handleTemplateChange} placeholder="Select Template" style={{ width: 250 }}>
Expand Down

0 comments on commit bf83724

Please sign in to comment.