Skip to content

Commit

Permalink
fix more lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
allroundexperts committed Nov 1, 2024
1 parent bbad7a5 commit eac43a1
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 15 deletions.
2 changes: 0 additions & 2 deletions src/libs/API/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -886,8 +886,6 @@ type WriteCommandParameters = {
[WRITE_COMMANDS.SET_INVOICING_TRANSFER_BANK_ACCOUNT]: Parameters.SetInvoicingTransferBankAccountParams;
[WRITE_COMMANDS.UPDATE_INVOICE_COMPANY_NAME]: Parameters.UpdateInvoiceCompanyNameParams;
[WRITE_COMMANDS.UPDATE_INVOICE_COMPANY_WEBSITE]: Parameters.UpdateInvoiceCompanyWebsiteParams;

[WRITE_COMMANDS.VALIDATE_USER_AND_GET_ACCESSIBLE_POLICIES]: Parameters.ValidateUserAndGetAccessiblePoliciesParams;
};

const READ_COMMANDS = {
Expand Down
3 changes: 3 additions & 0 deletions src/libs/Navigation/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1485,6 +1485,9 @@ type OnboardingModalNavigatorParamList = {
[SCREENS.ONBOARDING.PRIVATE_DOMAIN]: {
backTo?: string;
};
[SCREENS.ONBOARDING.WORKSPACES]: {
backTo?: string;
};
[SCREENS.ONBOARDING.PURPOSE]: {
backTo?: string;
};
Expand Down
4 changes: 2 additions & 2 deletions src/libs/actions/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1369,15 +1369,15 @@ function validateUserAndGetAccessiblePolicies(validationCode: string) {
{
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.KEY_JOINABLE_POLICIES,
value: {isLoading: true},
value: {isLoading: true, errors: null},
},
];

const successData: OnyxUpdate[] = [
{
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.KEY_JOINABLE_POLICIES,
value: {isLoading: false},
value: {isLoading: false, errors: null},
},
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,13 @@ function BaseOnboardingPrivateDomain({shouldUseNativeStyles, route}: BaseOnboard
const domain = email.split('@').at(1) ?? '';

// TODO
const clearError = useCallback(() => {
}, []);
const clearError = useCallback(() => {}, []);

const sendValidateCode = useCallback(() => {
if (!credentials?.login) {
return;
}
User.resendValidateCode(credentials.login)
User.resendValidateCode(credentials.login);
}, [credentials?.login]);

useEffect(() => {
Expand All @@ -65,10 +64,12 @@ function BaseOnboardingPrivateDomain({shouldUseNativeStyles, route}: BaseOnboard
<Text style={[styles.textAlignLeft, styles.mt5]}>{translate('onboarding.workspaceYouMayJoin', {domain, email})}</Text>
<ValidateCodeForm
validateCodeAction={validateCodeAction}
handleSubmitForm={code => { User.validateUserAndGetAccessiblePolicies(code) }}
handleSubmitForm={(code) => {
User.validateUserAndGetAccessiblePolicies(code);
}}
sendValidateCode={sendValidateCode}
clearError={clearError}
validateError={}
// validateError={null}
hideButton
/>
<View style={[styles.flex2, styles.justifyContentEnd]}>
Expand Down
5 changes: 1 addition & 4 deletions src/pages/OnboardingWorkspaces/types.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import type {RouteProp} from '@react-navigation/native';
import type {StackScreenProps} from '@react-navigation/stack';
import type {OnboardingModalNavigatorParamList} from '@libs/Navigation/types';
import type SCREENS from '@src/SCREENS';

type OnboardingWorkspacesProps = Record<string, unknown> & StackScreenProps<OnboardingModalNavigatorParamList, typeof SCREENS.ONBOARDING.PRIVATE_DOMAIN>;
type OnboardingWorkspacesProps = StackScreenProps<OnboardingModalNavigatorParamList, typeof SCREENS.ONBOARDING.WORKSPACES>;

type BaseOnboardingWorkspacesProps = {
/* Whether to use native styles tailored for native devices */
shouldUseNativeStyles: boolean;

route: RouteProp<OnboardingModalNavigatorParamList, typeof SCREENS.ONBOARDING.PRIVATE_DOMAIN>;
};

export type {OnboardingWorkspacesProps, BaseOnboardingWorkspacesProps};
14 changes: 12 additions & 2 deletions src/types/onyx/JoinablePolicies.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type {Errors} from './OnyxCommon';

/** Model of Joinable Policy */
type JoinablePolicy = {
/** Policy id of the workspace */
Expand All @@ -14,8 +16,16 @@ type JoinablePolicy = {
automaticJoiningEnabled: boolean;
};

/** Record of joinable policies, indexed by policy id */
type KeyJoinablePolicies = Record<string, JoinablePolicy>;
/** Model of Joinable Policies */
type KeyJoinablePolicies = {
/** Record of joinable policies, indexed by policy id */
policies: Record<string, JoinablePolicy>;
/** Whether we are loading the data via the API */
isLoading?: boolean;

/** Error message */
errors?: Errors;
};

export default KeyJoinablePolicies;

Expand Down

0 comments on commit eac43a1

Please sign in to comment.