Skip to content

Commit

Permalink
Merge branch 'feature/14-settings-page' into 'development'
Browse files Browse the repository at this point in the history
From feature/14-settings-page into development

Closes #14

See merge request prompt-engineers/v2/llm-server!14
  • Loading branch information
ryaneggz committed Aug 18, 2024
2 parents b754b6f + 90e828a commit 7a8df23
Show file tree
Hide file tree
Showing 5 changed files with 185 additions and 3 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- bugfix/42-redis-is-default-vector-db (2024-05-26)
- bugfix/33-groq-rag-not-working (2024-05-19)
### Changed
- feature/14-settings-page (2024-08-18)
- feature/16-improve-oauth-callback-page-ux (2024-08-18)
- feature/17-google-oauth (2024-08-18)
- feature/10-add-oauth-github (2024-08-14)
Expand Down
136 changes: 134 additions & 2 deletions examples/tools/gitlab.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
{
"name": "pe_create_project_issue",
"name": "create_project_issue",
"description": "Allows to create Gitlab project issue.",
"link": "",
"toolkit": "Gitlab",
Expand Down Expand Up @@ -34,7 +34,7 @@
}
},
{
"name": "pe_create_project_merge_request",
"name": "create_project_merge_request",
"description": "Allows to create Gitlab project merge request.",
"link": "",
"toolkit": "Gitlab",
Expand Down Expand Up @@ -78,5 +78,137 @@
"encrypted": true
}
}
},
{
"name": "create_repo_branch",
"description": "Create a new branch in the repository.",
"link": "https://docs.gitlab.com/ee/api/branches.html#create-repository-branch",
"method": "POST",
"toolkit": "Gitlab",
"url": "https://gitlab.com/api/v4/projects/{project_id}/repository/branches?branch={branch}&ref={ref}",
"headers": {
"PRIVATE-TOKEN": {
"value": "my_private_token",
"encrypted": true
}
},
"args": {
"project_id": {
"description": "This is the project ID for a Gitlab repository to be used as a URL param.",
"type": "str",
"default": "60281633",
"required": true
},
"branch": {
"description": "Name of new branch. Should be prefixed with either \"feature/\" or \"bugfix/\" then the issue id will follow and brief desc of title.\nExample: feature/24-add-functionality-for-item",
"type": "str",
"default": "",
"required": true
},
"ref": {
"description": "Branch name or commit SHA to create branch from.",
"type": "str",
"default": "",
"required": true
}
}
},
{
"name": "create_merge_request",
"description": "Creates a new merge request.",
"link": "https://docs.gitlab.com/ee/api/merge_requests.html#create-mr",
"method": "POST",
"toolkit": "Gitlab",
"url": "https://gitlab.com/api/v4/projects/{project_id}/merge_requests",
"headers": {
"PRIVATE-TOKEN": {
"value": "my_private_token",
"encrypted": true
}
},
"args": {
"project_id": {
"description": "This is the project ID for a Gitlab repository to be used as a URL param.",
"type": "str",
"default": "60281633",
"required": true
},
"source_branch": {
"description": "The source branch. Branch where changes have been made.",
"type": "str",
"default": "",
"required": true
},
"target_branch": {
"description": "The target branch. Branch where changes will be merged into.",
"type": "str",
"default": "development",
"required": true
},
"title": {
"description": "Title of Merge Request. \n---\nExample Title:\nFROM <source_branch> INTO <target_branch>",
"type": "str",
"default": "",
"required": true
},
"description": {
"description": "Description of the merge request. If issue number is included in the source_branch add \"Closes #<issuenumber>\" so that issue will automatically close on merge.",
"type": "str",
"default": "",
"required": false
},
"squash": {
"description": "If true, squash all commits into a single commit on merge.",
"type": "str",
"default": "true",
"required": false
}
}
},
{
"name": "create_commit",
"description": "Creates a new commit with multiple files and actions.",
"link": "https://docs.gitlab.com/ee/api/commits.html#create-a-commit-with-multiple-files-and-actions",
"method": "POST",
"toolkit": "Gitlab",
"url": "https://gitlab.com/api/v4/projects/{id}/repository/commits",
"headers": {
"PRIVATE-TOKEN": {
"value": "my_private_token",
"encrypted": true
}
},
"args": {
"id": {
"description": "The ID or URL-encoded path of the project.",
"type": "str",
"default": "60281633",
"required": true
},
"branch": {
"description": "Name of the branch to commit into. To create a new branch, also provide either start_branch or start_sha, and optionally start_project.",
"type": "str",
"default": "",
"required": true
},
"commit_message": {
"description": "Commit message describing the changes.",
"type": "str",
"default": "",
"required": true
},
"start_branch": {
"description": "Name of the branch to start the new branch from.",
"type": "str",
"default": "development",
"required": true
},
"actions": {
"description": "An array of action hashes to commit as a batch. Actions include create, delete, move, update, and chmod. \n\nExamples: \n1. Create a new file: {\"action\": \"create\", \"file_path\": \"foo/bar\", \"content\": \"some content\"} \n2. Delete a file: {\"action\": \"delete\", \"file_path\": \"foo/bar2\"} \n3. Move a file: {\"action\": \"move\", \"file_path\": \"foo/bar3\", \"previous_path\": \"foo/bar4\", \"content\": \"some content\"} \n4. Update a file: {\"action\": \"update\", \"file_path\": \"foo/bar5\", \"content\": \"new content\"} \n5. Change file permissions (chmod): {\"action\": \"chmod\", \"file_path\": \"foo/bar5\", \"execute_filemode\": true}",
"type": "array",
"default": "",
"required": true
}
}
}
]
39 changes: 39 additions & 0 deletions frontend/src/app/settings/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
"use client";

import { useRouter } from "next/navigation";
import { FC } from "react";
import { IoIosArrowBack } from "react-icons/io";


const SettingsPage: FC = () => {
const router = useRouter();

return (
<main
className="flex min-h-screen flex-col"
style={{ position: "relative" }}
>
<button
className="flex"
style={{
position: "absolute",
top: 10,
left: 10,
cursor: "pointer",
}}
onClick={() => router.back()}
>
<IoIosArrowBack className="text-2xl" /> <span className="font-semibold">Go Back</span>
</button>
<div
className={`flex-1 flex flex-col justify-center px-6 py-12 lg:px-8`}
>
<div className="sm:mx-auto sm:w-full sm:max-w-md text-center">
Settings Page
</div>
</div>
</main>
);
};

export default SettingsPage;
10 changes: 9 additions & 1 deletion frontend/src/components/dialog/SettingsPopover.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
"use client";

import { useAppContext } from "@/contexts/AppContext";
import { useAuthContext } from "@/contexts/AuthContext";
import { useRouter } from "next/navigation";

const SettingsPopover = () => {
const router = useRouter();
const { logout, retrieveUser } = useAuthContext();
const { setIsOpen, setIsCustomizeOpen } = useAppContext();
const { setIsCustomizeOpen } = useAppContext();

return (
<div
Expand Down Expand Up @@ -137,6 +141,10 @@ const SettingsPopover = () => {
id="headlessui-menu-item-:rmk:"
role="menuitem"
data-headlessui-state=""
onClick={(event) => {
event.preventDefault();
router.push("/settings");
}}
>
<svg
width="24"
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/components/forms/tools/ArgDataGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ export default function ArgsDataGrid() {
<option value="int">int</option>
<option value="bool">bool</option>
<option value="float">float</option>
<option value="array">array</option>
<option value="object">object</option>
</select>
</Field>
<Field className="col-span-2">
Expand Down

0 comments on commit 7a8df23

Please sign in to comment.