providers/rac: fix property mapping without enterprise (#8144)

* make rac blueprint only run when enterprise is active

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* make rac api same as other mappings

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* automatically scale size sent by device pixel ratio

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* actually always allow creation of rac mappings

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* fix missing application in flow context

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* fix wizard showing enterprise warning when license is installed

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* cleanup

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

---------

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens L
2024-01-14 21:21:06 +01:00
committed by GitHub
parent 7c116acf0f
commit 85f1584844
6 changed files with 43 additions and 11 deletions

View File

@ -5,6 +5,7 @@ import "@goauthentik/admin/property-mappings/PropertyMappingSAMLForm";
import "@goauthentik/admin/property-mappings/PropertyMappingScopeForm";
import "@goauthentik/admin/property-mappings/PropertyMappingTestForm";
import { DEFAULT_CONFIG } from "@goauthentik/common/api/config";
import "@goauthentik/elements/Alert";
import { AKElement } from "@goauthentik/elements/Base";
import "@goauthentik/elements/forms/ProxyForm";
import "@goauthentik/elements/wizard/FormWizardPage";
@ -63,7 +64,7 @@ export class InitialPropertyMappingWizardPage extends WizardPage {
];
this.host.isValid = true;
}}
?disabled=${type.requiresEnterprise ? !this.enterprise?.hasLicense : false}
?disabled=${type.requiresEnterprise ? this.enterprise?.hasLicense : false}
/>
<label class="pf-c-radio__label" for=${`${type.component}-${type.modelName}`}
>${type.name}</label
@ -114,6 +115,7 @@ export class PropertyMappingWizard extends AKElement {
<ak-property-mapping-wizard-initial
slot="initial"
.mappingTypes=${this.mappingTypes}
.enterprise=${this.enterprise}
>
</ak-property-mapping-wizard-initial>
${this.mappingTypes.map((type) => {

View File

@ -83,8 +83,12 @@ export class RacInterface extends Interface {
// Keep track of current connection attempt
connectionAttempt = 0;
static domSize(): DOMRect {
return document.body.getBoundingClientRect();
static domSize(): { width: number; height: number } {
const size = document.body.getBoundingClientRect();
return {
width: size.width * window.devicePixelRatio,
height: size.height * window.devicePixelRatio,
};
}
constructor() {