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

Feature: Docker Containers API #210

Merged
merged 34 commits into from
Dec 3, 2024
Merged

Conversation

alashchev17
Copy link
Contributor

@alashchev17 alashchev17 commented Nov 26, 2024

Featur: Docker Containers API

Description

  • Part of the global configuration UI feature, it provides support for docker containers fetching by filter_image coming from the configuration, also contains a lot of enhancements to the UI of integration setup page

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring (no functional changes, only code improvements)
  • Documentation update

Checklist

  • My code follows the code style of this project.
  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • Any dependent changes have been merged and published in downstream modules.
  • I have updated the documentation where necessary.

Linked Issues

Additional Notes

Should run with self_configure branch of the LSP

…nkClick extracted to separate files and scopes
…ional rendering of docker section within integration form
…etter & making integrationsview setup better
</Flex>
<Chevron open={open} />
</Flex>
<Collapsible.Trigger>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does the onClick handler work without the asChild prop being used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, because I'm specifying onClick directly on the element, not relying on Trigger click

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<Text> has a truncate property, it might not well with in a flex-box.

https://www.radix-ui.com/themes/docs/components/text
potential fix for truncate in a flex-box
https://css-tricks.com/flexbox-truncated-text/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also handling flex box with width adjustments, but thanks, will check that out

@alashchev17 alashchev17 marked this pull request as ready for review December 3, 2024 12:33
Copy link
Collaborator

@MarcMcIntosh MarcMcIntosh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work :)

I've made some notes for things to when I run this branch

src/components/Text/Text.module.css Show resolved Hide resolved
src/components/SmartLink/SmartLink.tsx Show resolved Hide resolved
src/components/SmartLink/SmartLink.tsx Show resolved Hide resolved
src/components/SmartLink/SmartLink.tsx Outdated Show resolved Hide resolved
src/components/Reveal/reveal.module.css Show resolved Hide resolved
}),
endpoints: (builder) => ({
getAllDockerContainers: builder.query<DockerContainersResponse, undefined>({
providesTags: ["DOCKER"],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: tags maybe causing cache issues.

src/components/IntegrationsView/IntegrationsView.tsx Outdated Show resolved Hide resolved
dispatch(integrationsApi.util.resetApiState());
dispatch(dockerApi.util.resetApiState());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to check: posable cache issues

src/components/IntegrationsView/IntegrationsView.tsx Outdated Show resolved Hide resolved
@MarcMcIntosh
Copy link
Collaborator

Show more / hide doesn't seem to change anything.

@alashchev17
Copy link
Contributor Author

alashchev17 commented Dec 3, 2024

Show more / hide doesn't seem to change anything.

Try to do that in postgres configuration
Already made it conditionally appearing

@alashchev17 alashchev17 changed the title WIP: Docker Containers API Feature: Docker Containers API Dec 3, 2024
@alashchev17 alashchev17 merged commit d718260 into feat/setup-integrations Dec 3, 2024
2 checks passed
@alashchev17 alashchev17 deleted the feat/docker-api branch December 3, 2024 16:23
alashchev17 added a commit that referenced this pull request Dec 4, 2024
* 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>
MarcMcIntosh added a commit that referenced this pull request Dec 5, 2024
* 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: 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

* 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>

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

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

* wip: form appearance & responsive layout

* wip: updated docker section

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

* wip(chat links): add stub api for chat links.

* wip(chat-links): setup story book.

* wip(chat links): add a quick ui to run in sotrybook

* chore(chat links): add todos.

* wip(chat links): add arguments to request handler and use msw in storybook.

* chore(chat links): update lsp url.

* ui(chat link title): add a information about the link in the title.

* wip(chat links): add chat links component to chat content.

* refactor(chat action types): enum couldn't be used for comparison :/

* fix(chat config cations): go back to integration.

* fix(chat config): go to action should open a configuration.

* chore(storybook): add config story to chat content.

* ui(configuration chat): adjust size and spacing of the available actions.

* wip(chat actions): comment out unhandled if statments.

* chore(links api): add model name to the links request.

* fix(links request): model name must be defined.

* wip(config chat): add notes about action handlers.

* 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

* refactor(chat meta): add meta info to chat request.

* fix(fixtures): update configuration chat fixture.

* feat: show links for all chats.

* chore(links meta): add meta to links.

* fix: linter error.

* feat(chat links): handle follow up action.

* hard code links mode to explore.

* feat(system message): request the system message with the chat stream.

* WIP(chat links): pass mode through follow-up and summarise project links.

* wip(chat links): infer the mode in none is added.

* fix: don't set deterministic messages when there isn't a system message.

* wip(system message): don't user deterministic messages because it stops the stream

* fix(chat meta links): set mode to the correct string.

* fix(chat links): show on new chat.

---------

Co-authored-by: alashchev17 <andrew.lashchev15@gmail.com>
Co-authored-by: Andrii Lashchov <84778697+alashchev17@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants