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

Feature incognito mode #112

Merged
merged 7 commits into from
Aug 13, 2020
Merged

Feature incognito mode #112

merged 7 commits into from
Aug 13, 2020

Conversation

flbulgarelli
Copy link
Member

@flbulgarelli flbulgarelli commented Aug 4, 2020

🎯 Goal

Implement a polymorphic Incognito user - in a null-object style - and the foundations of an incognito mode. This concept is required for allowing a userless mode.

📝 Details

  • Added a Mumuki::Domain::Incognito singleton
  • Added an organization flag for enabling this mode - which is actually a laboratory task
  • Added new delegations using a new naming schema when ambiguity may arise - 👥.*_at(📚) methods for user messages that take a content - as opposed to 📚.*_for(👥) methods that are content messages that take an user as argument

🔙 Backward compatibility

This PR should be 100% backwards compatible, since it does not remove any method nor it alters semantics

👀 See also

mumuki/mumuki-laboratory#1450

@flbulgarelli flbulgarelli force-pushed the feature-userless-mode branch from 1c28aa4 to c0e19b8 Compare August 10, 2020 13:31
@@ -52,7 +52,8 @@ def pending_exercises(user)
on assignments.exercise_id = exercises.id
and assignments.submitter_id = #{user.id}
and assignments.submission_status = #{Mumuki::Domain::Status::Submission::Passed.to_i}").
where('assignments.id is null')
where('assignments.id is null').
order('public.exercises.number asc')
Copy link
Contributor

Choose a reason for hiding this comment

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

This ordering logic it's related to next_exercise, not to pending_exercises.
It's an important distinction because we'll use indicators to easily get pending_items but ordering logic is not included there.

Copy link
Member Author

Choose a reason for hiding this comment

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

Great, I had that doubt 😄

Copy link
Member Author

Choose a reason for hiding this comment

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

Please review it again!

@flbulgarelli flbulgarelli requested a review from luchotc August 12, 2020 17:44
@flbulgarelli flbulgarelli marked this pull request as ready for review August 12, 2020 17:53
end

describe 'next_exercise', organization_workspace: :test do
# TODO this looks weird. Why do we need a non-polymorphic
Copy link
Contributor

Choose a reason for hiding this comment

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

Currently we aren't using indicators for this one as progress is shared between organizations.
This change was made and had to be rolled back because of that.

Copy link
Member

@julian-berbel julian-berbel left a comment

Choose a reason for hiding this comment

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

❤️

@flbulgarelli flbulgarelli merged commit 19c248b into master Aug 13, 2020
@flbulgarelli flbulgarelli deleted the feature-userless-mode branch August 13, 2020 18:24
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.

3 participants