Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Ftrack: Comment template can contain optional keys #3615

Merged
merged 6 commits into from
Aug 4, 2022

Conversation

iLLiCiTiT
Copy link
Member

Brief description

Reduced empty notes and descriptions during publishing when integrating to ftrack, intent can be nullable and StringTemplate support to keep less/greater symbols if don't contain any formatting <...> (<br/> is kept unchanged).

Description

The main issue is that templates in most of cases consist from {intent}: {comment} which cause that result is {-: }. One reason is that intent can't be empty at this moment so it's filled with other symbol (e.g. "-") and we're unable to know which part should be skipped if value is missing.

Intent can have nullable option so studio can tell that empty intent is possible and we can handle it in some way during publishing.

StringTemplate support to keep less/greater symbols if they do not contain any formatting. That is important for ftrack integrate note where html tags are used. If anybody would enter to template "<<b>{asset}</b>><><br/>" result after formatting would be "<b>Bob</b><><br/>" with asset = "Bob" and "<><br/>" if asset is not available. This is not a perfect solution for cases when someone would like to keep the symbols even between formatting but for current issue it's enough.

Integrate description skip integration if comment and intent are empty. Also template support optional keys. Integrate note can't skip if comment and intent are not available because are not only keys that can be used to fill the template but also support optional keys (was reason why StringTemplate needed modification).

Additional info

This does not handle all cases because we can use optional keys only "one way". So for combination of comment and intent when template looks like "{intent}: {comment}" there are 2 possibilities how to enter optional keys "<{intent}: >{comment}" or "{intent}<: {comment}>" but we can't support both at a single time. I think that it would be possible with some "magical expression logic" (First letters make MEL, coinsidence?) in template "<{intent}>{%: ?intent && comment%}<{comment}>".

Testing notes:

  1. Integrate description should skip if intent and comment are empty
  2. It should be possible to use optional keys in both integrate description and integrate note

@ynbot
Copy link
Contributor

ynbot commented Aug 3, 2022

Task linked: OP-3473 Leaving comment with publishing

@iLLiCiTiT iLLiCiTiT self-assigned this Aug 3, 2022
@iLLiCiTiT iLLiCiTiT added type: enhancement Enhancements to existing functionality module: Ftrack labels Aug 3, 2022
@kalisp
Copy link
Member

kalisp commented Aug 4, 2022

Could we add mention of optional keys to documentation (probably to https://openpype.io/docs/admin_settings_project_anatomy/)? I found it only for legacy documentation for v2 and was under impression it is () and not <>.

@iLLiCiTiT
Copy link
Member Author

Could we add mention of optional keys to documentation

Made PR.

@iLLiCiTiT iLLiCiTiT merged commit d5a6ef4 into develop Aug 4, 2022
@iLLiCiTiT iLLiCiTiT deleted the feature/OP-3473_Leaving-comment-with-publishing branch August 4, 2022 12:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
module: Ftrack type: enhancement Enhancements to existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants