- A checkbox per row the caller may change; select-all covers only the rows the current filter and search show, and is indeterminate on a partial selection. - Your own row and rows you cannot change show a disabled box whose label gives the reason. - Changing the filter or the search clears the selection and says so in a live region (decided 2026-10-06), so no hidden row stays selected. - The bulk bar appears at one or more selected rows and is hidden (out of the tab order) at zero. Actions arrive in T12.3. - Selection is updated in place, not by re-rendering, so focus stays on the checkbox just used. One delegated listener; no ids in inline handlers. - The email-width rule now targets td.ell, not nth-child(3), which the new column would have shifted. Checked in a DOM harness (jsdom) against the real page and scripts: 14/14; against main the selection checks fail. Browser probe at 390px/1440px follows in T12.6.
164 lines
8.1 KiB
HTML
164 lines
8.1 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>User Directory — Work Package Suite</title>
|
|
<script src="auth-guard.js"></script>
|
|
<!-- Date/number formatting. Must parse BEFORE the app scripts: they format
|
|
timestamps during their own boot. -->
|
|
<script src="wp-format.js"></script>
|
|
<!-- Addressable state (S3). Parses before the app scripts, which read the URL
|
|
during their own boot. -->
|
|
<script src="wp-url.js"></script>
|
|
<link rel="icon" href="favicon.ico" sizes="any">
|
|
<link rel="manifest" href="manifest.webmanifest">
|
|
<meta name="theme-color" content="#161616">
|
|
<link rel="stylesheet" href="theme-light.css">
|
|
<link rel="stylesheet" href="wp-chrome.css">
|
|
<link rel="stylesheet" href="console.css">
|
|
<link rel="stylesheet" href="wp-sidenav.css">
|
|
<style>
|
|
/* Page-specific only — everything structural is in console.css.
|
|
|
|
The directory is one wide table, so the column exceptions live here: email is
|
|
the one cell long enough to stretch a row, and the two role dropdowns need
|
|
room for "Assistant Project Manager" without pushing Actions off screen. */
|
|
/* The email cell, by its class: CR-020's selection column moved it from third to
|
|
fourth on the managers' table, and a position-based rule would have followed
|
|
the wrong column. */
|
|
#users-table table td.ell{ max-width:230px; overflow:hidden; text-overflow:ellipsis; }
|
|
#users-banner:not(:empty), #scope-banner:not(:empty){ margin-bottom:var(--s3); }
|
|
#nu-projects{ margin-top:var(--s2); }
|
|
#nu-projects .pickrow{ padding:var(--s1) var(--s1); }
|
|
/* A manager with one project doesn't need a scrolling picker; a manager with
|
|
thirty does, and it must not push the Create button below the fold. */
|
|
#nu-project-list{ max-height:200px; overflow:auto; border:1px solid var(--border); }
|
|
.whoami-chip{ font-size:12px; color:var(--muted); }
|
|
.whoami-chip strong{ color:var(--text); }
|
|
|
|
/* CR-020: row selection and the bulk bar. Tokens only (the token rule). */
|
|
#sel-banner:not(:empty), #bulk-banner:not(:empty){ margin-bottom:var(--s3); }
|
|
#bulk-banner ul{ margin:var(--s1) 0 0; padding-left:var(--s5); font-weight:400; }
|
|
table.grid th.selcell, table.grid td.selcell{ width:1%; padding:0 var(--s1); text-align:center; }
|
|
/* The label is the hit area: the 16px box alone is under the 24px floor. */
|
|
.selhit{ display:inline-flex; align-items:center; justify-content:center;
|
|
min-width:28px; min-height:28px; cursor:pointer; }
|
|
.selhit input{ width:16px; height:16px; margin:0; accent-color:var(--accent); cursor:pointer; }
|
|
.selhit input:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }
|
|
.selhit input:disabled{ cursor:default; }
|
|
/* Not --accent-soft: that is the admin pill's own fill (console.css, hover note). */
|
|
table.grid tbody tr.is-selected td{ background:var(--cds-layer-selected); }
|
|
table.grid tbody tr.is-selected td.selcell{ box-shadow:inset 3px 0 0 var(--accent); }
|
|
.bulkbar{ border:1px solid var(--accent); border-left:3px solid var(--accent);
|
|
background:var(--surface); padding:var(--s2) var(--s3); margin:0 0 var(--s3); }
|
|
.bulkbar[hidden]{ display:none; }
|
|
.bulkhead{ display:flex; align-items:center; justify-content:space-between; gap:var(--s2);
|
|
flex-wrap:wrap; margin-bottom:var(--s2); }
|
|
.bulkgroup{ display:flex; flex-wrap:wrap; align-items:center; gap:var(--s2);
|
|
padding:var(--s2) 0; border-top:1px solid var(--border); }
|
|
.bulkgroup > .bulklabel{ font-size:12px; font-weight:600; color:var(--muted); min-width:110px; }
|
|
.bulkgroup select{ height:var(--ctl); padding:0 var(--s1) 0 var(--s2); font:inherit; font-size:13px;
|
|
border:1px solid var(--border-strong); border-radius:0; background:var(--surface); color:var(--text);
|
|
max-width:100%; }
|
|
.bulkgroup select:focus-visible{ outline:2px solid var(--accent); outline-offset:-2px; }
|
|
/* The bulk delete dialog lists every affected username; a long list scrolls
|
|
inside the dialog instead of pushing its buttons off the screen. */
|
|
#wp-dlg-msg{ max-height:50vh; overflow:auto; }
|
|
@media (max-width:620px){
|
|
.bulkgroup > .bulklabel{ min-width:0; flex:1 1 100%; }
|
|
.bulkgroup select, .bulkgroup button{ flex:1 1 100%; }
|
|
}
|
|
@media (pointer:coarse){
|
|
.selhit{ min-width:44px; min-height:44px; }
|
|
.bulkbar button, .bulkgroup select{ min-height:44px; }
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<!-- SHARED DARK APP BAR -->
|
|
<header class="wp-appbar">
|
|
<a href="index.html" class="wp-appbar-brand" title="Back to site">
|
|
<span class="wp-logo-chip"><img src="prime-controls-logo.jpg" alt="Prime Controls"></span>
|
|
<span class="wp-appbar-title">Work Package Suite <span class="wp-appbar-sub">| User Directory</span></span>
|
|
</a>
|
|
</header>
|
|
|
|
<div class="wrap" id="users-main" style="display:none">
|
|
<div class="row" style="justify-content:space-between; margin-bottom:var(--s5)">
|
|
<div>
|
|
<h1>User Directory</h1>
|
|
<div class="sub" style="margin:0" id="dir-sub">The people on your projects — who they are, and how to reach them.</div>
|
|
</div>
|
|
<div class="row"><a class="home" href="index.html">← Site</a></div>
|
|
</div>
|
|
|
|
<!-- WHAT YOU MAY DO HERE (rendered from GET /api/auth/user-scope) -->
|
|
<div id="scope-banner"></div>
|
|
|
|
<!-- THE DIRECTORY -->
|
|
<div class="card">
|
|
<h2>People</h2>
|
|
<div class="sub" id="people-sub"></div>
|
|
<div class="toolbar">
|
|
<button onclick="loadUsers()">Refresh</button>
|
|
<input id="user-search" placeholder="Search name / username / email / job function…" oninput="filterChanged()"
|
|
aria-label="Search the directory">
|
|
<select id="user-filter" onchange="filterChanged()" aria-label="Show">
|
|
<option value="">Everyone</option>
|
|
<option value="active">Active only</option>
|
|
<option value="disabled">Disabled only</option>
|
|
<option value="mine">Accounts I manage</option>
|
|
</select>
|
|
</div>
|
|
<div id="users-banner"></div>
|
|
<!-- CR-020: bulk actions on the selected rows. Present only while at least one
|
|
row is selected (the hidden attribute also takes it out of the tab order). -->
|
|
<div id="bulk-bar" class="bulkbar" role="region" aria-label="Bulk actions on the selected users" hidden>
|
|
<div class="bulkhead">
|
|
<strong id="bulk-count">0 selected</strong>
|
|
<button type="button" onclick="clearSelection(true)">Clear selection</button>
|
|
</div>
|
|
<div id="bulk-actions"></div>
|
|
</div>
|
|
<div id="sel-banner"></div>
|
|
<div id="bulk-banner"></div>
|
|
<div id="users-table"><div class="note">Loading…</div></div>
|
|
</div>
|
|
|
|
<!-- ADD A USER (managers only; hidden otherwise) -->
|
|
<div class="card" id="create-card" style="display:none">
|
|
<h2>Add a user</h2>
|
|
<div class="sub" id="create-sub"></div>
|
|
<div class="urow">
|
|
<input id="nu-username" placeholder="Username *" autocomplete="off"
|
|
title="Must exactly match this person's Okta sign-in identity — that's how their first Okta sign-in finds this account instead of creating a second one.">
|
|
<input id="nu-fullname" placeholder="Full name" autocomplete="off">
|
|
<input id="nu-email" placeholder="Email" autocomplete="off">
|
|
<select id="nu-role" title="Permissions — what this account may do"></select>
|
|
<select id="nu-project-role" title="Job function on the project"></select>
|
|
</div>
|
|
<div id="nu-projects">
|
|
<div class="note" id="nu-projects-label" style="margin-bottom:var(--s1)"></div>
|
|
<div id="nu-project-list"></div>
|
|
</div>
|
|
<div class="row" style="margin-top:var(--s3)">
|
|
<button class="primary" onclick="createUser()">Create user</button>
|
|
<span id="users-create-msg" class="note" style="margin:0"></span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script src="console-util.js"></script>
|
|
<script src="wp-dialog.js"></script>
|
|
<script src="users.js"></script>
|
|
<!-- The app bar's project switcher reads ProjectData; without this the bar on this
|
|
page could never show a project and always read "Select a project" (F1). Must
|
|
parse before wp-chrome.js, which reads it as it mounts. -->
|
|
<script src="project-data.js"></script>
|
|
<script src="wp-chrome.js"></script>
|
|
<script src="wp-sidenav.js"></script>
|
|
</body>
|
|
</html>
|