-
Notifications
You must be signed in to change notification settings - Fork 1
Update getWithChildren
to use stela
#720
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
Conversation
22c3d46
to
8bc9934
Compare
67f1542
to
43c79d1
Compare
8bc9934
to
d00b5bf
Compare
43c79d1
to
d47ad15
Compare
d00b5bf
to
c43a07c
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #720 +/- ##
==========================================
- Coverage 45.16% 45.04% -0.12%
==========================================
Files 370 370
Lines 11284 11309 +25
Branches 1860 1862 +2
==========================================
- Hits 5096 5094 -2
- Misses 6013 6042 +29
+ Partials 175 173 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my point of view, taking into account that I'm still getting used to the code base, it looks good.
@aasandei-vsp Thank you, also I just wanted to underscore how accurate your review was / please do continue to flag things like that even if in this case we didn't end up making every change! |
I promise to do this and push back as well whenever I have a strong opinion about smth and back it up with arguments. I feel this is the only way to actually get to a healthy codebase. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had some pending comments - I will leave those here since @aasandei-vsp has already done such a thorough review!
stelaFolder.children ??= []; | ||
const childFolderVOs = stelaFolder.children | ||
.filter((child): child is StelaFolder => !isStelaRecord(child)) | ||
.map(convertStelaFolderToFolderVO); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to have a limit on how deeply we recurse? I suppose not since we need folders to work all the way down. Maybe a better question is: "does this recurse all the way down the children of a folder and do we need it to do that?"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could prevent a second layer just in defensive spirit -- but this also begs the question about the data stela returns (I assume folders in stela are shallow?)
PHP doesn't provide full depth right (i.e. our components are already assuming child folders need to be loaded?) <-- I will check.
thumbURL2000: stelaFolder.thumbnailUrls['2000'], | ||
thumbDT: stelaFolder.displayTimestamp, | ||
thumbnail256: stelaFolder.thumbnailUrls['256'], | ||
thumbnail256CloudPath: stelaFolder.thumbnailUrls['256'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know why we have both of these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's in the VO (not sure if both are actually used but I suppose therein lies the ultimate desire to move from VOs!)
web-app/src/app/models/folder-vo.ts
Lines 77 to 78 in daa410e
public thumbnail256: string; | |
public thumbnail256CloudPath: string; |
status: stelaFolder.status, | ||
publicDT: stelaFolder.publicAt, | ||
parentFolderId: stelaFolder.parentFolder.id, | ||
pathAsText: stelaFolder.paths.names, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(note to self) Plural?
d67a8f3
to
685be13
Compare
c43a07c
to
b8b7fb5
Compare
This continues our migration away from the PHP api / into stela. Similar to the work around get record we want to decouple the actual API calls from our component implementations. Once we're fully onto Stela we can update our components to use the stela data format.
b8b7fb5
to
3c5811e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, yes, this is only used in two ways: one is to load subfolders of "Apps" (I only see these in accounts that I used for testing our Etherpad integration, which I don't have locally or in dev). Even if we break that, I'm not too worried about it. The basic left menu I can confirm is loading.
The other place is to get folder thumbnails, which we only display in the public archive. This was working too, once I tried in a private window (to avoid using cached "broken" thumbnails). Looking good!
This PR updates
getWithChildren
to use stela.This function is not used in many places right now -- in particular I was only able to reliably trigger it by viewing the
Apps
section of the navigation.We picked this one because it will be used for unlisted shares.
Related to #683