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

Update kdropdown menu api #346

Merged

Conversation

marcellamaki
Copy link
Member

@marcellamaki marcellamaki commented Jul 29, 2022

Description

This PR changes the KDropdownMenu API by addressing the issue that KDropdownMenu also contained a button. Now, KDropdownMenu is only the popover elements

Issue addressed

Addresses #164
Does a better job fixing #136 (which caused a regression with my last fix).
Fix the regression where the additional options for the button (previously in a <slot/> in KDropdownMenu is no longer working, as you can see in the documentation

Before/after screenshots

There are no visual changes to the UI (I hope!)

Steps to test

I will open a corresponding kolibri PR that points to this commit next week with instructions for testing.

(optional) Implementation notes

At a high level, how did you implement this?

The makes KDropdownMenu a slot for KButton (or KIconButton) rather than responsible for also creating the button.

Does this introduce any tech-debt items?

Doing this would require some (fairly straightforward) remediation following a KDS version bump in Kolibri (11 instances of component are used) and KDP (5 instances of component). None in Studio.

Testing checklist

  • Contributor has fully tested the PR manually
  • If there are any front-end changes, before/after screenshots are included
  • Critical and brittle code paths are covered by unit tests
  • The change has been added to the changelog

Reviewer guidance

  • Is the code clean and well-commented?
  • Are there tests for this change?
  • Are all UI components LTR and RTL compliant (if applicable)?
  • Add other things to check for here

Post-merge updates and tracking

  • Learning Platform update PR is submitted
  • Learning Platform update PR is merged
  • Studio update PR is submitted
  • Studio update PR is merged
  • Data Portal update PR is submitted
  • Data Portal update PR is merged

Comments

@MisRob
Copy link
Member

MisRob commented Aug 19, 2022

@marcellamaki Thank you. Marcella, could you please make sure to fix the linter check? There are some prettier issues with spacing that make previewing changes difficult so it'd be helpful for review.

@marcellamaki
Copy link
Member Author

Yes - I will do this today. Thanks for pointing this out @MisRob, I'd missed it, and it definitely makes the diff seem much larger than it is!

@marcellamaki
Copy link
Member Author

Copy link
Member

@MisRob MisRob left a comment

Choose a reason for hiding this comment

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

Thank you, @marcellamaki, we reviewed the code together with @akolson, and overall it's looking good. There were a couple of places where we asked some questions, and it's possible that no updates will be required there, only clarification.

Also, one more general question regarding the PR description, what did you mean by "Fix the regression where the additional options for the button (previously in a in KDropdownMenu is no longer working, as you can see in the documentation"?

Before merging though, we'll need to make sure that the changelog and documentation are updated to reflect API updates for all KButton, KIconButton, and KDropdownMenu. This may not be a full list, just a pointer to a couple of places I noticed:

1. Nothing shows up in the Dropdowns section of the Buttons and links page and the section text is obsolete (https://deploy-preview-346--kolibri-design-system.netlify.app/buttons#dropdowns)

Screenshot from 2022-08-23 13-59-24

2. The Overview section on the KDropdownMenu page is obsolete (https://deploy-preview-346--kolibri-design-system.netlify.app/kdropdownmenu)
Screenshot from 2022-08-23 14-00-51

3. menu slot needs to be documented on KButton and KIconButton pages (https://deploy-preview-346--kolibri-design-system.netlify.app/kiconbutton/#slots)

Screenshot from 2022-08-23 14-07-25

4. I'd suggest mentioning how KButton, KIconButton, and KDropdownMenu can be used together including a code example, ideally. This could be, for example, done on the KDropdownMenu page and linked to from KButton and KIconButton pages. Or in any other way. The goal of this feedback is to make sure that everyone can understand easily how to use these components together.

lib/keen/UiMenuOption.vue Show resolved Hide resolved
lib/keen/UiMenuOption.vue Outdated Show resolved Hide resolved
lib/buttons-and-links/KButton.vue Show resolved Hide resolved
@MisRob
Copy link
Member

MisRob commented Sep 1, 2022

This also fixes #67

@marcellamaki
Copy link
Member Author

"Fix the regression where the additional options for the button (previously in a in KDropdownMenu is no longer working, as you can see in the documentation"

@MisRob and @akolson - what I am referencing (not very clearly) is this part of the documentation on "Buttons" where you can see:
Screen Shot 2022-09-01 at 10 23 55 AM
This button "ICON DROPDOWN" should actually be looking like an options menu icon ( ··· ), but due to the regression I introduced last year, it broke entirely and I failed to notice (it seems only in the documentation? I don't know of any places in kolibri where there were regressions, or at least don't recall any reports of regressions... but it is possible we missed it).

@MisRob
Copy link
Member

MisRob commented Sep 2, 2022

@marcellamaki I see, okay, thank you

@MisRob MisRob force-pushed the update-kdropdown-menu-api branch from d31bf6a to 2cd2da0 Compare September 6, 2022 10:55
- adds missing documentation to 'KIconButton'
- fixes 'menu' slot documentation not being generated for 'KButton'
- uses language consistent with other slots documentation
@MisRob
Copy link
Member

MisRob commented Sep 6, 2022

As @marcellamaki is on vacation, instead of posting feedback on the newest changes, I rebased on top of the latest develop and pushed two small fixes of changelog and documentation before merging.

@MisRob MisRob merged commit e27e430 into learningequality:develop Sep 6, 2022
MisRob added a commit to marcellamaki/kolibri that referenced this pull request Sep 8, 2022
MisRob added a commit to marcellamaki/kolibri that referenced this pull request Sep 14, 2022
MisRob added a commit to MisRob/kolibri-design-system that referenced this pull request Sep 14, 2022
Follow-up to
learningequality#346

Fixes 'Property or method "disabled" is not defined
on the instance but referenced during render.'
MisRob added a commit to MisRob/kolibri-design-system that referenced this pull request Sep 14, 2022
Follow-up to learningequality#346
where we removed KButton from KDropdownMenu. As a result,
products now need to wrap KDropdownMenu in KButton and therefore
need to use 'hasDropdown' property for dropdown menus that are
within buttons. This commit exposes this prop in documentation.
MisRob added a commit to MisRob/kolibri-design-system that referenced this pull request Sep 15, 2022
and clean up documentation (keep information about recent
changes in the changelog rather than in docs + couple minor
updates)

Follow-up to
learningequality#346
MisRob added a commit to MisRob/kolibri-design-system that referenced this pull request Sep 15, 2022
default slot is not alternative to `text` anymore

Follow-up to
learningequality#346
MisRob added a commit to MisRob/kolibri-design-system that referenced this pull request Sep 15, 2022
Follow-up to
learningequality#346

Fixes 'Property or method "disabled" is not defined
on the instance but referenced during render.'
MisRob added a commit to MisRob/kolibri-design-system that referenced this pull request Sep 15, 2022
Follow-up to learningequality#346
where we removed KButton from KDropdownMenu. As a result,
products now need to wrap KDropdownMenu in KButton and therefore
need to use 'hasDropdown' property for dropdown menus that are
within buttons. This commit exposes this prop in documentation.
marcellamaki added a commit that referenced this pull request Sep 15, 2022
"Update kdropdown menu api #346" follow-up
MisRob added a commit to MisRob/kolibri that referenced this pull request Sep 23, 2022
marcellamaki pushed a commit to marcellamaki/kolibri that referenced this pull request Sep 23, 2022
@MisRob MisRob mentioned this pull request Sep 28, 2023
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.

3 participants