[ARVADOS-WORKBENCH2] updated: 1.2.0-437-gf05ff87

Git user git at public.curoverse.com
Wed Sep 26 09:48:00 EDT 2018


Summary of changes:
 .../rich-text-editor-link.tsx                      | 24 ++++++++++++++--------
 .../rich-text-editor-dialog-actions.tsx            |  2 +-
 .../details-panel/project-details.tsx              | 11 ++++++----
 .../rich-text-editor-dialog.tsx                    |  9 +++-----
 4 files changed, 27 insertions(+), 19 deletions(-)

       via  f05ff87a5a04b0a6c45c2cba0b492c561de2e651 (commit)
      from  eb909803c6fe3c99894ac402a88ea7cbc114f66b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit f05ff87a5a04b0a6c45c2cba0b492c561de2e651
Author: Janicki Artur <artur.janicki at contractors.roche.com>
Date:   Wed Sep 26 15:47:50 2018 +0200

    improve dialog and fix richTextEditorLink
    
    Feature #14120
    
    Arvados-DCO-1.1-Signed-off-by: Janicki Artur <artur.janicki at contractors.roche.com>

diff --git a/src/components/rich-text-editor-link/rich-text-editor-link.tsx b/src/components/rich-text-editor-link/rich-text-editor-link.tsx
index ca942d7..2d6a5b4 100644
--- a/src/components/rich-text-editor-link/rich-text-editor-link.tsx
+++ b/src/components/rich-text-editor-link/rich-text-editor-link.tsx
@@ -3,7 +3,8 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import * as React from 'react';
-import { DispatchProp } from 'react-redux';
+import { Dispatch } from 'redux';
+import { connect } from 'react-redux';
 import { withStyles, StyleRulesCallback, WithStyles, Typography } from '@material-ui/core';
 import { ArvadosTheme } from '~/common/custom-theme';
 import { openRichTextEditorDialog } from '~/store/rich-text-editor-dialog/rich-text-editor-dialog-actions';
@@ -23,13 +24,20 @@ interface RichTextEditorLinkData {
     content: string;
 }
 
-type RichTextEditorLinkProps = RichTextEditorLinkData & WithStyles<CssRules>;
+interface RichTextEditorLinkActions {
+    onClick: (title: string, content: string) => void;
+}
+
+type RichTextEditorLinkProps = RichTextEditorLinkData & RichTextEditorLinkActions & WithStyles<CssRules>;
+
+const mapDispatchToProps = (dispatch: Dispatch) => ({
+    onClick: (title: string, content: string) => dispatch<any>(openRichTextEditorDialog(title, content))
+});
 
-export const RichTextEditorLink = withStyles(styles)(
-    ({ classes, title, content, label }: RichTextEditorLinkProps) =>
-        <Typography component='span' className={classes.root} 
-            // onClick={() => dispatch<any>(openRichTextEditorDialog(title, content))}
-            >
+export const RichTextEditorLink = connect(undefined, mapDispatchToProps)(
+    withStyles(styles)(({ classes, title, content, label, onClick }: RichTextEditorLinkProps) =>
+        <Typography component='span' className={classes.root}
+            onClick={() => onClick(title, content) }>
             {label}
         </Typography>
-);
\ No newline at end of file
+    ));
\ No newline at end of file
diff --git a/src/store/rich-text-editor-dialog/rich-text-editor-dialog-actions.tsx b/src/store/rich-text-editor-dialog/rich-text-editor-dialog-actions.tsx
index 39f3d84..d8bb6fd 100644
--- a/src/store/rich-text-editor-dialog/rich-text-editor-dialog-actions.tsx
+++ b/src/store/rich-text-editor-dialog/rich-text-editor-dialog-actions.tsx
@@ -7,6 +7,6 @@ import { dialogActions } from "~/store/dialog/dialog-actions";
 
 export const RICH_TEXT_EDITOR_DIALOG_NAME = 'richTextEditorDialogName';
 export const openRichTextEditorDialog = (title: string, text: string) => 
-    (dispatch: Dispatch) => {
+    async (dispatch: Dispatch) => {
         dispatch(dialogActions.OPEN_DIALOG({ id: RICH_TEXT_EDITOR_DIALOG_NAME, data: { title, text } }));
     };
\ No newline at end of file
diff --git a/src/views-components/details-panel/project-details.tsx b/src/views-components/details-panel/project-details.tsx
index 0e8835a..331952f 100644
--- a/src/views-components/details-panel/project-details.tsx
+++ b/src/views-components/details-panel/project-details.tsx
@@ -29,10 +29,13 @@ export class ProjectDetails extends DetailsData<ProjectResource> {
             {/* Missing attr */}
             <DetailsAttribute label='File size' value='1.4 GB' />
             <DetailsAttribute label='Description'>
-                <RichTextEditorLink 
-                    title={`Description of ${this.item.name}`}
-                    content={this.item.description} 
-                    label='Show full description' />
+                {this.item.description ? 
+                    <RichTextEditorLink
+                        title={`Description of ${this.item.name}`}
+                        content={this.item.description} 
+                        label='Show full description' />
+                    : '---'
+                }
             </DetailsAttribute>
         </div>;
     }
diff --git a/src/views-components/rich-text-editor-dialog/rich-text-editor-dialog.tsx b/src/views-components/rich-text-editor-dialog/rich-text-editor-dialog.tsx
index 4ac572f..a997355 100644
--- a/src/views-components/rich-text-editor-dialog/rich-text-editor-dialog.tsx
+++ b/src/views-components/rich-text-editor-dialog/rich-text-editor-dialog.tsx
@@ -22,12 +22,9 @@ export const RichTextEditorDialog = withDialog(RICH_TEXT_EDITOR_DIALOG_NAME)(
             maxWidth='sm'>
             <DialogTitle>{props.data.title}</DialogTitle>
             <DialogContent>
-                <DialogContentText>
-                    <RichTextEditor 
-                        value={RichTextEditor.createValueFromString(props.data.text, 'html')}
-                        readOnly={true}
-                        onChange={() => { return; }} />
-                </DialogContentText>
+                <RichTextEditor 
+                    value={RichTextEditor.createValueFromString(props.data.text, 'html')}
+                    readOnly={true} />
             </DialogContent>
             <DialogActions>
                 <Button

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list