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

Fix gateway detail redirect #1144

Closed
wants to merge 46 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
16ecb6d
Merge pull request #581 from bcgov/dev
ikethecoder Sep 30, 2022
9759c11
Merge pull request #605 from bcgov/dev
ikethecoder Oct 19, 2022
d4be57f
Merge pull request #611 from bcgov/dev
ikethecoder Oct 19, 2022
7e4d1a9
Merge pull request #616 from bcgov/dev
ikethecoder Oct 25, 2022
671b218
Merge pull request #623 from bcgov/dev
ikethecoder Oct 29, 2022
ff834c2
Merge pull request #670 from bcgov/dev
ikethecoder Dec 30, 2022
cbcac10
Merge pull request #677 from bcgov/dev
ikethecoder Jan 3, 2023
67b941a
Merge pull request #681 from bcgov/dev
ikethecoder Jan 4, 2023
110e90f
Merge pull request #688 from bcgov/dev
ikethecoder Jan 6, 2023
c1b20be
Merge pull request #691 from bcgov/dev
ikethecoder Jan 6, 2023
d89cd92
Merge pull request #704 from bcgov/dev
ikethecoder Jan 10, 2023
5303314
Merge pull request #706 from bcgov/dev
ikethecoder Jan 11, 2023
2cbdd3e
Merge pull request #707 from bcgov/dev
ikethecoder Jan 11, 2023
d0d8ab2
Merge pull request #723 from bcgov/dev
ikethecoder Jan 20, 2023
89e4bf4
Merge pull request #759 from bcgov/dev
ikethecoder Feb 22, 2023
bed9a70
Merge pull request #763 from bcgov/dev
ikethecoder Feb 22, 2023
e3bf9bb
Merge pull request #774 from bcgov/dev
ikethecoder Mar 9, 2023
c227da7
Merge pull request #778 from bcgov/dev
ikethecoder Mar 12, 2023
fe74bcd
Merge pull request #782 from bcgov/dev
ikethecoder Mar 14, 2023
f4a6ff0
Merge pull request #807 from bcgov/dev
ikethecoder May 17, 2023
13035f4
Merge pull request #820 from bcgov/dev
ikethecoder May 18, 2023
b236ea7
Merge pull request #826 from bcgov/dev
ikethecoder Jun 8, 2023
42cfcc7
Merge pull request #835 from bcgov/dev
ikethecoder Jun 12, 2023
9301fd1
Merge pull request #849 from bcgov/dev
ikethecoder Jul 12, 2023
a09f38c
Merge pull request #897 from bcgov/dev
ikethecoder Sep 8, 2023
359f97c
Merge pull request #907 from bcgov/dev
ikethecoder Sep 15, 2023
3077112
Merge pull request #914 from bcgov/dev
ikethecoder Sep 18, 2023
d6f212a
Merge pull request #955 from bcgov/dev
Elson9 Nov 7, 2023
336178f
Merge pull request #959 from bcgov/dev
ikethecoder Nov 8, 2023
29fbea3
Merge pull request #963 from bcgov/dev
ikethecoder Dec 5, 2023
a070d5f
Merge pull request #971 from bcgov/dev
ikethecoder Dec 6, 2023
c3d417a
Merge branch 'dev' into test
ikethecoder Dec 18, 2023
bd8e74f
Merge branch 'dev' into test
ikethecoder Dec 28, 2023
859778b
Merge pull request #999 from bcgov/dev
rustyjux Mar 1, 2024
e67727f
Merge pull request #1004 from bcgov/dev
ikethecoder Mar 6, 2024
2e40387
Merge pull request #1008 from bcgov/dev
ikethecoder Mar 7, 2024
7b1cf07
Merge pull request #1030 from bcgov/dev
ikethecoder Apr 11, 2024
e6f4b9b
Merge pull request #1035 from bcgov/dev
ikethecoder Apr 12, 2024
e61cbee
Merge pull request #1040 from bcgov/dev
ikethecoder Apr 15, 2024
a9958fd
Merge pull request #1042 from bcgov/dev
rustyjux Apr 16, 2024
12edc4b
Merge pull request #1055 from bcgov/dev
ikethecoder May 24, 2024
b902ab0
Merge pull request #1134 from bcgov/dev
rustyjux Aug 15, 2024
4c25e6d
isolate test to check redirect
rustyjux Aug 19, 2024
80ca09d
add return null
rustyjux Aug 19, 2024
01a526e
remove extra tests
rustyjux Aug 19, 2024
ee7bdef
scroll to top of details on nav from /list
rustyjux Aug 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion e2e/cypress/tests/20-gateways/01-list.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { report } from 'process'
import NameSpacePage from '../../pageObjects/namespace'
let gateways: any

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const NoGatewayRedirect = () => {
router.push('/manager/gateways/list');
}
}, [hasNamespace]);
return null
};

export default NoGatewayRedirect;
3 changes: 3 additions & 0 deletions src/nextapp/pages/manager/gateways/detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ const NamespacesPage: React.FC = () => {
text: 'Your Organization and Business Unit will appear here',
};
}, [namespace]);
useEffect(() => {
window.scrollTo(0, 0);
}, []);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change is to avoid the /detail page loading scrolled down when navigated to from /list if the user has scrolled down there. Maintaining scroll is noticeable and problematic for users on smaller displays.

We could add namespace as a dependency in order to also scroll to top when changing GW using the dropdown. However, this also causes scroll to top when going back from /manager page, which seems undesirable.

In newer versions of NextJS, the default option for router.push is scroll to top (and one can easily modify it for each call) but that's a much bigger can of worms.

const handleDelete = React.useCallback(async () => {
if (user?.namespace) {
toast({
Expand Down
Loading