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

fix(desc): empty slot not showing empty state #328

Merged
merged 2 commits into from
Aug 8, 2023
Merged

Conversation

kiaking
Copy link
Member

@kiaking kiaking commented Aug 8, 2023

I found that currently, if we pass null value to <SDesc> slots, it will not render <SDEscEmpty>. This PR fixes it by checking in the actual slot contents.

I've also added helper utilities to do this as well.

<!-- This works. <SDescEmpty> renderd -->
<SDescText></SDescText>

<!-- This does not work -->
<SDescText>{{ undefined }}</SDescText>

@kiaking kiaking added the bug Something isn't working label Aug 8, 2023
@kiaking kiaking requested review from cuebit and brc-dd August 8, 2023 02:43
@kiaking kiaking self-assigned this Aug 8, 2023
@netlify
Copy link

netlify bot commented Aug 8, 2023

Deploy Preview for sefirot-story ready!

Name Link
🔨 Latest commit d798e5e
🔍 Latest deploy log https://app.netlify.com/sites/sefirot-story/deploys/64d1ac044660fe000841c011
😎 Deploy Preview https://deploy-preview-328--sefirot-story.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@netlify
Copy link

netlify bot commented Aug 8, 2023

Deploy Preview for sefirot-docs ready!

Name Link
🔨 Latest commit d798e5e
🔍 Latest deploy log https://app.netlify.com/sites/sefirot-docs/deploys/64d1ac04a3b1520008a5f0fa
😎 Deploy Preview https://deploy-preview-328--sefirot-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@codecov
Copy link

codecov bot commented Aug 8, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.04% 🎉

Comparison is base (94db5b7) 84.47% compared to head (d798e5e) 84.51%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #328      +/-   ##
==========================================
+ Coverage   84.47%   84.51%   +0.04%     
==========================================
  Files         139      139              
  Lines       11127    11156      +29     
  Branches      492      630     +138     
==========================================
+ Hits         9400     9429      +29     
  Misses       1727     1727              
Files Changed Coverage Δ
lib/components/SDescDay.vue 100.00% <100.00%> (ø)
lib/components/SDescLink.vue 100.00% <100.00%> (ø)
lib/components/SDescNumber.vue 100.00% <100.00%> (ø)
lib/components/SDescText.vue 100.00% <100.00%> (ø)
lib/composables/Utils.ts 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@brc-dd
Copy link
Member

brc-dd commented Aug 8, 2023

Looking at the tests, this will also treat <SDescText><div></div></SDescText> as empty, right?

@kiaking
Copy link
Member Author

kiaking commented Aug 8, 2023

@brc-dd Haven't tested but I think so...? At the moment, either way works in that case since we don't have that use case 😅

@kiaking kiaking merged commit 823772e into main Aug 8, 2023
13 checks passed
@kiaking kiaking deleted the desc-empty-slot branch August 8, 2023 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants