diff --git a/services/api-server/src/api_server/html5.py b/services/api-server/src/api_server/html5.py index a0d7226..33fac02 100644 --- a/services/api-server/src/api_server/html5.py +++ b/services/api-server/src/api_server/html5.py @@ -1520,12 +1520,20 @@ def _object_action_links(project_id: str, object_name: str, lineage_id: object, first_module = next(iter(modules), None) module_lineage = str(getattr(first_module, "lineage_id", "") or "") source_link = ( - f'Source' + f'Source'.format( + project=quoted_project, + module=quote(module_lineage, safe=""), + ) if module_lineage else "" ) symbol_link = ( - f'Symbol' + f'Symbol'.format( + project=quoted_project, + lineage=quote(lineage, safe=""), + ) if lineage else "" ) @@ -1534,7 +1542,13 @@ def _object_action_links(project_id: str, object_name: str, lineage_id: object, Schema Impact Privacy - Flowchart + Flowchart {source_link} {symbol_link} diff --git a/services/api-server/tests/test_api.py b/services/api-server/tests/test_api.py index ce0da6a..8f056a5 100644 --- a/services/api-server/tests/test_api.py +++ b/services/api-server/tests/test_api.py @@ -318,6 +318,9 @@ def test_html5_object_context_fragment(tmp_path: Path): assert "data-html5-object-actions" in context.text assert f"/projects/{project_id}/objects/schema/%D0%94%D0%BE%D0%BA%D1%83%D0%BC%D0%B5%D0%BD%D1%82.%D0%97%D0%B0%D0%BA%D0%B0%D0%B7%D0%9F%D0%BE%D0%BA%D1%83%D0%BF%D0%B0%D1%82%D0%B5%D0%BB%D1%8F" in context.text assert f"/projects/{project_id}/objects/impact/%D0%94%D0%BE%D0%BA%D1%83%D0%BC%D0%B5%D0%BD%D1%82.%D0%97%D0%B0%D0%BA%D0%B0%D0%B7%D0%9F%D0%BE%D0%BA%D1%83%D0%BF%D0%B0%D1%82%D0%B5%D0%BB%D1%8F" in context.text + assert 'hx-target="[data-html5-flowchart]"' in context.text + assert 'hx-target="[data-html5-source]"' in context.text + assert 'hx-target="[data-html5-symbol-detail]"' in context.text assert "Контрагент" in context.text assert "Товары" in context.text assert "ФормаДокумента" in context.text