Skip to content

[v5] Add the Projects tab to the Admin page - #612

Merged
ldionne merged 6 commits into
users/ldionne/v5-projects-4-rename-movefrom
users/ldionne/v5-projects-5-admin-projects
Nov 3, 2026
Merged

ldionne merged 6 commits into
users/ldionne/v5-projects-4-rename-movefrom
users/ldionne/v5-projects-5-admin-projects

Conversation

@ldionne

@ldionne ldionne commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Add a Projects tab to the Admin page: list projects, create one, edit a
display name, rename a project, and delete one once it has no suites.
Controls the token doesn't allow are disabled, with the reason on hover.

No server change. Part of #594.

The Admin page gets a Projects tab (AD3), between API Keys and Test
Suites, kept in the URL as `tab=projects`. Until now, projects could only
be created, renamed and deleted through the API. This is step 5 of the
stack.

- "New project" takes a name and a display name. The name is checked as
  it is typed, against D7's rules and the existing projects, with AR11's
  red halo. The display name is trimmed, and sent as null when empty, as
  the schema editor sends a suite's (TS7). "Create project" needs an
  instance-wide `manage` key, and is disabled, saying why, until the
  projects have loaded, and while the name is empty or refused. On
  success the project joins the table, the form empties and the name
  takes the focus. A name taken meanwhile has the list fetched again, so
  that the check says so.
- The table lists every project, those without suites included, in
  AR22's order:
  - The name is edited in place (AR12) with the same check. Saving it
    renames the project, which needs an instance-wide key, once a plain
    confirmation (AR16) has warned that URLs, bookmarks and bots using
    the old name for any of its suites get a 404, and that API keys are
    unaffected.
  - The display name is edited in place too, without confirmation, and
    needs `manage` covering the project in full (I5).
  - The number of suites links to the project's suites (TS1).
  - Delete needs an instance-wide key. It is disabled, saying why, while
    the project has suites, and asks for a plain confirmation saying what
    deletion means for API keys. A project deleted elsewhere counts as
    deleted. Suites created in it meanwhile have the list fetched again,
    which disables the prompt's button.
- After a rename, the cached data of the project's suites goes, under
  the old name and under the new one, as does the list of API keys
  (AR16). The token is then checked again (AR17), and so it is after a
  deletion. The renamed row is a new one: its name's Edit button takes
  the focus once that check settles, or the table does if the button
  stays disabled. A deletion cancels a list of projects that is on its
  way, so that the list cannot bring the project back.
- A write naming a project deleted elsewhere, or giving a name taken
  there, has the list fetched again. That rule, already in the schema
  editor, is now one helper, `refetchProjectsIfOutdated`.
- `InlineEdit` takes an optional ref to its Edit button. `useRowConfirm`
  keeps `open` and `done` stable, so that a memoized table's columns can
  use them.
- "New suite" says to create a project in the Projects tab when there
  are none. `lnt v5 submit` and docs/v5_submit.rst point to the tab
  alongside `POST /api/projects`.
- Tests: 1771 client tests (projects-tab.test.tsx covers the form, the
  inline edits and their failures, deletion, gating, the cache and the
  focus), 151 e2e tests (a project created, renamed, edited and deleted
  from the tab, and a whole-project key that can only change its
  project's display name), and the lit test for the new `lnt v5 submit`
  message.

Part of #594.
@ldionne
ldionne added this pull request to stack #607 October 30, 2026 21:20
- Deleting a project now goes through `editProjects`, like creating,
  renaming and changing one, and like a suite's deletion: a list of
  projects on its way is cancelled, and asked for again once the project
  is out of the cache. `putProject` uses it too.
- When the project of an open Delete prompt goes from the list, deleted
  elsewhere, the prompt closes, and the table takes the focus only if it
  went down with the prompt (`useRowConfirm`'s new `close`). If the
  project was renamed instead, its new name's Edit button takes the
  focus, as after any rename.
- The renamed row's Edit button takes the focus through step 4's
  `useFocusOnceChecked`. A rename it is waiting for is dropped once the
  list no longer holds the new name, so that a project created later
  under it does not take the focus.
- "Rename or move" refetches the list only on `not_found` or
  `duplicate`, with `refetchProjectsIfOutdated`, rather than on any 404
  or 409: a 409 `retry` says nothing about the list.
- More tests:
  - the token re-check and cache changes after leaving the page during a
    rename or a deletion;
  - a created project dropping data under its name;
  - a list fetched before a rename or a deletion that arrives after it;
  - a rename whose project is gone from the cache;
  - the Delete prompt closing, focus included;
  - a single-suite key's hover on display names;
  - "Create project" waiting for the projects.

Part of #594.
flake8 refused the CHECK line of the CLI's message for a missing
project, at 127 characters. Split it into a CHECK-NEXT and a
CHECK-SAME, which still match the whole message.

Part of #594.
…onne/v5-projects-5-admin-projects

# Conflicts:
#	docs/v5_submit.rst
@ldionne
ldionne merged commit 3e18ca3 into main Nov 3, 2026
59 checks passed
@ldionne
ldionne deleted the users/ldionne/v5-projects-5-admin-projects branch November 3, 2026 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant