Skip to content

Commit 55a3d1a

Browse files
committed
Merge branch 'master' of https://github.com/processing/p5.js-web-editor into fix/rename-file-set-unsaved
2 parents 26df651 + 1cfe5dc commit 55a3d1a

File tree

5 files changed

+73
-49
lines changed

5 files changed

+73
-49
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
custom: https://processingfoundation.org/support

client/components/Nav.jsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import PropTypes from 'prop-types';
22
import React from 'react';
33
import { connect } from 'react-redux';
44
import { withRouter } from 'react-router';
5-
import { Link, browserHistory } from 'react-router';
5+
import { Link } from 'react-router';
66
import InlineSVG from 'react-inlinesvg';
77
import classNames from 'classnames';
88
import * as IDEActions from '../modules/IDE/actions/ide';
@@ -167,8 +167,6 @@ class Nav extends React.PureComponent {
167167

168168
handleLogout() {
169169
this.props.logoutUser();
170-
// if you're on the settings page, probably.
171-
browserHistory.push('/');
172170
this.setDropdown('none');
173171
}
174172

@@ -184,7 +182,8 @@ class Nav extends React.PureComponent {
184182
}
185183

186184
handleShare() {
187-
this.props.showShareModal();
185+
const { username } = this.props.params;
186+
this.props.showShareModal(this.props.project.id, this.props.project.name, username);
188187
this.setDropdown('none');
189188
}
190189

@@ -717,6 +716,7 @@ Nav.propTypes = {
717716
}).isRequired,
718717
project: PropTypes.shape({
719718
id: PropTypes.string,
719+
name: PropTypes.string,
720720
owner: PropTypes.shape({
721721
id: PropTypes.string
722722
})
@@ -742,7 +742,10 @@ Nav.propTypes = {
742742
layout: PropTypes.oneOf(['dashboard', 'project']),
743743
rootFile: PropTypes.shape({
744744
id: PropTypes.string.isRequired
745-
}).isRequired
745+
}).isRequired,
746+
params: PropTypes.shape({
747+
username: PropTypes.string
748+
})
746749
};
747750

748751
Nav.defaultProps = {
@@ -752,7 +755,10 @@ Nav.defaultProps = {
752755
},
753756
cmController: {},
754757
layout: 'project',
755-
warnIfUnsavedChanges: undefined
758+
warnIfUnsavedChanges: undefined,
759+
params: {
760+
username: undefined
761+
}
756762
};
757763

758764
function mapStateToProps(state) {

client/modules/IDE/components/SketchList.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ SketchListRowBase.propTypes = {
312312
cloneProject: PropTypes.func.isRequired,
313313
exportProjectAsZip: PropTypes.func.isRequired,
314314
changeProjectName: PropTypes.func.isRequired,
315-
onAddToCollection: PropTypes.func.isRequired,
315+
onAddToCollection: PropTypes.func.isRequired
316316
};
317317

318318
function mapDispatchToPropsSketchListRow(dispatch) {

client/modules/User/components/Collection.jsx

Lines changed: 40 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -327,44 +327,46 @@ class Collection extends React.Component {
327327
</Helmet>
328328
{this._renderLoader()}
329329
{this.hasCollection() && this._renderCollectionMetadata()}
330-
<div className="collection-table-wrapper">
331-
{this._renderEmptyTable()}
332-
{this.hasCollectionItems() &&
333-
<table className="sketches-table" summary="table containing all collections">
334-
<thead>
335-
<tr>
336-
{this._renderFieldHeader('name', 'Name')}
337-
{this._renderFieldHeader('createdAt', 'Date Added')}
338-
{this._renderFieldHeader('user', 'Owner')}
339-
<th scope="col"></th>
340-
</tr>
341-
</thead>
342-
<tbody>
343-
{this.props.collection.items.map(item =>
344-
(<CollectionItemRow
345-
key={item.id}
346-
item={item}
347-
user={this.props.user}
348-
username={this.getUsername()}
349-
collection={this.props.collection}
350-
/>))}
351-
</tbody>
352-
</table>
353-
}
354-
{
355-
this.state.isAddingSketches && (
356-
<Overlay
357-
title="Add sketch"
358-
actions={<SketchSearchbar />}
359-
closeOverlay={this.hideAddSketches}
360-
isFixedHeight
361-
>
362-
<div className="collection-add-sketch">
363-
<AddToCollectionSketchList username={this.props.username} collection={this.props.collection} />
364-
</div>
365-
</Overlay>
366-
)
367-
}
330+
<div className="collection-content">
331+
<div className="collection-table-wrapper">
332+
{this._renderEmptyTable()}
333+
{this.hasCollectionItems() &&
334+
<table className="sketches-table" summary="table containing all collections">
335+
<thead>
336+
<tr>
337+
{this._renderFieldHeader('name', 'Name')}
338+
{this._renderFieldHeader('createdAt', 'Date Added')}
339+
{this._renderFieldHeader('user', 'Owner')}
340+
<th scope="col"></th>
341+
</tr>
342+
</thead>
343+
<tbody>
344+
{this.props.collection.items.map(item =>
345+
(<CollectionItemRow
346+
key={item.id}
347+
item={item}
348+
user={this.props.user}
349+
username={this.getUsername()}
350+
collection={this.props.collection}
351+
/>))}
352+
</tbody>
353+
</table>
354+
}
355+
{
356+
this.state.isAddingSketches && (
357+
<Overlay
358+
title="Add sketch"
359+
actions={<SketchSearchbar />}
360+
closeOverlay={this.hideAddSketches}
361+
isFixedHeight
362+
>
363+
<div className="collection-add-sketch">
364+
<AddToCollectionSketchList username={this.props.username} collection={this.props.collection} />
365+
</div>
366+
</Overlay>
367+
)
368+
}
369+
</div>
368370
</div>
369371
</section>
370372
);

client/styles/components/_collection.scss

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
.collection-container {
22
padding: #{24 / $base-font-size}rem #{66 / $base-font-size}rem;
3+
position: relative;
34
flex: 1;
5+
overflow: hidden;
46
display: flex;
5-
flex-direction: column;
7+
flex-direction:column;
68
}
79

810
.collection-metadata {
@@ -114,15 +116,28 @@
114116
flex-grow: 0;
115117
}
116118

117-
.collection-table-wrapper {
118-
width: #{1012 / $base-font-size}rem;
119-
margin: 0 auto;
119+
.collection-content {
120+
display: flex;
121+
flex-direction: column;
120122
flex: 1;
123+
overflow: hidden;
124+
max-width: #{1012 / $base-font-size}rem;
125+
margin: 0 auto;
126+
width: 100%;
127+
121128
@include themify() {
122129
border: 1px solid getThemifyVariable('modal-border-color');
123130
}
124131
}
125132

133+
.collection-table-wrapper {
134+
overflow-y: auto;
135+
max-width: 100%;
136+
min-height: 100%;
137+
}
138+
139+
140+
// maybe don't need this?
126141
[data-has-items=false] .collection-table-wrapper {
127142
display: flex;
128143
justify-content: center;

0 commit comments

Comments
 (0)