Skip to content

refactor represantativesPicker and styles improves#23

Open
MEDOYED wants to merge 3 commits intomkaminetskyi:masterfrom
MEDOYED:master
Open

refactor represantativesPicker and styles improves#23
MEDOYED wants to merge 3 commits intomkaminetskyi:masterfrom
MEDOYED:master

Conversation

@MEDOYED
Copy link
Collaborator

@MEDOYED MEDOYED commented Jan 26, 2026

No description provided.

Copilot AI review requested due to automatic review settings January 26, 2026 17:20
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the representatives picker component to receive representatives data directly from the controller instead of using a boolean flag, and implements various style improvements to the navigation and desktop topbar components.

Changes:

  • Refactored representatives picker to accept representatives list directly rather than using renderRepresentativesPicker boolean flag
  • Fixed navigation active state identifier from accounts-overdue-debts to overdue-debts
  • Updated navigation CSS with adjusted spacing (gaps reduced, margin removed)
  • Enhanced desktop topbar logo styling with background, border, and improved layout

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
src/main/java/com/demo/demotaskforfeside/controller/AccountsOverdueDebtsController.java Added Model parameter and hardcoded test representatives list and userRole to pass to the view
src/main/resources/templates/pages/overdue-debts/overdue-debts.html Removed renderRepresentativesPicker parameter, added representatives parameter, and updated template structure to use inline content wrapper
src/main/resources/templates/fragments/navigation/navigation.html Fixed active navigation identifier from accounts-overdue-debts to overdue-debts
src/main/resources/templates/fragments/navigation/navigation.css Adjusted spacing with reduced gaps (18px→15px, 10px→5px) and removed top margin from section titles
src/main/resources/templates/fragments/general-one-s-report-page-content/general-one-s-report-page-content.html Moved representatives picker into toolbar grid, changed from boolean flag to direct representatives parameter
src/main/resources/templates/fragments/general-one-s-report-page-content/general-one-s-report-page-content.css Added styling for representatives picker container with flex layout and grid column spanning
src/main/resources/templates/fragments/general-one-s-report-page-content/fragments/representatives-picker/representatives-picker.html Changed fragment signature to accept representatives list, fixed CSS path, removed inline style, added server-side rendering of representative checkboxes, updated script loading
src/main/resources/templates/fragments/desktop-topbar/desktop-topbar.css Enhanced logo styling with flexbox centering, background, border, padding, and cursor pointer

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +61 to +70
<div
class="general-one-s-report-page-content__render-representatives-picker"
>
<div
th:replace="~{fragments/general-one-s-report-page-content/fragments/representatives-picker/representatives-picker :: representatives-picker(
userRole=${userRole},
representatives=${representatives}
)}"
></div>
</div>
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

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

The representatives picker wrapper div is now unconditionally rendered regardless of whether representatives data exists. While the inner content has th:if="${representatives}", the wrapper div with class general-one-s-report-page-content__render-representatives-picker will always be in the DOM even when empty. Consider adding th:if="${representatives}" to this wrapper div to avoid rendering unnecessary empty elements.

Copilot uses AI. Check for mistakes.
"Наталія Шевченко"
).collect(Collectors.toList());


Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

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

There are two consecutive blank lines here. Consider removing one to maintain consistent spacing throughout the codebase.

Suggested change

Copilot uses AI. Check for mistakes.
Comment on lines +72 to +73
<!-- grid-column: 1 / -1; -->

Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

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

This comment appears to be a note about the CSS styling of the representatives picker element above, but its placement after the element is confusing. If this is meant to document the CSS property grid-column: 1 / -1, consider either removing it (as the CSS is self-explanatory) or moving it to be an inline comment near the class attribute of the element it refers to.

Suggested change
<!-- grid-column: 1 / -1; -->

Copilot uses AI. Check for mistakes.
Comment on lines +61 to +70
<div
class="general-one-s-report-page-content__render-representatives-picker"
>
<div
th:replace="~{fragments/general-one-s-report-page-content/fragments/representatives-picker/representatives-picker :: representatives-picker(
userRole=${userRole},
representatives=${representatives}
)}"
></div>
</div>
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

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

The representatives picker is now inside the general-one-s-report-page-content__toolbar-grid div which is conditionally rendered with th:if="${renderDatePicker or renderClientPicker}" at line 23. This means the representatives picker will not be displayed if both renderDatePicker and renderClientPicker are false, even when representatives data is available. Consider whether the representatives picker should have independent visibility logic or if the th:if condition at line 23 should include a check for representatives.

Copilot uses AI. Check for mistakes.
renderDatePicker=true,
renderClientPicker=true,
renderRepresentativesPicker=true,
activeNav='accounts-overdue-debts',
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

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

The activeNav variable is defined but no longer used. It was previously used to set the active navigation item but has been replaced by activePage='overdue-debts' in the responsive-layout call at line 34. This unused variable should be removed to avoid confusion.

Suggested change
activeNav='accounts-overdue-debts',

Copilot uses AI. Check for mistakes.
>
<div
id="representativesFilter"
class="representatives-picker__filter"
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

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

The removal of style="display: none" from the representativesFilter element may cause it to be visible before the JavaScript loads and determines whether to show it. The JavaScript code at representatives-picker.js:539 and representatives-picker.js:587,604 manages the visibility of this element. Consider whether this initial visibility is intentional or if CSS should be used to hide it by default.

Suggested change
class="representatives-picker__filter"
class="representatives-picker__filter"
style="display: none"

Copilot uses AI. Check for mistakes.
Comment on lines +31 to +36
List<String> representatives = Stream.of(
"Іван Петренко",
"Марія Коваленко",
"Олег Сидоренко",
"Наталія Шевченко"
).collect(Collectors.toList());
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

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

The representatives list is hardcoded with test data. For a production-ready implementation, this data should be retrieved from a service or database rather than being hardcoded in the controller. Note that there's already a separate API endpoint at /api/sales/plan/representatives (in SalesPlanController.java) that returns the same representatives list - consider whether this endpoint should be used instead.

Copilot uses AI. Check for mistakes.
).collect(Collectors.toList());


model.addAttribute("userRole", "OWNER");
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

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

The userRole is hardcoded as "OWNER". For a production-ready implementation, this should be retrieved from the authenticated user's session or security context rather than being hardcoded.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant