feature: add edit option to global variables table (#3712)
* first attempt to edit variables on the data table * refactor: Rename AddNewVariableButton to GlobalVariableModal and update its usage The component AddNewVariableButton has been renamed to GlobalVariableModal to better reflect its purpose. The component is now used in multiple places, including the GlobalVariablesPage and InputGlobalComponent. This change improves code clarity and consistency. * fix: fix apply to fields on table edit option * refactor: Trim field names before checking for availability in GlobalVariableModal and GlobalVariablesPage Trim field names before checking for availability in GlobalVariableModal and GlobalVariablesPage to ensure consistent comparison and avoid any potential issues with leading or trailing spaces. * Refactor GlobalVariablesPage to remove unused cellRenderer in the "value" field * [autofix.ci] apply automated fixes * Add validation for 'value' field in VariableRead model and import CREDENTIAL_TYPE - Introduced a field validator for the 'value' field in the VariableRead model to handle cases where the variable type is CREDENTIAL_TYPE. - Added necessary import for CREDENTIAL_TYPE. - Removed an unnecessary blank line in the variable API. * Add constants for credential and generic types in variable service * Refactor import statements in `kubernetes.py` to improve module organization * Refactor imports in test_service.py for better organization * refactor: Update import statements in variable.py for better organization * Refactor import and reorder fields in VariableRead model - Changed import of `CREDENTIAL_TYPE` from `service` to `constants` module. - Reordered fields in `VariableRead` model to place `type` before `value`. * ✨ (userSettings.spec.ts): Add additional randomName variables for testing purposes 📝 (userSettings.spec.ts): Update test to interact with global variables and improve readability and maintainability of the code * test: fix test_create_variable --------- Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> Co-authored-by: cristhianzl <cristhian.lousa@gmail.com> Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
This commit is contained in:
parent
19818db68b
commit
d3b8f6cd7e
15 changed files with 186 additions and 68 deletions
|
|
@ -24,7 +24,7 @@ def test_create_variable(client, body, active_user, logged_in_headers):
|
|||
assert body["type"] == result["type"]
|
||||
assert body["default_fields"] == result["default_fields"]
|
||||
assert "id" in result.keys()
|
||||
assert "value" not in result.keys()
|
||||
assert body["value"] != result["value"]
|
||||
|
||||
|
||||
def test_create_variable__variable_name_alread_exists(client, body, active_user, logged_in_headers):
|
||||
|
|
|
|||
|
|
@ -1,11 +1,14 @@
|
|||
from langflow.services.database.models.variable.model import VariableUpdate
|
||||
import pytest
|
||||
from datetime import datetime
|
||||
from unittest.mock import patch
|
||||
from uuid import uuid4
|
||||
from datetime import datetime
|
||||
from sqlmodel import SQLModel, Session, create_engine
|
||||
|
||||
import pytest
|
||||
from sqlmodel import Session, SQLModel, create_engine
|
||||
|
||||
from langflow.services.database.models.variable.model import VariableUpdate
|
||||
from langflow.services.deps import get_settings_service
|
||||
from langflow.services.variable.service import GENERIC_TYPE, CREDENTIAL_TYPE, DatabaseVariableService
|
||||
from langflow.services.variable.constants import CREDENTIAL_TYPE, GENERIC_TYPE
|
||||
from langflow.services.variable.service import DatabaseVariableService
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue