-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Edition and deletion of messages (#22)
* Allow edition and deletion in jupyter-chat package * Handle edition and deletion of message in collaborative chat extension * Automatic application of license header * lint * Button to cancel message edition * Add ui-tests and fix flaky settings test * Add deleted and edited message information in chat component * Use edited and deleted flag in collaborative chat * Handle the deleted messages from file (out of band changes) * Uses global variables in tests * Add tests on out of band changes --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
c8dcd96
commit 80b8c6d
Showing
15 changed files
with
648 additions
and
109 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Copyright (c) Jupyter Development Team. | ||
* Distributed under the terms of the Modified BSD License. | ||
*/ | ||
|
||
import { | ||
ToolbarButtonComponent, | ||
deleteIcon, | ||
editIcon | ||
} from '@jupyterlab/ui-components'; | ||
import React from 'react'; | ||
|
||
const TOOLBAR_CLASS = 'jp-chat-toolbar'; | ||
|
||
/** | ||
* The toolbar attached to a message. | ||
*/ | ||
export function MessageToolbar(props: MessageToolbar.IProps): JSX.Element { | ||
const buttons: JSX.Element[] = []; | ||
|
||
if (props.edit !== undefined) { | ||
const editButton = ToolbarButtonComponent({ | ||
icon: editIcon, | ||
onClick: props.edit, | ||
tooltip: 'Edit' | ||
}); | ||
buttons.push(editButton); | ||
} | ||
if (props.delete !== undefined) { | ||
const deleteButton = ToolbarButtonComponent({ | ||
icon: deleteIcon, | ||
onClick: props.delete, | ||
tooltip: 'Delete' | ||
}); | ||
buttons.push(deleteButton); | ||
} | ||
|
||
return ( | ||
<div className={TOOLBAR_CLASS}> | ||
{buttons.map(toolbarButton => toolbarButton)} | ||
</div> | ||
); | ||
} | ||
|
||
export namespace MessageToolbar { | ||
export interface IProps { | ||
edit?: () => void; | ||
delete?: () => void; | ||
} | ||
} |
Oops, something went wrong.