mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-01-08 03:57:31 +00:00
fix upload file for typescript issues
This commit is contained in:
29654
package-lock.json
generated
29654
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -23,7 +23,7 @@ export const Upload: FunctionComponent<UploadProps> = ({
|
|||||||
}: UploadProps) => {
|
}: UploadProps) => {
|
||||||
const [selectedFilesTitle, setSelectedFilesTitle] = useState<string[]>([]);
|
const [selectedFilesTitle, setSelectedFilesTitle] = useState<string[]>([]);
|
||||||
|
|
||||||
const fileRef = useRef<HTMLInputElement>();
|
const fileRef = useRef<HTMLInputElement>() as React.MutableRefObject<HTMLInputElement>;
|
||||||
|
|
||||||
const onImportLinkKeyPress = (event: KeyboardEvent<HTMLAnchorElement>): void => {
|
const onImportLinkKeyPress = (event: KeyboardEvent<HTMLAnchorElement>): void => {
|
||||||
if (event.keyCode === Constants.KeyCodes.Enter || event.keyCode === Constants.KeyCodes.Space) {
|
if (event.keyCode === Constants.KeyCodes.Enter || event.keyCode === Constants.KeyCodes.Space) {
|
||||||
@@ -39,12 +39,14 @@ export const Upload: FunctionComponent<UploadProps> = ({
|
|||||||
const { files } = event.target;
|
const { files } = event.target;
|
||||||
|
|
||||||
const newFileList = [];
|
const newFileList = [];
|
||||||
for (let i = 0; i < files.length; i++) {
|
if (files) {
|
||||||
newFileList.push(files.item(i).name);
|
for (let i = 0; i < files.length; i++) {
|
||||||
}
|
newFileList.push(files[i].name);
|
||||||
if (newFileList) {
|
}
|
||||||
setSelectedFilesTitle(newFileList);
|
if (newFileList) {
|
||||||
props.onUpload(event);
|
setSelectedFilesTitle(newFileList);
|
||||||
|
props.onUpload(event);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const title = label + " to upload";
|
const title = label + " to upload";
|
||||||
|
|||||||
@@ -220,13 +220,15 @@ const makeMapStateToProps = (_: AppState, ownProps: ComponentProps): ((state: Ap
|
|||||||
const model = selectors.model(state, { contentRef: ownProps.contentRef });
|
const model = selectors.model(state, { contentRef: ownProps.contentRef });
|
||||||
const cellOrder = selectors.notebook.cellOrder(model as RecordOf<DocumentRecordProps>);
|
const cellOrder = selectors.notebook.cellOrder(model as RecordOf<DocumentRecordProps>);
|
||||||
const cellIndex = cellOrder.indexOf(ownProps.id);
|
const cellIndex = cellOrder.indexOf(ownProps.id);
|
||||||
const cellIdAbove = cellIndex ? cellOrder.get(cellIndex - 1, undefined) : undefined;
|
const cellIdAbove = cellIndex ? cellOrder.get(cellIndex - 1, "") : "";
|
||||||
const cellIdBelow = cellIndex !== undefined ? cellOrder.get(cellIndex + 1, undefined) : undefined;
|
const cellIdBelow = cellIndex !== undefined ? cellOrder.get(cellIndex + 1, "") : "";
|
||||||
|
|
||||||
return {
|
return {
|
||||||
cellType,
|
cellType,
|
||||||
cellIdAbove: cellIdAbove ? cellIdAbove : "",
|
cellIdAbove,
|
||||||
cellIdBelow: cellIdBelow ? cellIdBelow : "",
|
cellIdBelow,
|
||||||
|
// cellIdAbove: cellIdAbove ? cellIdAbove : "",
|
||||||
|
// cellIdBelow: cellIdBelow ? cellIdBelow : "",
|
||||||
hasCodeOutput: cellType === "code" && NotebookUtil.hasCodeCellOutput(cell as ImmutableCodeCell),
|
hasCodeOutput: cellType === "code" && NotebookUtil.hasCodeCellOutput(cell as ImmutableCodeCell),
|
||||||
isNotebookUntrusted: NotebookUtil.isNotebookUntrusted(state, ownProps.contentRef),
|
isNotebookUntrusted: NotebookUtil.isNotebookUntrusted(state, ownProps.contentRef),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -141,7 +141,8 @@
|
|||||||
"./src/Platform/Hosted/Components/SwitchAccount.tsx",
|
"./src/Platform/Hosted/Components/SwitchAccount.tsx",
|
||||||
"./src/Platform/Hosted/Components/SwitchSubscription.tsx",
|
"./src/Platform/Hosted/Components/SwitchSubscription.tsx",
|
||||||
"./src/Explorer/Notebook/NotebookComponent/VirtualCommandBarComponent.tsx",
|
"./src/Explorer/Notebook/NotebookComponent/VirtualCommandBarComponent.tsx",
|
||||||
"./src/Explorer/Notebook/NotebookRenderer/Toolbar.tsx"
|
"./src/Explorer/Notebook/NotebookRenderer/Toolbar.tsx",
|
||||||
|
"./src/Common/Upload/Upload.tsx"
|
||||||
],
|
],
|
||||||
"include": [
|
"include": [
|
||||||
"src/CellOutputViewer/transforms/**/*",
|
"src/CellOutputViewer/transforms/**/*",
|
||||||
|
|||||||
Reference in New Issue
Block a user