Skip to content

EPMRPP-103879 || Add sorting for organizations on 'All organizations' page #4409

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

Merged

Conversation

allaprischepa
Copy link
Contributor

@allaprischepa allaprischepa commented Jun 17, 2025

PR Checklist

  • Have you verified that the PR is pointing to the correct target branch? (develop for features/bugfixes, other if mentioned in the task)
  • Have you verified that your branch is consistent with the target branch and has no conflicts? (if not, make a rebase under the target branch)
  • Have you checked that everything works within the branch according to the task description and tested it locally?
  • Have you run the linter (npm run lint) prior to submission? Enable the git hook on commit in your IDE to run it and format the code automatically.
  • Have you run the tests locally and added/updated them if needed?
  • Have you checked that app can be built (npm run build)?
  • Have you checked that no new circular dependencies appreared with your changes? (the webpack plugin reports circular dependencies within the dev npm script)
  • Have you made sure that all the necessary pipelines has been successfully completed?
  • If the task requires translations to be updated, have you done this by running the manage:translations script?
  • Have you added the link to the PR in the Jira ticket comments?

Changes

  1. Implemented DropdownSorting component
  2. Implemented sorting feature on the All organizations page
  3. Added GA event while changing sorting option
  4. Added changes to .eslintrc:
    • Disabled import/prefer-default-export rule
    • Fixed no-shadow rule as the default one has incompatibility with TypeScript
    • Added import/extensions rule to allow skipping file extensions for JS/TS files while importing

ToDo

  1. Update the DropdownSorting component to remove the popover center alignment
    Depends on: EPMRPP-103879 || Support optional center alignment ui-kit#100
  2. Remove redundant toLowerCase() conversion for sortingDirection values passed to the UI-Kit Table component
    Depends on: EPMRPP-103879 || Make sort direction case insensitive and enum free ui-kit#103

Visuals

image

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Introduced a dropdown UI for sorting organizations by criteria such as name, creation date, users, projects, and last launch date.
    • Sorting state is managed via the URL for persistent and shareable sorting options.
    • Sorting functionality is permission-based, available only to authorized users.
    • Added keyboard navigation and direction toggling in sorting dropdown for improved usability.
    • Added visual direction indicators for sorting order in dropdown options.
  • Localization

    • Added sorting option translations for Belarusian, Spanish, Russian, Ukrainian, and Chinese.
  • Enhancements

    • Organizations table and panel views now support interactive sorting with visual controls and keyboard navigation.
    • Improved accessibility and styling for sorting dropdown and options.
  • Chores

    • Updated ESLint configuration and added TypeScript type definitions for improved code quality.
    • Added string key constants for common keyboard keys to enhance keyboard interaction handling.
    • Updated dependencies including @reportportal/ui-kit and added type definitions for react-tracking.

Copy link

coderabbitai bot commented Jun 17, 2025

Walkthrough

This update introduces a comprehensive sorting feature for organizations, including new UI components, permission controls, analytics events, and localization entries. TypeScript types, constants, and SCSS modules are added to support the dropdown sorting interface and ensure accessibility and internationalization. Related components and tables are refactored to integrate sorting state and logic.

Changes

File(s) Change Summary
app/.eslintrc Extended ESLint rules for TypeScript/TSX: import/export preferences, shadowing, and import extensions.
app/package.json Updated @reportportal/ui-kit dependency version; added @types/react-tracking to devDependencies.
app/localization/translated/be.json
app/localization/translated/es.json
app/localization/translated/ru.json
app/localization/translated/uk.json
app/localization/translated/zh.json
Added new localization entries for organization sorting options in Belarusian, Spanish, Russian, Ukrainian, and Chinese.
app/src/common/constants/keyCodes.js Added exported Keys object mapping key names to string values.
app/src/common/constants/permissions.js Added WORK_WITH_ORGANIZATIONS_SORTING action to ACTIONS.
app/src/common/utils/permissions/permissions.js Added exported canWorkWithOrganizationsSorting permission check.
app/src/common/utils/permissions/index.js Exported canWorkWithOrganizationsSorting.
app/src/components/dropdownSorting/dropdownSorting.scss New SCSS file for dropdown sorting component styles.
app/src/components/dropdownSorting/dropdownSorting.tsx New React component DropdownSorting for sorting dropdown UI with direction toggle and accessibility.
app/src/components/dropdownSorting/dropdownSortingOption/dropdownSortingOption.scss New SCSS file for dropdown sorting option styles.
app/src/components/dropdownSorting/dropdownSortingOption/dropdownSortingOption.tsx New React component DropdownSortingOption with direction icon, selection, and keyboard support.
app/src/components/dropdownSorting/dropdownSortingOption/index.ts
app/src/components/dropdownSorting/index.ts
Added barrel export files for dropdown sorting components.
app/src/components/main/analytics/events/ga4Events/organizationsPageEvents.js Added organizationsSorting(type) event generator to ORGANIZATION_PAGE_EVENTS.
app/src/controllers/instance/organizations/constants.ts Added SortingFields enum and ORGANIZATIONS_DEFAULT_SORT_COLUMN constant.
app/src/controllers/sorting/types.ts New TypeScript file defining SortingDirection type and WithSortingURLProps interface.
app/src/pages/instance/organizationsPage/organizationsPageHeader/organizationsPageHeader.jsx Added conditional rendering of OrganizationsSorting component based on permissions.
app/src/pages/instance/organizationsPage/organizationsPageHeader/organizationsSorting/index.ts New export file for OrganizationsSorting.
app/src/pages/instance/organizationsPage/organizationsPageHeader/organizationsSorting/messages.ts Added internationalized messages for sorting options.
app/src/pages/instance/organizationsPage/organizationsPageHeader/organizationsSorting/organizationsSorting.tsx New React component OrganizationsSorting with URL-based state and event tracking.
app/src/pages/instance/organizationsPage/organizationsPanelView/organizationsPanelView.jsx Enhanced OrganizationsPanelViewWrapped to support sorting props and updated HOC configuration.
app/src/pages/instance/organizationsPage/organizationsPanelView/organizationsTable/organizationsTable.jsx Updated OrganizationsTable to accept and handle sorting props, use constants, and enforce permissions for sortable columns.
app/src/types/global.d.ts Added TypeScript module declaration for importing .scss files as CSS modules.
app/src/components/dropdownSorting/directionIcon/directionIcon.tsx Added new DirectionIcon React component for sorting direction arrows.
app/src/components/dropdownSorting/directionIcon/index.ts Added barrel export for DirectionIcon.
app/src/components/dropdownSorting/messages.ts Added internationalized messages for dropdown sorting label.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant OrganizationsPageHeader
    participant OrganizationsSorting
    participant DropdownSorting
    participant OrganizationsPanelView
    participant OrganizationsTable

    User->>OrganizationsPageHeader: Loads organizations page
    OrganizationsPageHeader->>OrganizationsSorting: (if permitted) Render sorting UI
    OrganizationsSorting->>DropdownSorting: Render dropdown with sorting options
    User->>DropdownSorting: Selects sorting option/direction
    DropdownSorting->>OrganizationsSorting: onChange({value, direction})
    OrganizationsSorting->>OrganizationsPanelView: onChangeSorting(field)
    OrganizationsPanelView->>OrganizationsTable: Pass sortingColumn, sortingDirection
    OrganizationsTable->>OrganizationsTable: Sort data and render table
Loading

Suggested labels

TMS

Suggested reviewers

  • BlazarQSO
  • maria-hambardzumian
  • OleksandrDragun

Poem

In a warren of code, a rabbit did hop,
Adding sorting to tables, with a click and a pop!
Now users can order, by name or by date,
With dropdowns and arrows, the sorting is great.
With colors and keys, and translations anew,
This bunny’s new feature is ready for you!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6a3ccff and 3524268.

