* web/admin/bugfix: Edit Stage not working. Invoking IdentificationStageForm not working.
## What
1. Fix the field being referenced by Flows -\> \[One Flow\] -\> StageBindings -\> \[Edit Stage\] to use the PK for the *stage*, rather than the *binding*.
2. Added a check in `StrictUnsafe`: if the property is “wrapped” and untyped, treat it as an attribute, not a property.
3. Edit the `ak-bound-stages-list` target attribute to be an attribute, not a property.
## Why
1. This looks like a simple typo. To avoid this in the future, *we need tests*.
2. `ModelForm` uses both a converter and get/set accessors to manage the pk (primary key) of the object it is being invoked to edit: the first because Django primary keys can be either strings or numbers, and the latter because we have special transactional requirements when a primary key changes. Lit’s magic for handling this creates some weirdness around JavaScript prototyping (`wrapped` becomes the only key on the object; all the other keys become delegated to a prototype object), so `hasOwn()` can’t be used; we just have to check for `wrapped` and `!type`.
3. PKs are either strings or numbers, and ModelForm has a smart converter. There’s no need to shove the values around as properties and, in fact, that’ll break some things because there’s a working `attribute` field on ModelForm! Removing the `.` property marker both avoids this issue and makes visible exactly what item-id is being referenced.
* Forced update of package lock. AGAIN.
* Sigh
* Sigh. Again.
* Sigh. But this time, with an empty cache.
* Prettier and its opinions.
* Clearing the cache broke relationships inside SFE. That has been updated.
* WTF, over?
## What
Re-arranges where types are declared and how they’re accessed. In some cases, refine the types to provide stronger build-time guarantees.
## Why
A lot of our stages use bits and pieces of types from a base state, from the executor, and in some cases from redundant sources.
Union types are great for some things, but Typescript can get really hung up on passing a union type as a function parameter when there’s some low-level non-conformance across all the types in the union. Because OpenAPI doesn’t do abstractions, this commit introduces a `StageChallengeLike`, which abstracts all of the Challenge types, asserting that there is a unifying parent class that contains the minimum collection fields found across all challenges, and this lets us address the different challenge types and their corresponding components before worrying about refining the type for construction and deployment.
On the other hand, sometimes you want to be able to assert that *all* of the member of a union correspond to some shape of data, and you can always use `Pick<>` on the FormChallenge type to assert that at build time.
Other than that, this centralizes the types into locations in the codebase with well-known names.
## What
Provide dynamically imported dialogs and forms a default export.
Some minor cleanup of types: `PropertyValues` -\> `PropertyValues<this>` provides stronger type guarantees.
## Why
We define stages and other dynamic processes on the server side using a token, the server-side component name. Client-side elements are instantiated with a constructor and identified with an element tag name.
Dynamically importing components automatically registered the element tag name with the constructor, enabling custom elements to work. Without the default export, the registration goes to the browser but the identity of the component’s underlying constructor is lost. Browsers provide a reverse lookup: given a component’s constructor it can provide the registration tag. By having default exports, we allow dynamic imports to record the constructor, retrieve the tag, and dynamically construct the templates without having to manually maintain the tag/constructor relationship (which is already complicated enough by that server-side component/client-side element relationship).
## Testing
This is purely internal maintenance; it’s about hardening the build, not changing behavior. If it lints and builds cleanly, the only real test is that nothing is borken afterwards.
## What
Names being passed to the browser were being incorrectly rendered. This commit updates the code in `StrictUnsafe` so that after the correct-use assertion is passed, the elementProperties are checked to see if the attribute has been named differently from the typed attribute field, and if so, retrieves the attribute name and passes it, rather than the field name, to the browser.
## Why
Since we have a lot of components with similar interfaces, it makes sense to try and check that they’re being used correctly and that the types associated with them are correct. Plus Lit, unlike React, doesn’t have a self-erasing syntax: every Lit element *is* an element, whereas JSX is an esoteric function call syntax that happens to look like XML. JavaScript templates aren’t as pretty as JSX, but they get the job done just as readily.
But in this case, cleverness bit us: we want to use the component’s JavaScript field names and types to validate that we’re using it correctly and passing the right types, but in the end we’re constructing a tag that will trigger the browser to construct the component and use it– and the field names don’t always correspond to the attribute name. Lit has a syntax for mapping the one to the other and stores it in the `elementProperties` field.
This code checks that, after we’ve determined the correct prefix for an property field that has been passed into the component, that we’ve also checked and extracted the correct *attribute name* for that property field. Most of the time it will be the same as the property field, but it muts always be checked.
* first approach
* add cc and bcc support, better ui
* remove unnecessary data return
* add template support
* fix linting
* do the ui
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
* display invite info in InvitationSendEmailForm.ts
* Select the invitation template by default
* Fix linting
* fix tests
* Add tests, clean code
* Add docs
* fix link
* Make the UI less disgusting
* Make the UI less disgusting
* Apply suggestions from code review
Co-authored-by: Dewi Roberts <dewi@goauthentik.io>
Signed-off-by: Marcelo Elizeche Landó <marce@melizeche.com>
* small formatting fix
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
* Use writeToClipboard function, better wording for CC and BCC
---------
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Signed-off-by: Marcelo Elizeche Landó <marce@melizeche.com>
Co-authored-by: Jens Langhammer <jens@goauthentik.io>
Co-authored-by: Dewi Roberts <dewi@goauthentik.io>
* translate: Translate django.po in it_IT [Manual Sync]
83% of minimum 60% translated source file: 'django.po'
on 'it_IT'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
* translate: Translate en.xlf in it_IT [Manual Sync]
72% of minimum 60% translated source file: 'en.xlf'
on 'it_IT'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
---------
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
* translate: Translate en.xlf in cs_CZ [Manual Sync]
82% of minimum 60% translated source file: 'en.xlf'
on 'cs_CZ'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
* translate: Translate django.po in cs_CZ [Manual Sync]
82% of minimum 60% translated source file: 'django.po'
on 'cs_CZ'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
---------
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
* translate: Translate en.xlf in tr_TR [Manual Sync]
63% of minimum 60% translated source file: 'en.xlf'
on 'tr_TR'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
* translate: Translate django.po in tr_TR [Manual Sync]
67% of minimum 60% translated source file: 'django.po'
on 'tr_TR'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
---------
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
* translate: Translate en.xlf in zh-Hans [Manual Sync]
94% of minimum 60% translated source file: 'en.xlf'
on 'zh-Hans'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
* translate: Translate django.po in zh-Hans [Manual Sync]
97% of minimum 60% translated source file: 'django.po'
on 'zh-Hans'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
---------
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
* translate: Translate en.xlf in ru_RU [Manual Sync]
63% of minimum 60% translated source file: 'en.xlf'
on 'ru_RU'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
* translate: Translate django.po in ru_RU [Manual Sync]
66% of minimum 60% translated source file: 'django.po'
on 'ru_RU'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
---------
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
translate: Translate en.xlf in ko_KR [Manual Sync]
60% of minimum 60% translated source file: 'en.xlf'
on 'ko_KR'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
* translate: Translate en.xlf in ja_JP [Manual Sync]
83% of minimum 60% translated source file: 'en.xlf'
on 'ja_JP'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
* translate: Translate django.po in ja_JP [Manual Sync]
90% of minimum 60% translated source file: 'django.po'
on 'ja_JP'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
---------
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
* translate: Translate en.xlf in de_DE [Manual Sync]
77% of minimum 60% translated source file: 'en.xlf'
on 'de_DE'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
* translate: Translate django.po in de_DE [Manual Sync]
86% of minimum 60% translated source file: 'django.po'
on 'de_DE'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
---------
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
* translate: Translate en.xlf in es_ES [Manual Sync]
74% of minimum 60% translated source file: 'en.xlf'
on 'es_ES'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
* translate: Translate django.po in es_ES [Manual Sync]
82% of minimum 60% translated source file: 'django.po'
on 'es_ES'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
---------
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
* translate: Translate django.po in fr_FR [Manual Sync]
95% of minimum 60% translated source file: 'django.po'
on 'fr_FR'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
* translate: Translate en.xlf in fr_FR [Manual Sync]
91% of minimum 60% translated source file: 'en.xlf'
on 'fr_FR'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
---------
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
* translate: Translate django.po in fi_FI [Manual Sync]
93% of minimum 60% translated source file: 'django.po'
on 'fi_FI'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
* translate: Translate en.xlf in fi_FI [Manual Sync]
85% of minimum 60% translated source file: 'en.xlf'
on 'fi_FI'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
---------
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
* translate: Translate django.po in pt_BR [Manual Sync]
96% of minimum 60% translated source file: 'django.po'
on 'pt_BR'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
* translate: Translate en.xlf in pt_BR [Manual Sync]
92% of minimum 60% translated source file: 'en.xlf'
on 'pt_BR'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
---------
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>