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

Visually distinguish invitations in calendar grid #6624

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

GVodyanov
Copy link
Contributor

Fix #3869

@GVodyanov GVodyanov added the 2. developing Work in progress label Jan 13, 2025
@GVodyanov GVodyanov self-assigned this Jan 13, 2025
Copy link

codecov bot commented Jan 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59.30%. Comparing base (1d63a89) to head (4844e31).
Report is 10 commits behind head on main.

Additional details and impacted files
@@              Coverage Diff              @@
##               main    #6624       +/-   ##
=============================================
+ Coverage     23.17%   59.30%   +36.12%     
- Complexity      472      475        +3     
=============================================
  Files           250       42      -208     
  Lines         12020     2290     -9730     
  Branches       2296        0     -2296     
=============================================
- Hits           2786     1358     -1428     
+ Misses         8907      932     -7975     
+ Partials        327        0      -327     
Flag Coverage Δ
javascript ?
php 59.30% <ø> (-0.16%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Comment on lines +40 to +57
if (object.status && object._properties.size > 9) {
let didEveryoneDecline = true;
for (const [key, value] of object._properties.entries()) {
if (key === 'ATTENDEE') {
value.forEach((attendee) => {
for (const [key, value] of attendee._parameters.entries()) {
if (key === 'PARTSTAT') console.log('key', key, value._value)
if (key === 'PARTSTAT' && value._value !== 'DECLINED') {
didEveryoneDecline = false;
}
}
})
}
}
if (didEveryoneDecline) {
classNames.push('fc-event-nc-all-declined')
}
}
Copy link
Member

Choose a reason for hiding this comment

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

The data you need is already exposed by calendar-js. Take a look at the following pseudo-code:

for (const attendeeProperty of object.getPropertyIterator('ATTENDEE')) {
	const hasDeclined = attendeeProperty.participationStatus === 'DECLINED'
	// TODO: write the rest of the code
}

Copy link
Member

Choose a reason for hiding this comment

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

And to check if there are attendees you could use:

object.hasProperty('ATTENDEE')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2. developing Work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Visually distinguish invitations
2 participants