Web console: better lookup 404 detection (#14108)

* better lookup 404 detection

* update snapshot
This commit is contained in:
Vadim Ogievetsky 2023-04-19 09:27:55 -07:00 committed by GitHub
parent e8674e2a60
commit 4fffee1776
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 7 deletions

View File

@ -16,6 +16,8 @@
* limitations under the License.
*/
import { deepGet } from './object-change';
export function isLookupsUninitialized(error: Error | undefined) {
return error && error.message === 'Request failed with status code 404';
return deepGet(error || {}, 'response.status') === 404;
}

View File

@ -210,7 +210,7 @@ exports[`LookupsView matches snapshot 1`] = `
multiSort={true}
nestingLevelKey="_nestingLevel"
nextText="Next"
noDataText=""
noDataText="No lookups"
ofText="of"
onFetchData={[Function]}
onFilteredChange={[Function]}

View File

@ -355,11 +355,7 @@ export class LookupsView extends React.PureComponent<LookupsViewProps, LookupsVi
<ReactTable
data={lookups}
loading={lookupEntriesAndTiersState.loading}
noDataText={
!lookupEntriesAndTiersState.loading && !lookups.length
? 'No lookups'
: lookupEntriesAndTiersState.getErrorMessage() || ''
}
noDataText={lookupEntriesAndTiersState.getErrorMessage() || 'No lookups'}
filterable
filtered={lookupFilter}
onFilteredChange={filtered => {