Add hideInputs query param in notebookViewer and other minor updates (#82)

* Add hideInputs query param in notebookViewer

* Fix test and other minor changes

* Make GalleryHeaderComponent more functional
This commit is contained in:
Tanuj Mittal
2020-07-10 14:23:53 -07:00
committed by GitHub
parent 9bdf7e0cce
commit dcd6e0361c
7 changed files with 73 additions and 32 deletions

View File

@@ -93,21 +93,23 @@ describe("GalleryUtils", () => {
selectedTab,
sortBy,
searchText: decodeURIComponent(searchText)
});
} as GalleryUtils.GalleryViewerProps);
});
it("getNotebookViewerProps gets notebook viewer props correctly", () => {
const notebookUrl = "https%3A%2F%2Fnotebook.url";
const galleryItemId = "1234-abcd-efgh";
const hideInputs = "true";
const response = GalleryUtils.getNotebookViewerProps(
`?${GalleryUtils.NotebookViewerParams.NotebookUrl}=${notebookUrl}&${GalleryUtils.NotebookViewerParams.GalleryItemId}=${galleryItemId}`
`?${GalleryUtils.NotebookViewerParams.NotebookUrl}=${notebookUrl}&${GalleryUtils.NotebookViewerParams.GalleryItemId}=${galleryItemId}&${GalleryUtils.NotebookViewerParams.HideInputs}=${hideInputs}`
);
expect(response).toEqual({
notebookUrl: decodeURIComponent(notebookUrl),
galleryItemId
});
galleryItemId,
hideInputs: true
} as GalleryUtils.NotebookViewerProps);
});
it("getTabTitle returns correct title for official samples", () => {