Lanna Desk: logo, a public page at /, the back office at /desk, full sign-out
Logo: a Lanna gable whose crossed kalae horns stand over a desk, gold on navy, with "Lanna Desk" and "Visas · stays · contracts" in Sarabun drawn as outlines. static/brand/ has the mark, the logo for light and for dark backgrounds and a one-color version; scripts/gen_logo.py makes them, the favicon and the header's mark from forms/fonts/Sarabun-Bold/SemiBold (SIL Open Font License, next to the Regular already there). `/` is now lannadesk.com's public page (templates/landing.html, static/landing.css): what Lanna Desk takes care of, how a client starts (write, open the link, sign first, we keep the dates), how the data is kept, contact@lannadesk.com and "Staff sign-in". It needs no session and shows no records. The back office's first page, the deadlines, moves to `/desk` (web::HOME): the header, the nav, the filter, the login's default target and the messages' links follow. Signing out now ends the session at id.cnx.network too. Kanidm names no end_session_endpoint, but its GET /ui/logout ends the session and clears its cookies (SameSite=Lax, so they come along on a top-level navigation). The logout form may only lead to this site (CSP form-action 'self'), so /signed-out sends the browser on with a refresh and offers the link as well; providers that are not Kanidm keep the old page. Checks: fmt, clippy, 109 unit and 57 integration tests (the public page open and free of records, /desk behind the sign-in, the sign-out page leading to the provider); the page at 1280 and 390 px; the header's mark in both themes; the style check on the README, PLAN and the page.
This commit is contained in:
1 parent
e5e30c977c
commit
eafe918bcc
22 files changed
+639
-44
No files matched your search
+33
-1
@@ -36,7 +36,39 @@ async fn the_gate_sends_people_to_the_login(pool: PgPool) {
|
||||
assert_eq!(app.get("/healthz").await.status, StatusCode::OK);
|
||||
assert_eq!(app.get("/version").await.status, StatusCode::OK);
|
||||
assert_eq!(app.get("/static/app.css").await.status, StatusCode::OK);
|
||||
assert_eq!(app.get("/signed-out").await.status, StatusCode::OK);
|
||||
// after signing out the browser goes on to Kanidm's own sign-out, so
|
||||
// the next sign-in asks for the password again
|
||||
let r = app.get("/signed-out").await;
|
||||
assert_eq!(r.status, StatusCode::OK);
|
||||
let t = r.text();
|
||||
assert!(
|
||||
t.contains(r#"<meta http-equiv="refresh" content="0;url=https://id.test/ui/logout">"#)
|
||||
|| t.contains(r#"content="0;url=https://id.test/ui/logout""#),
|
||||
"{t}"
|
||||
);
|
||||
assert!(t.contains("Sign out of id.cnx.network"), "{t}");
|
||||
// the public page is open; the back office behind it is not
|
||||
let r = app.get("/").await;
|
||||
assert_eq!(r.status, StatusCode::OK);
|
||||
let t = r.text();
|
||||
assert!(
|
||||
t.contains("Lanna Desk") && t.contains("mailto:contact@lannadesk.com"),
|
||||
"{t}"
|
||||
);
|
||||
assert!(
|
||||
t.contains("href=\"/desk\" id=\"staff\">Staff sign-in"),
|
||||
"{t}"
|
||||
);
|
||||
assert!(!t.contains("Deadlines") && !t.contains("MUSTERMANN"), "{t}");
|
||||
assert_eq!(app.get("/static/landing.css").await.status, StatusCode::OK);
|
||||
assert_eq!(
|
||||
app.get("/static/brand/lannadesk-logo-dark.svg")
|
||||
.await
|
||||
.status,
|
||||
StatusCode::OK
|
||||
);
|
||||
let r = app.get("/desk").await;
|
||||
assert_eq!(r.location(), "/login?next=/desk");
|
||||
// the provider has not answered yet
|
||||
assert_eq!(
|
||||
app.get("/login").await.status,
|
||||
|
||||
+2
-2
@@ -19,7 +19,7 @@ async fn the_demo_people_show_every_kind_of_deadline(pool: PgPool) {
|
||||
visa::seed::demo(&pool, visa::dates::today()).await.unwrap();
|
||||
let app = local(pool.clone());
|
||||
|
||||
let r = app.get("/").await;
|
||||
let r = app.get("/desk").await;
|
||||
assert_eq!(r.status, StatusCode::OK);
|
||||
let page = r.text();
|
||||
for expect in [
|
||||
@@ -74,7 +74,7 @@ async fn the_demo_people_show_every_kind_of_deadline(pool: PgPool) {
|
||||
.fetch_one(&pool)
|
||||
.await
|
||||
.unwrap();
|
||||
let only = app.get(&format!("/?company={company}")).await.text();
|
||||
let only = app.get(&format!("/desk?company={company}")).await.text();
|
||||
assert!(only.contains("NOVAK, Tomas") && !only.contains("MUSTERMANN"));
|
||||
}
|
||||
|
||||
|
||||
+11
-4
@@ -87,10 +87,13 @@ async fn every_page_renders_with_demo_data(pool: PgPool) {
|
||||
.unwrap();
|
||||
|
||||
let mut pages = vec![
|
||||
("/".to_string(), "90-day report".to_string()),
|
||||
("/?all=1".to_string(), "Only the next 90 days".to_string()),
|
||||
("/desk".to_string(), "90-day report".to_string()),
|
||||
(
|
||||
format!("/?company={company}"),
|
||||
"/desk?all=1".to_string(),
|
||||
"Only the next 90 days".to_string(),
|
||||
),
|
||||
(
|
||||
format!("/desk?company={company}"),
|
||||
"MUSTERMANN, Erika".to_string(),
|
||||
),
|
||||
(
|
||||
@@ -260,9 +263,13 @@ async fn open_paths_headers_and_not_found(pool: PgPool) {
|
||||
assert_eq!(icon.status, StatusCode::OK);
|
||||
assert_eq!(icon.headers["content-type"], "image/svg+xml");
|
||||
|
||||
let r = app.get("/").await;
|
||||
let r = app.get("/desk").await;
|
||||
assert_eq!(r.status, StatusCode::OK);
|
||||
assert!(r.text().contains("No people yet"));
|
||||
// `/` is the public page, the same signed in or not
|
||||
let r = app.get("/").await;
|
||||
assert_eq!(r.status, StatusCode::OK);
|
||||
assert!(r.text().contains("Visas, work permits and contracts"));
|
||||
|
||||
let r = app.get("/people/999999").await;
|
||||
assert_eq!(r.status, StatusCode::NOT_FOUND);
|
||||
|
||||
Reference in new issue
Block a user