bjornregnell / kapten-alloc-web

Find your slot in space and time.
https://cs.lth.se/pgk/kaptenalloc
39 stars 4 forks source link

Adds feature to generate ICS file to add to calendar #4

Closed stagrim closed 2 years ago

stagrim commented 2 years ago

Adds button to create an ICS file using a self created iCalendar library, written in Scala.js. Also adds a checkbox to display times with or without "akademisk kvart", which in turn will carry over to the generated ICS file. I have tested generated ICS files, but bugs may still occur.

Please rearrange or style the new UI elements if you have a better idea of how they can be displayed. The same goes for the code itself, if you find a better way of doing things, please contribute.

stagrim commented 2 years ago

This looks good! Great work creating your own? ICal builder in Scala.

The iCalendar library is built from the ground up. It also contains code specifically made for kapten-alloc-web, like the functions in the Property companion object used to create Property classes from kapten-alloc data. More features from the iCalendar standard will be added when they are needed. Currently only features that are needed are implemented. I plan, for example, on adding support for alerts like my Rust version (plan was to use Rust-generated WebAssembly in kapten-alloc-web, but it would have made project more complex to maintain). In that case a new class, Alert, which inherits from VObject would be created, and a VObject vector in Event etc. It is build to be (hopefully) scalable, like to easily add new Parameters, Properties and such.

https://github.com/bjornregnell/kapten-alloc-web/pull/4#discussion_r753944572 Should be resolved with the 31c8b2d commit

Thanks for the review!

bjornregnell commented 2 years ago

This seems really useful @stagrim ! Happy coding :smile:
I will take a look hopefully by the end of this week after my lectures if not before.

@theolundqvist thanks for the review! Would be great if you meanwhile also could try to build it locally and perhaps do some quick testing and check the user experience?

@DagHemberg You also expressed interest in this previously. If you have some time over, you are welcome to give it a review if you like.

bjornregnell commented 2 years ago

I get this build error after merge:

sbt:hello Scala.js> fullLinkJS
[info] Full optimizing /home/bjornr/git/hub/bjornregnell/kapten-alloc-web/target/scala-3.1.0/hello-scala-js-opt
[error] file:/home/runner/work/scala-java-time/scala-java-time/core/js/target/scala-3.0.0/src_managed/main/org/threeten/bp/format/DateTimeFormatterBuilder.scala(1536:4:Labeled): any expected but <notype> found for tree of type org.scalajs.ir.Trees$Block
[error] There were 1 IR checking errors.
[error] (Compile / fullLinkJS) There were 1 IR checking errors.

Seems to be a clash between Scala versions (?)