Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/275 #292

Merged
merged 7 commits into from
Jun 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 29 additions & 3 deletions src/components/BrowserCell/BrowserCell.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,33 @@ class BrowserCell extends Component {
value.id
);
this.copyableValue = value.id;
} else if (type === 'Date') {
}
else if (type === 'Array') {
if ( typeof value[0] === 'object' && value[0].__type === 'Pointer' ) {
const array = [];
value.map( (v, i) => {
if ( typeof v !== 'object' || v.__type !== 'Pointer' ) {
throw new Error('Invalid type found in pointer array');
}
const object = new Parse.Object(v.className);
object.id = v.objectId;
array.push(
<a key={i} href='javascript:;' onClick={onPointerClick.bind(undefined, object)}>
<Pill value={v.objectId} />
</a>);
});
this.copyableValue = content = <ul>
{ array.map( a => <li>{a}</li>) }
</ul>
if ( array.length > 1 ) {
classes.push(styles.hasMore);
}
}
else {
this.copyableValue = content = JSON.stringify(value);
}
}
else if (type === 'Date') {
if (typeof value === 'object' && value.__type) {
value = new Date(value.iso);
} else if (typeof value === 'string') {
Expand All @@ -257,7 +283,7 @@ class BrowserCell extends Component {
this.copyableValue = content = dateStringUTC(value);
} else if (type === 'Boolean') {
this.copyableValue = content = value ? 'True' : 'False';
} else if (type === 'Object' || type === 'Bytes' || type === 'Array') {
} else if (type === 'Object' || type === 'Bytes') {
this.copyableValue = content = JSON.stringify(value);
} else if (type === 'File') {
const fileName = value.url() ? getFileName(value) : 'Uploading\u2026';
Expand Down Expand Up @@ -305,7 +331,7 @@ class BrowserCell extends Component {
if (current) {
classes.push(styles.current);
}

return readonly ? (
<Tooltip placement='bottom' tooltip='Read only (CTRL+C to copy)' visible={this.state.showTooltip}>
<span
Expand Down
17 changes: 17 additions & 0 deletions src/components/BrowserCell/BrowserCell.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,20 @@
color: #353446;
opacity: .9;
}

.hasMore{
height: auto;
max-height: 25px;
overflow-y: scroll;
}

.hasMore::-webkit-scrollbar {
-webkit-appearance: none!important;
width: 7px!important;
}

.hasMore::-webkit-scrollbar-thumb {
border-radius: 4px!important;
background-color: rgba(0, 0, 0, .5)!important;
box-shadow: 0 0 1px rgba(255, 255, 255, .5)!important;
}
2 changes: 1 addition & 1 deletion src/components/BrowserRow/BrowserRow.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,4 @@ export default class BrowserRow extends Component {
</div>
);
}
}
}
2 changes: 1 addition & 1 deletion src/dashboard/Data/Browser/Browser.scss
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ body:global(.expanded) {
@include MonospaceFont;
font-size: 12px;
white-space: nowrap;
height: 31px;
height: auto;
border-bottom: 1px solid #e3e3ea;

&:nth-child(odd) {
Expand Down