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

My courses implicit update #237

Merged
merged 5 commits into from
Feb 22, 2018
Merged

My courses implicit update #237

merged 5 commits into from
Feb 22, 2018

Conversation

Ostrenkiy
Copy link
Contributor

Задача: #APPS-1723

Коротко для Release Notes, в формате «Сделали/Добавили/Исправили N»:
Сделали локальное обновление Last Viewed для прогрессов в уроке.

Описание:
В LocalProgressLastViewedUpdater обновляются записи lastViewed для всех прогрессов вверх, начиная со степа. В CourseListPresenter теперь по willAppear() сортируем по последнему просмотру.

@Ostrenkiy Ostrenkiy added the main label Feb 15, 2018
@Ostrenkiy Ostrenkiy self-assigned this Feb 15, 2018
@Ostrenkiy Ostrenkiy requested a review from kvld February 15, 2018 14:27
@Ostrenkiy Ostrenkiy changed the title Feature/continue learning update My courses implicit update Feb 15, 2018
@@ -109,6 +109,10 @@ class CardsStepsPresenter {
view?.updateProgress(rating: rating, prevMaxRating: AdaptiveRatingHelper.getRating(for: currentLevel - 1), maxRating: AdaptiveRatingHelper.getRating(for: currentLevel), level: currentLevel)
}

func didAppear() {
LocalProgressLastViewedUpdater.shared.updateView(for: course)
Copy link
Contributor

Choose a reason for hiding this comment

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

Зачем здесь обновлять, если мы обновляем каждый раз в презентере каждого степа?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Здесь это нужно, а вот в CardStepViewController - нет

@@ -95,6 +95,7 @@ class LastStepRouter {
navigationController.pushViewController(sectionsVC, animated: false)
navigationController.pushViewController(unitsVC, animated: false)
navigationController.pushViewController(lessonVC, animated: true)
LocalProgressLastViewedUpdater.shared.updateView(for: course)
Copy link
Contributor

Choose a reason for hiding this comment

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

Для адаптивных курсов мы почему-то обновляем в презентере контроллера с адаптивными степами, а для обычных – в LastStepRouter. К тому же выше здесь есть код навигации к адаптивному степу.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

При роутинге на LastStep у нас не всегда прогружены sections и units для курса, соответственно мы не можем по цепочке вверх проставить все

class LocalProgressLastViewedUpdater {

//Singletons are bad, I know
//TODO: Remove this, add dependencies to objects everywhere
Copy link
Contributor

Choose a reason for hiding this comment

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

Возможно, пора снова подумать про DI.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Да, уберу shared там, где он не нужен

@Ostrenkiy Ostrenkiy merged commit 0acfb02 into dev Feb 22, 2018
@Ostrenkiy Ostrenkiy added this to the 1.53 milestone Feb 26, 2018
@Ostrenkiy Ostrenkiy mentioned this pull request Feb 26, 2018
@kvld kvld deleted the feature/continue-learning-update branch January 29, 2019 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants