Skip to content

Implement Pagination for Content libraries (SOL-4) - #6163

Merged
antoviaque merged 5 commits into
openedx:content-librariesfrom
open-craft:content_libraries/4-pagination
Dec 22, 2014
Merged

Implement Pagination for Content libraries (SOL-4)#6163
antoviaque merged 5 commits into
openedx:content-librariesfrom
open-craft:content_libraries/4-pagination

Conversation

@Kelketek

@Kelketek Kelketek commented Dec 5, 2014

Copy link
Copy Markdown
Contributor

@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @Kelketek! I've created OSPR-261 to keep track of it in JIRA. JIRA is a place for product owners to prioritize feature reviews by the engineering development teams.

Feel free to add as much of the following information to the ticket:

  • supporting documentation
  • edx-code email threads
  • timeline information ('this must be merged by XX date', and why that is)
  • partner information ('this is a course on edx.org')
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will still be done via the Github pull request interface. As a reminder, our process documentation is here.

@Kelketek Kelketek changed the title Implement Pagination for Content libraries (WIP) Implement Pagination for Content libraries Dec 5, 2014
@Kelketek

Kelketek commented Dec 5, 2014

Copy link
Copy Markdown
Contributor Author

@sarina This should be ready for review now-- removed the WIP flag, but I'm not sure what to do about Jenkins' quality report, since it's flagging a couple of 'TODO' comments, both of which are not intended to be addressed in this PR but which we don't really want to forget either.

@antoviaque antoviaque changed the title Implement Pagination for Content libraries Implement Pagination for Content libraries (SOL-4) Dec 7, 2014
@Kelketek

Kelketek commented Dec 7, 2014

Copy link
Copy Markdown
Contributor Author

Sorry @sarina , just found out you're not the person to ping for this. :) @explorerleslie @cahrens , this is ready for your review, and a sandbox is available, linked in the description with the standard staff@example.com account.

@sarina

sarina commented Dec 8, 2014

Copy link
Copy Markdown
Contributor

@Kelketek this PR will help the TODO issue: https://github.com/edx/edx-platform/pull/6122

@cahrens

cahrens commented Dec 8, 2014

Copy link
Copy Markdown

When you add a new component to the page, it is currently scrolling to show the top of the page. It should instead scroll down to show the newly added component. Related to this, it seems like the entire page is re-rendering each time a component is added, which does not seem necessary. Adding a new component will either case you go to go the next page (if at least 10 components already exist on the page), or it will be added as the last component on the current page. It seems like you can easily avoid re-rendering in the 2nd case.

(also note that I screwed up Xavier's test library by adding a discussion component-- I am so used to just clicking anything and forgot that it isn't expected to work)

@cahrens

cahrens commented Dec 8, 2014

Copy link
Copy Markdown

Drag and drop is now disabled. Is that intentional?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you add a trailing comma here, so that if something else needs to be added to the context, this line won't have to change again?

@singingwolfboy

Copy link
Copy Markdown
Contributor

@Kelketek: now that #6122 is merged, you should be able to get a passing Jenkins build if you rebase on top of the latest master. Can you do that?

@Kelketek

Kelketek commented Dec 8, 2014

Copy link
Copy Markdown
Contributor Author

@singingwolfboy Certainly! I'll get right on that.

@Kelketek

Kelketek commented Dec 8, 2014

Copy link
Copy Markdown
Contributor Author

@cahrens Yes, drag-and-drop's disabling is intentional, as I remember-- I can try to find the historical conversation on it, if you wish.

@Kelketek

Kelketek commented Dec 8, 2014

Copy link
Copy Markdown
Contributor Author

@singingwolfboy Wait, if I rebase on top of master with that, won't a merge with this feature branch be unclean? The feature branch would need a rebase first. Has it been?

@singingwolfboy

Copy link
Copy Markdown
Contributor

@Kelketek no, rebasing a branch makes it more clean than merging master into it. See the How to Rebase a Pull Request page for more info.

@cahrens

cahrens commented Dec 8, 2014

Copy link
Copy Markdown

I think the feature branch should be rebased on master, then this branch rebased on the feature branch.

@Kelketek

Kelketek commented Dec 8, 2014

Copy link
Copy Markdown
Contributor Author

@singingwolfboy That's not what I mean-- This branch is not intended to be merged into master. It's intended to be merged into the content-libraries feature branch. That branch is the one I need to rebase against. If I rebase against master, then I will have diverged from the content-libraries feature branch.

@singingwolfboy

Copy link
Copy Markdown
Contributor

Oh! I totally missed that, sorry. We'll need to get the content-libraries branch rebased onto master, and then you can rebase this pull request onto the newly-rebased content-libraries branch.

@Kelketek

Kelketek commented Dec 8, 2014

Copy link
Copy Markdown
Contributor Author

@singingwolfboy What's the procedure for that? Does one just create a new branch with the rebase, and someone on your end does a reset --hard against it?

@singingwolfboy

Copy link
Copy Markdown
Contributor

@Kelketek yes, that's basically the procedure. I'll take care of it -- I just want to make sure that everyone within edX (who cares about this branch) is aware of the change.

@Kelketek

Kelketek commented Dec 8, 2014

Copy link
Copy Markdown
Contributor Author

@singingwolfboy Thank you. I'll let the others at OpenCraft know that the feature branch will be rebased, and to prepare accordingly, since that means they may have to discard commits that aren't theirs on their rebase against the feature branch.

@cahrens

cahrens commented Dec 8, 2014

Copy link
Copy Markdown

@Kelketek Copy-paste makes me cringe. Should library-container view extend the container view?

@e-kolpakov

Copy link
Copy Markdown
Contributor

@cahrens I've just went through that file again - there're like two or three methods that can be shared. So it's not good and shame on me (since I have implemented it initially), but that's not that bad to cringe :) But of course it's useful to factor it out so that those methods are shared.

On the other hand, if library container extend ordinary container there would be more overloads than shared methods, so it might make sense to have a common ancestor, but not making library-container a descendant of ordinary container.

@cahrens

cahrens commented Dec 8, 2014

Copy link
Copy Markdown

From a functionality perspective, extension seems like the right thing here-- a library is a container page that adds additional features like paging.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can you give a high-level description of what changed in this file? I'm having trouble understanding via the diff.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@cahrens parameterized the whole test suite. It basically now works in two modes: with ordinary container and with library container. It tests common functionality found in both of them. The change was to wrap entire test suite into a function with some parameters and call it multiple times. As a result, every line changed indentation, and github diff viewer is unable to detect that, hence such a terrible diff.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

if you add ?w=1 to the end of the URL, Github will ignore whitespace when calculating diffs. That might make this easier to read.

@Kelketek
Kelketek force-pushed the content_libraries/4-pagination branch from cbd7e9b to 84e3183 Compare December 18, 2014 19:00
@Kelketek

Copy link
Copy Markdown
Contributor Author

@cahrens This is ready for another reviewing pass. Jenkins is still barfing on the quality checks even post-rebase, and it is now freaking out on bok_choy, heaven knows why, but I can't reproduce that locally either.

@cahrens

cahrens commented Dec 18, 2014

Copy link
Copy Markdown

OK. I don't think I will be able to get back to this until Monday or Tuesday.

@antoviaque

Copy link
Copy Markdown
Contributor

Updated the sandbox with the latest code: http://sandbox.opencraft.com:18010/

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I still think it would be good to make the last component unique in some way, and verify that the one displayed on the new page is the 11th one you added.

Actually, I think this is covered below, so I don't feel as strongly about it.

@cahrens

cahrens commented Dec 20, 2014

Copy link
Copy Markdown

👍 Just a few nits, but otherwise good.

@Kelketek
Kelketek force-pushed the content_libraries/4-pagination branch from 84e3183 to be3371e Compare December 22, 2014 16:02
@Kelketek

Copy link
Copy Markdown
Contributor Author

@antoviaque Jenkins has finished. The only failure is that unreproducible quality check issue as before.

@antoviaque

Copy link
Copy Markdown
Contributor

@Kelketek Great, thank you! Merging then. Congratulations on getting this to completion, and thanks again @cahrens for the extensive review.

antoviaque added a commit that referenced this pull request Dec 22, 2014
Implement Pagination for Content libraries (SOL-4)
@antoviaque
antoviaque merged commit fcc2045 into openedx:content-libraries Dec 22, 2014
antoviaque added a commit that referenced this pull request Jan 3, 2015
Implement Pagination for Content libraries (SOL-4)
@bradenmacdonald bradenmacdonald mentioned this pull request Jan 6, 2015
10 tasks
@bradenmacdonald
bradenmacdonald deleted the content_libraries/4-pagination branch January 6, 2015 22:33
@sarina sarina added the open-source-contribution PR author is not from Axim or 2U label Apr 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

open-source-contribution PR author is not from Axim or 2U

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants