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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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/>"
withasset = "Bob"
and"<><br/>"
ifasset
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
andintent
are empty. Also template support optional keys. Integrate note can't skip ifcomment
andintent
are not available because are not only keys that can be used to fill the template but also support optional keys (was reason whyStringTemplate
needed modification).Additional info
This does not handle all cases because we can use optional keys only "one way". So for combination of
comment
andintent
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: