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

Feat: Redirect /list to /dashboard for non-mobile users #4492

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

NihadBadalov
Copy link

@NihadBadalov NihadBadalov commented Feb 14, 2024

⚠️⚠️⚠️ Since we do not accept all types of pull requests and do not want to waste your time. Please be sure that you have read pull request rules:
https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md#can-i-create-a-pull-request-for-uptime-kuma

Tick the checkbox if you understand [x]:

  • I have read and understand the pull request rules.

Description

Fixes #359

Type of change

Please delete any options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • Other

Checklist

  • My code follows the style guidelines of this project
  • I ran ESLint and other linters for modified files
  • I have performed a self-review of my own code and tested it
  • I have commented my code, particularly in hard-to-understand areas (including JSDoc for methods)
  • My changes generates no new warnings
  • My code needed automated testing. I have added them (this is optional task)

Screenshots (if any)

None

@CommanderStorm CommanderStorm changed the title Feat: Redirect /link to /dashboard for non-mobile users Feat: Redirect /link to /dashboard for non-mobile users Feb 14, 2024
@CommanderStorm CommanderStorm changed the title Feat: Redirect /link to /dashboard for non-mobile users Feat: Redirect /list to /dashboard for non-mobile users Feb 14, 2024
src/pages/List.vue Outdated Show resolved Hide resolved
src/pages/List.vue Outdated Show resolved Hide resolved
src/pages/List.vue Outdated Show resolved Hide resolved
src/pages/List.vue Outdated Show resolved Hide resolved
src/mixins/mobile.js Outdated Show resolved Hide resolved
@CommanderStorm CommanderStorm marked this pull request as draft February 15, 2024 00:52
@CommanderStorm CommanderStorm added the question Further information is requested label Feb 15, 2024
@NihadBadalov NihadBadalov marked this pull request as ready for review February 15, 2024 08:06
@NihadBadalov
Copy link
Author

@CommanderStorm Reverted changes to the mobile mixin and corrected the redirect. Haven't ever used Vue - thanks for the help!

@NihadBadalov
Copy link
Author

Forgot to previously push the changes in the commit 8389f7c. Ready for review now

Copy link
Collaborator

@CommanderStorm CommanderStorm left a comment

Choose a reason for hiding this comment

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

Above when I was taking about

I think it would run during the init options api, but not when the browser changes its width => f.ex. gets larger
=> moving this logic to onResize() seems like a better choice

I was thinking about this case:

Recording 2024-02-17 at 16 04 09

=> is there a reason to keep this in the List.vue and not move it to onResize?

@NihadBadalov
Copy link
Author

NihadBadalov commented Feb 17, 2024

@CommanderStorm Do you mean we should check inside onResize whether we are in /list or /dashboard and redirect to the right one based on the page width?

@CommanderStorm
Copy link
Collaborator

That would be my idea.
An alternative approach would be registering+ de-registering an event listener in the mounted/.. lifecycle hooks.

@CommanderStorm CommanderStorm removed the question Further information is requested label Feb 17, 2024
@chakflying
Copy link
Collaborator

/dashboard itself is a valid page on mobile. I think the only case we need to handle is this:

  • On mobile view, route /list -> resize window to desktop -> redirect to /dashboard

The reverse does not need to happen.

@CommanderStorm CommanderStorm added the area:dashboard The main dashboard page where monitors' status are shown label Apr 3, 2024
@CommanderStorm CommanderStorm added the needs:review this PR needs a review by maintainers or other community members label May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:dashboard The main dashboard page where monitors' status are shown needs:review this PR needs a review by maintainers or other community members
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Route /list does not work with responsive UI
3 participants