Skip to content

Conversation

Houwie7000
Copy link
Collaborator

I have JIRA issue created

  • branch and/or PR name(s) includes JIRA ID
  • issue has "Fix version" assigned
  • issue "Status" is set to "In review"
  • PR labels are selected
  • FLP integration tests were ran successful

Copy link
Member

@graduta graduta left a comment

Choose a reason for hiding this comment

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

Good effort. I raised a few improvements that I think will make the user experience better and improve the code's readability


// Adopted from Bookkeeping/lib/public/components/Filters/common/filtersPanelPopover.js
import { h, popover, PopoverAnchors, PopoverTriggerPreConfiguration } from '/js/src/index.js';
// import { tooltip } from '../../common/popover/tooltip.js';
Copy link
Member

Choose a reason for hiding this comment

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

Code that is not needed should not be left as comments

Copy link
Member

Choose a reason for hiding this comment

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

I see you replied with "👍 " on this commend but the commented out code is still there.

@Houwie7000 Houwie7000 requested a review from graduta September 22, 2025 07:20
Copy link
Member

@graduta graduta left a comment

Choose a reason for hiding this comment

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

I added a few comments for improving the logic of the code and the build of the request

]),
});
export default () => [
h('.w-50.text-center', [h('b.f4', 'Layouts')]),
Copy link
Member

Choose a reason for hiding this comment

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

Currently you are not displaying the header Label Layouts anymore. This is because there has been a change in dev where the headers are now expected to be in format of centrlCol and rightCol.
I believe when you merged from dev, you did not realize this and kept your changes instead of merging them together.

Please have another look at the changes in this file


// Adopted from Bookkeeping/lib/public/components/Filters/common/filtersPanelPopover.js
import { h, popover, PopoverAnchors, PopoverTriggerPreConfiguration } from '/js/src/index.js';
// import { tooltip } from '../../common/popover/tooltip.js';
Copy link
Member

Choose a reason for hiding this comment

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

I see you replied with "👍 " on this commend but the commented out code is still there.

friendlyName: () => friendlyName ? friendlyName : key,
inputPlaceholder: () => inputPlaceholder ? inputPlaceholder : '',
getValue: () => value ? value : null,
// trim checks if value is a string value, test this
Copy link
Member

Choose a reason for hiding this comment

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

We should not just disable an eslint if inconvenient.
I think in this case, you cannot just remove the {} because of the other eslint rule not allowing assignments in arrow functions.
Thus, a cleaner solution is to apply the exception of one line function (contrary to the previous comments, I understand)

set: () => {
  value = v:
}

Copy link
Member

Choose a reason for hiding this comment

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

I understand it is actually the same as you initially added. It was an oversight from my side, forgetting about the assignment eslint rule, I apologise for that

*/
stringifyActiveFiltersFriendly() {
let activeFilterText = 'Active filters: ';
if (this.allInActive()) {
Copy link
Member

Choose a reason for hiding this comment

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

If I understand this bit correctly, right now for this check, it works simply because there is only one filter present, but the moment we will add another one, the condition will not hold anymore.
I think is better to use the getAllActive and compare to 0, if no filter is active then no text is displayed.

this.folders = new Map();
this.searchFilterModel = new SearchFilterModel();
this.searchFilterModel.observe(() => {
if (!this.searchFilterModel.allInActive()) {
Copy link
Member

Choose a reason for hiding this comment

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

I believe the filter should only send the active filters and not all of them. For example if we have 2 parameters, objectPath and tab, we only want to attach one of them to the request.
For testing purposes, try to register another filter

Copy link
Member

Choose a reason for hiding this comment

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

Moreover, I think here the if condition should as well use the getActive like recommended in the other comment

*/
this.filters = new Map(); // key -> filter instance
this.searchInput = '';
this.register(createKeyValueFilter('objectPath', 'Object path', 'e.g. TPC'));
Copy link
Member

Choose a reason for hiding this comment

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

The registration should happen in the model using the search model as it is dependent on the page. In this case the LayoutListModel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants