[ARVADOS-WORKBENCH2] updated: 1.3.1-382-g7f440c8e
Git user
git at public.curoverse.com
Thu Feb 28 10:38:56 EST 2019
Summary of changes:
src/components/form-dialog/form-dialog.tsx | 2 +-
src/components/text-field/text-field.tsx | 14 +++++++-
.../rich-text-editor-dialog.tsx | 41 ++++++++++++++++++----
3 files changed, 49 insertions(+), 8 deletions(-)
via 7f440c8e719b78ddbccf90ab42b6b38575dc8c21 (commit)
from afb588643e62c20e94e284877913f60b4754c1cf (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 7f440c8e719b78ddbccf90ab42b6b38575dc8c21
Author: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>
Date: Thu Feb 28 16:38:44 2019 +0100
refs #14875-inappropriate-format-of-the-project-desc
Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>
diff --git a/src/components/form-dialog/form-dialog.tsx b/src/components/form-dialog/form-dialog.tsx
index 40050b76..b5654e86 100644
--- a/src/components/form-dialog/form-dialog.tsx
+++ b/src/components/form-dialog/form-dialog.tsx
@@ -51,7 +51,7 @@ export const FormDialog = withStyles(styles)((props: DialogProjectProps) =>
disableBackdropClick={props.submitting}
disableEscapeKeyDown={props.submitting}
fullWidth
- maxWidth='sm'>
+ maxWidth='md'>
<form>
<DialogTitle className={props.classes.dialogTitle}>
{props.dialogTitle}
diff --git a/src/components/text-field/text-field.tsx b/src/components/text-field/text-field.tsx
index 4788e18c..5f21f971 100644
--- a/src/components/text-field/text-field.tsx
+++ b/src/components/text-field/text-field.tsx
@@ -15,12 +15,23 @@ import {
import RichTextEditor from 'react-rte';
import Margin = PropTypes.Margin;
-type CssRules = 'textField';
+type CssRules = 'textField' | 'rte';
const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
textField: {
marginBottom: theme.spacing.unit * 3
},
+ rte: {
+ fontFamily: 'Arial',
+ '& a': {
+ textDecoration: 'none',
+ color: theme.palette.primary.main,
+ '&:hover': {
+ cursor: 'pointer',
+ textDecoration: 'underline'
+ }
+ }
+ }
});
type TextFieldProps = WrappedFieldProps & WithStyles<CssRules>;
@@ -67,6 +78,7 @@ export const RichEditorTextField = withStyles(styles)(
render() {
return <RichTextEditor
+ className={this.props.classes.rte}
value={this.state.value}
onChange={this.onChange}
placeholder={this.props.label} />;
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 c8fd6cdc..2c4cc0de 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
@@ -3,27 +3,56 @@
// SPDX-License-Identifier: AGPL-3.0
import * as React from "react";
-import { Dialog, DialogTitle, DialogContent, DialogActions, Button } from "@material-ui/core";
+import {
+ Dialog,
+ DialogTitle,
+ DialogContent,
+ DialogActions,
+ Button,
+ StyleRulesCallback,
+ WithStyles,
+ withStyles
+} from "@material-ui/core";
+import { ArvadosTheme } from '~/common/custom-theme';
import { WithDialogProps } from "~/store/dialog/with-dialog";
import { withDialog } from '~/store/dialog/with-dialog';
import { RICH_TEXT_EDITOR_DIALOG_NAME } from "~/store/rich-text-editor-dialog/rich-text-editor-dialog-actions";
import RichTextEditor from 'react-rte';
+type CssRules = 'rte';
+
+const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
+ rte: {
+ fontFamily: 'Arial',
+ '& a': {
+ textDecoration: 'none',
+ color: theme.palette.primary.main,
+ '&:hover': {
+ cursor: 'pointer',
+ textDecoration: 'underline'
+ }
+ }
+ },
+
+});
+
export interface RichTextEditorDialogDataProps {
title: string;
text: string;
}
-export const RichTextEditorDialog = withDialog(RICH_TEXT_EDITOR_DIALOG_NAME)(
- (props: WithDialogProps<RichTextEditorDialogDataProps>) =>
+export const RichTextEditorDialog = withStyles(styles)(withDialog(RICH_TEXT_EDITOR_DIALOG_NAME)(
+ (props: WithDialogProps<RichTextEditorDialogDataProps> & WithStyles<CssRules>) =>
<Dialog open={props.open}
onClose={props.closeDialog}
fullWidth
maxWidth='sm'>
<DialogTitle>{props.data.title}</DialogTitle>
<DialogContent>
- <RichTextEditor
- value={RichTextEditor.createValueFromString(props.data.text, 'html')}
+ <RichTextEditor
+ className={props.classes.rte}
+ value={props.data.text ?
+ RichTextEditor.createValueFromString(props.data.text.replace(/</g, '<').replace(/>/g, '>').replace(/&/g, '&'), 'html') : ''}
readOnly={true} />
</DialogContent>
<DialogActions>
@@ -34,5 +63,5 @@ export const RichTextEditorDialog = withDialog(RICH_TEXT_EDITOR_DIALOG_NAME)(
Close
</Button>
</DialogActions>
- </Dialog>
+ </Dialog>)
);
\ No newline at end of file
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list