-
Notifications
You must be signed in to change notification settings - Fork 19
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
enh(dashboard): add recent pages dashboard widget #898
Conversation
4a9d5bd
to
85412d1
Compare
Super nice, thanks @blizzz! We probably should think about more performant solutions to fetch the list of recent pages for all collectives. What do you think about a dedicated Something along the lines of: SELECT p.*, fc.mtime FROM oc_filecache fc LEFT JOIN oc_collectives_pages p ON fc.fileId = p.file_id WHERE (fc.path LIKE 'appdata_123/collectives/13/%' OR fc.path LIKE 'appdata_123/collectives/14/%') AND mimetype=14; |
By the way, that's the corresponding issue that will be closed with this PR: #113 |
@mejo- please see the latest commit that targets your suggestions and our conversation in talk. P.S.: What is also fixed is a Readme title that appeared before, and Collective emojis are also added. Screenshot ^ is updated. |
32006bb
to
41618ee
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.
Thanks a lot @blizzz, looks really good overall. I have some minor comments though.
41618ee
to
f5a39f2
Compare
1 failed and 1 flaky tests on run #1242 ↗︎
Details:
cypress/e2e/page-list.spec.js • 1 failed test • Nextcloud stable25
cypress/e2e/page-list.spec.js • 1 flaky test • Nextcloud stable27
Review all test suite changes for PR #898 ↗︎ |
f5a39f2
to
48109ce
Compare
48109ce
to
c586066
Compare
01f1ba5
to
828e953
Compare
not sure why the cypress tests are failing, this is rather a frontend thing. Similar failures reported at #936 |
148a121
to
f5aaa73
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.
I think a small Cypress smoke test that tests whether the recent pages widget displays and lists a page would be good. @blizzz would you like to look into this yourself?
Given that I'd like to release Collectives latest tomorrow we can either postpone this or I'll see whether I find time to do it myself later.
I cannot promise to accomplish this today. |
Let's follow up on that then I'd say |
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.
Super nice, thanks again for the PR. Only two comments. I have both suggested code changes ready locally and could commit+push them to this PR to get the PR in quickly.
But also fine if you want to do the changes yourself.
lib/Service/RecentPagesService.php
Outdated
} else { | ||
$title = basename($internalPath); | ||
} | ||
$url = $this->urlGenerator->linkToRoute('collectives.start.indexPath', ['path' => implode('/', $pathParts)]); |
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.
$url = $this->urlGenerator->linkToRoute('collectives.start.indexPath', ['path' => implode('/', $pathParts)]); | |
$fileIdSuffix = '?fileId=' . $row['file_id']; | |
$url = $this->urlGenerator->linkToRoute('collectives.start.indexPath', ['path' => implode('/', $pathParts)]) . $fileIdSuffix; |
It would be nice to add the fileId
query parameter to the URL, to make the URL more robust to title changes (e.g. when copying the URL somewhere else).
if ($row['filename'] !== 'Readme.md') { | ||
$pathParts[] = basename($row['filename'], PageInfo::SUFFIX); | ||
$title = basename($row['filename'], PageInfo::SUFFIX); | ||
} else { |
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.
} else { | |
} elseif ($internalPath === '' || $internalPath === '.') { | |
$title = $this->l10n->t('Landing page'); | |
} else { |
We have to special-treat landing pages here.
f5aaa73
to
abb2409
Compare
I pushed a simple Cypress test. Edit: the Cypress test depends on the fix for landing pages to succeed 🙈 |
55dc145
to
ca3c11b
Compare
Signed-off-by: Arthur Schiwon <[email protected]>
…tion - adds a simplified RecentPage model to avoid incomplete PageInfo instances - add RecentPageService with a method to fetch them for a specified user - adapts and simplifies RecenPagesWidget Signed-off-by: Arthur Schiwon <[email protected]>
- CollectiveHelper methods now return array with collective id as key - by catch: make use of fluid setter at RecentPage Signed-off-by: Arthur Schiwon <[email protected]>
Signed-off-by: Arthur Schiwon <[email protected]>
Signed-off-by: Arthur Schiwon <[email protected]>
Signed-off-by: Arthur Schiwon <[email protected]>
- psalm issue: vimeo/psalm#8258 Signed-off-by: Arthur Schiwon <[email protected]>
Signed-off-by: Arthur Schiwon <[email protected]>
… links Signed-off-by: Jonas <[email protected]>
Signed-off-by: Jonas <[email protected]>
ca3c11b
to
aa7febf
Compare
Fixes: #113
The implementation is not necessarily the most performant one… but using the services of Collectives that already are at hand.