-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: show banner warning and disable export if azul is indexing (#3775…
…) (#3808) * feat: show banner warning and disable export if azul is indexing (#3775) * feat: disable export if azul is indexing (#3775) * feat: updated app layout (#3775) * chore: updated package (#3775) --------- Co-authored-by: Fran McDade <franmcdade@Frans-MacBook-Pro.local>
- Loading branch information
Showing
13 changed files
with
192 additions
and
76 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
explorer/app/components/common/RenderComponents/renderComponents.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { ComponentCreator } from "@clevercanary/data-explorer-ui/lib/components/ComponentCreator/ComponentCreator"; | ||
import { ComponentsConfig } from "@clevercanary/data-explorer-ui/lib/config/entities"; | ||
import React, { Fragment } from "react"; | ||
|
||
export interface RenderComponentsProps { | ||
components?: ComponentsConfig; | ||
} | ||
|
||
export const RenderComponents = ({ | ||
components, | ||
}: RenderComponentsProps): JSX.Element => { | ||
return ( | ||
<Fragment> | ||
{components && <ComponentCreator components={components} response={{}} />} | ||
</Fragment> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
explorer/app/viewModelBuilders/azul/hca-dcp/common/systemStatusMapper/entities.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* Model of raw HTTP index response. | ||
*/ | ||
export interface IndexHttpResponse { | ||
progress: { | ||
unindexed_bundles: number; | ||
unindexed_documents: number; | ||
}; | ||
up: boolean; | ||
} |
33 changes: 33 additions & 0 deletions
33
explorer/app/viewModelBuilders/azul/hca-dcp/common/systemStatusMapper/systemStatusMapper.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { | ||
INDEXING_STATUS, | ||
SystemStatusResponse, | ||
} from "@clevercanary/data-explorer-ui/lib/providers/systemStatus"; | ||
import { IndexHttpResponse } from "./entities"; | ||
|
||
/** | ||
* Normalize system status response. | ||
* @param response - HTTP response. | ||
* @returns normalized system status response. | ||
*/ | ||
export function bindSystemStatusResponse( | ||
response?: IndexHttpResponse | ||
): SystemStatusResponse | undefined { | ||
if (!response) return; | ||
return { | ||
indexing: isIndexing(response), | ||
indexingStatus: INDEXING_STATUS.COMPLETE, | ||
ok: response.up, | ||
}; | ||
} | ||
|
||
/** | ||
* Returns true if the system is currently indexing. | ||
* @param response - HTTP response. | ||
* @returns true if the system is currently indexing. | ||
*/ | ||
function isIndexing(response: IndexHttpResponse): boolean { | ||
return ( | ||
response.progress.unindexed_bundles > 0 || | ||
response.progress.unindexed_documents > 0 | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.