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

AnMi: Replaced KResponsiveWindow mixin by useKResponsiveWindow compos… #11346

Conversation

andreamisuraca
Copy link
Contributor

Summary

Into the Facility plugin I replaced KResponsiveWindow mixin with useKResponsiveWindow composable.

References

#11323

Reviewer guidance

Just a replacement. Still some doubts about responsiveWindowMixin (without K), should it be changed too?


Testing checklist

  • Contributor has fully tested the PR manually
  • If there are any front-end changes, before/after screenshots are included
  • Critical user journeys are covered by Gherkin stories
  • Critical and brittle code paths are covered by unit tests

PR process

  • PR has the correct target branch and milestone
  • PR has 'needs review' or 'work-in-progress' label
  • If PR is ready for review, a reviewer has been added. (Don't use 'Assignees')
  • If this is an important user-facing change, PR or related issue has a 'changelog' label
  • If this includes an internal dependency change, a link to the diff is provided

Reviewer checklist

  • Automated test coverage is satisfactory
  • PR is fully functional
  • PR has been tested for accessibility regressions
  • External dependency files were updated if necessary (yarn and pip)
  • Documentation is updated
  • Contributor is in AUTHORS.md

@github-actions github-actions bot added APP: Facility Re: Facility App (user/class management, facility settings, csv import/export, etc.) SIZE: very small labels Oct 3, 2023
Copy link
Member

@rtibbles rtibbles left a comment

Choose a reason for hiding this comment

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

A tweak to use the composition API fully here!

@@ -249,7 +249,8 @@
return this.$route.name === PageNames.DATA_EXPORT_PAGE;
},
windowSizeStyle() {
if (this.windowIsMedium || this.windowIsSmall) {
const { windowIsMedium, windowIsSmall } = useKResponsiveWindow();
Copy link
Member

Choose a reason for hiding this comment

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

It is best to consume the composable via the composition API, so instead of making the modification here, you would add a setup() method to the component, like this:

setup() {
    const { windowIsMedium, windowIsSmall } = useKResponsiveWindow();
    return { windowIsMedium, windowIsSmall };
},

this.windowIsMedium and this.windowIsSmall will now be defined on the component, as they are returned as properties of the setup function return value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @rtibbles thanks for the hint. I tried to fix it as you suggested.

@MisRob
Copy link
Member

MisRob commented Oct 4, 2023

@andreamisuraca Thank you for the contribution! Can you recall which pages you tested manually? There's no need to be uploading screenshots or go into much detail, just jotting down briefly what places in the app are affected (e.g. URL or brief steps to navigate to a page) would help the QA team to test for regressions.

@MisRob
Copy link
Member

MisRob commented Oct 4, 2023

@andreamisuraca

Still some doubts about responsiveWindowMixin (without K), should it be changed too?

Yes, please have a look at a note about imports here #11321

@andreamisuraca
Copy link
Contributor Author

@MisRob thank you for the hint. I checked the following pages and forms:

  • /en/facility/#/settings
  • /en/facility/#/data
  • /en/facility/#/classes
  • /en/facility/#/users/new

@andreamisuraca andreamisuraca force-pushed the anmi-useKResponsiveWindow_facillity_plugin branch from b108426 to 046e8dc Compare October 4, 2023 13:06
@andreamisuraca andreamisuraca force-pushed the anmi-useKResponsiveWindow_facillity_plugin branch from 046e8dc to d1a305a Compare October 6, 2023 07:49
@MisRob MisRob added the TODO: needs review Waiting for review label Oct 6, 2023
Copy link
Member

@rtibbles rtibbles left a comment

Choose a reason for hiding this comment

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

One place where it looks like the wrong composable attribute has been used. Seems our linting is not catching this just yet!

@rtibbles rtibbles dismissed their stale review October 9, 2023 17:15

Code concerns addressed!

Copy link
Member

@rtibbles rtibbles left a comment

Choose a reason for hiding this comment

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

No observed regressions during manual testing.

@rtibbles rtibbles merged commit aa59dc1 into learningequality:develop Oct 9, 2023
34 checks passed
@rtibbles
Copy link
Member

rtibbles commented Oct 9, 2023

Thank you for your contribution, @andreamisuraca - much appreciated! Your responsiveness to feedback is commendable.

vkWeb pushed a commit to vkWeb/kolibri that referenced this pull request Oct 19, 2023
… Facility plugin (learningequality#11346)

* AnMi: Replaced KResponsiveWindow mixin by useKResponsiveWindow composable in Facility plugin

* AnMi: Added setup method to the components

* AnMi: Fixed unit test by adding missing mock

* AnMi: Replaced wrong composable
vkWeb pushed a commit to vkWeb/kolibri that referenced this pull request Oct 20, 2023
… Facility plugin (learningequality#11346)

* AnMi: Replaced KResponsiveWindow mixin by useKResponsiveWindow composable in Facility plugin

* AnMi: Added setup method to the components

* AnMi: Fixed unit test by adding missing mock

* AnMi: Replaced wrong composable
poju3185 pushed a commit to poju3185/kolibri that referenced this pull request Mar 15, 2024
… Facility plugin (learningequality#11346)

* AnMi: Replaced KResponsiveWindow mixin by useKResponsiveWindow composable in Facility plugin

* AnMi: Added setup method to the components

* AnMi: Fixed unit test by adding missing mock

* AnMi: Replaced wrong composable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
APP: Facility Re: Facility App (user/class management, facility settings, csv import/export, etc.) SIZE: small SIZE: very small TODO: needs review Waiting for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants