-
Notifications
You must be signed in to change notification settings - Fork 4
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] [AUT-3574] Change User Perspective according to the login flow #406
[FEATURE] [AUT-3574] Change User Perspective according to the login flow #406
Conversation
- Removed `FEATURE_FLAG_TAO_AS_A_TOOL` Feature Flag Refs: https://oat-sa.atlassian.net/browse/RFE-847 Refs: oat-sa/tao-core#3986
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #406 +/- ##
=============================================
+ Coverage 31.32% 31.73% +0.40%
- Complexity 842 850 +8
=============================================
Files 106 107 +1
Lines 2953 2978 +25
=============================================
+ Hits 925 945 +20
- Misses 2028 2033 +5 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have similar comments to:
oat-sa/tao-core#3983 (review)
models/classes/AuthoringAsTool/AuthoringAsToolLtiConfigProvider.php
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- New code is covered by tests (if applicable)
- Tests are running successfully (old and new ones) on my local machine (if applicable)
- New code is respecting code style rules
- New code is respecting best practices
- New code is not subject to concurrency issues (if applicable)
- Feature is working correctly on my local machine (if applicable)
- Acceptance criteria are respected
- Pull request title and description are meaningful
Co-authored-by: Bartłomiej Marszał <bartlomiej@taotesting.com> Signed-off-by: André Luiz Machado <andre.luiz.kbca@gmail.com>
models/classes/AuthoringAsTool/AuthoringAsToolLtiConfigProvider.php
Outdated
Show resolved
Hide resolved
models/classes/AuthoringAsTool/AuthoringAsToolLtiConfigProvider.php
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What you are trying to achieve is to provide different implementation of AuthoringAsToolConfigProviderInterface* that will contain reference to Lti Claim with a fallback to configuration values.
I don't agree with using previous service implementation from class properties as config fallback. Instead I would recommend to extend class, override methods or move common methods into abstract class.
|
||
$services | ||
->set(AuthoringAsToolLtiConfigProvider::class) | ||
->decorate(AuthoringAsToolConfigProviderInterface::class) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of decorating I would suggest to overload implementation of AuthoringAsToolConfigProviderInterface*
Hello @bartlomiejmarszal Embracing composition over method overloading aligns with the Liskov Substitution Principle, a fundamental tenet of object-oriented design. By favoring composition, we uphold the principle's mandate for substitutability, enabling interchangeable components that adhere to a consistent interface. This approach fosters greater code reliability, extensibility, and adaptability, as it encourages the creation of cohesive and loosely coupled modules that can be easily substituted or extended without compromising the integrity of the system. |
|
||
public const LTI_REDIRECT_AFTER_LOGOUT_URL = 'authoringSettings.redirectAfterLogoutUrl'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public const LTI_REDIRECT_AFTER_LOGOUT_URL = 'authoringSettings.redirectAfterLogoutUrl'; | |
public const LTI_REDIRECT_AFTER_LOGOUT_URL = 'authoringSettings.redirectAfterLogoutUrl'; |
IMO this implementation violate composition pattern as it using multiple implementation of itself by class property. I think for this purpose better fit would be using method overload |
Hello @bartlomiejmarszal Regarding your suggestion of method overloading, I'd like to delve deeper: which specific method are you proposing to overload? It's essential to consider the context and implications of such a decision within our design framework. I think what you are proposing is to use inheritance instead of Aggregation, right??? |
Version
There are 0 BREAKING CHANGE, 3 features, 10 fixes |
What's changed
FEATURE_FLAG_TAO_AS_A_TOOL
, the user experience should change dynamically nowAuthoringAsToolConfigProviderInterface
. Tao Core uses this info to apply proper user experiencePlease also check: oat-sa/tao-core#3983, https://github.com/oat-sa/tao-portal/pull/740
Refs: https://oat-sa.atlassian.net/browse/RFE-847
Refs: https://github.com/oat-sa/tao-portal/pull/720
Refs: https://github.com/oat-sa/tao-portal/pull/740
Demo
Feature
Screen.Recording.2024-03-19.at.09.25.21.mov
Fallback
Screen.Recording.2024-03-19.at.10.07.32.mov