From ad552fddf9c45481a9de04b12ed7c03c5dfb056f Mon Sep 17 00:00:00 2001 From: Sny Date: Fri, 25 Mar 2022 14:05:01 +0530 Subject: [PATCH] OpenConceptLab/ocl_issues#1203 | Search results inline loader --- src/components/search/ResultsTable.jsx | 54 ++++++++++++++------------ src/components/search/Search.jsx | 5 ++- 2 files changed, 33 insertions(+), 26 deletions(-) diff --git a/src/components/search/ResultsTable.jsx b/src/components/search/ResultsTable.jsx index 1b7fb3be..f4a78add 100644 --- a/src/components/search/ResultsTable.jsx +++ b/src/components/search/ResultsTable.jsx @@ -740,7 +740,7 @@ const ResultsTable = ( onPinCreate, onPinDelete, pins, nested, showPin, essentialColumns, onReferencesDelete, isVersionedObject, onCreateSimilarClick, onCreateMappingClick, viewFields, hapi, fhir, history, onSelect, asReference, onSelectChange, onIndependentDetailsToggle, onWidthChange, onLimitChange, - isInsideConfiguredOrg + isInsideConfiguredOrg, isLoading } ) => { const [details, setDetails] = React.useState(null); @@ -754,7 +754,7 @@ const ResultsTable = ( const isValueSet = resource === 'ValueSet' const isConceptMap = resource === 'ConceptMap' const shouldShowPin = showPin && resourceDefinition.pinnable; - const canRender = results.total && resourceDefinition; + const canRender = (results.total && resourceDefinition) || isLoading; const defaultOrderBy = get(find(resourceDefinition.columns, {sortOn: get(values(sortParams), '0', 'last_update')}), 'id', 'UpdateOn'); const defaultOrder = get(keys(sortParams), '0') === 'sortAsc' ? 'asc' : 'desc'; const [selectedList, setSelectedList] = React.useState([]); @@ -928,29 +928,35 @@ const ResultsTable = ( { + isLoading ? + + + + + : ( map(results.items, (item, index) => ( - - )) + + ))) } diff --git a/src/components/search/Search.jsx b/src/components/search/Search.jsx index 17dc7fcc..54575ece 100644 --- a/src/components/search/Search.jsx +++ b/src/components/search/Search.jsx @@ -841,9 +841,9 @@ class Search extends React.Component { } { - isLoading ? + isLoading && (showHierarchy || !isTable) ?
- +
:
{ @@ -859,6 +859,7 @@ class Search extends React.Component { /> : ( isTable ?