Skip to content

[Feature] Improve DataBrowser relation viewer #446

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

Closed
wants to merge 0 commits into from
Closed

[Feature] Improve DataBrowser relation viewer #446

wants to merge 0 commits into from

Conversation

ellemedit
Copy link
Contributor

relation viewer

  • has url statement
  • can go back
  • can add a row
  • can bring existing row to attach
  • fixed filter

@ghost
Copy link

ghost commented Jul 5, 2016

By analyzing the blame information on this pull request, we identified @drew-gross, @TylerBrock and @gavrix to be potential reviewers.

let queryFilters = JSON.parse(this.props.location.query.filters);
queryFilters.forEach((filter) => {
filters = filters.push(new Map(filter));
});
}

const { className, entityId, relationName } = this.props.params;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is that a re-declaration here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was just blinded for shortcut. Remove above?

Copy link
Contributor

Choose a reason for hiding this comment

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

If above is not used yes :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can I force-push to fix it?

Copy link
Contributor

Choose a reason for hiding this comment

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

No need to force push, we squash upon merge.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

linted at 0ee762d

@flovilmart
Copy link
Contributor

The overall code look great, and the feature is 💯. I'm no react expert but it seems we're bloating the Browser component with a lot of corner case Logic for the relations. Can we compose or inherit instead? What do you think @peterdotjs @drew-gross

@ellemedit
Copy link
Contributor Author

ellemedit commented Jul 5, 2016

@flovilmart please make it better. and above mistakes will not happen if eslint and flow applied to this project... have a plan?

@flovilmart
Copy link
Contributor

I'm asking for advice here. Want to make sure we keep the code base maintainable. Otherwise I'm impressed! 👍

@ellemedit
Copy link
Contributor Author

ellemedit commented Jul 5, 2016

I want to submit a PR which makes this project more maintainable but this project is too huge to patch this myself. There are too many legacies...

import Field from 'components/Field/Field.react';
import Label from 'components/Label/Label.react';
import TextInput from 'components/TextInput/TextInput.react';
import { List, Map } from 'immutable';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This component doesn't need immutable structures. Please remove this before squashing.

Copy link
Contributor

Choose a reason for hiding this comment

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

That's your code :) you should do the changes

@ghost
Copy link

ghost commented Jul 5, 2016

@beingbook updated the pull request.

2 similar comments
@ghost
Copy link

ghost commented Jul 5, 2016

@beingbook updated the pull request.

@ghost
Copy link

ghost commented Jul 5, 2016

@beingbook updated the pull request.

@peterdotjs
Copy link
Contributor

@beingbook @flovilmart generally we'll prefer composition over inheritance but in this case Browser already has several states for various dialogs that it seems okay to keep it in the same component but may be worth looking at in a future refactor PR as it gets larger.

RE: flow and eslint, we had discussed around the time it was open sourced but there wasn't enough request for it to justify the refactor. For future maintainability I totally agree that it would be beneficial. eslint will be a sizable task to refactor but with flow we can go with the approach of any new file that is touched to be flowified. If you're interested in taking this on we're totally supportive of it.

Looks great overall though!

<span className={styles.details}>
{props.details}
</span>
const goBack = () => history.goBack();
Copy link
Contributor

Choose a reason for hiding this comment

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

will this functionality be any different than hitting browser back?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I know it matters. I just added this because relation viewer has url statement. If a user access relation viewer first, it will matter. But I have no idea to implement this better. Can you suggest about it?

@ghost
Copy link

ghost commented Jul 6, 2016

@beingbook updated the pull request.

1 similar comment
@ghost
Copy link

ghost commented Jul 6, 2016

@beingbook updated the pull request.

@ellemedit
Copy link
Contributor Author

what's next step?

@peterdotjs
Copy link
Contributor

@beingbook I haven't had a chance to patch it and try it out but looks good otherwise. I'll update once I've gotten a chance to test it out.

@flovilmart
Copy link
Contributor

@beingbook you're in good hands with @peterdotjs!

@@ -0,0 +1,98 @@
import * as Filters from 'lib/Filters';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is imported but not used.

@ghost
Copy link

ghost commented Jul 8, 2016

@beingbook updated the pull request.

@ellemedit
Copy link
Contributor Author

oops. I did something wrong... I guess rebase and force push made ref tree twisted...

@facebook-github-bot
Copy link

@beingbook updated the pull request.

1 similar comment
@ghost
Copy link

ghost commented Jul 8, 2016

@beingbook updated the pull request.

@ellemedit ellemedit closed this Jul 8, 2016
@ghost
Copy link

ghost commented Jul 8, 2016

@beingbook updated the pull request.

@ellemedit ellemedit mentioned this pull request Jul 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants