- {
- this.props.repoID &&
+ {(mode === 'current_repo_and_other_repos' || mode === 'only_current_library') &&
@@ -122,24 +124,26 @@ class FileChooser extends React.Component {
}
}
-
-
-
-
{gettext('Other Libraries')}
+ {mode !== 'only_current_library' &&
+
+
+
+ {libName}
+
+ {
+ this.state.isOtherRepoShow &&
+
+ }
- {
- this.state.isOtherRepoShow &&
-
- }
-
+ }
);
}
diff --git a/frontend/src/shared-file-view-text.js b/frontend/src/shared-file-view-text.js
index 9ddb298e9c..099c14e84f 100644
--- a/frontend/src/shared-file-view-text.js
+++ b/frontend/src/shared-file-view-text.js
@@ -5,6 +5,8 @@ import CodeMirror from 'react-codemirror';
import { Button } from 'reactstrap';
import { Utils } from './utils/utils';
import watermark from 'watermark-dom';
+import SaveSharedFileDialog from './components/dialog/save-shared-file-dialog';
+import toaster from './components/toast';
import { serviceURL, gettext, siteRoot, mediaUrl, logoPath, logoWidth, logoHeight, siteTitle } from './utils/constants';
import 'codemirror/lib/codemirror.css';
@@ -42,6 +44,9 @@ class SharedFileViewText extends React.Component {
constructor(props) {
super(props);
+ this.state = {
+ showSaveSharedFileDialog: false,
+ };
}
changeEncode = (e) => {
@@ -68,6 +73,18 @@ class SharedFileViewText extends React.Component {
);
}
+ handleSaveSharedFileDialog = () => {
+ this.setState({
+ showSaveSharedFileDialog: !this.state.showSaveSharedFileDialog
+ });
+ }
+
+ saveFileSuccess = () => {
+ let msg = gettext('Successfully saved {fileName}.');
+ msg = msg.replace('{fileName}', fileName);
+ toaster.success(msg);
+ }
+
render() {
return (
@@ -104,7 +121,14 @@ class SharedFileViewText extends React.Component {
{this.fileEncode()}
{ err ?
{err}
:
-
}
+ }
+ { this.state.showSaveSharedFileDialog &&
+
+ }