Skip to content
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

Add Markdown custom field type #4007

Merged
merged 6 commits into from
Jul 5, 2023

Conversation

MeganerdDev
Copy link
Contributor

Closes: #4006

What's Changed

  • Added new custom field type for Markdown
    • Reused CommentField
    • Reused SmallTextarea widget -> not required for PR
  • Apply markdown render to template

NOTE

  • I think still we need to perform render_markdown() to test for script injection similar to custom_fields.py#L588 since that doesnt sanitize/check the field.label data?

TODO

  • Explanation of Change(s)
  • Added change log fragment(s) (for more information see the documentation)
  • Attached Screenshots, Payload Example
  • Unit, Integration Tests
  • Documentation Updates (when adding/changing features)
  • Example Plugin Updates (when adding/changing features)
  • Outline Remaining Work, Constraints from Design

SCREENSHOTS

image
image
image

meganerd and others added 3 commits June 27, 2023 15:26
@MeganerdDev
Copy link
Contributor Author

Definitely open for feedback!

  • I tested this on Nautobot v1.5.22b1 to be working
  • I am using the SmallTextarea widget, which could instead just be the default widget

@bryanculver bryanculver changed the base branch from develop to develop-1.6 June 28, 2023 17:15
@bryanculver
Copy link
Member

At @lampwins' feedback, this can be included as a part of 1.6.

@bryanculver
Copy link
Member

PR might look ugly until #4020 goes in.

@bryanculver bryanculver requested a review from a team June 28, 2023 17:16
Copy link
Contributor

@glennmatthews glennmatthews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks both straightforward and useful - my favorite type of PR! :-)

nautobot/extras/models/customfields.py Outdated Show resolved Hide resolved
Reorder added imports alphabetically
@bryanculver bryanculver changed the base branch from develop-1.6 to develop June 29, 2023 23:42
@bryanculver bryanculver changed the base branch from develop to develop-1.6 June 29, 2023 23:42
@glennmatthews
Copy link
Contributor

Oh oops, looks like our CI isn't checking for it in develop-1.6 yet - could you please add a changes/4006.added changelog fragment as part of this PR?

@MeganerdDev
Copy link
Contributor Author

Oh oops, looks like our CI isn't checking for it in develop-1.6 yet - could you please add a changes/4006.added changelog fragment as part of this PR?

Thanks Glenn, you previously reminded me on another pull request on the changelog fragment. I'll try and get that jammed in my brain! Fragment ./changes/4006.added added

@bryanculver bryanculver merged commit 3216787 into nautobot:develop-1.6 Jul 5, 2023
17 checks passed
@glennmatthews glennmatthews mentioned this pull request Jul 21, 2023
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Markdown custom field type
3 participants