- {file && file.url() ?
Download : null}
+
);
}
diff --git a/src/components/Pill/Pill.react.js b/src/components/Pill/Pill.react.js
index d186bb4772..32b7cb1b43 100644
--- a/src/components/Pill/Pill.react.js
+++ b/src/components/Pill/Pill.react.js
@@ -7,9 +7,29 @@
*/
import React from 'react';
import styles from 'components/Pill/Pill.scss';
+import Icon from "components/Icon/Icon.react";
+
//TODO: refactor, may want to move onClick outside or need to make onClick able to handle link/button a11y
-let Pill = ({ value, onClick }) => (
-
{value}
+let Pill = ({ value, onClick, fileDownloadLink, followClick = false }) => (
+
+ {value}
+ {followClick && (
+
+
+
+ )}
+ {!followClick && fileDownloadLink && (
+
+
+
+ )}
+
);
export default Pill;
diff --git a/src/components/Pill/Pill.scss b/src/components/Pill/Pill.scss
index 156a633dc5..c24ca6240e 100644
--- a/src/components/Pill/Pill.scss
+++ b/src/components/Pill/Pill.scss
@@ -9,20 +9,44 @@
.pill {
@include MonospaceFont;
- display: inline-block;
- background: #D5E5F2;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
color: #0E69A1;
height: 20px;
line-height: 20px;
border-radius: 10px;
font-size: 11px;
- padding: 0 8px;
width: 100%;
- text-align: center;
overflow: hidden;
text-overflow: ellipsis;
-
- &:hover {
- background: #BFD4E5;
+ white-space: nowrap;
+ margin-bottom: 4px;
+ & a {
+ height: 20px;
+ width: 20px;
+ background: #d6e5f2;
+ border-radius: 50%;
+ margin-left: 5px;
+ & svg {
+ transform: rotate(316deg);
+ }
}
}
+
+.content {
+ width: 80%;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ text-align: left;
+ height: 100%;
+ white-space: nowrap;
+}
+
+.iconAction {
+ cursor: pointer;
+}
+
+.disableIconAction {
+ cursor: initial;
+}
\ No newline at end of file
diff --git a/src/dashboard/Data/Browser/EditRowDialog.react.js b/src/dashboard/Data/Browser/EditRowDialog.react.js
index e5dbcbd348..6e31031b83 100644
--- a/src/dashboard/Data/Browser/EditRowDialog.react.js
+++ b/src/dashboard/Data/Browser/EditRowDialog.react.js
@@ -14,6 +14,7 @@ import GeoPointEditor from 'components/GeoPointEditor/GeoPointEditor.react';
import FileEditor from 'components/FileEditor/FileEditor.react';
import ObjectPickerDialog from 'dashboard/Data/Browser/ObjectPickerDialog.react';
import styles from 'dashboard/Data/Browser/Browser.scss';
+import getFileName from 'lib/getFileName';
export default class EditRowDialog extends React.Component {
constructor(props) {
@@ -23,7 +24,7 @@ export default class EditRowDialog extends React.Component {
const { currentObject, openObjectPickers, expandedTextAreas } = this.initializeState(
selectedObject
);
- this.state = { currentObject, openObjectPickers, expandedTextAreas };
+ this.state = { currentObject, openObjectPickers, expandedTextAreas, showFileEditor: false };
this.updateCurrentObject = this.updateCurrentObject.bind(this);
this.handleChange = this.handleChange.bind(this);
@@ -31,6 +32,8 @@ export default class EditRowDialog extends React.Component {
this.openPointer = this.openPointer.bind(this);
this.toggleObjectPicker = this.toggleObjectPicker.bind(this);
this.openRelation = this.openRelation.bind(this);
+ this.openFileEditor = this.openFileEditor.bind(this);
+ this.hideFileEditor = this.hideFileEditor.bind(this);
}
componentWillReceiveProps(props) {
@@ -216,6 +219,18 @@ export default class EditRowDialog extends React.Component {
this.setState({ expandedTextAreas });
}
+ openFileEditor() {
+ this.setState({
+ showFileEditor: true
+ });
+ }
+
+ hideFileEditor() {
+ this.setState({
+ showFileEditor: false
+ });
+ }
+
render() {
const { selectedObject, className, columns, onClose, schema } = this.props;
const { currentObject, openObjectPickers, expandedTextAreas } = this.state;
@@ -247,6 +262,7 @@ export default class EditRowDialog extends React.Component {
'restricted'
].indexOf(name) >= 0);
+ let val = currentObject[name];
switch (type) {
case 'String':
inputComponent = (
@@ -257,7 +273,7 @@ export default class EditRowDialog extends React.Component {
: false
}
disabled={isDisabled}
- placeholder={name === 'password' ? '(hidden)' : ''}
+ placeholder={name === 'password' ? '(hidden)' : val === undefined ? '(undefined)' : ''}
value={currentObject[name]}
onChange={newValue => this.updateCurrentObject(newValue, name)}
onBlur={newValue => this.handleChange(newValue, name)}
@@ -269,6 +285,7 @@ export default class EditRowDialog extends React.Component {
this.updateCurrentObject(newValue, name)}
onBlur={newValue => this.handleChange(parseFloat(newValue), name)}
/>
@@ -286,6 +303,7 @@ export default class EditRowDialog extends React.Component {
expandedTextAreas[name].rows
}
disabled={isDisabled}
+ placeholder={val === undefined && '(undefined)'}
value={currentObject[name]}
onChange={newValue => this.updateCurrentObject(newValue, name)}
onBlur={newValue =>
@@ -296,7 +314,7 @@ export default class EditRowDialog extends React.Component {
break;
case 'Boolean':
inputComponent = isDisabled ? (
-
+
) : (
- this.handleChange(newValue, name)}
- />
+ {file && }
+
+
this.openFileEditor()}
+ />
+ {this.state.showFileEditor && (
+ this.handleChange(newValue, name)}
+ />
+ )}
+
);
break;
@@ -362,6 +391,7 @@ export default class EditRowDialog extends React.Component {