SparkEdUAB / sparked-next

The next version of sparked based on nextjs
https://sparkednext.app/
MIT License
2 stars 5 forks source link

Library filters should be dynamic #182

Closed OlivierJM closed 2 months ago

OlivierJM commented 4 months ago

Similar to here https://www.alemhulu.com/ Filters in the library should be dynamic, meaning that if you choose a grade then you should only see subjects under that specific grade on the filter, Then units & topics should be disabled until a Grade & Subject are selected. Also we should make a unit come show up before topic.

Screenshot 2024-06-05 at 07 45 03

mikemtdev commented 4 months ago

Shouldn't this filtering be done on the back end?

OlivierJM commented 4 months ago

Shouldn't this filtering be done on the back end?

We may need to change to not render on the server so that we individually query these.

@brianmuks can you help out on this? we need to a few endpoints. e.g: for subjects, we need something like this

brianmuks commented 4 months ago

I will share the end points end of today

OlivierJM commented 4 months ago

Thank you Brian.

brianmuks commented 4 months ago
  • gradeId

For these end points my understanding is this: fetchSubjectsByGradeId fetchUnitsBySubjectId @OlivierJM @mikemtdev please confirm

OlivierJM commented 4 months ago
  • gradeId

For these end points my understanding is this:

fetchSubjectsByGradeId

fetchUnitsBySubjectId

@OlivierJM @mikemtdev please confirm

Let's do it for topics as well as media contents. This way it will be easier to find related media contents as well.

brianmuks commented 4 months ago

At the moment my understanding is that subjects and grades are not linked to topics ,media content and units. We need to implement this too right ?

brianmuks commented 4 months ago

At the moment my understanding is that subjects and grades are not linked to topics ,media content and units. We need to implement this too right ?

@OlivierJM waiting for your response.

OlivierJM commented 4 months ago

At the moment my understanding is that subjects and grades are not linked to topics ,media content and units. We need to implement this too right ?

@OlivierJM waiting for your response.

Apologies I was at a funeral since yesterday and didn't check my messages sooner. I think it would be good to link grades to media contents/topics.

Otherwise we as long as we maintain this relationship we should be fine Grade ==> Subject ==> Unit ==> Topic ==> Media and then you should be able to call the children by its parentId

brianmuks commented 3 months ago

Thanks. This is helpful !

mikemtdev commented 3 months ago

@brianmuks you can ping me when you are ready

OlivierJM commented 3 months ago

@brianmuks this is blocked

OlivierJM commented 3 months ago

@mikemtdev let's focus on finishing this one.

brianmuks commented 3 months ago

@brianmuks you can ping me when you are ready

Sure

OlivierJM commented 3 months ago

@mikemtdev any progress with this ? or are you blocked in any way ?

OlivierJM commented 3 months ago

@mikemtdev You are still working on this right ?

mikemtdev commented 3 months ago

Yes, I am adding what had remained.

OlivierJM commented 3 months ago

cool, Thanks

OlivierJM commented 2 months ago

@mikemtdev any update on this ? it is still not functioning as intended

OlivierJM commented 2 months ago

@mikemtdev the way we have it like this will be very expensive since it just make calls almost all the time with not much conditions and no caching, we will need to refactor a little bit maybe once this is fixed #225 https://github.com/SparkEdUAB/sparked-next/blob/main/src/app/library/layout.tsx

mikemtdev commented 2 months ago

@OlivierJM Meaning this should only be grade on initial page load then subject after grade has been seleted. And so on and so forth?

OlivierJM commented 2 months ago

Yes

OlivierJM commented 2 months ago

So we load the page we show a list all media limited by a certain amount

subjects should only be fetched when a grade has been selected should be similar all the way down to topic

OlivierJM commented 2 months ago

@YewoMhango thanks for fixing this.