Added support for acknowledging code of conduct for using public Notebook Gallery (#117)

* minro code edits

* Added support for acknowledging code of conduct

- Added CodeOfConduct component that shows links and a checkbox that must be acknwledged before seeing the public galley
- Added verbose message for notebook publish error (when another notebook with the same name exists in the gallery)
- Added a feature flag for enabling code of conduct acknowledgement

* Added Info Component

* minor edit

* fixed failign tests

* publish tab displayed only when code of conduct accepted

* added code of conduct fetch during publish

* fixed bug

* added test and addressed PR comments

* changed line endings

* added comment

* addressed PR comments
This commit is contained in:
Srinath Narayanan
2020-08-11 00:37:05 -07:00
committed by GitHub
parent 3051961093
commit 7a3e54d43e
20 changed files with 633 additions and 114 deletions

View File

@@ -166,7 +166,7 @@ export default class NotebookTabV2 extends TabsBase {
},
{
iconName: "PublishContent",
onCommandClick: () => this.publishToGallery(),
onCommandClick: async () => await this.publishToGallery(),
commandButtonLabel: publishLabel,
hasPopup: false,
disabled: false,
@@ -456,9 +456,9 @@ export default class NotebookTabV2 extends TabsBase {
);
}
private publishToGallery = () => {
private publishToGallery = async () => {
const notebookContent = this.notebookComponentAdapter.getContent();
this.container.publishNotebook(
await this.container.publishNotebook(
notebookContent.name,
notebookContent.content,
this.notebookComponentAdapter.getNotebookParentElement()