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

Optimize dev views #3838

Merged
merged 2 commits into from
Sep 28, 2023
Merged

Optimize dev views #3838

merged 2 commits into from
Sep 28, 2023

Conversation

manuelmeister
Copy link
Member

@manuelmeister manuelmeister commented Sep 23, 2023

What has been done in this PR:

  • require authentication for the dev views (it is needed anyway, because we don't have a writable endpoint without login)

  • reduce code duplication in controls (make manual testing more systematic)

  • use performance instead of Date to measure time in /performance (use browser api which is intended for performance measuring)

Next we should decide which endpoint we could use. (Some ideas: #3609 (comment))

This PR does not include the endpoint changes. This should be done in a next pr.

@manuelmeister manuelmeister added the deploy! Creates a feature branch deployment for this PR label Sep 23, 2023
@manuelmeister manuelmeister temporarily deployed to feature-branch September 23, 2023 18:35 — with GitHub Actions Inactive
@github-actions
Copy link

github-actions bot commented Sep 23, 2023

Feature branch deployment currently inactive.

If the PR is still open, you can add the deploy! label to this PR to trigger a feature branch deployment.

@manuelmeister manuelmeister temporarily deployed to feature-branch September 23, 2023 18:36 — with GitHub Actions Inactive
Copy link
Contributor

@BacLuc BacLuc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as i understood from the code, you did the following:

  1. require authentication for the dev views
  2. reduce code duplication in controls
  3. use performance instead of Date to measure time in /performance

@@ -391,10 +122,115 @@ export default {
selectValue: null,
dateValue: '2020-01-01',
timeValue: '2020-01-01T14:45:00+00:00',

headers: [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are the headers in data?
they don't change, don't they? -> they could be a computed value, which would be cached
but i don't know the best practice here.
https://stackoverflow.com/questions/50536254/vue-js-referencing-constants-in-data

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a config array for the datatable and is best practice. A computed value is only needed if it depends on other props/data and should be recomputed if at least one of the dependencies change. As you can see below for the items array (for instance the this.textfieldValue in the id: 'text-field' items).

Comment on lines +82 to +84
direction: rtl;
span {
direction: ltr;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks strange, why do we need rtl, and then switch back to ltr in the inner span?
isn't this just right text alignment?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ensures that the column heading text is aligned to the right (just like the content), and the up/down arrow is on the left side.

@manuelmeister
Copy link
Member Author

@BacLuc thanks for the description. Initially this was together with #3824. But then I decided to split it, and sadly did not explain better.

Copy link
Member

@usu usu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rest looks good to me, thanks

frontend/src/views/dev/Performance.vue Show resolved Hide resolved
@usu usu enabled auto-merge September 28, 2023 18:31
@manuelmeister manuelmeister temporarily deployed to feature-branch September 28, 2023 18:34 — with GitHub Actions Inactive
@usu usu added this pull request to the merge queue Sep 28, 2023
Merged via the queue into ecamp:devel with commit 605efd8 Sep 28, 2023
24 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deploy! Creates a feature branch deployment for this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants