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

User profile pages (favorites, created content, recent activity, security & access) #1615

Merged
merged 6 commits into from
Nov 20, 2016

Conversation

mistercrunch
Copy link
Member

img

@mistercrunch
Copy link
Member Author

screen shot 2016-11-17 at 6 12 28 pm

@bkyryliuk @ascott @vera-liu this is ready for review

@mistercrunch mistercrunch changed the title [WiP] User profile pages (favorites, created content, recent activity, security & access) User profile pages (favorites, created content, recent activity, security & access) Nov 18, 2016
<h1>{dashboard.dashboard_title}</h1>
<h1>
{dashboard.dashboard_title} &nbsp;
<span is class="favstar" class_name="Dashboard" obj_id={dashboard.id} />
Copy link

@ascott ascott Nov 18, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be <span className="favstar"? typo maybe?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ReactDOM's is flag is a way to allow for passing raw unstandard html attributes which in this case I needed if I didn't want to alter the way the "favstar" thing was designed. Once that flag is on everything is like raw html, so class instead of className.

We need to redesign FavStar as a react component, in the meantime it's a little hack to make it work as is.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gotcha, thanks for the explanation.

user: React.PropTypes.object.isRequired,
};

class App extends React.PureComponent {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could be a stateless functional component.

export default function App(props) {
  return (
    <div>...</div>
  );
}

};
}

imgLoading() {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like we aren't using this anywhere, let's delete it.

import React from 'react';
import moment from 'moment';
import TableLoader from './TableLoader';

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add a propTypes object here...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh interesting, the linter didn't trigger because it's unaware of what's hapenning inside the backticks

const propTypes = {
user: React.PropTypes.object.isRequired,
};
const Security = ({ user }) => (
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's use named functions for SFC's

export default function Security({ user }) {
  return (
     ...
  );
}

import TableLoader from './TableLoader';
import moment from 'moment';
import $ from 'jquery';

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs proptypes validation


const propTypes = {
dataEndpoint: React.PropTypes.string.isRequired,
loadingNode: React.PropTypes.node,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to expose a custom loading node for this component. i can see how we could simplify this if we hard code the loading node in this component.

delete tableProps.dataEndpoint;
delete tableProps.columns;
if (this.state.isLoading) {
return this.props.loadingNode;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm surprised the linter doesn't complain about multiple return statements. would be nice to follow the convention of a single return statement for the render function.

@@ -0,0 +1,13 @@
.tab-pane {
min-height: 400px;
border-left: 1px solid #bbb;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could simplify this to:

border: 1px solid #bbb;
border-top: 0px;

@@ -48,7 +49,7 @@ const config = {
},
{
test: /\.jsx?$/,
exclude: APP_DIR + '/node_modules',
exclude: /(node_modules|bower_components)/,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this change? where do we use bower_components?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I hit some problems I may have ended fixing in other ways, going to try to roll this back

<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{{appbuilder.get_url_for_index}}">
<a class="navbar-brand" href="/superset/profile/{{ current_user.username }}/">
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@ascott
Copy link

ascott commented Nov 18, 2016

some comments, but overall this is DOPE! nice!

@mistercrunch
Copy link
Member Author

Alright, all comments addressed except for the multiple return one. I think it's good to allow to have multiple exit points out of a method. It's discussed/debated here:
http://stackoverflow.com/questions/36707/should-a-function-have-only-one-return-statement

Thanks for the review!

@mistercrunch mistercrunch merged commit 7e1852e into apache:master Nov 20, 2016
@mistercrunch mistercrunch deleted the user_profile branch November 20, 2016 05:23
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.14.0 labels Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants