-
Notifications
You must be signed in to change notification settings - Fork 344
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
UI/Metabar: engage/disengage more-button #6318
Conversation
d25d819
to
6341d85
Compare
6341d85
to
c9d110a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @nhaagen
Thanks a bunch for turning the main-controls and slates into ES6 modules. This is already a huge improvement of readability and maintainability :).
About the concrete changes, please answer the following questions:
- A11Y: you have mentioned a mantis ticket describing an accessibility issue. How is this PR related to the ticket? If I understand the report correctly, the issue still remains because the slates do not provide an
aria-expanded
attribute. Am I missing something?
Please consider the following suggestions:
- Bundle structure: we have not fully settled on how we want to manage our bundles yet, so this point is highly optional, but IMO we should try to only use the
dist/
folder to provide different formats of a bundles business logic, e.g. standard, minified, or ES6 in the future. This PR introduces a separate file to load additional functionality. Therefore, I recommend to mergemaincontrols.js
andmainbar.js
into one index file. - Filenames: according to Airbnb's naming conventions, the filename should exactly match its default export. This is not the case for all newly added files, except
maincontrols.js
.
Please implement the following changes:
- Encapsulation: there are many public methods and properties of
Metabar
andSlate
which should be made private or internal (not accessible bythis
) instead. If a property must be accessible, please do so with an according getter/setter. -
cls*
properties: these properties should be internal, while at it, you could also rename them to something likeclass*
orclassFor*
or similar, sincecls
is not a known acronym. -
il
: you are accessing other components globally viail
on several occasions. Please try to inject the according functionality in the constructor already and pass it down from the index file. Let me know if this is suboptimal or not possible for some usages. -
maincontrols.js:22
: you initialize an unused property/namespace here (il.UI.table
), please remove it.
Kind regards,
@thibsy
34836e6
to
4dc05b9
Compare
60f7c7f
to
c801019
Compare
Hi @thibsy ,
The actual changes of this PR can hardly be seen; the linked ticket asks for the metabar more-button to carry an With deleting the line and checks in place, the refactoring was made necessary. Metabar depends on slate, so both had to be touched ;(
I fully agree. In the end, there should be but one file "maincrontrols.min.js" containing slate, metabar and mainbar.
I set quite a few methods and props to private and tried my best to inject dependencies; it's still quite entangled, though, but visible a least. |
c801019
to
11f7849
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @nhaagen
Thanks for the quick feedback and for implementing the changes.
About the concrete changes, please answer the following questions:
- A11Y: thanks for pointing out the exact change, I missed that :). However, I think the issue is still not fully fixed by this PR alone, because according to the linked report of Materna, sub-menus also need to provide an
aria-expanded
attribute. If I currently click e.g. the user sub-menu in mobile view, this attribute is not set. I've opened another ticket for this, since the current targets the "more" button.
Please implement the following changes:
-
class*
properties: I think these properties need to be internal constants, instead of private properties, since their values do not change. This may lead to some methods needing to be internal as well, because they will not usethis
anymore. Please do the same forSlate.#replacementType
.
Thanks for bearing with me!
Kind regards,
@thibsy
Picked for release_8 |
…button (ILIAS-eLearning#6318)" This reverts commit fc218e3.
https://mantis.ilias.de/view.php?id=37151
I merely converted the late slate.js and metabar.js into ES6; I left out mainbar.js for now and economic reasons and split up the dist-files; also, the jquery-parts are still in ;(