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: Flow main layout #2662

Merged
merged 12 commits into from
Aug 27, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void test_role_allowed() {

AvailableViewInfo config = new AvailableViewInfo("Test",
new String[] { "ROLE_ADMIN" }, false, "/test", false, false,
null, null, null);
null, null, null, false);
routeUtil.setRoutes(Collections.singletonMap("/test", config));

Assert.assertTrue("Route should be allowed for ADMIN role.",
Expand All @@ -52,7 +52,7 @@ public void test_role_not_allowed() {

AvailableViewInfo config = new AvailableViewInfo("Test",
new String[] { "ROLE_ADMIN" }, false, "/test", false, false,
null, null, null);
null, null, null, false);
routeUtil.setRoutes(Collections.singletonMap("/test", config));

Assert.assertFalse("USER role should not allow ADMIN route.",
Expand All @@ -67,7 +67,7 @@ public void test_login_required() {
request.setUserPrincipal(Mockito.mock(Principal.class));

AvailableViewInfo config = new AvailableViewInfo("Test", null, true,
"/test", false, false, null, null, null);
"/test", false, false, null, null, null, false);
routeUtil.setRoutes(Collections.singletonMap("/test", config));

Assert.assertTrue("Request with user principal should be allowed",
Expand All @@ -82,7 +82,7 @@ public void test_login_required_failed() {
request.setUserPrincipal(null);

AvailableViewInfo config = new AvailableViewInfo("Test", null, true,
"/test", false, false, null, null, null);
"/test", false, false, null, null, null, false);
routeUtil.setRoutes(Collections.singletonMap("/test", config));

Assert.assertFalse("No login should be denied access",
Expand All @@ -97,11 +97,11 @@ public void test_login_required_on_layout() {
request.setUserPrincipal(null);

AvailableViewInfo pageWithoutLogin = new AvailableViewInfo("Test Page",
null, false, "/test", false, false, null, null, null);
null, false, "/test", false, false, null, null, null, false);

AvailableViewInfo layoutWithLogin = new AvailableViewInfo("Test Layout",
null, true, "", false, false, null,
Collections.singletonList(pageWithoutLogin), null);
Collections.singletonList(pageWithoutLogin), null, false);
routeUtil.setRoutes(Map.ofEntries(entry("/test", pageWithoutLogin),
entry("", layoutWithLogin)));

Expand All @@ -118,11 +118,11 @@ public void test_login_required_on_page() {
request.setUserPrincipal(null);

AvailableViewInfo pageWithLogin = new AvailableViewInfo("Test Page",
null, true, "/test", false, false, null, null, null);
null, true, "/test", false, false, null, null, null, false);

AvailableViewInfo layoutWithoutLogin = new AvailableViewInfo(
"Test Layout", null, false, "", false, false, null,
Collections.singletonList(pageWithLogin), null);
Collections.singletonList(pageWithLogin), null, false);
routeUtil.setRoutes(Map.ofEntries(entry("/test", pageWithLogin),
entry("", layoutWithoutLogin)));

Expand All @@ -142,7 +142,7 @@ public void test_login_not_required_on_root() {
request.setUserPrincipal(null);

AvailableViewInfo config = new AvailableViewInfo("Root", null, false,
"", false, false, null, null, null);
"", false, false, null, null, null, false);
routeUtil.setRoutes(Collections.singletonMap("", config));

Assert.assertTrue("Login no required should allow access",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"route": "/foo",
"lazy": false,
"register": false,
"menu": null
"menu": null,
"flowLayout":false
},
"/bar": {
"params": {},
Expand All @@ -17,7 +18,8 @@
"route": "/bar",
"lazy": false,
"register": false,
"menu": null
"menu": null,
"flowLayout":false
},
"/home": {
"params": {},
Expand All @@ -27,7 +29,8 @@
"route": "/home",
"lazy": false,
"register": false,
"menu": null
"menu": null,
"flowLayout":false
},
"/wildcard": {
"params": {
Expand All @@ -39,7 +42,8 @@
"route": "/wildcard",
"lazy": false,
"register": false,
"menu": null
"menu": null,
"flowLayout":false
},
"/comments": {
"params": {
Expand All @@ -51,7 +55,8 @@
"route": "/comments",
"lazy": false,
"register": false,
"menu": null
"menu": null,
"flowLayout":false
},
"/profile": {
"params": {},
Expand All @@ -64,7 +69,8 @@
"route": "/profile",
"lazy": false,
"register": false,
"menu": null
"menu": null,
"flowLayout":false
},
"/": {
"params": {},
Expand All @@ -74,7 +80,8 @@
"route": "/",
"lazy": false,
"register": false,
"menu": null
"menu": null,
"flowLayout":false
},
"/orders": {
"params": {},
Expand All @@ -84,6 +91,7 @@
"route": "/orders",
"lazy": false,
"register": false,
"menu": null
"menu": null,
"flowLayout":false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"route": "/home",
"lazy": false,
"register": false,
"menu": null
"menu": null,
"flowLayout":false
},
"/foo": {
"params": {},
Expand All @@ -17,7 +18,8 @@
"route": "/foo",
"lazy": false,
"register": false,
"menu": null
"menu": null,
"flowLayout":false
},
"/wildcard": {
"params": {
Expand All @@ -29,7 +31,8 @@
"route": "/wildcard",
"lazy": false,
"register": false,
"menu": null
"menu": null,
"flowLayout":false
},
"/bar": {
"params": {},
Expand All @@ -39,7 +42,8 @@
"route": "/bar",
"lazy": false,
"register": false,
"menu": null
"menu": null,
"flowLayout":false
},
"/comments": {
"params": {
Expand All @@ -51,7 +55,8 @@
"route": "/comments",
"lazy": false,
"register": false,
"menu": null
"menu": null,
"flowLayout":false
},
"/": {
"params": {},
Expand All @@ -61,7 +66,8 @@
"route": "/",
"lazy": false,
"register": false,
"menu": null
"menu": null,
"flowLayout":false
},
"/orders": {
"params": {},
Expand All @@ -71,6 +77,7 @@
"route": "/orders",
"lazy": false,
"register": false,
"menu": null
"menu": null,
"flowLayout":false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"route": "/foo",
"lazy": false,
"register": false,
"menu": null
"menu": null,
"flowLayout":false
},
"/bar": {
"params": {},
Expand All @@ -17,7 +18,8 @@
"route": "/bar",
"lazy": false,
"register": false,
"menu": null
"menu": null,
"flowLayout":false
},
"/home": {
"params": {},
Expand All @@ -27,7 +29,8 @@
"route": "/home",
"lazy": false,
"register": false,
"menu": null
"menu": null,
"flowLayout":false
},
"/wildcard": {
"params": {
Expand All @@ -39,7 +42,8 @@
"route": "/wildcard",
"lazy": false,
"register": false,
"menu": null
"menu": null,
"flowLayout":false
},
"/comments": {
"params": {
Expand All @@ -51,7 +55,8 @@
"route": "/comments",
"lazy": false,
"register": false,
"menu": null
"menu": null,
"flowLayout":false
},
"/profile": {
"params": {},
Expand All @@ -64,7 +69,8 @@
"route": "/profile",
"lazy": false,
"register": false,
"menu": null
"menu": null,
"flowLayout":false
},
"/": {
"params": {},
Expand All @@ -74,7 +80,8 @@
"route": "/",
"lazy": false,
"register": false,
"menu": null
"menu": null,
"flowLayout":false
},
"/orders": {
"params": {},
Expand All @@ -84,6 +91,7 @@
"route": "/orders",
"lazy": false,
"register": false,
"menu": null
"menu": null,
"flowLayout":false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"route": "/home",
"lazy": false,
"register": false,
"menu": null
"menu": null,
"flowLayout":false
},
"/profile": {
"params": {},
Expand All @@ -20,7 +21,8 @@
"route": "/profile",
"lazy": false,
"register": false,
"menu": null
"menu": null,
"flowLayout":false
},
"/": {
"params": {},
Expand All @@ -30,7 +32,8 @@
"route": "/",
"lazy": false,
"register": false,
"menu": null
"menu": null,
"flowLayout":false
},
"/orders": {
"params": {},
Expand All @@ -40,6 +43,7 @@
"route": "/orders",
"lazy": false,
"register": false,
"menu": null
"menu": null,
"flowLayout":false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"route": "/foo",
"lazy": false,
"register": false,
"menu": null
"menu": null,
"flowLayout":false
},
"/bar": {
"params": {},
Expand All @@ -17,7 +18,8 @@
"route": "/bar",
"lazy": false,
"register": false,
"menu": null
"menu": null,
"flowLayout":false
},
"/home": {
"params": {},
Expand All @@ -27,7 +29,8 @@
"route": "/home",
"lazy": false,
"register": false,
"menu": null
"menu": null,
"flowLayout":false
},
"/comments": {
"params": {
Expand All @@ -39,7 +42,8 @@
"route": "/comments",
"lazy": false,
"register": false,
"menu": null
"menu": null,
"flowLayout":false
},
"/wildcard": {
"params": {
Expand All @@ -51,7 +55,8 @@
"route": "/wildcard",
"lazy": false,
"register": false,
"menu": null
"menu": null,
"flowLayout":false
},
"/profile": {
"params": {},
Expand All @@ -64,6 +69,7 @@
"route": "/profile",
"lazy": false,
"register": false,
"menu": null
"menu": null,
"flowLayout":false
}
}
Loading