From 87c012b9f6e6794c8ee8ac380e49738ad2a2b6db Mon Sep 17 00:00:00 2001
From: Nimish Agrawal <37630020+nimishagarwal76@users.noreply.github.com>
Date: Wed, 13 Mar 2019 01:47:27 +0530
Subject: [PATCH 1/6] Autofocus on Add File menu (#882)
---
client/modules/IDE/components/NewFileForm.jsx | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/client/modules/IDE/components/NewFileForm.jsx b/client/modules/IDE/components/NewFileForm.jsx
index 8e3b5977..d0a6b8ab 100644
--- a/client/modules/IDE/components/NewFileForm.jsx
+++ b/client/modules/IDE/components/NewFileForm.jsx
@@ -8,6 +8,10 @@ class NewFileForm extends React.Component {
this.createFile = this.props.createFile.bind(this);
}
+ componentDidMount() {
+ this.fileName.focus();
+ }
+
render() {
const { fields: { name }, handleSubmit } = this.props;
return (
@@ -25,6 +29,7 @@ class NewFileForm extends React.Component {
type="text"
placeholder="Name"
{...domOnlyProps(name)}
+ ref={(element) => { this.fileName = element; }}
/>
{name.touched && name.error && {name.error}}
From a01892948943075e4732d4a745e86d22e31486a5 Mon Sep 17 00:00:00 2001
From: nimish
Date: Wed, 13 Mar 2019 18:10:47 +0530
Subject: [PATCH 2/6] Remove file menu on blur
---
client/modules/IDE/components/FileNode.jsx | 1 +
client/styles/components/_sidebar.scss | 4 +++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/client/modules/IDE/components/FileNode.jsx b/client/modules/IDE/components/FileNode.jsx
index d3b5be6b..7e5f1d70 100644
--- a/client/modules/IDE/components/FileNode.jsx
+++ b/client/modules/IDE/components/FileNode.jsx
@@ -154,6 +154,7 @@ export class FileNode extends React.Component {
tabIndex="0"
onClick={this.toggleFileOptions}
onBlur={() => setTimeout(this.hideFileOptions, 200)}
+ style={{ display: (this.state.isOptionsOpen) ? 'inline-block' : '' }}
>
diff --git a/client/styles/components/_sidebar.scss b/client/styles/components/_sidebar.scss
index dba607e0..bde98922 100644
--- a/client/styles/components/_sidebar.scss
+++ b/client/styles/components/_sidebar.scss
@@ -125,7 +125,6 @@
@include icon();
@include themify() {
padding: #{4 / $base-font-size}rem 0;
- background-color: map-get($theme-map, 'file-selected-color');
padding-right: #{6 / $base-font-size}rem;
}
display: none;
@@ -137,6 +136,9 @@
display: none;
}
}
+ .sidebar__file-item:hover > .file-item__content & {
+ display: inline-block;
+ }
& svg {
width: #{10 / $base-font-size}rem;
}
From 1d2cb87c3362b7975d314f38c298de96954ef96a Mon Sep 17 00:00:00 2001
From: Cassie Tarakajian
Date: Thu, 14 Mar 2019 16:10:50 -0400
Subject: [PATCH 3/6] for #874, also fixes bug in which file options could be
revealed by right clicking even if user isn't owner of sketch
---
client/modules/IDE/components/FileNode.jsx | 12 +++++++-----
client/modules/IDE/components/Sidebar.jsx | 8 ++++++--
client/styles/components/_sidebar.scss | 6 ++++++
3 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/client/modules/IDE/components/FileNode.jsx b/client/modules/IDE/components/FileNode.jsx
index 7e5f1d70..252de291 100644
--- a/client/modules/IDE/components/FileNode.jsx
+++ b/client/modules/IDE/components/FileNode.jsx
@@ -65,6 +65,9 @@ export class FileNode extends React.Component {
toggleFileOptions(e) {
e.preventDefault();
+ if (!this.props.canEdit) {
+ return;
+ }
if (this.state.isOptionsOpen) {
this.setState({ isOptionsOpen: false });
} else {
@@ -88,7 +91,7 @@ export class FileNode extends React.Component {
renderChild(childId) {
return (
-
+
);
}
@@ -154,7 +157,6 @@ export class FileNode extends React.Component {
tabIndex="0"
onClick={this.toggleFileOptions}
onBlur={() => setTimeout(this.hideFileOptions, 200)}
- style={{ display: (this.state.isOptionsOpen) ? 'inline-block' : '' }}
>
@@ -251,7 +253,8 @@ FileNode.propTypes = {
newFile: PropTypes.func.isRequired,
newFolder: PropTypes.func.isRequired,
showFolderChildren: PropTypes.func.isRequired,
- hideFolderChildren: PropTypes.func.isRequired
+ hideFolderChildren: PropTypes.func.isRequired,
+ canEdit: PropTypes.bool.isRequired
};
FileNode.defaultProps = {
@@ -262,8 +265,7 @@ FileNode.defaultProps = {
function mapStateToProps(state, ownProps) {
// this is a hack, state is updated before ownProps
- return state.files.find(file => file.id === ownProps.id) || { ...ownProps, name: 'test', fileType: 'file' };
- // return state.files.find(file => file.id === ownProps.id);
+ return state.files.find(file => file.id === ownProps.id) || { name: 'test', fileType: 'file' };
}
function mapDispatchToProps(dispatch) {
diff --git a/client/modules/IDE/components/Sidebar.jsx b/client/modules/IDE/components/Sidebar.jsx
index 5172f27a..6419abe1 100644
--- a/client/modules/IDE/components/Sidebar.jsx
+++ b/client/modules/IDE/components/Sidebar.jsx
@@ -41,11 +41,12 @@ class Sidebar extends React.Component {
}
render() {
+ const canEditProject = this.userCanEditProject();
const sidebarClass = classNames({
'sidebar': true,
'sidebar--contracted': !this.props.isExpanded,
'sidebar--project-options': this.props.projectOptionsVisible,
- 'sidebar--cant-edit': !this.userCanEditProject()
+ 'sidebar--cant-edit': !canEditProject
});
return (
@@ -82,7 +83,10 @@ class Sidebar extends React.Component {
- file.name === 'root')[0].id} />
+ file.name === 'root')[0].id}
+ canEdit={canEditProject}
+ />
);
}
diff --git a/client/styles/components/_sidebar.scss b/client/styles/components/_sidebar.scss
index bde98922..93f6967d 100644
--- a/client/styles/components/_sidebar.scss
+++ b/client/styles/components/_sidebar.scss
@@ -138,10 +138,16 @@
}
.sidebar__file-item:hover > .file-item__content & {
display: inline-block;
+ .sidebar--cant-edit & {
+ display: none;
+ }
}
& svg {
width: #{10 / $base-font-size}rem;
}
+ .sidebar__file-item--open > .file-item__content & {
+ display: inline-block;
+ }
}
.sidebar__file-item-options {
From 542512f720387aef3d992ab15c94ea0ebe925d1a Mon Sep 17 00:00:00 2001
From: siddhant <30566406+siddhant1@users.noreply.github.com>
Date: Fri, 15 Mar 2019 02:52:17 +0530
Subject: [PATCH 4/6] Removed logs (#890)
---
webpack/config.prod.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/webpack/config.prod.js b/webpack/config.prod.js
index 249b509e..1b6b01e6 100644
--- a/webpack/config.prod.js
+++ b/webpack/config.prod.js
@@ -120,7 +120,8 @@ module.exports = [{
new webpack.optimize.UglifyJsPlugin({
sourceMap: true,
compress: {
- warnings: false
+ warnings: false,
+ drop_console :true
}
}),
new webpack.LoaderOptionsPlugin({
From f8ee62a1b5e3c4e9b2e1dc5446a7250c5fd10d34 Mon Sep 17 00:00:00 2001
From: Nimish Agrawal <37630020+nimishagarwal76@users.noreply.github.com>
Date: Fri, 15 Mar 2019 22:30:29 +0530
Subject: [PATCH 5/6] Removes scrollbar when not needed (#892)
---
client/styles/components/_sidebar.scss | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/client/styles/components/_sidebar.scss b/client/styles/components/_sidebar.scss
index 93f6967d..2c25d4fa 100644
--- a/client/styles/components/_sidebar.scss
+++ b/client/styles/components/_sidebar.scss
@@ -46,7 +46,7 @@
.sidebar__root-item {
position: relative;
- overflow-y: scroll;
+ overflow-y: auto;
flex: 1 1 auto;
}
From 3d248a0573c79e895dd82a7f8524be41d9f07639 Mon Sep 17 00:00:00 2001
From: Apoorv Taneja
Date: Sat, 16 Mar 2019 03:05:48 +0530
Subject: [PATCH 6/6] fixed password length (#901)
---
client/utils/reduxFormUtils.js | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/client/utils/reduxFormUtils.js b/client/utils/reduxFormUtils.js
index 4bb74319..0f822b9b 100644
--- a/client/utils/reduxFormUtils.js
+++ b/client/utils/reduxFormUtils.js
@@ -64,6 +64,11 @@ export function validateSignup(formProps) {
if (!formProps.password) {
errors.password = 'Please enter a password';
}
+ if (formProps.password) {
+ if (formProps.password.length < 6) {
+ errors.password = 'Password must be at least 6 characters';
+ }
+ }
if (!formProps.confirmPassword) {
errors.confirmPassword = 'Please enter a password confirmation';
}