⛔ Files ignored due to path filters (1)
  • app/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (30)
  • app/.eslintrc (1 hunks)
  • app/localization/translated/be.json (2 hunks)
  • app/localization/translated/es.json (2 hunks)
  • app/localization/translated/ru.json (2 hunks)
  • app/localization/translated/uk.json (2 hunks)
  • app/localization/translated/zh.json (2 hunks)
  • app/package.json (2 hunks)
  • app/src/common/constants/keyCodes.js (1 hunks)
  • app/src/common/constants/permissions.js (1 hunks)
  • app/src/common/utils/permissions/index.js (1 hunks)
  • app/src/common/utils/permissions/permissions.js (1 hunks)
  • app/src/components/dropdownSorting/directionIcon/directionIcon.tsx (1 hunks)
  • app/src/components/dropdownSorting/directionIcon/index.ts (1 hunks)
  • app/src/components/dropdownSorting/dropdownSorting.scss (1 hunks)
  • app/src/components/dropdownSorting/dropdownSorting.tsx (1 hunks)
  • app/src/components/dropdownSorting/dropdownSortingOption/dropdownSortingOption.scss (1 hunks)
  • app/src/components/dropdownSorting/dropdownSortingOption/dropdownSortingOption.tsx (1 hunks)
  • app/src/components/dropdownSorting/dropdownSortingOption/index.ts (1 hunks)
  • app/src/components/dropdownSorting/index.ts (1 hunks)
  • app/src/components/dropdownSorting/messages.ts (1 hunks)
  • app/src/components/main/analytics/events/ga4Events/organizationsPageEvents.js (1 hunks)
  • app/src/controllers/instance/organizations/constants.ts (2 hunks)
  • app/src/controllers/sorting/types.ts (1 hunks)
  • app/src/pages/instance/organizationsPage/organizationsPageHeader/organizationsPageHeader.jsx (3 hunks)
  • app/src/pages/instance/organizationsPage/organizationsPageHeader/organizationsSorting/index.ts (1 hunks)
  • app/src/pages/instance/organizationsPage/organizationsPageHeader/organizationsSorting/messages.ts (1 hunks)
  • app/src/pages/instance/organizationsPage/organizationsPageHeader/organizationsSorting/organizationsSorting.tsx (1 hunks)
  • app/src/pages/instance/organizationsPage/organizationsPanelView/organizationsPanelView.jsx (5 hunks)
  • app/src/pages/instance/organizationsPage/organizationsPanelView/organizationsTable/organizationsTable.jsx (6 hunks)
  • app/src/types/global.d.ts (1 hunks)
✅ Files skipped from review due to trivial changes (5)
  • app/src/pages/instance/organizationsPage/organizationsPageHeader/organizationsSorting/index.ts
  • app/src/pages/instance/organizationsPage/organizationsPageHeader/organizationsSorting/messages.ts
  • app/src/controllers/sorting/types.ts
  • app/localization/translated/es.json
  • app/localization/translated/be.json
