Prettier 2.0 (#393)

This commit is contained in:
Steve Faulkner
2021-01-20 09:15:01 -06:00
committed by GitHub
parent c1937ca464
commit 4be53284b5
500 changed files with 41927 additions and 41838 deletions

View File

@@ -20,7 +20,7 @@ describe("NotebookMetadataComponent", () => {
views: 0,
newCellId: undefined,
policyViolations: undefined,
pendingScanJobIds: undefined
pendingScanJobIds: undefined,
},
isFavorite: false,
downloadButtonText: "Download",
@@ -28,7 +28,7 @@ describe("NotebookMetadataComponent", () => {
onDownloadClick: undefined,
onFavoriteClick: undefined,
onUnfavoriteClick: undefined,
onReportAbuseClick: undefined
onReportAbuseClick: undefined,
};
const wrapper = shallow(<NotebookMetadataComponent {...props} />);
@@ -52,7 +52,7 @@ describe("NotebookMetadataComponent", () => {
views: 0,
newCellId: undefined,
policyViolations: undefined,
pendingScanJobIds: undefined
pendingScanJobIds: undefined,
},
isFavorite: true,
downloadButtonText: "Download",
@@ -60,7 +60,7 @@ describe("NotebookMetadataComponent", () => {
onDownloadClick: undefined,
onFavoriteClick: undefined,
onUnfavoriteClick: undefined,
onReportAbuseClick: undefined
onReportAbuseClick: undefined,
};
const wrapper = shallow(<NotebookMetadataComponent {...props} />);

View File

@@ -10,7 +10,7 @@ import {
PersonaSize,
PrimaryButton,
Stack,
Text
Text,
} from "office-ui-fabric-react";
import * as React from "react";
import { IGalleryItem } from "../../../Juno/JunoClient";
@@ -35,7 +35,7 @@ export class NotebookMetadataComponent extends React.Component<NotebookMetadataC
const options: Intl.DateTimeFormatOptions = {
year: "numeric",
month: "short",
day: "numeric"
day: "numeric",
};
const dateString = new Date(this.props.data.created).toLocaleString("default", options);

View File

@@ -44,7 +44,8 @@ interface NotebookViewerComponentState {
showProgressBar: boolean;
}
export class NotebookViewerComponent extends React.Component<NotebookViewerComponentProps, NotebookViewerComponentState>
export class NotebookViewerComponent
extends React.Component<NotebookViewerComponentProps, NotebookViewerComponentState>
implements DialogHost {
private clientManager: NotebookClientV2;
private notebookComponentBootstrapper: NotebookComponentBootstrapper;
@@ -59,12 +60,12 @@ export class NotebookViewerComponent extends React.Component<NotebookViewerCompo
isReadOnly: true,
cellEditorType: "monaco",
autoSaveInterval: 365 * 24 * 3600 * 1000, // There is no way to turn off auto-save, set to 1 year
contentProvider: contents.JupyterContentProvider // NotebookViewer only knows how to talk to Jupyter contents API
contentProvider: contents.JupyterContentProvider, // NotebookViewer only knows how to talk to Jupyter contents API
});
this.notebookComponentBootstrapper = new NotebookComponentBootstrapper({
notebookClient: this.clientManager,
contentRef: createContentRef()
contentRef: createContentRef(),
});
this.state = {
@@ -72,7 +73,7 @@ export class NotebookViewerComponent extends React.Component<NotebookViewerCompo
galleryItem: props.galleryItem,
isFavorite: props.isFavorite,
dialogProps: undefined,
showProgressBar: true
showProgressBar: true,
};
this.loadNotebookContent();
@@ -148,7 +149,7 @@ export class NotebookViewerComponent extends React.Component<NotebookViewerCompo
{this.notebookComponentBootstrapper.renderComponent(NotebookReadOnlyRenderer, {
hideInputs: this.props.hideInputs,
hidePrompts: this.props.hidePrompts
hidePrompts: this.props.hidePrompts,
})}
{this.state.dialogProps && <DialogComponent {...this.state.dialogProps} />}
@@ -173,7 +174,7 @@ export class NotebookViewerComponent extends React.Component<NotebookViewerCompo
return {
galleryItem,
isFavorite
isFavorite,
};
}
@@ -205,25 +206,25 @@ export class NotebookViewerComponent extends React.Component<NotebookViewerCompo
onCancel && onCancel();
},
choiceGroupProps,
textFieldProps
}
textFieldProps,
},
});
}
private favoriteItem = async (): Promise<void> => {
GalleryUtils.favoriteItem(this.props.container, this.props.junoClient, this.state.galleryItem, item =>
GalleryUtils.favoriteItem(this.props.container, this.props.junoClient, this.state.galleryItem, (item) =>
this.setState({ galleryItem: item, isFavorite: true })
);
};
private unfavoriteItem = async (): Promise<void> => {
GalleryUtils.unfavoriteItem(this.props.container, this.props.junoClient, this.state.galleryItem, item =>
GalleryUtils.unfavoriteItem(this.props.container, this.props.junoClient, this.state.galleryItem, (item) =>
this.setState({ galleryItem: item, isFavorite: false })
);
};
private downloadItem = async (): Promise<void> => {
GalleryUtils.downloadItem(this.props.container, this.props.junoClient, this.state.galleryItem, item =>
GalleryUtils.downloadItem(this.props.container, this.props.junoClient, this.state.galleryItem, (item) =>
this.setState({ galleryItem: item })
);
};