fix: implemented cached values and temporary MCP servers on MCP component (#8628)

* Added actionCount to fetch only servers without actionCount

* Updated queries and uses to use servers without action data first, and then to fetch them

* removed comment

* updated constants

* Added loading dropdown

* Make options persist

* Implemented new value format for McpComponent and implemented saving and removing temp Mcp Server if config is existent

* Changed value type

* Implemented cache and saving the server config

* Fixed mcp server test

* fix backend formatting

* fixed lint

* Added await

* Fixed save button not appearing when no servers are available

* added condition to only show save button when options is not null
This commit is contained in:
Lucas Oliveira 2025-06-23 11:15:22 -03:00 committed by GitHub
commit 4a09655f2f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 282 additions and 83 deletions

View file

@ -182,5 +182,27 @@ test(
await expect(page.getByText("test_server")).not.toBeVisible({
timeout: 3000,
});
await awaitBootstrapTest(page, { skipModal: true });
await page.getByText("Untitled document").first().click();
await page.waitForTimeout(1000);
await page.waitForSelector('[data-testid="save-mcp-server-button"]', {
timeout: 10000,
});
await page.getByTestId("save-mcp-server-button").click({ timeout: 10000 });
await page.waitForTimeout(1000);
await expect(page.getByTestId("save-mcp-server-button")).toBeHidden({
timeout: 10000,
});
await page.getByTestId("mcp-server-dropdown").click({ timeout: 10000 });
await expect(page.getByText("test_server")).toHaveCount(2, {
timeout: 10000,
});
},
);