
* web: Add InvalidationFlow to Radius Provider dialogues
## What
- Bugfix: adds the InvalidationFlow to the Radius Provider dialogues
- Repairs: `{"invalidation_flow":["This field is required."]}` message, which was *not* propagated
to the Notification.
- Nitpick: Pretties `?foo=${true}` expressions: `s/\?([^=]+)=\$\{true\}/\1/`
## Note
Yes, I know I'm going to have to do more magic when we harmonize the forms, and no, I didn't add the
Property Mappings to the wizard, and yes, I know I'm going to have pain with the *new* version of
the wizard. But this is a serious bug; you can't make Radius servers with *either* of the current
dialogues at the moment.
* This (temporary) change is needed to prevent the unit tests from failing.
\# What
\# Why
\# How
\# Designs
\# Test Steps
\# Other Notes
* Revert "This (temporary) change is needed to prevent the unit tests from failing."
This reverts commit dddde09be5
.
* web/components: Remove all special cases of slug handling, replace with a "smart slug" component
This commit removes all special handling for the `slug` attribute in our text. A variant of the text
input control that can handle formatting-as-slugs has replaced all the slugificiation code; simply
drop it onto a page and tell it the (must be unique) selector from which to get the data to be
slugified. It only looks up one tier of the DOM so be careful that both the text input and its slug
accessory occupy the same DOM context.
## Details
### The Component
Now that we know a (lot) more about Lit, this component has been slightly updated to meet our
current standards.
- web/src/components/ak-slug-input.ts
Changes made:
- The "listen for the source object" has been moved to the `firstUpdated`, so that it no longer has
to wait for the end of a render.
- The `dirtyFlag` handler now uses the `@input` syntax.
- Updated the slug formatter to permit trailing dashes.
- Uses the `@bound` decorator, eliminating the need to do binding in the constructor (and so
eliminating the constructor completely).
### Component uses:
The following components were revised to use `ak-slug-input` instead of a plain text input with the
slug-handling added by our forms manager.
- applications/ApplicationForm.ts
- flows/FlowForm.ts
- sources/kerberos/KerberosSourceForm.ts
- sources/ldap/LDAPSourceForm.ts
- sources/oauth/OAuthSourceForm.ts
- sources/plex/PlexSourceForm.ts
- sources/saml/SAMLSourceForm.ts
- sources/scim/SCIMSourceForm.ts
### Remove the redundant special slug handling code
- web/src/elements/forms/Form.ts
- web/src/elements/forms/HorizontalFormElement.ts
### A special case among special cases
- web/src/admin/stages/invitation/InvitationForm.ts
This form is our one case where we have a slug input field with no corresponding text source. Adding
a simple event handler to validate the value whenever it changed and write back a "clean" slug was
the most straightforward solution. I added a help line; it seemed "surprising" to ask someone for a
name and not follow the same rules as "names" everywhere else in our UI without explanation.
* After writing the commit message, I realized some of the comments I made MUST be added to the component.
* The `source` attribute needed its own comment to indicate that a `query()` compatible selector is expected.
* Added public/private/protected/# indicators to all fields. Trying to balance between getting it 'right' and leaving an opening for harmonizing style-sharing and state-sharing between (text / textarea), slug, password and (visible / hidden / secret).
* Removed the ids as requested; the default "look for this" matches the original behavior without requiring it be hard-coded and unchangable.
43 lines
1.2 KiB
TypeScript
43 lines
1.2 KiB
TypeScript
/**
|
|
* @file Global variables provided by Node.js
|
|
*/
|
|
|
|
declare module "module" {
|
|
global {
|
|
/**
|
|
* @deprecated This is not present in ESM files.
|
|
*
|
|
* ```js
|
|
* import { dirname } from "node:path";
|
|
* import { fileURLToPath } from "node:url";
|
|
*
|
|
* const relativeDirname = dirname(fileURLToPath(import.meta.url));
|
|
* ```
|
|
*/
|
|
|
|
var __dirname: string;
|
|
}
|
|
}
|
|
|
|
declare module "process" {
|
|
global {
|
|
namespace NodeJS {
|
|
interface ProcessEnv {
|
|
/**
|
|
* An environment variable used to determine
|
|
* whether Node.js is running in production mode.
|
|
*
|
|
* @see {@link https://nodejs.org/en/learn/getting-started/nodejs-the-difference-between-development-and-production | The difference between development and production}
|
|
*/
|
|
readonly NODE_ENV?: "development" | "production";
|
|
/**
|
|
* @todo Determine where this is used and if it is needed,
|
|
* give it a better name.
|
|
* @deprecated
|
|
*/
|
|
readonly AK_API_BASE_PATH?: string;
|
|
}
|
|
}
|
|
}
|
|
}
|