MemberJunction / MJ

Main MemberJunction Repository
https://docs.memberjunction.org/
ISC License
4 stars 0 forks source link

Code Clarity in Generic Browser #121

Closed AN-BC closed 2 months ago

AN-BC commented 5 months ago

https://github.com/MemberJunction/MJ/blob/fd3cac71b98894c76e2872ca1c299aea2fb58e03/packages/Angular/explorer-core/src/lib/generic-browser-list/generic-browser-list.component.html#L9

@JS-BC I was checking out this commit and noticed the "unshift" in the new code to reorder the information in the browser to handle showing "View" ahead of "Folder".

While I appreciate that this solves the request, it isn't the right way to handle this. We should be able to explicitly control the order of the options. If "data" contains those options, the container of the component would control this?

Also, the variable name "data" is not sufficiently descriptive in a complex component like this and should be given a name like "createButtonData" or something more clear to make the code easier to read.

Please come up with a more robust solution for handling a list of possible options and clear ordering mechanism.

JS-BC commented 3 months ago

Following up, update the data dropdown array to have elements holding FieldName and EventHandler properties. When an option is selected invoke the associated event handler.

AN-BC commented 2 months ago

@JS-BC did you already do this? If not please knock out this week