Skip to content

Commit

Permalink
Feature: Integrations Setup (#185)
Browse files Browse the repository at this point in the history
* wip(integrations): add service for the api.

* fix(integrations): add _ to unused function argument.

* wip(integrations): add enabled feild.

* chore(types): update integration fixture

* wip: integrations page layout + data retrieval

* wip: conditional rendering of form and cards & JSON schema parsing into form

* wip: customized form & updating data

* wip: icon in title & overall enhancements

* wip: renamed buttons

* wip(integration api): update response types.

* wip: ajv & rjsf libraries removal

* wip(intergrations api): add save handler.

* fix(integrations): typo in types

* wip: fixing endpoints & new hooks for data fetching

* fix(integrations): typos.

* fix: type guards conditions

* wip(integrations UI): grouping integrations on global, project specific

* wip(integrations): schema parsing & refactoring

- [x] Implemented an `IntegrationForm` with reusable fields for each integration field type
- [x] Schema check in `handleSubmit` to transform formData to corresponding field types
- [x] Added `toPascalCase` utility function

* wip: rendering values & LSP responses handling

Slight refactoring of apply and return buttons, and some other minor changes.

* Wip smart links button (#206)

* wip(configuration chat): send first messages.

* wip(configuration chat): tool use in configuration chat.

* wip: smartlinks within fields & return to integraitons page from chat

* wip(integrations): availability

* wip: return button alignment

* wip: form disabled if values didn't change

* wip: better UI & cancel values of form

* wip: header for integrations & better layout & availability

* wip: field.f_type -> [f_type, f_size]

* wip: form cancel removed & smartlinks on the right side of form buttons

* WIP: Refactor/integration chat (#209)

* wip(configuration chat): handle going back.

* fix(integration chat): change tools setting to explore.

* chore(missing deps in hook): `renderField` function was missing deps.

* feat(integration data cache): add slice for integrations cache.

* fix(integration cache): remove item on save.

* fix(config chat): chat being sent multiple times.

* wip(tool confirmation): skip confirming tool use when running a configuration.

* feat: add apply all button to configuration chat.

* feat: reload old configuration chat and go back to the form

* feat(configuration chat): add error message handler.

* fix(configuration chat): use agentic mode and don't set the model.

---------

Co-authored-by: Andrii Lashchov <84778697+alashchev17@users.noreply.github.com>

* fix(config chat): reuse last model and system prompt

* Feature: Docker Containers API (#210)

* wip: docker containers api handlers

* wip: docker actions API & action buttons

* wip: better action handling

* wip: simplification of dockerApi & action buttons improvements

* chore: fixtures update

* chore: removal of unnecessary esling rule bypass

* wip: docker container card & refactoring of integration form

* feat(configuration): adjusted size of inputs based on f_size & DataList instead of raw flexboxes

* wip: form appearance & responsive layout

* wip: updated docker section

* wip(refactoring): smartlink, availability, renderField, handleSmartlinkClick extracted to separate files and scopes

* wip(form): bool f_type support

* wip(refactoring): making docker within integr_schema optional, conditional rendering of docker section within integration form

* wip(docker): error handling

* wip(refactoring): toolscontent usage summary refactoring

* wip(docker containers): collapsible container details & reveal if large

* wip(refactoring): project name handling for macOS & Windows

* wip(refactoring): docker error card & debounced loaded state

* wip(docker containers): better loading state management

* wip: separation & refactoring of UI, making docker containers cards better & making integrationsview setup better

* fix: error types for docker error cards

* fix: unchecked switch values included to formData

* chore: removal no-console

* chore: removal of unexisting prop

* fix: extra fields showup button conditional rendering

* chore: TODO insertion

* fix:  rule bypass removal

* feat: debug logging library usage for integrations logs

* feat: implementing root debug instance, managing debuggable instances launch

* chore: better logging message

* chore: TODO for tags invalidation docker

* fix: replaced <label/> to <Text as='label' />

* chore: endpoints extraction to consts & TODO insertion for cache invalidation logic

* fix: padding shift issue & middleware for detail error on integration-get

* fix: simplification of UI

* feat: hardcoded icons for integrations

* feat: smartlinks for each docker container

* fix: values[fieldKey] could be falsy

* chore: added TODOs and removed legacy code

* chore: titles for docker container smartlinks

* fix: adjusted color for 'off' badge

* fix: preventing click on disabled dropdown item if disabled

---------

Co-authored-by: Marc McIntosh <marcmcintosh1987@gmail.com>
  • Loading branch information
alashchev17 and MarcMcIntosh authored Dec 4, 2024
1 parent 859801c commit cbf1a9a
Show file tree
Hide file tree
Showing 69 changed files with 4,148 additions and 190 deletions.
154 changes: 114 additions & 40 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"dependencies": {
"@reduxjs/toolkit": "^2.2.7",
"@types/react": "^18.2.43",
"debug": "^4.3.7",
"react-redux": "^9.1.2"
},
"devDependencies": {
Expand All @@ -68,6 +69,7 @@
"@testing-library/dom": "^10.1.0",
"@testing-library/react": "^16.0.0",
"@testing-library/user-event": "^14.5.1",
"@types/debug": "^4.1.12",
"@types/js-cookie": "^3.0.6",
"@types/lodash.groupby": "^4.6.9",
"@types/lodash.isequal": "^4.5.8",
Expand Down
1 change: 1 addition & 0 deletions src/__fixtures__/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ export * from "./chat";
export { TABLE } from "./table";
export * from "./context_files";
export * from "./prompts";
export * from "./integrations";
export * from "./survey_questions";
89 changes: 89 additions & 0 deletions src/__fixtures__/integrations.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
import type { Integration } from "../services/refact";

export const INTEGRATIONS_RESPONSE: Integration = {
project_path: "",
integr_name: "postgres",
integr_config_path: "/Users/user/.config/refact/integrations.d/postgres.yaml",
integr_schema: {
fields: {
host: {
f_type: "string",
f_desc:
"Connect to this host, for example 127.0.0.1 or docker container name.",
f_placeholder: "marketing_db_container",
},
port: {
f_type: "int",
f_desc: "Which port to use.",
f_default: "5432",
},
user: {
f_type: "string",
f_placeholder: "john_doe",
},
password: {
f_type: "string",
f_default: "$POSTGRES_PASSWORD",
smartlinks: [
{
sl_label: "Open passwords.yaml",
sl_goto: "EDITOR:passwords.yaml",
},
],
},
database: {
f_type: "string",
f_placeholder: "marketing_db",
},
},
available: {
on_your_laptop_possible: true,
when_isolated_possible: true,
},
smartlinks: [
{
sl_label: "Test",
sl_chat: [
{
role: "user",
content:
"🔧 Use postgres database to briefly list the tables available, express satisfaction and relief if it works, and change nothing.\nIf it doesn't work, go through the usual plan in the system prompt.\nThe current config file is @file %CURRENT_CONFIG%\n",
},
],
},
],
docker: {
filter_image: "postgres",
filter_label: "",
new_container_default: {
image: "postgres:13",
environment: {
POSTGRES_DB: "marketing_db",
POSTGRES_USER: "john_doe",
POSTGRES_PASSWORD: "$POSTGRES_PASSWORD",
},
},
smartlinks: [
{
sl_label: "Add Database Container",
sl_chat: [
{
role: "user",
content:
'🔧 Your job is to create a new section under "docker" that will define a new postgres container, inside the current config file %CURRENT_CONFIG%. Follow the system prompt.\n',
},
],
},
],
},
},
integr_values: {
psql_binary_path: "",
host: "",
port: 0,
user: "",
password: "",
database: "",
},
error_log: [],
};
Loading

0 comments on commit cbf1a9a

Please sign in to comment.