🚧 Files skipped from review as they are similar to previous changes (25)
  • app/src/common/utils/permissions/index.js
  • app/src/components/dropdownSorting/index.ts
  • app/src/components/dropdownSorting/dropdownSortingOption/index.ts
  • app/src/types/global.d.ts
  • app/src/components/dropdownSorting/directionIcon/index.ts
  • app/src/components/main/analytics/events/ga4Events/organizationsPageEvents.js
  • app/src/common/utils/permissions/permissions.js
  • app/package.json
  • app/.eslintrc
  • app/src/components/dropdownSorting/dropdownSorting.scss
  • app/src/components/dropdownSorting/messages.ts
  • app/src/controllers/instance/organizations/constants.ts
  • app/src/common/constants/keyCodes.js
  • app/localization/translated/zh.json
  • app/src/common/constants/permissions.js
  • app/src/components/dropdownSorting/dropdownSortingOption/dropdownSortingOption.tsx
  • app/src/pages/instance/organizationsPage/organizationsPageHeader/organizationsPageHeader.jsx
  • app/src/components/dropdownSorting/directionIcon/directionIcon.tsx
  • app/src/components/dropdownSorting/dropdownSortingOption/dropdownSortingOption.scss
  • app/src/pages/instance/organizationsPage/organizationsPageHeader/organizationsSorting/organizationsSorting.tsx
  • app/src/pages/instance/organizationsPage/organizationsPanelView/organizationsPanelView.jsx
  • app/localization/translated/ru.json
  • app/localization/translated/uk.json
  • app/src/pages/instance/organizationsPage/organizationsPanelView/organizationsTable/organizationsTable.jsx
  • app/src/components/dropdownSorting/dropdownSorting.tsx
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Setting variables for docker build
  • GitHub Check: build (20)
  • GitHub Check: build (20)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Post Copyable Unit Tests in Comment
  • Commit Unit Tests in branch feature/EPMRPP-103879-all-organizations-sorting

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@codecov-commenter
Copy link

codecov-commenter commented Jun 17, 2025

Codecov Report

Attention: Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 66.53%. Comparing base (b48d643) to head (3524268).

Files with missing lines Patch % Lines
app/src/common/constants/keyCodes.js 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4409      +/-   ##
===========================================
- Coverage    66.56%   66.53%   -0.04%     
===========================================
  Files           85       85              
  Lines          981      983       +2     
  Branches       140      140              
===========================================
+ Hits           653      654       +1     
- Misses         297      298       +1     
  Partials        31       31              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@allaprischepa allaprischepa marked this pull request as ready for review June 17, 2025 12:45
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 9

🧹 Nitpick comments (16)
app/src/common/constants/keyCodes.js (1)

38-50: Consider freezing the keys object and aligning naming.

Rename Keys to uppercase KEYS and wrap it with Object.freeze to prevent runtime mutation, aligning with other constants:

- export const Keys = {
+ export const KEYS = Object.freeze({
   BACKSPACE: 'Backspace',
   TAB: 'Tab',
   ENTER: 'Enter',
   ESCAPE: 'Escape',
   SPACE: ' ',
   ARROW_LEFT: 'ArrowLeft',
   ARROW_UP: 'ArrowUp',
   ARROW_RIGHT: 'ArrowRight',
   ARROW_DOWN: 'ArrowDown',
   DELETE: 'Delete',
- };
+ } as const);
app/src/controllers/sorting/types.ts (2)

25-26: Refine namespace and namespaceSelector instead of unknown.

Using unknown is overly permissive. Consider specifying concrete types or making the interface generic to reflect actual usage (e.g. string, selector function, or a typed key).


21-28: Add JSDoc for sorting props.

Documenting each property in WithSortingURLProps will improve readability and help future maintainers understand how these URL props are used.

app/src/common/utils/permissions/permissions.js (1)

89-91: Add unit tests for the new permission check.

canWorkWithOrganizationsSorting isn’t covered by existing tests. Please add cases in permissions.test.js to validate its behavior for administrator, manager, and other roles.

Would you like me to draft the test skeleton?

app/localization/translated/uk.json (1)

1646-1650: Verify terminology consistency for "users".

Here you use “Учасники” for the users label; elsewhere in the UI the term “Користувачі” may be present. Align on one term across all Ukrainian translations.

app/src/components/main/analytics/events/ga4Events/organizationsPageEvents.js (1)

41-46: Align dynamic-event function name with existing naming convention
Existing dynamic generators (e.g., clickApplyFilterButton) start with a verb, while the newly-added organizationsSorting does not. For consistency and easier grep/search, consider renaming to something like clickOrganizationsSorting (or selectOrganizationsSorting).

