web: (ESLint) Consistent use of triple-equals. (#14554)
web: Consistent use of triple-equals.
This commit is contained in:
@ -59,7 +59,7 @@ export class AboutModal extends WithLicenseSummary(WithBrandConfig(ModalButton))
|
||||
|
||||
renderModal() {
|
||||
let product = globalAK().brand.brandingTitle || DefaultBrand.brandingTitle;
|
||||
if (this.licenseSummary.status != LicenseSummaryStatusEnum.Unlicensed) {
|
||||
if (this.licenseSummary.status !== LicenseSummaryStatusEnum.Unlicensed) {
|
||||
product += ` ${msg("Enterprise")}`;
|
||||
}
|
||||
return html`<div
|
||||
|
@ -65,7 +65,7 @@ export class OutpostDeploymentModal extends ModalButton {
|
||||
</label>
|
||||
<input class="pf-c-form-control" readonly type="text" value="true" />
|
||||
</div>
|
||||
${this.outpost?.type == OutpostTypeEnum.Proxy
|
||||
${this.outpost?.type === OutpostTypeEnum.Proxy
|
||||
? html`
|
||||
<h3>
|
||||
${msg(
|
||||
|
@ -170,7 +170,7 @@ export class ProxyProviderViewPage extends AKElement {
|
||||
.replaceAll("outpost.company:9000", window.location.hostname)
|
||||
.replaceAll("https://app.company", extHost.toString())
|
||||
.replaceAll("app.company", extHost.hostname);
|
||||
} else if (this.provider?.mode == ProxyMode.ForwardDomain) {
|
||||
} else if (this.provider?.mode === ProxyMode.ForwardDomain) {
|
||||
return input
|
||||
.replaceAll("authentik.company", window.location.hostname)
|
||||
.replaceAll("outpost.company:9000", extHost.toString())
|
||||
|
@ -25,7 +25,7 @@ export function propertyMappingsSelector(object: string, instanceMappings?: stri
|
||||
return async (mappings: DualSelectPair<KerberosSourcePropertyMapping>[]) =>
|
||||
mappings.filter(
|
||||
([_0, _1, _2, mapping]: DualSelectPair<KerberosSourcePropertyMapping>) =>
|
||||
object == "user" &&
|
||||
object === "user" &&
|
||||
mapping?.managed?.startsWith("goauthentik.io/sources/kerberos/user/default/"),
|
||||
);
|
||||
}
|
||||
|
@ -160,7 +160,7 @@ export class PlexSourceForm extends WithCapabilitiesConfig(BaseSourceForm<PlexSo
|
||||
${this.plexResources?.map((r) => {
|
||||
const selected = Array.from(this.instance?.allowedServers || []).some(
|
||||
(server) => {
|
||||
return server == r.clientIdentifier;
|
||||
return server === r.clientIdentifier;
|
||||
},
|
||||
);
|
||||
return html`<option value=${r.clientIdentifier} ?selected=${selected}>
|
||||
|
@ -160,7 +160,7 @@ export class UserListPage extends WithBrandConfig(WithCapabilitiesConfig(TablePa
|
||||
const disabled = this.selectedElements.length < 1;
|
||||
const currentUser = rootInterface<AdminInterface>()?.user;
|
||||
const shouldShowWarning = this.selectedElements.find((el) => {
|
||||
return el.pk === currentUser?.user.pk || el.pk == currentUser?.original?.pk;
|
||||
return el.pk === currentUser?.user.pk || el.pk === currentUser?.original?.pk;
|
||||
});
|
||||
return html`<ak-forms-delete-bulk
|
||||
objectLabel=${msg("User(s)")}
|
||||
|
@ -211,7 +211,7 @@ export class NavigationButtons extends AKElement {
|
||||
<slot name="extra"></slot>
|
||||
</div>
|
||||
${this.renderImpersonation()}
|
||||
${this.userDisplayName != ""
|
||||
${this.userDisplayName
|
||||
? html`<div class="pf-c-page__header-tools-group pf-m-hidden">
|
||||
<div class="pf-c-page__header-tools-item pf-m-visible-on-2xl">
|
||||
${this.userDisplayName}
|
||||
|
@ -59,7 +59,7 @@ export class TreeViewNode extends AKElement {
|
||||
const level = this.item?.level || 0;
|
||||
// Ignore the last item as that shouldn't be expanded
|
||||
pathSegments.pop();
|
||||
if (pathSegments[level] == this.item?.id) {
|
||||
if (pathSegments[level] === this.item?.id) {
|
||||
this.open = true;
|
||||
}
|
||||
if (this.activePath === this.fullPath && this.host !== undefined) {
|
||||
@ -157,7 +157,7 @@ export class TreeView extends AKElement {
|
||||
createNode(path: string[], parentItem: TreeViewItem, level: number): TreeViewItem {
|
||||
const id = path.shift();
|
||||
const idx = parentItem.childItems.findIndex((e: TreeViewItem) => {
|
||||
return e.id == id;
|
||||
return e.id === id;
|
||||
});
|
||||
if (idx < 0) {
|
||||
const item: TreeViewItem = {
|
||||
|
@ -46,7 +46,7 @@ export class SidebarVersion extends WithLicenseSummary(WithVersion(AKElement)) {
|
||||
return nothing;
|
||||
}
|
||||
let product = globalAK().brand.brandingTitle || DefaultBrand.brandingTitle;
|
||||
if (this.licenseSummary.status != LicenseSummaryStatusEnum.Unlicensed) {
|
||||
if (this.licenseSummary.status !== LicenseSummaryStatusEnum.Unlicensed) {
|
||||
product += ` ${msg("Enterprise")}`;
|
||||
}
|
||||
return html`<button
|
||||
|
@ -3,6 +3,6 @@ export function randomId(length = 8) {
|
||||
return "x".repeat(length).replace(/x/g, (c) => {
|
||||
const r = (dt + Math.random() * 16) % 16 | 0;
|
||||
dt = Math.floor(dt / 16);
|
||||
return (c == "x" ? r : (r & 0x3) | 0x8).toString(16);
|
||||
return (c === "x" ? r : (r & 0x3) | 0x8).toString(16);
|
||||
});
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ export class TypeCreateWizardPage extends WithLicenseSummary(WizardPage) {
|
||||
return html`<div
|
||||
class="pf-l-grid__item pf-m-3-col pf-c-card ${requiresEnterprise
|
||||
? "pf-m-non-selectable-raised"
|
||||
: "pf-m-selectable-raised"} ${this.selectedType == type
|
||||
: "pf-m-selectable-raised"} ${this.selectedType === type
|
||||
? "pf-m-selected-raised"
|
||||
: ""}"
|
||||
tabindex=${idx}
|
||||
|
@ -144,7 +144,7 @@ export class IdentificationStage extends BaseStage<
|
||||
password.setAttribute("name", "password");
|
||||
password.setAttribute("autocomplete", "current-password");
|
||||
password.onkeyup = (ev: KeyboardEvent) => {
|
||||
if (ev.key == "Enter") {
|
||||
if (ev.key === "Enter") {
|
||||
this.submitForm(ev);
|
||||
}
|
||||
const el = ev.target as HTMLInputElement;
|
||||
@ -169,7 +169,7 @@ export class IdentificationStage extends BaseStage<
|
||||
totp.setAttribute("name", "code");
|
||||
totp.setAttribute("autocomplete", "one-time-code");
|
||||
totp.onkeyup = (ev: KeyboardEvent) => {
|
||||
if (ev.key == "Enter") {
|
||||
if (ev.key === "Enter") {
|
||||
this.submitForm(ev);
|
||||
}
|
||||
const el = ev.target as HTMLInputElement;
|
||||
|
@ -337,11 +337,11 @@ export class RacInterface extends Interface {
|
||||
}
|
||||
|
||||
renderOverlay() {
|
||||
if (!this.clientState || this.clientState == GuacClientState.CONNECTED) {
|
||||
if (!this.clientState || this.clientState === GuacClientState.CONNECTED) {
|
||||
return nothing;
|
||||
}
|
||||
let message = html`${GuacStateToString(this.clientState)}`;
|
||||
if (this.clientState == GuacClientState.WAITING) {
|
||||
if (this.clientState === GuacClientState.WAITING) {
|
||||
message = html`${msg("Connecting...")}`;
|
||||
}
|
||||
if (this.hasConnected) {
|
||||
|
@ -69,7 +69,7 @@ export class UserTokenForm extends ModelForm<Token, string> {
|
||||
class="pf-c-form-control"
|
||||
/>
|
||||
</ak-form-element-horizontal>
|
||||
${this.intent == IntentEnum.AppPassword
|
||||
${this.intent === IntentEnum.AppPassword
|
||||
? html`<ak-form-element-horizontal label=${msg("Expiring")} name="expires">
|
||||
<input
|
||||
type="datetime-local"
|
||||
|
@ -22,6 +22,6 @@ export function randomId() {
|
||||
return "xxxxxxxx".replace(/x/g, (c) => {
|
||||
const r = (dt + Math.random() * 16) % 16 | 0;
|
||||
dt = Math.floor(dt / 16);
|
||||
return (c == "x" ? r : (r & 0x3) | 0x8).toString(16);
|
||||
return (c === "x" ? r : (r & 0x3) | 0x8).toString(16);
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user