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

attendeeProperty: Add member function #627

Merged
merged 1 commit into from
Nov 1, 2023
Merged

Conversation

onny
Copy link
Contributor

@onny onny commented Aug 17, 2023

Adding the possibility to read and set the MEMBER attribute as described in https://www.rfc-editor.org/rfc/rfc5545#section-3.2.11

Not sure yet how to deal with:

  • Testing and adding tests
  • Read and write multiple addresses of MEMBER field
  • Sanity check if MEMBER field exists

Would like to use this field in #627

@onny
Copy link
Contributor Author

onny commented Oct 6, 2023

Are these changes correct? What would be missing? @miaulalala @tcitworld

I wanted to test it on my local dev environment. I changed package.json of the calendar app to a local path: "@nextcloud/calendar-js": "file:/home/onny/projects/calendar-js". Now I get: Module not found: Error: Can't resolve '@nextcloud/calendar-js' in ....
I rerun npm ci and also tried to add an resolve alias to the webpack config without any luck. How do you do this?

@codecov
Copy link

codecov bot commented Oct 6, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c5ddbd6) 91.01% compared to head (eb9c15b) 91.02%.
Report is 17 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #627      +/-   ##
==========================================
+ Coverage   91.01%   91.02%   +0.01%     
==========================================
  Files          57       57              
  Lines        2782     2787       +5     
  Branches      507      508       +1     
==========================================
+ Hits         2532     2537       +5     
  Misses        250      250              
Files Coverage Δ
src/properties/attendeeProperty.js 100.00% <100.00%> (ø)

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

@miaulalala
Copy link

Thanks for the PR Onny! @st3iny can you help with the js issue?

@st3iny
Copy link
Member

st3iny commented Oct 27, 2023

Are these changes correct? What would be missing? @miaulalala @tcitworld

I wanted to test it on my local dev environment. I changed package.json of the calendar app to a local path: "@nextcloud/calendar-js": "file:/home/onny/projects/calendar-js". Now I get: Module not found: Error: Can't resolve '@nextcloud/calendar-js' in .... I rerun npm ci and also tried to add an resolve alias to the webpack config without any luck. How do you do this?

I like to do npm install ~/path/to/calendar-js inside the calendar repo. Npm will then setup the correct paths in package.json and package-lock.json.

@st3iny
Copy link
Member

st3iny commented Oct 27, 2023

As far as I can see it there can be multiple MEMBER parameters per ATTENDEE property. The current version uses the value (this.value) but should act on the paremeter instead.

The parameter value is either a single calendar address in a quoted-string or a COMMA-separated list of calendar addresses, each in a quoted-string.

Something like:

this.getParameter('MEMBER').getValueIterator() // ...
this.getParameter('MEMBER').setValue([ /* values */]) // ...

@st3iny
Copy link
Member

st3iny commented Oct 27, 2023

I amended the code a bit to make the parameter compatible with string arrays. I also added some more unit tests.

We will do a release shortly to get your other PR in the calendar repo merged soon.

Again, thanks a lot for your work :)

@st3iny
Copy link
Member

st3iny commented Oct 27, 2023

This PR can't be merged probably because ICAL.js is broken 😢

Ref kewisch/ical.js#634

Idea and original code by Jonas Heinrich (@onny).

Signed-off-by: Richard Steinmetz <[email protected]>
@st3iny
Copy link
Member

st3iny commented Nov 1, 2023

After some more investigation, it seems that the mentioned bug is an edge case. In real ics files attendees will have more parameters than just MEMBER. Besides, the bug is already affecting calendar-js as MEMBER is parsed anyway (just not exposed yet).

@st3iny st3iny merged commit 2074db6 into nextcloud:main Nov 1, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants