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

🧹 Journal: Move Entry rendering to EntryComponent #1650

Merged
merged 1 commit into from
Jul 20, 2023

Conversation

zspencer
Copy link
Member

@zspencer zspencer commented Jul 10, 2023

This refactor allows us to do post-processing of the markdown at the Component level, which has access to the rails URL builders; which should allow us to link to the Keyword within the Entry#body

@zspencer zspencer added ✨ feature Reduces Client's Burden or Grants them Benefits 🥔 Satisfices It's good enough to use, but not particularly great labels Jul 11, 2023
@zspencer zspencer force-pushed the journal/introduce-terms branch from 632529a to e3fd349 Compare July 13, 2023 00:11
@zspencer zspencer force-pushed the journal/link-to-terms branch from b934994 to 97c1c7a Compare July 13, 2023 00:12
@zspencer zspencer force-pushed the journal/introduce-terms branch from 1f7e22e to 06d3df7 Compare July 13, 2023 22:34
Base automatically changed from journal/introduce-terms to main July 13, 2023 22:38
@zspencer zspencer force-pushed the journal/link-to-terms branch from 97c1c7a to 415606a Compare July 13, 2023 22:42
@zspencer zspencer changed the title 🥔✨ Journal: Entry links to their Terms 🥔✨ Journal: Entry links to their Keywords Jul 13, 2023
@zspencer zspencer force-pushed the journal/link-to-terms branch from 37dbae4 to 3668ba5 Compare July 13, 2023 23:32
@zspencer zspencer changed the base branch from main to journal/entries-know-their-keywords July 13, 2023 23:32
@zspencer zspencer force-pushed the journal/entries-know-their-keywords branch from 6f9a625 to 6ffd6bd Compare July 15, 2023 01:01
Base automatically changed from journal/entries-know-their-keywords to main July 15, 2023 01:07
@zspencer zspencer force-pushed the journal/link-to-terms branch 4 times, most recently from 41de505 to cc7950d Compare July 20, 2023 18:51
@zspencer zspencer changed the title 🥔✨ Journal: Entry links to their Keywords 🧹 Journal: Move Entry rendering to EntryComponent Jul 20, 2023
@zspencer zspencer requested review from a team July 20, 2023 19:11
@zspencer zspencer marked this pull request as ready for review July 20, 2023 19:11
- https://github.com/zinc-collective/convene/issues/1566

This refactor allows us to do post-processing of the markdown at the
Component level, which has access to the rails URL builders; which
should allow us to link to the `Keyword` within the `Entry#body`...
@zspencer zspencer force-pushed the journal/link-to-terms branch from cc7950d to cde1583 Compare July 20, 2023 19:13
@zspencer
Copy link
Member Author

Here's where it links to the Keyword: #1684

@zspencer zspencer added 🧹 refactor Includes non-behavioral changes and removed ✨ feature Reduces Client's Burden or Grants them Benefits 🥔 Satisfices It's good enough to use, but not particularly great labels Jul 20, 2023
super(*args, **kwargs)
end

def body_html
Copy link
Contributor

Choose a reason for hiding this comment

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

What about content_html not to confuse with the<body> tag. This might be more consistent with other components that define header/content/footer slots?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, I like that! I will do a follow up PR to rename Entry#body to Entry#content

let(:component) { described_class.new(entry: entry) }
let(:entry) { create(:journal_entry, body: "https://www.google.com @[email protected] #GoodTimes") }

it { is_expected.to have_link("https://www.google.com", href: "https://www.google.com") }
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason you're just testing the link existence and not other strings?

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, I could have done some tests to ensure headings have the appropriate ids and such; but this was the thrust of the work I was doing so it's what I focused on.

@zspencer zspencer merged commit a435d21 into main Jul 20, 2023
@zspencer zspencer deleted the journal/link-to-terms branch July 20, 2023 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧹 refactor Includes non-behavioral changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants