Closed luminousleek closed 2 months ago
The check_docs
test is failing because the PR is doing its job - it's giving logger warnings when attributes for a quiz are being overridden:
The warnings arise from the panel in the Header and Hint example with slots at this page (the relevant documentation file is /docs/userGuide/syntax/questions.md
), where the code for the question in the panel is
<question type="checkbox" header="Which of the following is true?" hint="Think out of the box! :fas-box:">
<!-- Header slot -->
<div slot="header">
<p>Which of the following is correct?</p>
<p>Challenge: Try to get all the answers on your first try! ⭐️ ⭐️</p>
</div>
<!-- other code omitted for brevity -->
<!-- Hint slot -->
<div slot="hint">
<p>Think out of the box! <span aria-hidden="true" class="fas fa-box"></span></p>
<p>Need another hint? <tooltip content="Two of the answers are correct!">Hover over me!</tooltip> <span aria-hidden="true" class="fas fa-mouse-pointer"></span></p>
</div>
</question>
As can be seen, the header
and hint
attributes are overridden by their respective slots, which then triggers a logger warning. A simple fix would be to delete the header
and hint
attributes, so I'm wondering if it's OK to do this in this PR or if I need to create a separate PR for this.
I tested the rest of the other attributes for the components to see whether they're able to be overridden by slots.
Looks like the header
, content
and label
attributes for a-point
are able to be overridden by slots
Also, the header
attribute for tab
is also able to be overridden by a slot
As well as the content
attribute for tooltip
And the alt
attribute for panel
Basically that's all the attributes that are handled by MdAttributeRenderer.ts
. The PR is updated to use processSlotAttributes
for the rest of the attributes.
@kaixin-hc Each PR must have a SEMVER impact label, please remember to label the PR properly.
What is the purpose of this pull request?
Partially resolves #2476
Overview of changes:
Implement
processSlotAttribute
method and use it for attributes that can be overridden by slots.Anything you'd like to highlight/discuss:
The docs are not correct regarding this.
Testing instructions:
Proposed commit message: (wrap lines at 72 characters)
Checklist: :ballot_box_with_check:
Reviewer checklist:
Indicate the SEMVER impact of the PR:
At the end of the review, please label the PR with the appropriate label:
r.Major
,r.Minor
,r.Patch
.Breaking change release note preparation (if applicable):