Skip to content
This repository has been archived by the owner on Sep 3, 2019. It is now read-only.

AENV-69: As an author I want to add my article to a respective playlist #31

Merged
merged 7 commits into from Oct 1, 2015

Conversation

takeit
Copy link
Contributor

@takeit takeit commented Sep 22, 2015

This one should be merged instead of #29

TODO:

  • on modal close, load featured articles lists, but update an array of available lists by the missing value. (dont reload the whole array)
  • modal size should be changed to the smaller one because on the right side there is a lot of free space
  • header should be added to the modal window, because modal close button ("x") overlaps the featured articles save button.

See an image below for the first two issues:

zrzut ekranu 2015-09-22 10 59 10

- [x] in the featured articles pane, there should be a pointer coursor when hovering the featured article list to which article is assigned to - [x] icon for the "Add existing articles list(s)" should be changed to "plus icon" ? at the moment there, is an image icon.

zrzut ekranu 2015-09-22 10 56 33

- [x] title attribute should be changed to describe featured article lists (atm there is text describing slideshows, e.g. Attach Slideshows etc) - [x] "Articles Lists" text should be changed to "Featured Articles Lists" - [x] "Close" button should be hidden in when Featured Article Lists modal is open (on the newscoop side) - add article's position in assigned featured list - **Note**: this will be introduced later.

@takeit
Copy link
Contributor Author

takeit commented Sep 29, 2015

@plamut pls review

@plamut
Copy link
Contributor

plamut commented Sep 30, 2015

@takeit Is it urgent? I didn't manage to do it yet, unfortunately, it's been a busy day.

@takeit
Copy link
Contributor Author

takeit commented Sep 30, 2015

@plamut no rush as there is one todo left, take your time. I pinged you to review that when you find some time.

@plamut
Copy link
Contributor

plamut commented Sep 30, 2015

OK, good, I'll probably have some spare time tomorrow.

@takeit takeit changed the title [WIP] Aenv 69 AENV-69: As an author I want to add my article to a respective playlist Sep 30, 2015
_.remove(
self.assignedArticlesLists,
{id: value.id}
);
Copy link
Contributor

Choose a reason for hiding this comment

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

Just checking - is it really safe to delete the elements from the array while iterating over it? Does it, for example, work for two consecutive elements when both should be deleted? It is likely that the second one gets skipped over if its immediate predecessor gets deleted.

I would recommend creating a test case for this and modify the code if needed. One possible solution would be to iterate over the array backwards.

(and if this is based on any of my code snippets - looks familiar - then I take the blame 😄 )

BTW, I think the comments need an update, too, since we are not adding and deleting lists, but the article objects instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point, although it worked fine, but it was not a good approach, I replaced that snippet with the iteration in reverse + I have added more tests to cover this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

since we are adding and removing featured article list(s) (not articles) from the array where those lists are being kept, comments are correct.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, good then, leave the comments as they are then.

@plamut
Copy link
Contributor

plamut commented Oct 1, 2015

Looks good and readable so far, with docstrings and extensive test coverage, good work.
Just please have a look at the alleged issue mentioned above, just in case.

@takeit
Copy link
Contributor Author

takeit commented Oct 1, 2015

Thanks for the review! I updated the PR according to your comments.

@plamut
Copy link
Contributor

plamut commented Oct 1, 2015

I think the rest is fine, didn't find any issues really. It's also great to see that you guys still write readable code, keep doing that, it really benefits the project.
👍

featured articles lists optimizations

added updating the existing assigned articles lists array

iterate in reverse when removing the element

fixed translations and less improvement
takeit added a commit that referenced this pull request Oct 1, 2015
AENV-69: As an author I want to add my article to a respective playlist
@takeit takeit merged commit d258be0 into master Oct 1, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants