8000 fix(agenda): Agenda 'now' fallback to next event if there is no current event by holloway · Pull Request #8693 · ietf-tools/datatracker · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix(agenda): Agenda 'now' fallback to next event if there is no current event #8693

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

Merged
merged 4 commits into from
Mar 19, 2025

Conversation

holloway
Copy link
Contributor

The 'now' internal page link would fail if there was no current event. For example, clicking 'now' before
events start for the day would fail. This PR adds a fallback where it will find the next event even if it hasn't started yet.

8000
if (lastEventId) {
document.getElementById(`agenda-rowid-${lastEventId}`)?.scrollIntoView(true)
if (nowEventId) {
document.getElementById(`agenda-rowid-${nowEventId}`)?.scrollIntoView(true)
} else {
message.warning('There is no event happening right now.')
Copy link
Member

Choose a reason for hiding this comment

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

missing "or in the future" to be consistent with AgendaMobileBar

findNowEventId () {
const currentEventId = this.findCurrentEventId()

if (currentEventId) return currentEventId
Copy link
Member

Choose a reason for hiding this comment

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

Add curly braces.

if (sh.adjustedStart > current) {
// -> Use the first event of multiple events having identical times
if (nextEvent.start === sh.adjustedStart.toMillis()) {
continue
Copy link
Member

Choose a reason for hiding this comment

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

Use break instead? No need to keep iterating, as events are already chronological.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've simplified this loop ... see 52678da

Copy link
codecov bot commented Mar 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.80%. Comparing base (70bf2ae) to head (e6a6442).
Report is 40 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8693      +/-   ##
==========================================
- Coverage   88.88%   88.80%   -0.08%     
==========================================
  Files         312      314       +2     
  Lines       40891    41243     +352     
==========================================
+ Hits        36345    36626     +281     
- Misses       4546     4617      +71     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@holloway holloway requested a review from NGPixel March 18, 2025 06:22
@holloway holloway marked this pull request as ready for review March 18, 2025 08:39
@NGPixel NGPixel changed the title fix: Agenda 'now' fallback to next event if there is no current event fix(agenda): Agenda 'now' fallback to next event if there is no current event Mar 18, 2025
@rjsparks rjsparks merged commit 3356505 into ietf-tools:main Mar 19, 2025
10 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 23, 2025
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.

3 participants
0