From 324ad2040bfc2ebd9ea2f58365c5f488aaf8fdb5 Mon Sep 17 00:00:00 2001 From: Vasanti Suthar Date: Wed, 10 Aug 2022 00:16:20 +0530 Subject: [PATCH 1/6] modified the play not found message with search term --- src/common/playlists/PlayList.jsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/common/playlists/PlayList.jsx b/src/common/playlists/PlayList.jsx index 22e4d63c3b..c41c32886a 100644 --- a/src/common/playlists/PlayList.jsx +++ b/src/common/playlists/PlayList.jsx @@ -1,6 +1,7 @@ import PlayThumbnail from "./PlayThumbnail"; import { ReactComponent as ImageOops } from "images/img-oops.svg"; -import React, { Fragment, useEffect, useState } from "react"; +import React, { Fragment, useEffect, useState, useContext } from "react"; +import { SearchContext } from "common/search/search-context"; import "react-loader-spinner/dist/loader/css/react-spinner-loader.css"; import Loader from "common/spinner/spinner"; import * as all_plays from "plays"; @@ -13,6 +14,8 @@ const PlayList = () => { const [loading, error, plays] = useGetPlays(); const [allPlays, setAllPlays] = useState([]) + const { searchTerm } = useContext(SearchContext); + let { playid } = useParams(); // return the parameter of url if (loading) { @@ -23,7 +26,7 @@ const PlayList = () => { return (
-

Play not found

+

Play not found for "{ searchTerm }"

Please change your search or adjust filters to find plays.

From b8dfcaecae5bc55d043e97e9136f067920cf954b Mon Sep 17 00:00:00 2001 From: Vasanti Suthar Date: Tue, 16 Aug 2022 02:22:58 +0530 Subject: [PATCH 2/6] checked falsy value of searchterm --- src/common/playlists/PlayList.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/playlists/PlayList.jsx b/src/common/playlists/PlayList.jsx index c41c32886a..e303eff897 100644 --- a/src/common/playlists/PlayList.jsx +++ b/src/common/playlists/PlayList.jsx @@ -25,8 +25,8 @@ const PlayList = () => { if (plays?.length === 0) { return (
- -

Play not found for "{ searchTerm }"

+ +

Play not found {searchTerm ? "for " + searchTerm : null}

Please change your search or adjust filters to find plays.

From 4e9192cc5d8a4d5cd9cf92405401c41f033fb63d Mon Sep 17 00:00:00 2001 From: Vasanti Suthar Date: Tue, 16 Aug 2022 03:07:42 +0530 Subject: [PATCH 3/6] implemented check for filter and search --- src/common/playlists/PlayList.jsx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/common/playlists/PlayList.jsx b/src/common/playlists/PlayList.jsx index e8864b2437..486723396f 100644 --- a/src/common/playlists/PlayList.jsx +++ b/src/common/playlists/PlayList.jsx @@ -15,9 +15,15 @@ const PlayList = () => { const [loading, error, plays] = useGetPlays(); const [allPlays, setAllPlays] = useState([]) - const { searchTerm } = useContext(SearchContext); + const { searchTerm, filterQuery } = useContext(SearchContext); + + const hasFilterQuery = + filterQuery.level_id.length > 0 || + filterQuery.tags.length > 0 || + filterQuery.owner_user_id.length > 0 || + filterQuery.language.length > 0; - let { playid } = useParams(); // return the parameter of url + let { playid } = useParams(); // return the parameter of url if (loading) { return ; @@ -27,7 +33,11 @@ const PlayList = () => { return (
-

Play not found {searchTerm ? "for " + searchTerm : null}

+

Play not found + {hasFilterQuery? " for matched filter criteria" : null} + {hasFilterQuery && searchTerm ? " and ": null} + {searchTerm ? " for " + searchTerm : null} +

Please change your search or adjust filters to find plays.

From b091a89fdaeb99bfc1c60b37dfadc44ed4447929 Mon Sep 17 00:00:00 2001 From: Vasanti Suthar <63599802+vasantisuthar@users.noreply.github.com> Date: Tue, 23 Aug 2022 21:56:47 +0530 Subject: [PATCH 4/6] Update src/common/playlists/PlayList.jsx Co-authored-by: Sachin Chaurasiya --- src/common/playlists/PlayList.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/playlists/PlayList.jsx b/src/common/playlists/PlayList.jsx index 486723396f..0ab59146ec 100644 --- a/src/common/playlists/PlayList.jsx +++ b/src/common/playlists/PlayList.jsx @@ -35,7 +35,7 @@ const PlayList = () => {

Play not found {hasFilterQuery? " for matched filter criteria" : null} - {hasFilterQuery && searchTerm ? " and ": null} + {hasFilterQuery && searchTerm ? " and": null} {searchTerm ? " for " + searchTerm : null}

From c001c3275f0157731dc5f54e84c3777ff22f420f Mon Sep 17 00:00:00 2001 From: Vasanti Suthar <63599802+vasantisuthar@users.noreply.github.com> Date: Tue, 23 Aug 2022 21:57:27 +0530 Subject: [PATCH 5/6] Update src/common/playlists/PlayList.jsx Co-authored-by: Sachin Chaurasiya --- src/common/playlists/PlayList.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/playlists/PlayList.jsx b/src/common/playlists/PlayList.jsx index 0ab59146ec..e91a31f198 100644 --- a/src/common/playlists/PlayList.jsx +++ b/src/common/playlists/PlayList.jsx @@ -36,7 +36,7 @@ const PlayList = () => {

Play not found {hasFilterQuery? " for matched filter criteria" : null} {hasFilterQuery && searchTerm ? " and": null} - {searchTerm ? " for " + searchTerm : null} + {searchTerm ? ` for ${searchTerm}` : null}

Please change your search or adjust filters to find plays. From 50ec38c97b91d4c79383defd3368217b1d006ff0 Mon Sep 17 00:00:00 2001 From: Vasanti Suthar Date: Sun, 4 Sep 2022 23:44:22 +0530 Subject: [PATCH 6/6] updated response --- src/common/playlists/PlayList.jsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/common/playlists/PlayList.jsx b/src/common/playlists/PlayList.jsx index e91a31f198..cb606311e5 100644 --- a/src/common/playlists/PlayList.jsx +++ b/src/common/playlists/PlayList.jsx @@ -35,8 +35,7 @@ const PlayList = () => {

Play not found {hasFilterQuery? " for matched filter criteria" : null} - {hasFilterQuery && searchTerm ? " and": null} - {searchTerm ? ` for ${searchTerm}` : null} + {searchTerm ? " for " + searchTerm : null}

Please change your search or adjust filters to find plays.