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

IFC-604 - Update repositories fields #4208

Merged
merged 2 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 9 additions & 1 deletion frontend/app/src/screens/repository/repository-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@ const RepositoryForm = ({ onSuccess, schema, currentObject, onSubmit }: NodeForm
const fields = getFormFieldsFromSchema({ auth, schema, initialObject: currentObject });

const gitUrlFieldProps = fields.find(({ name }) => name === "location");
const credentialFieldProps = fields.find(({ name }) => name === "credential");

const nameFieldProps = fields.find(({ name }) => name === "name");
const descriptionFieldProps = fields.find(({ name }) => name === "description");

// 1 of those 2 fields will be choosen depending on the read only or regular repository
const refFieldProps = fields.find(({ name }) => name === "ref");
const defaultBranchFieldProps = fields.find(({ name }) => name === "default_branch");

const tagsFieldProps = fields.find(({ name }) => name === "tags");

return (
Expand Down Expand Up @@ -81,6 +84,11 @@ const RepositoryForm = ({ onSuccess, schema, currentObject, onSubmit }: NodeForm
)}
</FormGroup>

<FormGroup>
{refFieldProps && <DynamicInput {...refFieldProps} />}
{defaultBranchFieldProps && <DynamicInput {...defaultBranchFieldProps} />}
</FormGroup>

{tagsFieldProps && (
<FormGroup>
<DynamicInput {...tagsFieldProps} />
Expand Down
2 changes: 1 addition & 1 deletion python_sdk/tests/fixtures/schema_02.json
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
"order_weight": 10000
}
],
"label": "Genericrepository",
"label": "Generic repository",
"used_by": [
"CoreReadOnlyRepository",
"CoreRepository"
Expand Down
Loading