-
Notifications
You must be signed in to change notification settings - Fork 304
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
General
: Make sure the filter button renders when reloading the course statistics page
#10231
base: develop
Are you sure you want to change the base?
General
: Make sure the filter button renders when reloading the course statistics page
#10231
Conversation
WalkthroughThe pull request introduces changes to handle control configuration updates and rendering in the course overview and statistics components. Modifications include updating the subscription logic in the Changes
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (1)src/test/javascript/spec/component/course/course-overview.component.spec.ts (1)Pattern ⏰ Context from checks skipped due to timeout of 90000ms (5)
🔇 Additional comments (2)
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/main/webapp/app/shared/tab-bar/tab-bar.ts (1)
11-11
: LGTM! Consider adding JSDoc for the new property.The addition of
controlsRendered
event emitter is a good solution for handling control rendering events. Consider adding JSDoc documentation to explain its purpose and usage.export interface BarControlConfigurationProvider { controlConfiguration: BarControlConfiguration; + /** Emits when the controls template has been rendered in the view. */ controlsRendered: EventEmitter<void>; }
src/main/webapp/app/overview/course-overview.component.ts (1)
626-630
: LGTM! Consider unsubscribing from controlsRendered.The async/await pattern is well implemented to ensure proper control rendering sequence. However, since we're using
firstValueFrom
on an event emitter, consider cleaning up the subscription to prevent potential memory leaks.this.controlsSubscription = this.controlConfiguration.subject?.subscribe(async (controls: TemplateRef<any>) => { this.controls = controls; - await firstValueFrom(provider.controlsRendered); + const controlsRenderedSubscription = provider.controlsRendered.subscribe(); + await firstValueFrom(provider.controlsRendered); + controlsRenderedSubscription.unsubscribe(); this.tryRenderControls(); }) || undefined;
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
src/main/webapp/app/overview/course-overview.component.ts
(1 hunks)src/main/webapp/app/overview/course-statistics/course-statistics.component.ts
(3 hunks)src/main/webapp/app/shared/tab-bar/tab-bar.ts
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
src/main/webapp/app/shared/tab-bar/tab-bar.ts (1)
src/main/webapp/app/overview/course-overview.component.ts (1)
src/main/webapp/app/overview/course-statistics/course-statistics.component.ts (1)
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: Call Build Workflow / Build .war artifact
- GitHub Check: Call Build Workflow / Build and Push Docker Image
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: server-tests
- GitHub Check: Analyse
🔇 Additional comments (2)
src/main/webapp/app/overview/course-statistics/course-statistics.component.ts (2)
119-119
: LGTM! Property initialization looks good.The
controlsRendered
event emitter is properly initialized as a class property.
285-285
: LGTM! Event emission is correctly placed.The event is emitted at the right time in the
ngAfterViewInit
lifecycle hook, ensuring that the controls template is available.
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.
Tested on TS5, works as expected.
e938b58
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.
Tested on TS4. Works as expected 👍🏼
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.
Tested on TS5, works fine.
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.
Tested on TS6, all works as expected.
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.
Tested on TS5, button renders after reloading the page (tested in Chrome and Safari) 👍
Tested on TS1, button renders after reloading the page (tested in Firefox) |
Tested on TS1 works as expected |
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.
test locally and worked as expected
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.
Tested on TS5, the filter button renders as supposed to
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.
Tested on TS4, the button renders without problems
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.
Tested on TS4, the button renders.
we need to wait if all client tests pass |
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.
One client test in course-overview.component.spec.ts
consistently fails. Please fix it first, otherwise we cannot merge this PR
Checklist
General
Client
authorities
to all new routes and checked the course groups for displaying navigation elements (links, buttons).Motivation and Context
Currently the filter button of the course statistics page does not render when reloading the page. This PR fixes that.
Fixes #10130
Description
Add EventEmitter that fires when child view sets the BarControl (that includes the filter button) in order to time the rendering at the parent view
Steps for Testing
Prerequisites:
Testserver States
Note
These badges show the state of the test servers.
Green = Currently available, Red = Currently locked
Click on the badges to get to the test servers.
Review Progress
Performance Review
Code Review
Manual Tests
Screenshots
Summary by CodeRabbit
New Features
controlsRendered
event emitter to signal control rendering completion.Improvements