-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #123 from XpressAI/adry/fix-component-parser
🐛Skip category when error occurred during components parsing
- Loading branch information
Showing
8 changed files
with
64 additions
and
38 deletions.
There are no files selected for viewing
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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { ServiceManager } from '@jupyterlab/services'; | ||
import { showDialog, Dialog } from '@jupyterlab/apputils'; | ||
|
||
import {requestAPI} from "../server/handler"; | ||
import React from 'react'; | ||
|
||
async function get_all_components_method() { | ||
const response = await requestAPI<any>('components/'); | ||
const components = response["components"]; | ||
const error_msg = response["error_msg"]; | ||
|
||
if(error_msg){ | ||
showDialog({ | ||
title: 'Parse Component Failed', | ||
body: ( | ||
<pre>{error_msg}</pre> | ||
), | ||
buttons: [Dialog.warnButton({ label: 'OK' })] | ||
}); | ||
} | ||
return components; | ||
} | ||
|
||
export default async function ComponentList(serviceManager: ServiceManager) { | ||
let component_list_result: string[] = await get_all_components_method(); | ||
|
||
return component_list_result; | ||
} |
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