-  organizationsSorting: (type) => ({
+  clickOrganizationsSorting: (type) => ({
app/.eslintrc (1)

108-121: Duplicate / conflicting rule declarations
import/extensions and import/prefer-default-export are already defined in the root ruleset (lines 37 and 68-77). Duplicating them inside the TypeScript override adds noise and can mislead future maintainers when the two blocks drift out of sync. Consider removing the duplicate entries from the override.

app/src/components/dropdownSorting/dropdownSorting.scss (1)

55-57: Removing focus outline harms keyboard accessibility
.select-list:focus { outline: none; } eliminates the only visible focus indication for users navigating with a keyboard. Replace it with a custom outline style instead of removing it entirely.

-.select-list:focus {
-  outline: none;
-}
+.select-list:focus {
+  outline: 2px solid $COLOR--topaz;
+  outline-offset: 2px;
+}
app/src/pages/instance/organizationsPage/organizationsPageHeader/organizationsPageHeader.jsx (1)

32-33: Import path inconsistency
Other permission helpers are imported from 'common/utils/permissions', while the new one uses 'common/utils/permissions/permissions'. Mixing both styles will trip relative-path regex searches and may cause circular-import headaches later. Prefer the shorter, already-used path:

-import { canWorkWithOrganizationsSorting } from 'common/utils/permissions/permissions';
+import { canWorkWithOrganizationsSorting } from 'common/utils/permissions';

Also applies to: 38-38

app/src/components/dropdownSorting/dropdownSortingOption/dropdownSortingOption.scss (1)

57-61: Icon rotation collides with explicit down-arrow

When a row is both .selected and hovered you rotate the icon 180°.
If direction === SORTING_DESC the component is already rendering a real down-arrow (see TSX). Rotating the up-arrow on hover produces inconsistent visual feedback.

Consider dropping the rotation or limiting it to the non-selected state.

app/src/components/dropdownSorting/dropdownSortingOption/dropdownSortingOption.tsx (1)

61-75: Add basic ARIA attributes for accessibility

The option buttons are keyboard-focusable via script but lack semantics for screen readers.

-    <button
+    <button
+      role="menuitemradio"
+      aria-checked={selected}
+      aria-label={label}
       type="button"

These attributes make the dropdown navigable by assistive technologies without affecting current behaviour.

app/src/pages/instance/organizationsPage/organizationsPanelView/organizationsPanelView.jsx (1)

82-85: Tighten prop-types for the new sorting props

Using plain string loses compile-time validation. Declare the allowed literals and mark the callback as required to match its usage.

-  sortingColumn: PropTypes.string,
-  sortingDirection: PropTypes.string,
-  onChangeSorting: PropTypes.func,
+  sortingColumn: PropTypes.oneOf([
+    'created_at',
+    'name',
+    'users',
+    'projects',
+    'last_launch_date',
+  ]),
+  sortingDirection: PropTypes.oneOf(['asc', 'desc']),
+  onChangeSorting: PropTypes.func.isRequired,
app/src/components/dropdownSorting/dropdownSorting.tsx (2)

85-108: ESC key should close the list for full keyboard control

Users expect Esc to collapse dropdowns. Adding it improves UX and aligns with ARIA practices.

       if ([Keys.ENTER, Keys.SPACE].includes(event.key)) {
         event.preventDefault();
         handleChange(options[highlightedIndex].value);
       }
+      if (event.key === Keys.ESCAPE) {
+        event.preventDefault();
+        setIsOpened(false);
+      }

138-148: Expose dropdown state to assistive tech

Add aria-haspopup and aria-expanded to the trigger button to announce the popover state.

       <button
         type="button"
         className={cx('value', { open: isOpened })}
+        aria-haspopup="listbox"
+        aria-expanded={isOpened}
         onKeyDown={() => setKeyboardControl(true)}
       >
app/src/pages/instance/organizationsPage/organizationsPanelView/organizationsTable/organizationsTable.jsx (2)

48-105: useMemo will recalculate on every assigned-organizations change

assignedOrganizations is an object that changes reference whenever any organization assignment mutates, which may be frequent. This forces the whole table data to be remapped on each such change, potentially degrading performance for large lists.
Consider memoising / normalising assignedOrganizations in Redux or deriving only the needed slices (e.g. a shallow array of organisation roles) before putting it into the dependency list.


155-162: Minor: early‐return could guard against null-ish keys

getSortingColumn is called with whatever comes from URL params. A short guard can avoid the extra lookup when key is null/undefined and helps future maintainers. Not critical, but improves readability.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f87e6b9 and 89a2c2f.

⛔ Files ignored due to path filters (1)
  • app/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (26)
  • app/.eslintrc (1 hunks)
  • app/localization/translated/be.json (1 hunks)
  • app/localization/translated/es.json (1 hunks)
  • app/localization/translated/ru.json (1 hunks)
  • app/localization/translated/uk.json (1 hunks)
  • app/localization/translated/zh.json (1 hunks)
  • app/package.json (1 hunks)
  • app/src/common/constants/keyCodes.js (1 hunks)
  • app/src/common/constants/permissions.js (1 hunks)
  • app/src/common/utils/permissions/permissions.js (1 hunks)
  • app/src/components/dropdownSorting/dropdownSorting.scss (1 hunks)
  • app/src/components/dropdownSorting/dropdownSorting.tsx (1 hunks)
  • app/src/components/dropdownSorting/dropdownSortingOption/dropdownSortingOption.scss (1 hunks)
  • app/src/components/dropdownSorting/dropdownSortingOption/dropdownSortingOption.tsx (1 hunks)
  • app/src/components/dropdownSorting/dropdownSortingOption/index.ts (1 hunks)
  • app/src/components/dropdownSorting/index.ts (1 hunks)
  • app/src/components/main/analytics/events/ga4Events/organizationsPageEvents.js (1 hunks)
  • app/src/controllers/instance/organizations/constants.ts (2 hunks)
  • app/src/controllers/sorting/types.ts (1 hunks)
  • app/src/pages/instance/organizationsPage/organizationsPageHeader/organizationsPageHeader.jsx (3 hunks)
  • app/src/pages/instance/organizationsPage/organizationsPageHeader/organizationsSorting/index.ts (1 hunks)
  • app/src/pages/instance/organizationsPage/organizationsPageHeader/organizationsSorting/messages.ts (1 hunks)
  • app/src/pages/instance/organizationsPage/organizationsPageHeader/organizationsSorting/organizationsSorting.tsx (1 hunks)
  • app/src/pages/instance/organizationsPage/organizationsPanelView/organizationsPanelView.jsx (5 hunks)
  • app/src/pages/instance/organizationsPage/organizationsPanelView/organizationsTable/organizationsTable.jsx (6 hunks)
  • app/src/types/global.d.ts (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
app/src/common/utils/permissions/permissions.js (2)
app/src/common/utils/permissions/permissions.test.js (1)
  • checkPermission (32-32)
app/src/common/constants/permissions.js (2)
  • ACTIONS (22-70)
  • ACTIONS (22-70)
app/src/pages/instance/organizationsPage/organizationsPageHeader/organizationsPageHeader.jsx (2)
app/src/common/utils/permissions/permissions.js (2)
  • canWorkWithOrganizationsSorting (89-91)
  • canWorkWithOrganizationsSorting (89-91)
app/src/pages/instance/organizationsPage/organizationsPageHeader/organizationsSorting/organizationsSorting.tsx (1)
  • OrganizationsSorting (76-76)
🔇 Additional comments (14)
app/src/types/global.d.ts (1)

17-20: Add global SCSS module declaration.

Declaring .scss imports as typed objects ensures type safety and editor support for CSS modules. Well structured and necessary for the new dropdown sorting styles.

app/src/controllers/instance/organizations/constants.ts (2)

2-2: License header year bump.

Updated the Apache license header year from 2024 to 2025. No further action needed.


37-46: Introduce SortingFields enum and default sort column.

Defines clear, strongly-typed sorting keys and sets a sensible default. This provides a solid foundation for the organizations sorting feature.

app/localization/translated/ru.json (1)

1647-1651: I want to ensure we didn’t miss en.json in the scan. Let’s list all locale files and verify the new keys are present in en.json as well.

#!/bin/bash
# List all locale files under translated
echo "Locale files:"
ls app/localization/translated/*.json

# Check that en.json contains the OrganizationsSorting keys
echo -e "\nChecking OrganizationsSorting keys in en.json:"
rg "\"OrganizationsSorting\\.(creationDate|lastLaunchDate|name|projects|users)\"" -n app/localization/translated/en.json || echo "❌ en.json is missing these keys"
app/src/components/dropdownSorting/index.ts (1)

1-18: Re-export and license header look good

The license header is applied correctly, and the export { DropdownSorting } from './dropdownSorting'; statement provides a clean, consistent import path for the component.

app/localization/translated/uk.json (2)

1646-1650: Localization entries are correctly added and ordered.

The new OrganizationsSorting.* keys are inserted in alphabetical order with accurate Ukrainian translations and proper JSON syntax.


1646-1650: Ensure translation keys are consumed in code.

Please verify that each of these new keys is actually referenced by the sorting component to avoid dead entries.

#!/bin/bash
# Verify usage of new sorting translation keys in the codebase
rg -n "OrganizationsSorting\.(creationDate|lastLaunchDate|name|projects|users)"
app/src/pages/instance/organizationsPage/organizationsPageHeader/organizationsSorting/index.ts (1)

17-17: Clean re-export of OrganizationsSorting
This module correctly re-exports the OrganizationsSorting component, ensuring concise and consistent imports across the codebase.

app/src/components/dropdownSorting/dropdownSortingOption/index.ts (1)

17-17: Consistent re-export of DropdownSortingOption
The index file provides a straightforward re-export of DropdownSortingOption, facilitating cleaner import paths.

app/localization/translated/be.json (1)

1647-1651: Confirm accuracy and consistency of Belarusian translations for new sorting options

Ensure that the translation entries under OrganizationsSorting match the intended sorting labels and align with translations in other locales. The current mappings:

  • "creationDate": "Дата стварэння"
  • "lastLaunchDate": "Дата апошняга запуску"
  • "name": "Назва"
  • "projects": "Праекты"
  • "users": "Удзельнікі"

Everything appears correct and consistent.

app/src/pages/instance/organizationsPage/organizationsPageHeader/organizationsSorting/messages.ts (1)

19-40: Messages file looks good
I don’t see any i18n, typing or casing issues.

app/src/pages/instance/organizationsPage/organizationsPageHeader/organizationsPageHeader.jsx (1)

91-92: Conditional render looks good, but verify header spacing
Rendering <OrganizationsSorting /> inside the existing flex container may shift the layout when permissions vary. Double-check the header spacing in both “allowed” and “no-permission” cases.

app/src/pages/instance/organizationsPage/organizationsPanelView/organizationsTable/organizationsTable.jsx (2)

163-169: Permission helper receives only userRole

canWorkWithOrganizationsSorting is fed an object containing just { userRole }. Verify that this helper doesn’t expect additional params (e.g. projectRole) to avoid a false-negative permission check.


171-174: Handler ignores sorting direction

handleChangeSorting forwards only the column key. If the dropdown is also expected to toggle direction, the table cannot reflect it. Double-check the contract of onChangeSorting; you might need to pass both key and direction.

Copy link
Member

@AmsterGet AmsterGet left a comment

Choose a reason for hiding this comment

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

General suggestion:
You can tag @coderabbitai to answer for his comments to allow him to study on them to avoid noisy comments in the future.

@allaprischepa allaprischepa force-pushed the feature/EPMRPP-103879-all-organizations-sorting branch from 6a3ccff to 3524268 Compare June 19, 2025 13:51
Copy link

@allaprischepa
Copy link
Contributor Author

Force pushed after rebasing

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.

3 participants