Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ import jss from "jss";
import preset from "jss-preset-default";
import { intl } from "../../global/global";
import { ErrorStyles } from "../../global/mixins";
import {
sensitiveMaskAttrs,
shouldMaskSensitiveField,
} from "../../utils/posthogMasking";
import { RegistrationFormState } from "../sqm-portal-registration-form/useRegistrationFormState";

export interface InputFieldViewProps {
Expand Down Expand Up @@ -40,6 +44,9 @@ const styleString = sheet.toString();
export function InputFieldView(props: InputFieldViewProps) {
const { states, content } = props;
const validationErrors = states?.registrationFormState?.validationErrors;
const shouldMask =
content.fieldType === "tel" || shouldMaskSensitiveField(content.fieldName);
const maskAttrs = sensitiveMaskAttrs(shouldMask);

return (
<div class={sheet.classes.FieldContainer} part="sqm-base">
Expand All @@ -52,6 +59,7 @@ export function InputFieldView(props: InputFieldViewProps) {
name={`/${content.fieldName}`}
type={content.fieldType}
label={content.fieldLabel}
{...maskAttrs}
{...(!content.fieldOptional ? { required: true } : [])}
disabled={
states.registrationFormState?.loading ||
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { h } from "@stencil/core";
import { ErrorStyles } from "../../global/mixins";
import { createStyleSheet } from "../../styling/JSS";
import { sensitiveMaskAttrs } from "../../utils/posthogMasking";
import { RegistrationFormState } from "../sqm-portal-registration-form/useRegistrationFormState";

export interface NameFieldsViewProps {
Expand Down Expand Up @@ -67,6 +68,7 @@ const styleString = sheet.toString();
export function NameFieldsView(props: NameFieldsViewProps) {
const { states } = props;
const validationErrors = states?.registrationFormState?.validationErrors;
const maskAttrs = sensitiveMaskAttrs(true);
return (
<div class={sheet.classes.FieldsContainer}>
<style type="text/css">
Expand All @@ -78,6 +80,7 @@ export function NameFieldsView(props: NameFieldsViewProps) {
name="/firstName"
type="text"
label={states.content.firstNameLabel}
{...maskAttrs}
required={!states.optional}
disabled={
states.registrationFormState?.loading ||
Expand All @@ -100,6 +103,7 @@ export function NameFieldsView(props: NameFieldsViewProps) {
name="/lastName"
type="text"
label={states.content.lastNameLabel}
{...maskAttrs}
required={!states.optional}
disabled={
states.registrationFormState?.loading ||
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { h } from "@stencil/core";
import { intl } from "../../../global/global";
import { sensitiveMaskAttrs } from "../../../utils/posthogMasking";
import { BankingInfoFormViewProps } from "./sqm-banking-info-form-view";

export function getFormMap({
Expand All @@ -15,11 +16,13 @@ export function getFormMap({
bankCountry?: string;
}) {
const { errors, ...formState } = props.states.formState;
const sensitiveAttrs = sensitiveMaskAttrs(true);

return {
0: {
input: (
<sl-input
{...sensitiveAttrs}
required
label={props.text.beneficiaryAccountNameLabel}
name="/beneficiaryAccountName"
Expand All @@ -40,6 +43,7 @@ export function getFormMap({
1: {
input: (
<sl-select
{...sensitiveAttrs}
required
label={props.text.bankAccountTypeLabel}
name="/bankAccountType"
Expand All @@ -65,6 +69,7 @@ export function getFormMap({
2: {
input: (
<sl-input
{...sensitiveAttrs}
required
label={props.text.bankAccountNumberLabel}
name="/bankAccountNumber"
Expand All @@ -85,6 +90,7 @@ export function getFormMap({
3: {
input: (
<sl-input
{...sensitiveAttrs}
required
label={props.text.ibanLabel}
name="/bankAccountNumber"
Expand All @@ -106,6 +112,7 @@ export function getFormMap({
4: {
input: (
<sl-input
{...sensitiveAttrs}
required
label={props.text.swiftCodeLabel}
name="/swiftCode"
Expand All @@ -125,6 +132,7 @@ export function getFormMap({
5: {
input: (
<sl-input
{...sensitiveAttrs}
required
label={intl.formatMessage(
{
Expand Down Expand Up @@ -160,6 +168,7 @@ export function getFormMap({
6: {
input: (
<sl-input
{...sensitiveAttrs}
required
label={props.text.bankNameLabel}
name="/bankName"
Expand All @@ -179,6 +188,7 @@ export function getFormMap({
7: {
input: [
<sl-select
{...sensitiveAttrs}
required
label={props.text.classificationLabel}
name="/beneficiaryClassification"
Expand All @@ -203,6 +213,7 @@ export function getFormMap({
</sl-menu-item>
</sl-select>,
<sl-input
{...sensitiveAttrs}
required
label={intl.formatMessage(
{
Expand Down Expand Up @@ -230,6 +241,7 @@ export function getFormMap({
8: {
input: (
<sl-select
{...sensitiveAttrs}
required
label={props.text.classificationCPFLabel}
name="/beneficiaryClassification"
Expand All @@ -251,6 +263,7 @@ export function getFormMap({
9: {
input: (
<sl-input
{...sensitiveAttrs}
key="patronymicName"
required
label={props.text.patronymicNameLabel}
Expand All @@ -270,6 +283,7 @@ export function getFormMap({
10: {
input: (
<sl-input
{...sensitiveAttrs}
key="voCode"
label={props.text.voCodeLabel}
name="/voCode"
Expand All @@ -288,6 +302,7 @@ export function getFormMap({
11: {
input: (
<sl-input
{...sensitiveAttrs}
required
label={props.text.agencyCodeLabel}
name="/agencyCode"
Expand All @@ -307,6 +322,7 @@ export function getFormMap({
12: {
input: [
<sl-input
{...sensitiveAttrs}
required
label={props.text.bankAddressLabel}
name="/bankAddress"
Expand All @@ -322,6 +338,7 @@ export function getFormMap({
})}
></sl-input>,
<sl-input
{...sensitiveAttrs}
required
label={props.text.bankCityLabel}
name="/bankCity"
Expand All @@ -337,6 +354,7 @@ export function getFormMap({
})}
></sl-input>,
<sl-input
{...sensitiveAttrs}
required
label={props.text.bankStateLabel}
name="/bankState"
Expand All @@ -352,6 +370,7 @@ export function getFormMap({
})}
></sl-input>,
<sl-input
{...sensitiveAttrs}
required
label={props.text.bankPostalCodeLabel}
name="/bankPostalCode"
Expand All @@ -371,6 +390,7 @@ export function getFormMap({
13: {
input: (
<sl-input
{...sensitiveAttrs}
required
label={props.text.branchCodeLabel}
name="/branchCode"
Expand All @@ -390,6 +410,7 @@ export function getFormMap({
14: {
input: (
<sl-select
{...sensitiveAttrs}
required
label={props.text.classificationLabel}
name="/beneficiaryClassification"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { h, VNode } from "@stencil/core";
import { intl } from "../../../global/global";
import { createStyleSheet } from "../../../styling/JSS";
import { sensitiveMaskAttrs } from "../../../utils/posthogMasking";
import { FORM_STEPS } from "../data";
import { BankingInfoFormData } from "./useBankingInfoForm";

Expand Down Expand Up @@ -290,6 +291,7 @@ export const BankingInfoFormView = (props: BankingInfoFormViewProps) => {
} = props;

const { classes } = sheet;
const sensitiveAttrs = sensitiveMaskAttrs(true);

const getLoadingSkeleton = (
checkedValue: "toBankAccount" | "toPayPalAccount" | undefined,
Expand Down Expand Up @@ -339,6 +341,7 @@ export const BankingInfoFormView = (props: BankingInfoFormViewProps) => {
return (
<sl-form
class={classes.FormWrapper}
{...sensitiveAttrs}
onSl-submit={callbacks.onSubmit}
ref={(el: HTMLFormElement) => (refs.formRef.current = el)}
novalidate
Expand Down Expand Up @@ -448,6 +451,7 @@ export const BankingInfoFormView = (props: BankingInfoFormViewProps) => {
<sl-radio
class={classes.Checkbox}
exportparts="base: radio-base"
{...sensitiveAttrs}
checked={formState.paymentMethodChecked === "toBankAccount"}
onInput={() =>
callbacks.setPaymentMethodChecked("toBankAccount")
Expand Down Expand Up @@ -481,6 +485,7 @@ export const BankingInfoFormView = (props: BankingInfoFormViewProps) => {
<sl-radio
class={classes.Checkbox}
exportparts="base: radio-base"
{...sensitiveAttrs}
checked={formState.paymentMethodChecked === "toPayPalAccount"}
onInput={() =>
callbacks.setPaymentMethodChecked("toPayPalAccount")
Expand Down Expand Up @@ -514,6 +519,7 @@ export const BankingInfoFormView = (props: BankingInfoFormViewProps) => {
<sl-radio
class={classes.Checkbox}
exportparts="base: radio-base"
{...sensitiveAttrs}
checked={
formState.paymentScheduleChecked === "BALANCE_THRESHOLD"
}
Expand Down Expand Up @@ -541,6 +547,7 @@ export const BankingInfoFormView = (props: BankingInfoFormViewProps) => {
<sl-radio
class={classes.Checkbox}
exportparts="base: radio-base"
{...sensitiveAttrs}
checked={formState.paymentScheduleChecked === "FIXED_DAY"}
onInput={() => callbacks.setPaymentScheduleChecked("FIXED_DAY")}
disabled={states.disabled}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import deepmerge from "deepmerge";
import { DemoData } from "../../../global/demo";
import { intl } from "../../../global/global";
import { createStyleSheet } from "../../../styling/JSS";
import { sensitiveMaskAttrs } from "../../../utils/posthogMasking";
import { getProps } from "../../../utils/utils";
import { TAX_CONTEXT_NAMESPACE } from "../data";
import { getFormMap } from "./formDefinitions";
Expand Down Expand Up @@ -381,6 +382,7 @@ export class BankingInfoForm {
? useDemoBankingInfoForm(this)
: useBankingInfoForm(this);

const sensitiveAttrs = sensitiveMaskAttrs(true);
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sensitiveAttrs declaration is mis-indented relative to surrounding code, which looks like a formatting slip and makes the render method harder to scan. Please align it with the other const declarations (or run the formatter used in this package).

Suggested change
const sensitiveAttrs = sensitiveMaskAttrs(true);
const sensitiveAttrs = sensitiveMaskAttrs(true);

Copilot uses AI. Check for mistakes.
const { errors } = props.states.formState;

const fieldRequiredError = this.fieldRequiredError;
Expand Down Expand Up @@ -491,11 +493,13 @@ export class BankingInfoForm {
{props.states.isPartner && props.states.showVerification ? (
<sl-dialog
class={sheet.classes.Dialog}
{...sensitiveAttrs}
open={true}
onSl-hide={props.callbacks.onVerificationHide}
label={props.text.verifyEmailHeaderText}
>
<sqm-code-verification
{...sensitiveAttrs}
verifyCodeHeaderText={verifyDescription}
reverifyCodeHeaderText={verifyDescription}
onVerification={props.callbacks.onVerification}
Expand All @@ -511,6 +515,7 @@ export class BankingInfoForm {
formInputsSlot: inputFields?.map(({ input }) => input),
countryInputSlot: (
<sl-select
{...sensitiveAttrs}
label={props.text.bankLocationLabel}
disabled={props.states.saveLoading}
required
Expand All @@ -529,6 +534,7 @@ export class BankingInfoForm {
})}
>
<sl-input
{...sensitiveAttrs}
disabled={props.states.saveLoading}
class={sheet.classes.SearchInput}
placeholder={this.searchForCountryText}
Expand Down Expand Up @@ -559,6 +565,7 @@ export class BankingInfoForm {
),
paymentMethodSlot: (
<sl-input
{...sensitiveAttrs}
key="paymentMethod"
label={props.text.paymentMethod}
placeholder={props.states.paymentMethodFeeLabel}
Expand All @@ -567,6 +574,7 @@ export class BankingInfoForm {
),
paymentThresholdSelectSlot: (
<sl-select
{...sensitiveAttrs}
required
disabled={props.states.saveLoading}
label={props.text.paymentThresholdSelectLabel}
Expand All @@ -590,6 +598,7 @@ export class BankingInfoForm {
),
paymentFixedDaySelectSlot: (
<sl-select
{...sensitiveAttrs}
required
disabled={props.states.saveLoading}
label={props.text.paymentDaySelectLabel}
Expand All @@ -614,6 +623,7 @@ export class BankingInfoForm {
),
paypalInputSlot: (
<sl-input
{...sensitiveAttrs}
required
disabled={props.states.saveLoading}
value={props.states?.formState?.paypalEmailAddress || ""}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { VNode, h } from "@stencil/core";
import { intl } from "../../../global/global";
import { createStyleSheet } from "../../../styling/JSS";
import { sensitiveMaskAttrs } from "../../../utils/posthogMasking";
import { FORM_STEPS } from "../data";

export interface IndirectTaxFormViewProps {
Expand Down Expand Up @@ -195,10 +196,12 @@ export const IndirectTaxFormView = (props: IndirectTaxFormViewProps) => {
} = props;

const { classes } = sheet;
const sensitiveAttrs = sensitiveMaskAttrs(true);

return (
<sl-form
class={classes.FormWrapper}
{...sensitiveAttrs}
onSl-submit={callbacks.onSubmit}
ref={(el: HTMLFormElement) => (refs.formRef.current = el)}
novalidate
Expand Down Expand Up @@ -304,6 +307,7 @@ export const IndirectTaxFormView = (props: IndirectTaxFormViewProps) => {
<div class={classes.InnerRadioContainer}>
<sl-radio
exportparts="base: radio-base"
{...sensitiveAttrs}
name="/checked"
value="notRegistered"
id="notRegistered"
Expand All @@ -320,6 +324,7 @@ export const IndirectTaxFormView = (props: IndirectTaxFormViewProps) => {
</sl-radio>
<sl-radio
exportparts="base: radio-base"
{...sensitiveAttrs}
name="/checked"
value="otherRegion"
id="otherRegion"
Expand Down
Loading
Loading