Skip to content

Conversation

Junjiequan
Copy link
Member

@Junjiequan Junjiequan commented Jul 4, 2025

Description

  • Replaced the existing full-text search implementation in the dataset and proposal dashboards with a new shared FullTextSearchBarComponent.
  • Updated proposal dashboard components to handle text change and search actions via event emitters.
  • Updated module imports to include the new FullTextSearchBarModule.

Motivation

Background on use case, changes needed

Fixes:

Please provide a list of the fixes implemented in this PR

  • Items added

Changes:

Please provide a list of the changes implemented by this PR

  • changes made

Tests included

  • Included for each change/fix?
  • Passing? (Merge will not be approved unless this is checked)

Documentation

  • swagger documentation updated [required]
  • official documentation updated [nice-to-have]

official documentation info

If you have updated the official documentation, please provide PR # and URL of the pages where the updates are included

Backend version

  • Does it require a specific version of the backend
  • which version of the backend is required:

Summary by Sourcery

Refactor proposal dashboard to use a shared full-text search bar component and extract table functionality into a dedicated ProposalTableComponent, streamlining search and table logic across dataset and proposal dashboards.

Enhancements:

  • Introduce a shared FullTextSearchBarComponent and module, replacing custom search implementations in dataset and proposal dashboards
  • Extract proposal table rendering and state management into a standalone ProposalTableComponent, simplifying the parent dashboard component
  • Simplify ProposalDashboardComponent to handle only search term input, routing, and row navigation
  • Update module declarations and imports to include FullTextSearchBarModule and register ProposalTableComponent, and adjust dataset module imports accordingly

Tests:

  • Update unit tests to instantiate ProposalTableComponent instead of ProposalDashboardComponent

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @Junjiequan - I've reviewed your changes and they look great!

Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments

### Comment 1
<location> `src/app/proposals/proposal-table/proposal-table.component.ts:264` </location>
<code_context>
     });
   }

-  onGlobalTextSearchChange(text: string) {
-    this.router.navigate([], {
-      queryParams: {
-        textSearch: text || undefined,
-        pageIndex: 0,
-      },
-      queryParamsHandling: "merge",
-    });
-  }
</code_context>

<issue_to_address>
onGlobalTextSearchChange is defined but not used.

If unused, please remove this method to keep the codebase clean.
</issue_to_address>

<suggested_fix>
<<<<<<< SEARCH
  onGlobalTextSearchChange(text: string) {
    this.router.navigate([], {
      queryParams: {
        textSearch: text || undefined,
        pageIndex: 0,
      },
      queryParamsHandling: "merge",
    });
  }
=======
>>>>>>> REPLACE

</suggested_fix>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@Junjiequan Junjiequan force-pushed the SWAP-4818-scicat-fe-proposals-filters-evaluation-draft- branch from a661412 to 71653ad Compare July 18, 2025 07:23
@Junjiequan Junjiequan force-pushed the SWAP-4818-scicat-fe-proposals-filters-evaluation-draft- branch from 65b5aa2 to 669f115 Compare July 28, 2025 12:30
Copy link
Member

@nitrosx nitrosx left a comment

Choose a reason for hiding this comment

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

Can we add the following fields to the list of columns in the proposals table?

  • Type
  • Start Date
  • End Date

Other than that it looks good

@nitrosx
Copy link
Member

nitrosx commented Aug 8, 2025

Also, can we take care of the conflicts that are mentioned here?

Copy link
Collaborator

@martin-trajanovski martin-trajanovski left a comment

Choose a reason for hiding this comment

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

It looks good to me in general. A small thing that I found hard to figure out is what Start Time and End Time filters really filter by. There are no such fields on the proposal as I can see.

@Junjiequan
Copy link
Member Author

It looks good to me in general. A small thing that I found hard to figure out is what Start Time and End Time filters really filter by. There are no such fields on the proposal as I can see.

@martin-trajanovski startTime and endTime are optional fields, they are defined in the proposal schema

@Junjiequan Junjiequan requested a review from nitrosx August 13, 2025 13:09
@Junjiequan Junjiequan merged commit 86231e1 into master Aug 15, 2025
8 checks passed
@Junjiequan Junjiequan deleted the SWAP-4818-scicat-fe-proposals-filters-evaluation-draft- branch August 15, 2025 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants