diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/config/default.py b/spiffworkflow-backend/src/spiffworkflow_backend/config/default.py index 8804b3d1..c1498e86 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/config/default.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/config/default.py @@ -41,8 +41,8 @@ SPIFFWORKFLOW_BACKEND_URL = environ.get("SPIFFWORKFLOW_BACKEND_URL", default="ht SPIFFWORKFLOW_BACKEND_CONNECTOR_PROXY_URL = environ.get( "SPIFFWORKFLOW_BACKEND_CONNECTOR_PROXY_URL", default="http://localhost:7004" ) -SPIFFWORKFLOW_BACKEND_CONNECTOR_PROXY_TYPE_AHEAD_URL = environ.get( - "SPIFFWORKFLOW_BACKEND_CONNECTOR_PROXY_TYPE_AHEAD_URL", +SPIFFWORKFLOW_BACKEND_CONNECTOR_PROXY_TYPEAHEAD_URL = environ.get( + "SPIFFWORKFLOW_BACKEND_CONNECTOR_PROXY_TYPEAHEAD_URL", default="https://emehvlxpwodjawtgi7ctkbvpse0vmaow.lambda-url.us-east-1.on.aws", ) diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/routes/connector_proxy_controller.py b/spiffworkflow-backend/src/spiffworkflow_backend/routes/connector_proxy_controller.py index dca3cbe7..cc2a77db 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/routes/connector_proxy_controller.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/routes/connector_proxy_controller.py @@ -8,18 +8,14 @@ from flask.wrappers import Response def connector_proxy_typeahead_url() -> Any: """Returns the connector proxy type ahead url.""" - return current_app.config["SPIFFWORKFLOW_BACKEND_CONNECTOR_PROXY_TYPE_AHEAD_URL"] + return current_app.config["SPIFFWORKFLOW_BACKEND_CONNECTOR_PROXY_TYPEAHEAD_URL"] def typeahead(category: str, prefix: str, limit: int) -> flask.wrappers.Response: - url = f"{connector_proxy_typeahead_url()}/v1/type-ahead/{category}?prefix={prefix}&limit={limit}" + url = f"{connector_proxy_typeahead_url()}/v1/typeahead/{category}?prefix={prefix}&limit={limit}" proxy_response = requests.get(url) status = proxy_response.status_code - if status // 100 == 2: - response = proxy_response.text - else: - # supress pop up errors on the client - status = 200 - response = "[]" + response = proxy_response.text + return Response(response, status=status, mimetype="application/json") diff --git a/spiffworkflow-frontend/src/routes/TaskShow.tsx b/spiffworkflow-frontend/src/routes/TaskShow.tsx index 7a9c8fec..1eb30fac 100644 --- a/spiffworkflow-frontend/src/routes/TaskShow.tsx +++ b/spiffworkflow-frontend/src/routes/TaskShow.tsx @@ -23,7 +23,7 @@ import ProcessBreadcrumb from '../components/ProcessBreadcrumb'; import InstructionsForEndUser from '../components/InstructionsForEndUser'; // TODO: move this somewhere else -function TypeAheadWidget({ +function TypeaheadWidget({ id, onChange, options: { category, itemFormat }, @@ -60,7 +60,7 @@ function TypeAheadWidget({ } }; - const typeAheadSearch = (inputText: string) => { + const typeaheadSearch = (inputText: string) => { if (inputText) { lastSearchTerm.current = inputText; // TODO: check cache of prefixes -> results @@ -74,7 +74,7 @@ function TypeAheadWidget({ return ( { setSelectedItem(event.selectedItem); onChange(itemToString(event.selectedItem)); @@ -83,7 +83,6 @@ function TypeAheadWidget({ items={items} itemToString={itemToString} placeholder={`Start typing to search for ${category}...`} - titleText={`Type ahead search for ${category}`} selectedItem={selectedItem} /> ); @@ -394,7 +393,7 @@ export default function TaskShow() { return getFieldsWithDateValidations(jsonSchema, formData, errors); }; - const widgets = { typeAhead: TypeAheadWidget }; + const widgets = { typeahead: TypeaheadWidget }; return (