-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Allow markdown title and description in CronWorkflows, WorkflowTemplates, & ClusterWorkflowTemplates. Fixes #12644 #12697
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mentioned in the issue that you should use the code from #12580 which contains various fixes, optimizations, and more.
This should also add new sections for all 3 of these to the docs from #12582. Could just add screenshots to those sections, don't need to give examples again since they're effectively the same amongst these. Using the same example text as the existing docs would be desired for consistency as well (your screenshots here have different text, so would not suffice)
b1a0428
to
b0b528f
Compare
ui/src/app/cluster-workflow-templates/cluster-workflow-template-list.scss
Outdated
Show resolved
Hide resolved
657d309
to
1824504
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a few issues with all the copy+pasting here. In the components below, copy+pasting is not the right approach -- importing would be better. In the CSS, the copy+pasted code seems largely irrelevant.
Please be thoughtful about what and how you copy+paste.
I've also requested some changes to the docs.
See in-line comments below
ui/src/app/cluster-workflow-templates/cluster-workflow-template-row.tsx
Outdated
Show resolved
Hide resolved
{templates.map(t => ( | ||
<Link className='row argo-table-list__row' key={t.metadata.uid} to={uiUrl(`cluster-workflow-templates/${t.metadata.name}`)}> | ||
<div className='columns small-1'> | ||
<i className='fa fa-clone' /> | ||
</div> | ||
<div className='columns small-5'>{t.metadata.name}</div> | ||
<div className='columns small-3'> | ||
<Timestamp date={t.metadata.creationTimestamp} /> | ||
</div> | ||
</Link> | ||
))} | ||
{templates.map(t => { | ||
return <ClusterWorkflowTemplateRow workflow={t} key={`${t.metadata.namespace}/${t.metadata.name}`} />; | ||
})} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Conversely, I don't think this row needs to be split into a separate component at this time. It can be left as-is within the list component. The row is quite short here (note that the Workflows Row has much more details than this row)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be easier to renovate the system in the future if it were structured in the same way.
Personally, I would like to keep it the same. Is that a problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see what you were going for, because workflows-row
is split it out, make the others consistent.
Two things:
- The Workflows List is the exception to things because it's so big and detailed; I'm not sure that other components should follow its example
- If we do want to refactor this as such, it would be better done as a separate refactor PR. That keeps things "atomic" and single purpose -- in particular, it keeps the diff here to only what is necessary for this feature, which makes it easier to review now and easier to understand in the future if someone looks at this PR (if this needs a revert for some reason, for historical purposes, or if someone want to copy this PR to another feature, etc). Similarly a refactor is easier to read / review / revert etc as its own independent PR -- the changes should effectively be a no-op as they do not change behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I see that the variables here are a bit harder to use without a separated component. That is a bit annoying.
There's a few techniques to workaround that. Two main ones I am thinking of are to call a function to do some of the logic and to split out the title/desc as its own component, but in the same file for now. The latter would be more consistent with the Workflows Row and would be easier to follow-up with a refactor if desired
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I made the title and description separate components.
ui/src/app/cluster-workflow-templates/cluster-workflow-template-list.scss
Outdated
Show resolved
Hide resolved
docs/assets/cluster-workflow-template-title-and-description-markdown-complex.png
Outdated
Show resolved
Hide resolved
docs/assets/cluster-workflow-template-title-and-description-markdown.png
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking much better! 🙂
I left several small documentation comments in-line below, as well as a few code comments. I haven't reviewed the row
components as I think it'd be easier to do so if those are not refactored in this PR.
Also DCO is missing on one of your commits here
{templates.map(t => ( | ||
<Link className='row argo-table-list__row' key={t.metadata.uid} to={uiUrl(`cluster-workflow-templates/${t.metadata.name}`)}> | ||
<div className='columns small-1'> | ||
<i className='fa fa-clone' /> | ||
</div> | ||
<div className='columns small-5'>{t.metadata.name}</div> | ||
<div className='columns small-3'> | ||
<Timestamp date={t.metadata.creationTimestamp} /> | ||
</div> | ||
</Link> | ||
))} | ||
{templates.map(t => { | ||
return <ClusterWorkflowTemplateRow workflow={t} key={`${t.metadata.namespace}/${t.metadata.name}`} />; | ||
})} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see what you were going for, because workflows-row
is split it out, make the others consistent.
Two things:
- The Workflows List is the exception to things because it's so big and detailed; I'm not sure that other components should follow its example
- If we do want to refactor this as such, it would be better done as a separate refactor PR. That keeps things "atomic" and single purpose -- in particular, it keeps the diff here to only what is necessary for this feature, which makes it easier to review now and easier to understand in the future if someone looks at this PR (if this needs a revert for some reason, for historical purposes, or if someone want to copy this PR to another feature, etc). Similarly a refactor is easier to read / review / revert etc as its own independent PR -- the changes should effectively be a no-op as they do not change behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you make an additional small modification to this file? now that it's shared, I think we could be more explicit that this component is not meant to be used in isolation and that instead the lazy-loaded suspense variant should be used.
Could you add an _
underscore prefix to the name of the file, i.e. _react-markdown-gfm.tsx
to give some form of indication that it's "private"? (the underscore prefix does not actually do anything in JS/TS, but people with experience in other languages might recognize it).
Also could you add at the top of the file a comment saying to use the lazy loaded suspense variant instead with its filename listed? GitHub won't let me comment in-line at the top because the first line is unchanged
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your support.
I learned a lot.
I've made some corrections, can you check them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jmeridth Would you like to help review this once it's ready?
6d5030c
to
793b48a
Compare
Signed-off-by: panicboat <panicboat@gmail.com> fix: review points on CronWorkflow Signed-off-by: panicboat <panicboat@gmail.com> fix: review points Signed-off-by: panicboat <panicboat@gmail.com> fix: review points Signed-off-by: panicboat <panicboat@gmail.com> fix: review point Signed-off-by: panicboat <panicboat@gmail.com> fix: review point Signed-off-by: panicboat <panicboat@gmail.com> Update ui/src/app/cluster-workflow-templates/cluster-workflow-template-list.scss Signed-off-by: panicboat <panicboat@gmail.com> fix: review points Signed-off-by: panicboat <panicboat@gmail.com> fix: review points Signed-off-by: panicboat <panicboat@gmail.com> fix: spelling error fix: rename wf name Signed-off-by: panicboat <panicboat@gmail.com> Apply suggestions from code review Signed-off-by: panicboat <panicboat@gmail.com> feat: Allow markdown title and description. Signed-off-by: panicboat <panicboat@gmail.com> fix: review points Signed-off-by: panicboat <panicboat@gmail.com> Co-Authored-By: Anton Gilgur <4970083+agilgur5@users.noreply.github.com>
793b48a
to
028eb74
Compare
Hi. |
It wasn't, only your non-markdown PR #12674 made it in. For reference, I did specifically ask for this to be included in 3.6 on more than one occasion and specifically put it in the 3.6.0 milestone for that reason |
@agilgur5 Thanks, I understand. |
That would certainly help, but I don't think you did anything wrong. I just didn't have time to review this as I had plenty of other things on my plate, especially as this was a 3.6 feature and 3.5 had many high priority bugs.
It is usually better to re-use an existing PR rather than making a new one to keep the history and have it be easier to search than duplication. That being said, I no longer have the ability to approve PRs as I resigned recently, in one part due to arbitrary decision changes around 3.6 made without even a discussion and without commenting on any existing issues/PRs/meetings and that being part of a broader pattern that I find antithetical to the open and collaborative nature of open source. |
Fixes #12644
Motivation
Use markdown for better visibility
Modifications
Verification