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

IBX-2277: [Taxonomy] As a user, I want to change language context in Taxonomy Tree #319

Conversation

GrabowskiM
Copy link
Contributor

Question Answer
Tickets https://issues.ibexa.co/browse/IBX-2277
Bug fix? no
New feature? yes
BC breaks? no
Tests pass? yes
Doc needed? no
License GPL-2.0

Checklist:

  • Coding standards ($ composer fix-cs)
  • Ready for Code Review

@@ -0,0 +1,17 @@
(function(global, doc, ibexa) {
const set = (domElement, instance) => {
Copy link
Contributor

@tischsoic tischsoic Feb 11, 2022

Choose a reason for hiding this comment

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

I'm not sure, but I would probably prefer more verbose names e.g. setInstance etc. given these are functions and not object methods. WDYT? 🤔

const set = (domElement, instance) => {
domElement.ibexaInstance = instance;
}
const get = (domElement) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure whether we need to implement it right now, but... now it is not possible to check whether the given dom element has instance assigned without catching the error and checking its message.
Why not just return undefined when there is not instance assigned?
I think the guidance here may be get method from Map which does just that.
ref. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/get

@@ -6,6 +6,8 @@
container: dropdownContainer,
});

dropdownContainer.instance = dropdown;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why you are not using helper here?

@bogusez bogusez assigned bogusez and unassigned dew326 Feb 22, 2022
@GrabowskiM GrabowskiM force-pushed the IBX-2277-taxonomy-as-a-user-i-want-to-change-language-context-in-taxonomy-tree branch from b72a9d9 to 01efa4c Compare February 23, 2022 14:12
@GrabowskiM GrabowskiM force-pushed the IBX-2277-taxonomy-as-a-user-i-want-to-change-language-context-in-taxonomy-tree branch from 01efa4c to f73b730 Compare March 1, 2022 12:07
@dew326 dew326 merged commit 66b2b01 into main Mar 2, 2022
@dew326 dew326 deleted the IBX-2277-taxonomy-as-a-user-i-want-to-change-language-context-in-taxonomy-tree branch March 2, 2022 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants