This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
authentik/web
Ken Sternberg 73751e5cd9
web: refactor status label to separate component (#7407)
* web: break circular dependency between AKElement & Interface.

This commit changes the way the root node of the web application shell is
discovered by child components, such that the base class shared by both
no longer results in a circular dependency between the two models.

I've run this in isolation and have seen no failures of discovery; the identity
token exists as soon as the Interface is constructed and is found by every item
on the page.

* web: fix broken typescript references

This built... and then it didn't?  Anyway, the current fix is to
provide type information the AkInterface for the data that consumers
require.

* A quality of life thing: `<ak-status-label good>`

There's an idiom throughout the UI:

``` HTML
<ak-label color=${item.enabled ? PFColor.Green : PFColor.Red}>
      ${item.enabled ? msg("Yes") : msg("No")}
      </ak-label>
```

There are two problems with this.

- Repeating the conditional multiple times is error-prone
- The color scheme doesn't communicate much.

There are uses for ak-label that aren't like this, but I'm focusing on this particular use case,
which occurs about 20 times throughout the UI.

Since it's so common, let's isolate the most common case: `<ak-status-label good />` gives you the
"good" status, and `<ak-status-label/>` gives you the "bad" status, which is the default (no
arguments to the function).

There wasn't much clarity in the system for when to use orange vs red vs grey, but looking through
the use cases, it became clear that Red meant fail/inaccessible, Orange meant "Warning, but not
blocking," and Grey just means "info: this thing is off".

So let's define that with meaning: there are three types, error, warning, and info. Which
corresponds to debugging levels, but whatever, nerds grok that stuff.

So that example at the top becomes

```<ak-status-label ?good=${item.enabled}></ak-status-label>```

... and we can now more clearly understand what that conveys.

There is some heavy tension in this case: this is an easier and quicker-to-write solution to
informing the user of a binary status in an iconic way, but the developer has to remember that it
exists.

Story provided, and changes to the existing uses of the existing idiom provided.

* Added the 'compact label' story to storybook.
2023-11-20 11:24:48 -08:00
..
.storybook web: package up horizontal elements into their own components (#7053) 2023-10-04 13:07:52 -07:00
authentik/sources sources/oauth: fix reddit (#5557) 2023-05-09 23:41:24 +02:00
icons web, website: compress images (#6121) 2023-08-02 12:06:03 +00:00
scripts web: the return of pseudolocalization (#7190) 2023-10-16 13:54:43 -07:00
src web: refactor status label to separate component (#7407) 2023-11-20 11:24:48 -08:00
xliff web: refactor sidebar capabilities for categorical subsections (#7482) 2023-11-20 10:24:59 -08:00
.babelrc web/admin: simplify sidebar renderer (#6797) 2023-09-11 12:58:55 -07:00
.dockerignore root: fix references to helm chart 2021-06-13 14:30:44 +02:00
.eslintignore web: bump @typescript-eslint/eslint-plugin from 5.61.0 to 6.0.0 in /web (#6210) 2023-07-11 14:32:50 +02:00
.eslintrc.json web: laying the groundwork for future expansion (#7045) 2023-10-02 13:33:27 -07:00
.eslintrc.precommit.json web: Detangling some circular dependencies in Admin and User (#6852) 2023-09-13 10:16:24 -07:00
.gitignore web: the return of pseudolocalization (#7190) 2023-10-16 13:54:43 -07:00
.prettierignore enterprise: initial enterprise (#5721) 2023-07-17 17:57:08 +02:00
.prettierrc.json web: bump prettier from 2.8.8 to 3.0.0 in /web (#6329) 2023-07-21 18:19:19 +02:00
README.md web: Add storybook (#5865) 2023-06-07 13:05:33 +02:00
lit-localize.json web: locales: rename fr_FR to fr to match transifex 2023-10-02 13:31:21 +02:00
package-lock.json web: bump the eslint group in /web with 1 update (#7629) 2023-11-20 10:53:42 +01:00
package.json web: bump the eslint group in /web with 1 update (#7629) 2023-11-20 10:53:42 +01:00
robots.txt root: move webapp to /web (#347) 2020-11-28 19:43:42 +01:00
rollup.config.mjs web: refactor sidebar capabilities for categorical subsections (#7482) 2023-11-20 10:24:59 -08:00
rollup.proxy.mjs web: bump rollup from 2.79.1 to 3.28.1 in /web (#6616) 2023-08-24 17:13:03 +02:00
security.txt root: update supported versions 2023-01-20 14:23:21 +01:00
static.go outposts: release binary outposts (#1954) 2021-12-17 19:49:32 +00:00
static_outpost.go outposts: release binary outposts (#1954) 2021-12-17 19:49:32 +00:00
tsconfig.json web: Replace ad-hoc toggle control with ak-toggle-group (#6470) 2023-08-28 20:00:25 +02:00
web-test-runner.config.mjs web: basic cleanup of buttons (#6107) 2023-07-18 08:29:42 -07:00

README.md

authentik WebUI

This is the default UI for the authentik server. The documentation is going to be a little sparse for awhile, but at least let's get started.

Comments

NOTE: The comments in this section are for specific changes to this repository that cannot be reliably documented any other way. For the most part, they contain comments related to custom settings in JSON files, which do not support comments.

  • tsconfig.json:
    • compilerOptions.useDefineForClassFields: false is required to make TSC use the "classic" form of field definition when compiling class definitions. Storybook does not handle the ESNext proposed definition mechanism (yet).
    • compilerOptions.plugins.ts-lit-plugin.rules.no-unknown-tag-name: "off": required to support rapidoc, which exports its tag late.
    • compilerOptions.plugins.ts-lit-plugin.rules.no-missing-import: "off": lit-analyzer currently does not support path aliases very well, and cannot find the definition files associated with imports using them.
    • compilerOptions.plugins.ts-lit-plugin.rules.no-incompatible-type-binding: "warn": lit-analyzer does not support generics well when parsing a subtype of HTMLElement. As a result, this threw too many errors to be supportable.