Skip to content

Added the project favorite column in project Info reactor#899

Merged
themaherkhalil merged 2 commits intodevfrom
896-reactor-for-bookmarking-on-preview
Jul 17, 2025
Merged

Added the project favorite column in project Info reactor#899
themaherkhalil merged 2 commits intodevfrom
896-reactor-for-bookmarking-on-preview

Conversation

@rameshpaulraj
Copy link
Copy Markdown
Contributor

@rameshpaulraj rameshpaulraj commented Jun 12, 2025

Description

Currently the Project info doesn't return the project favorite column. As its required for the front end to make the favorite inside the app itself.

Changes Made

Added the project favorite column which is using the dependency of project permission table.

How to Test

  1. In System Apps -> Terminal -> Pixel
  2. Execute "ProjectInfo(project=[]);" (AppId should be replaced with appid)
  3. In the response you will get the project favorite column as below screenshot

image

Notes

@rameshpaulraj rameshpaulraj linked an issue Jun 12, 2025 that may be closed by this pull request
1 task
@github-actions
Copy link
Copy Markdown

@CodiumAI-Agent /describe

@QodoAI-Agent
Copy link
Copy Markdown

Title

Added the project favorite column in project Info reactor


User description

Description

Currently the Project info doesn't return the project favorite column. As its required for the front end to make the favorite inside the app itself.

Changes Made

Added the project favorite column which is using the dependency of project permission table.

How to Test

  1. In System Apps -> Terminal -> Pixel
  2. Execute "ProjectInfo(project=[]);" (AppId should be replaced with appid)
  3. In the response you will get the project favorite column as below screenshot

Notes


PR Type

Enhancement


Description

  • Add project_favorite selector to query

  • Expose favorite status in ProjectInfo reactor


Changes walkthrough 📝

Relevant files
Enhancement
SecurityProjectUtils.java
Add project_favorite query selector                                           

src/prerna/auth/utils/SecurityProjectUtils.java

  • Added QueryColumnSelector for PROJECTPERMISSION__FAVORITE
  • Mapped column to project_favorite field
  • +1/-0     

    Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • @github-actions
    Copy link
    Copy Markdown

    @CodiumAI-Agent /review

    @QodoAI-Agent
    Copy link
    Copy Markdown

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Missing Join

    Verify that the query backing this selector includes a join to the project_permission table so that PROJECTPERMISSION__FAVORITE resolves correctly.

    qs.addSelector(new QueryColumnSelector("PROJECTPERMISSION__FAVORITE", "project_favorite"));
    Column Existence

    Ensure the FAVORITE column exists in the project_permission table and matches the naming convention used in the selector.

    qs.addSelector(new QueryColumnSelector("PROJECTPERMISSION__FAVORITE", "project_favorite"));

    @github-actions
    Copy link
    Copy Markdown

    @CodiumAI-Agent /improve

    @QodoAI-Agent
    Copy link
    Copy Markdown

    PR Code Suggestions ✨

    CategorySuggestion                                                                                                                                    Impact
    General
    add PROJECTPERMISSION join

    Ensure the PROJECTPERMISSION table is joined (e.g., via a left join) before
    selecting its columns, or the SQL will fail. Add the join call if it’s missing.

    src/prerna/auth/utils/SecurityProjectUtils.java [2566]

    -qs.addSelector(new QueryColumnSelector("PROJECTPERMISSION__FAVORITE", "project_favorite"));
    +qs.addLeftJoin("PROJECTPERMISSION", "PP", "PP.PROJECTID = PROJECT.PROJECTID");
    +qs.addSelector(new QueryColumnSelector("PP.FAVORITE", "project_favorite"));
    Suggestion importance[1-10]: 9

    __

    Why: Without a join on PROJECTPERMISSION, selecting project_favorite will cause the SQL to fail; adding the left join is essential for query correctness.

    High
    Possible issue
    map null favorites to false

    Guard against null values for project_favorite by applying a COALESCE (or CASE)
    expression so the map never contains null. This prevents downstream NPEs or
    unexpected null handling.

    src/prerna/auth/utils/SecurityProjectUtils.java [2566]

    -qs.addSelector(new QueryColumnSelector("PROJECTPERMISSION__FAVORITE", "project_favorite"));
    +qs.addSelector(new QueryColumnSelector("COALESCE(PROJECTPERMISSION__FAVORITE, FALSE)", "project_favorite"));
    Suggestion importance[1-10]: 6

    __

    Why: Wrapping PROJECTPERMISSION__FAVORITE in COALESCE(..., FALSE) prevents null values from propagating and avoids potential NPEs downstream.

    Low

    @themaherkhalil themaherkhalil merged commit c30bc83 into dev Jul 17, 2025
    3 checks passed
    @themaherkhalil themaherkhalil deleted the 896-reactor-for-bookmarking-on-preview branch July 17, 2025 18:05
    @github-actions
    Copy link
    Copy Markdown

    @CodiumAI-Agent /update_changelog

    @QodoAI-Agent
    Copy link
    Copy Markdown

    Changelog updates: 🔄

    2025-07-17

    Added

    • project favorite column in project info reactor to support frontend bookmarking

    to commit the new content to the CHANGELOG.md file, please type:
    '/update_changelog --pr_update_changelog.push_changelog_changes=true'

    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.

    Reactor for Bookmarking on Preview

    3 participants