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

chore: update regex for more valid scripture feature references #155

Merged
merged 3 commits into from
Jan 31, 2024

Conversation

nlewis84
Copy link
Contributor

@nlewis84 nlewis84 commented Jan 30, 2024

🐛 Issue

Some scripture features are bombing out in web-embeds but not in mobile/admin

✏️ Solution

  • Adjust the logic of the scripture parsing in web-embeds
  • Also, it became apparent that there were some styling differences for HtmlFeatures. This was an easy fix, so I just threw it on this PR.

🔬 To Test

  1. Start the micro-service by yarn dev in the /micro-service folder
  2. Nav to http://localhost:3000/?id=UniversalContentItem-8aa3cff4-5054-4464-b1dc-e2e31c5adf1d
  3. See 4 example ScriptureFeatures working correctly
  4. If you want to verify on the mobile app, use Apollos Demo, head to the Explore tab, check out the last feature and tap on Psalm 100 Devotional

📸 Screenshots

Before
Screenshot 2024-01-30 at 5 13 45 PM
---
After
Screenshot 2024-01-30 at 5 49 08 PM

After photos for mobile and web to show parity

Mobile Web
html styling web
header styling mobile

Copy link

vercel bot commented Jan 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
apollos-micro-service ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 31, 2024 3:44pm
apollos-web-embeds ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 31, 2024 3:44pm

@nlewis84
Copy link
Contributor Author

@vinnyjth I will work on this description. Discovered this issue while hooking up ScriptureFeatures on Admin. I dropped the before/after photos in the description already. Ideally, I think I would also like to make sure the padding/margin around scripture features on embeds matches mobile. My gut says it is probably too compact here.

@vinnyjth
Copy link
Member

@nlewis84 Sounds good! long term, I wonder if we should expose this from the API :D

@nlewis84
Copy link
Contributor Author

@nlewis84 Sounds good! long term, I wonder if we should expose this from the API :D

Yeah, I think you are right on long term plan for it.

Copy link
Member

@vinnyjth vinnyjth left a comment

Choose a reason for hiding this comment

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

Thanks for the helpful examples here!

@@ -21,16 +21,37 @@ function ScriptureFeature(props = {}) {
};

function parseBibleReference(reference) {
const regex = /^([\w\s]+)\s(\d+):(\d+)-?(\d+)?$/;
// This regex handles cases like 'Genesis 1-3' and 'Genesis 1:1-3:24'
const regex = /^([\w\s]+)\s(\d+)(?::(\d+))?(?:-(\d+)(?::(\d+))?)?$/;
Copy link
Member

Choose a reason for hiding this comment

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

💪

@@ -7,19 +7,27 @@ import { TypeStyles } from '../Typography';
const Longform = styled.div`
${TypeStyles.BodyText};
max-width: 700px;
margin-bottom: ${themeGet('space.xl')};
Copy link
Member

Choose a reason for hiding this comment

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

thanks for throwing these style updates in!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep! Very obvious compared to this before shot:
Screenshot 2024-01-31 at 4 12 11 PM

@nlewis84 nlewis84 merged commit b3b28e5 into main Jan 31, 2024
5 checks passed
@nlewis84 nlewis84 deleted the scripture_feature_fix branch January 31, 2024 22:31
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.

2 participants