Skip to content

[#15] [Backend] As a user, I can query keywords, [#16] [UI] As a user, I can query keywords, #45

Draft
mosharaf13 wants to merge 2 commits intodevelopfrom
feature/16-query-keywords
Draft

[#15] [Backend] As a user, I can query keywords, [#16] [UI] As a user, I can query keywords, #45
mosharaf13 wants to merge 2 commits intodevelopfrom
feature/16-query-keywords

Conversation

@mosharaf13
Copy link
Contributor

Closes #15
Closes #16

What happened 👀

  • Users can now query search stats through a search box

Insight 📝

  • Added a search box for users to input query keywords
  • Returned search stats based on those keywords

Proof Of Work 📹

Before search Screen Shot 2023-06-14 at 7 22 28 PM
After search Screen Shot 2023-06-14 at 7 22 42 PM

@mosharaf13 mosharaf13 requested a review from a user June 14, 2023 12:39
@mosharaf13 mosharaf13 changed the base branch from main to ui/list-keywords June 14, 2023 12:40
search_keyword = params[:search_keyword]

if search_keyword.present?
@pagy, @search_stats = pagy(current_user.search_stats.where(keyword: search_keyword))

Choose a reason for hiding this comment

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

⚠️ Calls 'current_user.search_stats' 2 times

if search_keyword.present?
@pagy, @search_stats = pagy(current_user.search_stats.where(keyword: search_keyword))
else
@pagy, @search_stats = pagy(current_user.search_stats)

Choose a reason for hiding this comment

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

⚠️ Calls 'current_user.search_stats' 2 times

@github-actions
Copy link

Code coverage is now at 0.00% (0/93 lines)

Generated by 🚫 Danger

@mosharaf13 mosharaf13 self-assigned this Jun 15, 2023
@mosharaf13 mosharaf13 added this to the 0.4.0 milestone Jun 15, 2023
Copy link
Contributor

@longnd longnd left a comment

Choose a reason for hiding this comment

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

The query condition in this PR is too simple. Pls check the requirement

At least, the following examples must be implemented

Allow users to query all the stored data across all their uploaded keyword.

Examples of the SQL queries which users can run:

  • How many URLs contain the word technology in AdWords.
  • How many times a specific URL shows up in stored search results.
  • How many keywords have URLs in stored search results with 2 or more / or 1 or more >.

@pagy, @search_stats = pagy(current_user.search_stats)
search_keyword = params[:search_keyword]

if search_keyword.present?
Copy link
Contributor

Choose a reason for hiding this comment

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

@mosharaf13 mosharaf13 marked this pull request as draft June 19, 2023 09:07
Base automatically changed from ui/list-keywords to develop June 23, 2023 03:42
@sanG-github sanG-github removed their request for review September 26, 2023 02:41
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.

[UI] As a user, I can query keywords [Backend] As a user, I can query keywords

2 participants