feat: First checkin for the ical direct features#189
feat: First checkin for the ical direct features#189dploeger wants to merge 4 commits intoColdTrick:masterfrom
Conversation
|
@jdalsem can you find some time checking this out? Thanks. |
|
i enabled the automated checks on this PR. You might want to fix them first. After that i will do a detailed review of the code. At first glance it looks ok (with some minor remarks). I was wondering how you see this working together with the AddThisEvent feature (which also supports ical downloads). Should users choose on or the other? Maybe you could squash all your commits into one.. we do not need all the development commits in our history |
Sure. Will do, thanks.
I've made it selectable in the code. AddThisEvent doesn't support iCal imports and is a US-based company so many people will favor a local embedded version (at least we would 😅)
Yes, of course. I usually do a rebase with fixups once everything is settled. |
|
lol 4 comments... something went wrong probably If this can provide the same feature as AddThisEvent, we might choose to drop that. It is just an 'easy' solution (from the past). No specific needs... maybe the links in the mail footer is special |
|
Shouldn't use the GitHub app on an unstable 5G connection apparently. 😂 Sure, the iCal export also works fine on mobile with direct import into the calendar app. Although users who use the AddThisEvent app already might want to keep it. |
82b58db to
18e497f
Compare
18e497f to
c0bbb1e
Compare
|
@jdalsem Could you please approve the workflow again. I've fixed some things. |
|
we also expect the composer.lock file to be present (and updated with your changes) |
Hm. Actually did a Was that wrong? |
|
Hm. Maybe I copied the wrong composer.lock. 😆 I'll take a look |
|
Ah. Found the right composer.lock. Sorry. |
|
best option is to reset the lock and composer.json and do:
best practice is to not do composer update as it will update all (unrelated) packages... composer update should be something that we do in a separate commit / PR... not a big issue / blocker for now, but it might introduce unrelated issues |
|
still not ok... |
|
Yeah, resetted the lock like you suggested now. |
|
Now it installs correctly... some views/actions seem to be assuming too much... or not casting input correctly.. i will have a look at the rest of the PR |
|
Thanks. I'll take a look at the unit test result. |
|
If I read the result correctly, it just having a problem with calling the import ical action without specifying a correct input file. So the fix would be to check for a proper file and exiting, right? |
jdalsem
left a comment
There was a problem hiding this comment.
It was a big review, but i think you are on the right track... do not let the amount of comments discourage you. I am merely trying to make sure it all works as expected.
Main concerns:
- forms (import/export) should not be part of a listing resource (next to all/mine)
- actions should do some more sanity checks and expect users to misbehave
- importing of attendees feels a privacy issue (as users might join events they did not subscribe for themselves)
- importing to random users/groups is possible. You might need to validate if that is possible / allowed
If we can get this PR merged, this will be added in a minor version of Event Manager as 'experimental'. If all works fine we might consider dropping AddEvent in the version for Elgg 7 and completely switch to this ical feature.
There was a problem hiding this comment.
loosely comparing is not recommended. use triple === if you know it is a string or just use empty($start_date)
There was a problem hiding this comment.
you do this everywhere... just commenting once about it
There was a problem hiding this comment.
Do you mean every double == comparison? Because I see that outside my changed files as well. Or just comparing empty strings?
There was a problem hiding this comment.
there might be some legacy code that still does check with ==, but === is better. See https://www.php.net/manual/en/language.operators.comparison.php#:~:text=Note%3A%20Be%20aware%20that%20PHP's,in%20most%20cases.
There was a problem hiding this comment.
defaulting to empty string is not recommended. If you need it to always be a string, better to cast it:
$start_date = (string) get_input('start_date');
There was a problem hiding this comment.
you do this everywhere... just commenting once about it
There was a problem hiding this comment.
I wanted to default to an empty string so I can later default to the current time. A better alternative would be probably to check, if the start_date input was given at all. Is there a "has_input" function or something?
There was a problem hiding this comment.
no nothing other than get_input... has_input is just as tricky as you do not know if the input is valid. Personally just cast and check the validity with empty() or elgg_is_empty() and then decide if you need a special default.
There was a problem hiding this comment.
also a loosely compared condition... use !empty($region)
| @@ -0,0 +1,27 @@ | |||
| <?php | |||
There was a problem hiding this comment.
i think the import/export resource could be replaced by utilizing ajax forms
replace the tabs in the filter menu by title menu buttons that popup with an ajax form (look at reported content for an example)
There was a problem hiding this comment.
What do you mean with "reported content"?
composer.json
Outdated
There was a problem hiding this comment.
please remove this, we do not want it in our code....
we have sniffs configured in Elgg (the base repo) and in our IDE... we do not want the administration in our plugins... might need to update your lock file (composer update --lock) if you touch this
There was a problem hiding this comment.
Oh whoops. Got in there while trying to simulate the lint checks.
| 'path' => '/event', | ||
| 'resource' => 'event/upcoming', | ||
| ], | ||
| 'collection:ical:export' => [ |
There was a problem hiding this comment.
remove this if you decided to switch to ajax forms... as mentioned before
dploeger
left a comment
There was a problem hiding this comment.
I've fixed the first batches of comments. I'll take a look at the rest.
This implements a feature I called "ical direct" offering ical export and import features without the need of an external provider.
Features: