Make HTML5 object actions update panels
CI / python (push) Has been cancelled
CI / rust (push) Has been cancelled

This commit is contained in:
2026-05-17 01:01:11 +03:00
parent 61cfc9d1cd
commit 48070f0f70
2 changed files with 20 additions and 3 deletions
+17 -3
View File
@@ -1520,12 +1520,20 @@ def _object_action_links(project_id: str, object_name: str, lineage_id: object,
first_module = next(iter(modules), None) first_module = next(iter(modules), None)
module_lineage = str(getattr(first_module, "lineage_id", "") or "") module_lineage = str(getattr(first_module, "lineage_id", "") or "")
source_link = ( source_link = (
f'<a class="button" href="/html5/projects/{quoted_project}/source/{quote(module_lineage, safe="")}">Source</a>' f'<a class="button" href="/html5/projects/{quoted_project}/source/{quote(module_lineage, safe="")}" '
'hx-get="/html5/projects/{project}/source/{module}" hx-target="[data-html5-source]" hx-swap="outerHTML">Source</a>'.format(
project=quoted_project,
module=quote(module_lineage, safe=""),
)
if module_lineage if module_lineage
else "" else ""
) )
symbol_link = ( symbol_link = (
f'<a class="button" href="/html5/projects/{quoted_project}/symbols/{quote(lineage, safe="")}/detail">Symbol</a>' f'<a class="button" href="/html5/projects/{quoted_project}/symbols/{quote(lineage, safe="")}/detail" '
'hx-get="/html5/projects/{project}/symbols/{lineage}/detail" hx-target="[data-html5-symbol-detail]" hx-swap="outerHTML">Symbol</a>'.format(
project=quoted_project,
lineage=quote(lineage, safe=""),
)
if lineage if lineage
else "" else ""
) )
@@ -1534,7 +1542,13 @@ def _object_action_links(project_id: str, object_name: str, lineage_id: object,
<a class="button" href="/projects/{quoted_project}/objects/schema/{quoted_object}">Schema</a> <a class="button" href="/projects/{quoted_project}/objects/schema/{quoted_object}">Schema</a>
<a class="button" href="/projects/{quoted_project}/objects/impact/{quoted_object}">Impact</a> <a class="button" href="/projects/{quoted_project}/objects/impact/{quoted_object}">Impact</a>
<a class="button" href="/projects/{quoted_project}/objects/privacy/{quoted_object}">Privacy</a> <a class="button" href="/projects/{quoted_project}/objects/privacy/{quoted_object}">Privacy</a>
<a class="button" href="/html5/projects/{quoted_project}/flowchart?focus={quoted_object}">Flowchart</a> <a
class="button"
href="/html5/projects/{quoted_project}/flowchart?focus={quoted_object}"
hx-get="/html5/projects/{quoted_project}/flowchart?focus={quoted_object}"
hx-target="[data-html5-flowchart]"
hx-swap="outerHTML"
>Flowchart</a>
{source_link} {source_link}
{symbol_link} {symbol_link}
</nav> </nav>
+3
View File
@@ -318,6 +318,9 @@ def test_html5_object_context_fragment(tmp_path: Path):
assert "data-html5-object-actions" in context.text 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/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 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 assert "Товары" in context.text
assert "ФормаДокумента" in context.text assert "ФормаДокумента" in context.text