From 90e828aba4624a2f6be9936a8ba83e392783887e Mon Sep 17 00:00:00 2001 From: Glootie Date: Sun, 18 Aug 2024 22:55:01 +0000 Subject: [PATCH] From feature/14-settings-page into development --- Changelog.md | 1 + examples/tools/gitlab.json | 136 +++++++++++++++++- frontend/src/app/settings/page.tsx | 39 +++++ .../src/components/dialog/SettingsPopover.tsx | 10 +- .../components/forms/tools/ArgDataGrid.tsx | 2 + 5 files changed, 185 insertions(+), 3 deletions(-) create mode 100644 frontend/src/app/settings/page.tsx diff --git a/Changelog.md b/Changelog.md index cf7a4ad..2c3fd56 100644 --- a/Changelog.md +++ b/Changelog.md @@ -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) diff --git a/examples/tools/gitlab.json b/examples/tools/gitlab.json index 82ca2e0..3a42d6a 100644 --- a/examples/tools/gitlab.json +++ b/examples/tools/gitlab.json @@ -1,6 +1,6 @@ [ { - "name": "pe_create_project_issue", + "name": "create_project_issue", "description": "Allows to create Gitlab project issue.", "link": "", "toolkit": "Gitlab", @@ -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", @@ -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 INTO ", + "type": "str", + "default": "", + "required": true + }, + "description": { + "description": "Description of the merge request. If issue number is included in the source_branch add \"Closes #\" 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 + } + } } ] \ No newline at end of file diff --git a/frontend/src/app/settings/page.tsx b/frontend/src/app/settings/page.tsx new file mode 100644 index 0000000..fe4c698 --- /dev/null +++ b/frontend/src/app/settings/page.tsx @@ -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 ( +
+ +
+
+ Settings Page +
+
+
+ ); +}; + +export default SettingsPage; diff --git a/frontend/src/components/dialog/SettingsPopover.tsx b/frontend/src/components/dialog/SettingsPopover.tsx index f5f28fe..4f1c47a 100644 --- a/frontend/src/components/dialog/SettingsPopover.tsx +++ b/frontend/src/components/dialog/SettingsPopover.tsx @@ -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 (
{ id="headlessui-menu-item-:rmk:" role="menuitem" data-headlessui-state="" + onClick={(event) => { + event.preventDefault(); + router.push("/settings"); + }} > int + +