Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Href for operation description keys #496

Closed
chegoryu opened this issue Apr 18, 2024 · 2 comments
Closed

Href for operation description keys #496

chegoryu opened this issue Apr 18, 2024 · 2 comments

Comments

@chegoryu
Copy link

chegoryu commented Apr 18, 2024

I have external system to execute graphs of tasks (like Nirvana in Yandex).
I add links to external system to the operation description likes this:
Screenshot 2024-04-18 at 20 58 02

But right now it is only possible to specify that description key is a link (via special attribute):

const isWithoutTags = !Object.hasOwnProperty.call(attributes(value), '_type_tag');

Like this for example:

https://github.com/ytsaurus/ytsaurus/blob/a8a049235559916b09cba7d5e65610db16d1289a/yt/python/yt/wrapper/common.py#L407

However these links sometimes are very long, so I want to specify only task id, but add href attribute to it with full link, for example:

<
    "_type_tag"="url";
    "_href"="my.super.executor.com/ui/tasks/9a6e3f4c-7336-4971-ae18-7e4124cf9a02";
>"9a6e3f4c-7336-4971-ae18-7e4124cf9a02"
Screenshot 2024-04-18 at 21 07 23
@vrozaev
Copy link
Collaborator

vrozaev commented Apr 23, 2024

Hello @chegoryu!

It's looks like you can specify both things - href and text for the link.

ytsaurus-ui covert yson to unipica at this line

And according to this unit test in unipica library you can specify both things like this:

{
  $value: {
    href: "https://example.com",
    text: "Example",
    title: "Example title",
  },
  $attributes: { _type_tag: "url" },
}

Please, let us know if it worked for you.

@chegoryu
Copy link
Author

Wow, it works

Screenshot 2024-04-23 at 16 28 43

Thank you so much

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants