djplaner / canvas-collections

Transform Canvas LMS modules by adding structure, visuals, and context
https://djplaner.github.io/canvas-collections/
GNU General Public License v3.0
1 stars 0 forks source link

Svelte rewrite - v1 #153

Closed djplaner closed 1 year ago

djplaner commented 1 year ago

Implementation

Status - working on deleting a collection. Most of it appears to be working, but there's something wrong with the reactive stuff. It apepars to be trying to access a representation for a collection that no longer exists

Longer term tasks

Support

CanvasCollections

UniversityDateCalendar

CanvasCollectionsConfiguration

CollectionRepresentation

ModuleConfiguration

Cards

Assessment table

Table evolution

Longer term

Canvas collections

djplaner commented 1 year ago

Documentation

dev

Based on this repo lpshanley/tampermonkey-svelte

djplaner commented 1 year ago

Working on Controller

Aim being to figure out what the controller does and how it should be done in Svelte

Current Process

Plan

setContent

Goes into the main.ts - called before the App.

If it's not a modulesPage or a course, don't add the app.

If it is pass the courseId and editMode to the component

component creation

main.ts passes context as props to <CanvasCollections courseId= editMode=>

configurationStore

After some initial configuration the process is

initialiseConfigPage

parseNewPageBody

djplaner commented 1 year ago

Planning out representations

div#canvas-collections-representation

Current structure is

CanvasCollectionsRepresentation

<CanvasCollectionsRepresentation>
  <CollectionsNavigation>
  </CollectionsNavigation>
  <div.cc-message>{message for current collections}</div>
  <CollectionRepresentation>
  </CollectionRepresentation>
</CanvasCollectionsRepresentation>

To do

djplaner commented 1 year ago

Reactive representations

problem

With multiple collections with Cards representation, changing between them will change the name of the collection, but will NOT modify the representation of the cards - still showing the same cards as initially loaded.

ponderings

Should be the same if multiple assessment tables

Check this by adding multiples - CONFIRMED

Suggesting the problem is that the {collection} used for the name of the collection is reactive. What's not reactive is the code that's generating the HTML for the tables or cards

Solution

Make the calculation of moduleIds reactive by adding $: