Skip to content
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

Migrate app frontend to Vue #936

Merged
merged 17 commits into from
Jul 21, 2023
Merged

Migrate app frontend to Vue #936

merged 17 commits into from
Jul 21, 2023

Conversation

susnux
Copy link
Contributor

@susnux susnux commented Jul 11, 2023

Rewrite of the frontend code using Typescript + Vue and building with Vite.

Changes ✨

  • Rewrite using Vue instead of React
  • Loading a local log file is supported
  • Sorting log table by level, app or time
  • Filtering log table by search query (by default also listens on CTRL+F to block unified search (except when a11y shortcuts is configured).
  • Show raw log entries in details modal
  • Keep features of React version (copy entries (raw & formatted), exception parsing and displaying, multiple time display formats (raw, local style, UTC), etc.
  • 100% code coverage (unit tests) on logic (stores, utils).

Resolves 🐛

Screenshots 🖼️

what image
familiar ui look (tried to keep basic layout the same) image
proper action menu for copy and to open the details modal image
details modal for raw log entry or the full exception (incl. stack trace) image
consistent setting dialog image
local log files are possible to load image

Screen recording 📹

logreader.mp4

(Note that the local log file did not magically appear but the upload dialog was simply not part of the recorded window 😉 )

Done ✔️

  • Migrate build environment (configs etc)
  • Migrate log table
  • Logic for app settings
    • Backend API for settings and initial state
    • Frontend store
  • Logic for handling server logs
    • Parsing
    • Manually loading
    • Polling
  • Automatic loading of new / old log entries aka infinite scroll
  • Sorting the table
  • Searching and filtering the table
    • Replaces the not working search
  • Handling / Loading local log files
  • Add back the exception parser
  • Add back the exception component
  • Add tests
    • Backend changes
    • stores - unit tests
    • utils - unit tests

To do 🚧

  • Squash commits ⚠️

Follow Up

  • Use something like the RecycleScroller (Problem: Unknown height of elements if expanded).
  • Paste log entries
  • tfoot for "no more older entries"
  • Add more tests
    • Log table - unit tests
    • App - unit tests
    • Settings - unit tests
    • E2E Cypress

@codecov
Copy link

codecov bot commented Jul 12, 2023

Codecov Report

❗ No coverage uploaded for pull request base (master@42071b1). Click here to learn what that means.
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #936   +/-   ##
=========================================
  Coverage          ?   42.26%           
  Complexity        ?      139           
=========================================
  Files             ?       23           
  Lines             ?      601           
  Branches          ?       31           
=========================================
  Hits              ?      254           
  Misses            ?      347           
  Partials          ?        0           
Flag Coverage Δ
unit 19.86% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@icewind1991
Copy link
Member

Note that having the compiled files as .mjs breaks some setups that don't have a proper mimetype configured for that extension.

@susnux susnux marked this pull request as ready for review July 17, 2023 15:18
@susnux
Copy link
Contributor Author

susnux commented Jul 17, 2023

Note that having the compiled files as .mjs breaks some setups that don't have a proper mimetype configured for that extension.

For Apache server this is done automatically since Nextcloud 27 (nextcloud/server#36057 and nextcloud/server#38688) for Nginx this is also documented for Nextcloud 27 (nextcloud/documentation#10575). So as this targets Nextcloud 28 it should be "safe".

@szaimen

This comment was marked as resolved.

@susnux

This comment was marked as resolved.

susnux added 10 commits July 20, 2023 17:57
Reimplement frontend settings and log entry actions

* Move to `NcAppSettingsDialog`
* Make table header sticky
* Make table columns fixed width
* Add actions to rows
* Add modal to view raw data of log entry
* Add helpers and settings store
* Add store for fetching and polling log entries

Signed-off-by: Ferdinand Thiessen <[email protected]>
Signed-off-by: Ferdinand Thiessen <[email protected]>
…sing functions

* Allow polling (live log)
* Allow downloading log files
* Implement infinite scroll

Signed-off-by: Ferdinand Thiessen <[email protected]>
And fix handling quoted log entries when parsing a file (did not even work in React)

Signed-off-by: Ferdinand Thiessen <[email protected]>
Important: Note that the tests are run with timezone **not** set to UTC,
this allows to test if there is a difference between local TZ and UTC.

Signed-off-by: Ferdinand Thiessen <[email protected]>
…ts and parse even old exception types

Signed-off-by: Ferdinand Thiessen <[email protected]>
Signed-off-by: Ferdinand Thiessen <[email protected]>
* Use secondary button style for filtered columns
* Minor typo in dialog name
* Make table border and log level colors less annoying
* Add header to app
* Make `<hr>` look less bright
* Only try to load entries from server if file logging is enabled
* Clear local log entries when switching to server log
* Make filter button primary when active
* Add default name to downloaded log file
* Remove 'hide raw entry' button
* Datetime format on settings dialog
* LogDetailsModal should display the information in vertical list on mobile
* Move actions inside the details modal
* Add name to settings button
* Move copy actions in modal to the same row as the 'hide exception' button
* Make sure only the table is scrolled and the settings button is always displayed

Signed-off-by: Ferdinand Thiessen <[email protected]>
@susnux susnux force-pushed the feat/migrate-to-vue branch 2 times, most recently from f0dd06d to 4496515 Compare July 21, 2023 18:48
@susnux
Copy link
Contributor Author

susnux commented Jul 21, 2023

/compile amend

Signed-off-by: Ferdinand Thiessen <[email protected]>
Signed-off-by: nextcloud-command <[email protected]>
@susnux susnux merged commit 47fa999 into master Jul 21, 2023
33 checks passed
@delete-merged-branch delete-merged-branch bot deleted the feat/migrate-to-vue branch July 21, 2023 22:56
@github-actions
Copy link

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the reviewing process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR reviewing process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment