
* 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/element: empty-state should not have a default label when used as a loading indicator
* .
* web/bug/empty-state: Fix issues with EmptyState and Loading Overlay
- Add a method, `hasSlotted()`, to the Base component.
- Revise `EmptyState` to use `hasSlotted()`.
- Revise `LoadingOverlay` to use `hasSlotted()`.
- Provide (hopefully complete) Storybook stories for both
- Revise use of these components throughout the codebase.
The essential problem here was mine: I misunderstood what the Patternfly `SlotController` does (and,
yikes, how it does it). Slots aren't magical; they're just named containers, in which lightDOM
elements that appear between the opening and closing tags of a web component can be strategically
placed, shown or hidden, and to some extent styled, within the rendered and visible results of the
shadowDOM component that will fill the browser's RECT allocated to that component.
SlotController tries to associate the template with slots by creating the shadowDOM *first*, then
working backwards to see if there are lightDOM components to put into those slots. That's not what
we want; we want to see if there are lightDOM components that meet our slot requirements and, if
there are, create corresponding slots for them.
That's what `hasSlotted()` does: it returns true or false to the question, "Is there currently in
the lightDOM for this component an entry requesting a known slot name?" Components are free to do
what they want with that knowledge.
`<ak-empty-state>` now has several modes, all well-documented in the Storybook story. But in short,
the Title is now a default slot; any HTML Element not sent to one of the named slots are put into
the Title. The two named slots are `body` and `primary`. The header is bold and large; body is
just text, and primary is boxed to indicate that one or more buttons should be placed there, to
allow interaction.
The extra modes are controlled by boolean attributes:
- `loading`: Shows the loading spinner, overriding the `icon` attribute
- `default`: Shows the loading spinner *and* the word "Loading" (i18n-aware).
The priority for all of these is:
- Has something in the default (header) slot: That text will be shown. Overrides both
- `default` overrides `loading`
- `loading`
q`<ak-loading-overlay>` is a specialized variant of `<ak-empty-state>` over what will become
`<ak-backdrop>`, but for now is just internal. It allows only for the heading and primary slots,
forwarding them `<ak-empty-state>`. Since this is literally the *Loading*Overlay, showing the
`loading` spinner is the default; to prevent it, pass `no-spinner` as an attribute.
* Grammatical error.
* Prettier had opinions that shouldn't have been aired in public.
* Prettier had opinions that shouldn't have been aired in public.
* Collapsing unnecessary boolean nest.
* fix typo
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
* always render icon
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
* missing default in flow exec
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
* unrelated: fix loading interface
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
* rename default attr
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
* fix jsdoc
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
---------
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Co-authored-by: Jens Langhammer <jens@goauthentik.io>
86 lines
2.3 KiB
JavaScript
86 lines
2.3 KiB
JavaScript
/**
|
|
* @file Paths used by the web package.
|
|
*
|
|
* @runtime node
|
|
*/
|
|
import { DistDirectoryName } from "#paths";
|
|
import { dirname, resolve } from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
const relativeDirname = dirname(fileURLToPath(import.meta.url));
|
|
|
|
//#region Base paths
|
|
|
|
/**
|
|
* @typedef {'@goauthentik/web'} WebPackageIdentifier
|
|
*/
|
|
|
|
/**
|
|
* The root of the web package.
|
|
*
|
|
* @runtime node
|
|
*/
|
|
export const PackageRoot = /** @type {WebPackageIdentifier} */ (resolve(relativeDirname, ".."));
|
|
|
|
/**
|
|
* Path to the web package's distribution directory.
|
|
*
|
|
* This is where the built files are located after running the build process.
|
|
*
|
|
* @runtime node
|
|
*/
|
|
export const DistDirectory = /** @type {`${WebPackageIdentifier}/${DistDirectoryName}`} */ (
|
|
resolve(PackageRoot, DistDirectoryName)
|
|
);
|
|
|
|
//#endregion
|
|
|
|
//#region Entry points
|
|
|
|
/**
|
|
* @typedef {{ in: string, out: string }} EntryPointTarget
|
|
*
|
|
* ESBuild entrypoint target.
|
|
* Matches the type defined in the ESBuild context.
|
|
*/
|
|
|
|
/**
|
|
* Entry points available for building.
|
|
*
|
|
* @satisfies {Record<string, EntryPointTarget>}
|
|
*
|
|
* @runtime node
|
|
*/
|
|
export const EntryPoint = /** @type {const} */ ({
|
|
Admin: {
|
|
in: resolve(PackageRoot, "src", "admin", "AdminInterface", "index.entrypoint.ts"),
|
|
out: resolve(DistDirectory, "admin", "AdminInterface"),
|
|
},
|
|
User: {
|
|
in: resolve(PackageRoot, "src", "user", "index.entrypoint.ts"),
|
|
out: resolve(DistDirectory, "user", "UserInterface"),
|
|
},
|
|
Flow: {
|
|
in: resolve(PackageRoot, "src", "flow", "index.entrypoint.ts"),
|
|
out: resolve(DistDirectory, "flow", "FlowInterface"),
|
|
},
|
|
StandaloneAPI: {
|
|
in: resolve(PackageRoot, "src", "standalone", "api-browser/index.entrypoint.ts"),
|
|
out: resolve(DistDirectory, "standalone", "api-browser", "index"),
|
|
},
|
|
StandaloneLoading: {
|
|
in: resolve(PackageRoot, "src", "standalone", "loading/index.entrypoint.ts"),
|
|
out: resolve(DistDirectory, "standalone", "loading", "index"),
|
|
},
|
|
RAC: {
|
|
in: resolve(PackageRoot, "src", "rac", "index.entrypoint.ts"),
|
|
out: resolve(DistDirectory, "rac", "index"),
|
|
},
|
|
Polyfill: {
|
|
in: resolve(PackageRoot, "src", "polyfill", "index.entrypoint.ts"),
|
|
out: resolve(DistDirectory, "poly"),
|
|
},
|
|
});
|
|
|
|
//#endregion
|