Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement the policy report fields creation flow #44275

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
76ed460
Squashed commit of the following:
rezkiy37 Jun 24, 2024
679f6f1
Merge branch 'main' of https://github.com/rezkiy37/Expensify into fea…
rezkiy37 Jun 25, 2024
ec80ccb
integrate WorkspaceListValuesPage
rezkiy37 Jun 25, 2024
ae8a62d
rename screen
rezkiy37 Jun 25, 2024
8f43c69
integrate WorkspaceListValuesPage
rezkiy37 Jun 25, 2024
885a5fd
integrate WorkspaceAddValuePage
rezkiy37 Jun 25, 2024
2246172
remove horizontal spacing
rezkiy37 Jun 25, 2024
716e641
integrate submitting and validation for new value
rezkiy37 Jun 25, 2024
73217a8
simplify WorkspaceListValuesPage
rezkiy37 Jun 25, 2024
9ddb2cf
remove list value selector modal
rezkiy37 Jun 25, 2024
a679ec9
integrate value editing
rezkiy37 Jun 25, 2024
6bc8d61
integrate value deleting
rezkiy37 Jun 25, 2024
819a9a7
add empty state
rezkiy37 Jun 25, 2024
893e0a5
add right label for values
rezkiy37 Jun 25, 2024
fb29fc8
use value index instead of name
rezkiy37 Jun 25, 2024
0c752f7
fix value deleting
rezkiy37 Jun 25, 2024
70f45c4
integrate InitialListValueSelector
rezkiy37 Jun 25, 2024
a47beda
reset ios changes
rezkiy37 Jun 25, 2024
da4bc15
Merge branch 'main' of https://github.com/rezkiy37/Expensify into fea…
rezkiy37 Jun 26, 2024
804c28e
fix nav settings
rezkiy37 Jun 26, 2024
828acdb
use transparent bg for empty list
rezkiy37 Jun 26, 2024
4a9b6fb
remove right carets for lists
rezkiy37 Jun 26, 2024
803dc9b
fix string
rezkiy37 Jun 26, 2024
3dd1b77
remove right spacing for header
rezkiy37 Jun 26, 2024
14c68e3
integrate bulk actions for values
rezkiy37 Jun 26, 2024
12e5cb6
add translations
rezkiy37 Jun 26, 2024
580112b
move translations
rezkiy37 Jun 26, 2024
8f10648
move component
rezkiy37 Jun 26, 2024
54f202f
update comments
rezkiy37 Jun 26, 2024
4caad65
remove comment
rezkiy37 Jun 26, 2024
7a5f45c
use default values
rezkiy37 Jun 26, 2024
b15dcc3
integrate validateReportFieldListValueName
rezkiy37 Jun 26, 2024
7ec4c4a
integrate validation for create report field page
rezkiy37 Jun 26, 2024
9483546
integrate draft form submission
rezkiy37 Jun 26, 2024
f66f400
Update en.ts
jamesdeanexpensify Jun 26, 2024
df1fc29
Update en.ts
jamesdeanexpensify Jun 26, 2024
e27cd9f
Update en.ts
jamesdeanexpensify Jun 26, 2024
47c903b
Merge branch 'main' of https://github.com/rezkiy37/Expensify into fea…
rezkiy37 Jun 27, 2024
d981975
integrate createReportField and update imports
rezkiy37 Jun 27, 2024
bd8f461
centrilize list value empty
rezkiy37 Jun 27, 2024
98280ec
sync text up
rezkiy37 Jun 27, 2024
232e242
created first test scenario
rezkiy37 Jun 27, 2024
976ac90
Merge branch 'main' of https://github.com/rezkiy37/Expensify into fea…
rezkiy37 Jun 28, 2024
72eee9e
clarify comments
rezkiy37 Jun 28, 2024
c2ae8fc
remove dev. logs
rezkiy37 Jun 28, 2024
9147f6d
remove extra styles array
rezkiy37 Jun 28, 2024
b07d4fd
add comment
rezkiy37 Jun 28, 2024
257d486
remove extra styles array
rezkiy37 Jun 28, 2024
f6c1cb0
simplify styles
rezkiy37 Jun 28, 2024
ed9954e
memorize entire sections
rezkiy37 Jun 28, 2024
95856f1
unify BULK_ACTION_TYPES
rezkiy37 Jun 28, 2024
8f26fc4
simplify array styles
rezkiy37 Jun 28, 2024
b97a85e
undo extra changes
rezkiy37 Jun 28, 2024
ef43e16
create more case scenarios
rezkiy37 Jun 28, 2024
bd5dacd
improve test
rezkiy37 Jun 28, 2024
1b8e1c4
fix en translations
rezkiy37 Jun 28, 2024
8bc922e
add spanish translations
rezkiy37 Jun 28, 2024
942b02f
handle small screen for header button
rezkiy37 Jun 28, 2024
27d585f
Merge branch 'main' of https://github.com/rezkiy37/Expensify into fea…
rezkiy37 Jun 28, 2024
a3ef7a4
Merge branch 'main' of https://github.com/rezkiy37/Expensify into fea…
rezkiy37 Jul 1, 2024
409ff12
improve Spanish translations
rezkiy37 Jul 1, 2024
207c6dd
Merge branch 'main' of https://github.com/rezkiy37/Expensify into fea…
rezkiy37 Jul 2, 2024
805d3b6
add top padding
rezkiy37 Jul 2, 2024
6a02590
fix button layout
rezkiy37 Jul 2, 2024
78e4577
add missed types
rezkiy37 Jul 2, 2024
a78985e
fix report field key
rezkiy37 Jul 2, 2024
05d3319
reset selected values on navigate
rezkiy37 Jul 2, 2024
e005d47
do not clear on success
rezkiy37 Jul 2, 2024
25aa8dd
update tests
rezkiy37 Jul 2, 2024
82789d1
Merge branch 'main' of https://github.com/rezkiy37/Expensify into fea…
rezkiy37 Jul 3, 2024
6f4496b
simplify failureData
rezkiy37 Jul 3, 2024
eac25ff
improved policies onyx connection
rezkiy37 Jul 3, 2024
f49d243
add js doc comments
rezkiy37 Jul 3, 2024
15f33ea
rename page add value page
rezkiy37 Jul 3, 2024
64fca65
rename list values page
rezkiy37 Jul 3, 2024
256ca29
rename edit value page
rezkiy37 Jul 3, 2024
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
32 changes: 12 additions & 20 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1849,6 +1849,11 @@ const CONST = {
MAKE_MEMBER: 'makeMember',
MAKE_ADMIN: 'makeAdmin',
},
BULK_ACTION_TYPES: {
DELETE: 'delete',
DISABLE: 'disable',
ENABLE: 'enable',
},
MORE_FEATURES: {
ARE_CATEGORIES_ENABLED: 'areCategoriesEnabled',
ARE_TAGS_ENABLED: 'areTagsEnabled',
Expand All @@ -1859,21 +1864,6 @@ const CONST = {
ARE_EXPENSIFY_CARDS_ENABLED: 'areExpensifyCardsEnabled',
ARE_TAXES_ENABLED: 'tax',
},
CATEGORIES_BULK_ACTION_TYPES: {
DELETE: 'delete',
DISABLE: 'disable',
ENABLE: 'enable',
},
TAGS_BULK_ACTION_TYPES: {
DELETE: 'delete',
DISABLE: 'disable',
ENABLE: 'enable',
},
DISTANCE_RATES_BULK_ACTION_TYPES: {
DELETE: 'delete',
DISABLE: 'disable',
ENABLE: 'enable',
},
DEFAULT_CATEGORIES: [
'Advertising',
'Benefits',
Expand Down Expand Up @@ -1904,11 +1894,6 @@ const CONST = {
DUPLICATE_SUBSCRIPTION: 'duplicateSubscription',
FAILED_TO_CLEAR_BALANCE: 'failedToClearBalance',
},
TAX_RATES_BULK_ACTION_TYPES: {
DELETE: 'delete',
DISABLE: 'disable',
ENABLE: 'enable',
},
COLLECTION_KEYS: {
DESCRIPTION: 'description',
REIMBURSER: 'reimburser',
Expand Down Expand Up @@ -2256,6 +2241,7 @@ const CONST = {
LOGIN_CHARACTER_LIMIT: 254,
CATEGORY_NAME_LIMIT: 256,
TAG_NAME_LIMIT: 256,
WORKSPACE_REPORT_FIELD_POLICY_MAX_LENGTH: 256,
REPORT_NAME_LIMIT: 100,
TITLE_CHARACTER_LIMIT: 100,
DESCRIPTION_LIMIT: 500,
Expand Down Expand Up @@ -5079,6 +5065,12 @@ const CONST = {
},

EXCLUDE_FROM_LAST_VISITED_PATH: [SCREENS.NOT_FOUND, SCREENS.SAML_SIGN_IN, SCREENS.VALIDATE_LOGIN] as string[],

REPORT_FIELD_TYPES: {
TEXT: 'text',
DATE: 'date',
LIST: 'dropdown',
},
} as const;

type Country = keyof typeof CONST.ALL_COUNTRIES;
Expand Down
3 changes: 3 additions & 0 deletions src/ONYXKEYS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,8 @@ const ONYXKEYS = {
WORKSPACE_RATE_AND_UNIT_FORM_DRAFT: 'workspaceRateAndUnitFormDraft',
WORKSPACE_TAX_CUSTOM_NAME: 'workspaceTaxCustomName',
WORKSPACE_TAX_CUSTOM_NAME_DRAFT: 'workspaceTaxCustomNameDraft',
WORKSPACE_REPORT_FIELDS_FORM: 'workspaceReportFieldsForm',
WORKSPACE_REPORT_FIELDS_FORM_DRAFT: 'workspaceReportFieldsFormDraft',
POLICY_CREATE_DISTANCE_RATE_FORM: 'policyCreateDistanceRateForm',
POLICY_CREATE_DISTANCE_RATE_FORM_DRAFT: 'policyCreateDistanceRateFormDraft',
POLICY_DISTANCE_RATE_EDIT_FORM: 'policyDistanceRateEditForm',
Expand Down Expand Up @@ -564,6 +566,7 @@ type OnyxFormValuesMapping = {
[ONYXKEYS.FORMS.WORKSPACE_TAG_FORM]: FormTypes.WorkspaceTagForm;
[ONYXKEYS.FORMS.WORKSPACE_RATE_AND_UNIT_FORM]: FormTypes.WorkspaceRateAndUnitForm;
[ONYXKEYS.FORMS.WORKSPACE_TAX_CUSTOM_NAME]: FormTypes.WorkspaceTaxCustomName;
[ONYXKEYS.FORMS.WORKSPACE_REPORT_FIELDS_FORM]: FormTypes.WorkspaceReportFieldsForm;
[ONYXKEYS.FORMS.CLOSE_ACCOUNT_FORM]: FormTypes.CloseAccountForm;
[ONYXKEYS.FORMS.PROFILE_SETTINGS_FORM]: FormTypes.ProfileSettingsForm;
[ONYXKEYS.FORMS.DISPLAY_NAME_FORM]: FormTypes.DisplayNameForm;
Expand Down
20 changes: 20 additions & 0 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,26 @@ const ROUTES = {
route: 'settings/workspaces/:policyID/reportFields',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/reportFields` as const,
},
WORKSPACE_CREATE_REPORT_FIELD: {
route: 'settings/workspaces/:policyID/reportFields/new',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/reportFields/new` as const,
},
WORKSPACE_REPORT_FIELD_LIST_VALUES: {
route: 'settings/workspaces/:policyID/reportFields/new/listValues',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/reportFields/new/listValues` as const,
},
WORKSPACE_REPORT_FIELD_ADD_VALUE: {
route: 'settings/workspaces/:policyID/reportFields/new/addValue',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/reportFields/new/addValue` as const,
},
WORKSPACE_REPORT_FIELD_VALUE_SETTINGS: {
route: 'settings/workspaces/:policyID/reportFields/new/:valueIndex',
getRoute: (policyID: string, valueIndex: number) => `settings/workspaces/${policyID}/reportFields/new/${valueIndex}` as const,
},
WORKSPACE_REPORT_FIELD_EDIT_VALUE: {
route: 'settings/workspaces/:policyID/reportFields/new/:valueIndex/edit',
getRoute: (policyID: string, valueIndex: number) => `settings/workspaces/${policyID}/reportFields/new/${valueIndex}/edit` as const,
},
WORKSPACE_EXPENSIFY_CARD: {
route: 'settings/workspaces/:policyID/expensify-card',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/expensify-card` as const,
Expand Down
5 changes: 5 additions & 0 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,11 @@ const SCREENS = {
TAG_EDIT: 'Tag_Edit',
TAXES: 'Workspace_Taxes',
REPORT_FIELDS: 'Workspace_ReportFields',
REPORT_FIELDS_CREATE: 'Workspace_ReportFields_Create',
REPORT_FIELDS_LIST_VALUES: 'Workspace_ReportFields_ListValues',
REPORT_FIELDS_ADD_VALUE: 'Workspace_ReportFields_AddValue',
REPORT_FIELDS_VALUE_SETTINGS: 'Workspace_ReportFields_ValueSettings',
REPORT_FIELDS_EDIT_VALUE: 'Workspace_ReportFields_EditValue',
TAX_EDIT: 'Workspace_Tax_Edit',
TAX_NAME: 'Workspace_Tax_Name',
TAX_VALUE: 'Workspace_Tax_Value',
Expand Down
4 changes: 2 additions & 2 deletions src/components/ButtonWithDropdownMenu/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ type PaymentType = DeepValueOf<typeof CONST.IOU.PAYMENT_TYPE | typeof CONST.IOU.

type WorkspaceMemberBulkActionType = DeepValueOf<typeof CONST.POLICY.MEMBERS_BULK_ACTION_TYPES>;

type WorkspaceDistanceRatesBulkActionType = DeepValueOf<typeof CONST.POLICY.DISTANCE_RATES_BULK_ACTION_TYPES>;
type WorkspaceDistanceRatesBulkActionType = DeepValueOf<typeof CONST.POLICY.BULK_ACTION_TYPES>;

type WorkspaceTaxRatesBulkActionType = DeepValueOf<typeof CONST.POLICY.TAX_RATES_BULK_ACTION_TYPES>;
type WorkspaceTaxRatesBulkActionType = DeepValueOf<typeof CONST.POLICY.BULK_ACTION_TYPES>;

type DropdownOption<TValueType> = {
value: TValueType;
Expand Down
4 changes: 3 additions & 1 deletion src/components/Form/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,14 @@ type ValidInputs =
| typeof AddPlaidBankAccount
| typeof EmojiPickerButtonDropdown;

type ValueTypeKey = 'string' | 'boolean' | 'date' | 'country';
type ValueTypeKey = 'string' | 'boolean' | 'date' | 'country' | 'reportFields' | 'disabledListValues';
type ValueTypeMap = {
string: string;
boolean: boolean;
date: Date;
country: Country | '';
reportFields: string[];
disabledListValues: boolean[];
};
type FormValue = ValueOf<ValueTypeMap>;

Expand Down
17 changes: 13 additions & 4 deletions src/components/TextPicker/TextSelectorModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import HeaderWithBackButton from '@components/HeaderWithBackButton';
import Modal from '@components/Modal';
import ScreenWrapper from '@components/ScreenWrapper';
import ScrollView from '@components/ScrollView';
import Text from '@components/Text';
import TextInput from '@components/TextInput';
import type {BaseTextInputRef} from '@components/TextInput/BaseTextInput/types';
import useLocalize from '@hooks/useLocalize';
Expand All @@ -14,7 +15,7 @@ import CONST from '@src/CONST';
import type {TextSelectorModalProps} from './types';
import usePaddingStyle from './usePaddingStyle';

function TextSelectorModal({value, description = '', onValueSelected, isVisible, onClose, ...rest}: TextSelectorModalProps) {
function TextSelectorModal({value, description = '', subtitle, onValueSelected, isVisible, onClose, shouldClearOnClose, ...rest}: TextSelectorModalProps) {
const {translate} = useLocalize();
const styles = useThemeStyles();

Expand All @@ -24,6 +25,13 @@ function TextSelectorModal({value, description = '', onValueSelected, isVisible,
const inputRef = useRef<BaseTextInputRef | null>(null);
const focusTimeoutRef = useRef<NodeJS.Timeout | null>(null);

const hide = useCallback(() => {
onClose();
if (shouldClearOnClose) {
setValue('');
}
}, [onClose, shouldClearOnClose]);

useFocusEffect(
useCallback(() => {
focusTimeoutRef.current = setTimeout(() => {
Expand All @@ -44,8 +52,8 @@ function TextSelectorModal({value, description = '', onValueSelected, isVisible,
<Modal
type={CONST.MODAL.MODAL_TYPE.RIGHT_DOCKED}
isVisible={isVisible}
onClose={onClose}
onModalHide={onClose}
onClose={hide}
onModalHide={hide}
hideModalContentWhileAnimating
useNativeDriver
shouldUseModalPaddingStyle={false}
Expand All @@ -59,12 +67,13 @@ function TextSelectorModal({value, description = '', onValueSelected, isVisible,
>
<HeaderWithBackButton
title={description}
onBackButtonPress={onClose}
onBackButtonPress={hide}
/>
<ScrollView
contentContainerStyle={[styles.flex1, styles.mh5, styles.mb5]}
keyboardShouldPersistTaps="handled"
>
<View style={styles.pb4}>{!!subtitle && <Text style={[styles.sidebarLinkText, styles.optionAlternateText]}>{subtitle}</Text>}</View>
<View style={styles.flex1}>
<TextInput
// eslint-disable-next-line react/jsx-props-no-spreading
Expand Down
7 changes: 5 additions & 2 deletions src/components/TextPicker/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ type TextSelectorModalProps = {

/** Whether to show the tooltip text */
shouldShowTooltips?: boolean;
} & Pick<MenuItemBaseProps, 'description'> &

/** Whether to clear the input value when the modal closes */
shouldClearOnClose?: boolean;
} & Pick<MenuItemBaseProps, 'subtitle' | 'description'> &
TextProps;

type TextPickerProps = {
Expand All @@ -39,7 +42,7 @@ type TextPickerProps = {

/** Whether to show the tooltip text */
shouldShowTooltips?: boolean;
} & Pick<MenuItemBaseProps, 'rightLabel' | 'description'> &
} & Pick<MenuItemBaseProps, 'rightLabel' | 'subtitle' | 'description'> &
TextProps;

export type {TextSelectorModalProps, TextPickerProps};
42 changes: 40 additions & 2 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,9 @@ export default {
companyID: 'Company ID',
userID: 'User ID',
disable: 'Disable',
initialValue: 'Initial value',
currentDate: 'Current date',
value: 'Value',
},
location: {
useCurrent: 'Use current location',
Expand Down Expand Up @@ -1987,7 +1990,7 @@ export default {
reimburse: 'Reimbursements',
categories: 'Categories',
tags: 'Tags',
reportFields: 'Report Fields',
reportFields: 'Report fields',
taxes: 'Taxes',
bills: 'Bills',
invoices: 'Invoices',
Expand Down Expand Up @@ -2430,9 +2433,42 @@ export default {
title: "You haven't created any report fields",
subtitle: 'Add a custom field (text, date, or dropdown) that appears on reports.',
},
subtitle: "Report fields apply to all spend and can be helpful when you'd like to prompt for extra information",
subtitle: "Report fields apply to all spend and can be helpful when you'd like to prompt for extra information.",
disableReportFields: 'Disable report fields',
disableReportFieldsConfirmation: 'Are you sure? Text and date fields will be deleted, and lists will be disabled.',
textType: 'Text',
dateType: 'Date',
dropdownType: 'List',
textAlternateText: 'Add a field for free text input.',
dateAlternateText: 'Add a calendar for date selection.',
dropdownAlternateText: 'Add a list of options to choose from.',
nameInputSubtitle: 'Choose a name for the report field.',
typeInputSubtitle: 'Choose what type of report field to use.',
initialValueInputSubtitle: 'Enter a starting value to show in the report field.',
listValuesInputSubtitle: 'These values will appear in your report field dropdown. Enabled values can be selected by members.',
listInputSubtitle: 'These values will appear in your report field list. Enabled values can be selected by members.',
deleteValue: 'Delete value',
deleteValues: 'Delete values',
disableValue: 'Disable value',
disableValues: 'Disable values',
enableValue: 'Enable value',
enableValues: 'Enable values',
emptyReportFieldsValues: {
title: "You haven't created any list values",
subtitle: 'Add custom values to appear on reports.',
},
deleteValuePrompt: 'Are you sure you want to delete this list value?',
deleteValuesPrompt: 'Are you sure you want to delete these list values?',
listValueRequiredError: 'Please enter a list value name',
existingListValueError: 'A list value with this name already exists',
editValue: 'Edit value',
listValues: 'List values',
addValue: 'Add value',
existingReportFieldNameError: 'A report field with this name already exists',
reportFieldNameRequiredError: 'Please enter a report field name',
reportFieldTypeRequiredError: 'Please choose a report field type',
reportFieldInitialValueRequiredError: 'Please choose a report field initial value',
genericFailureMessage: 'An error occurred while updating the report field. Please try again.',
},
tags: {
tagName: 'Tag name',
Expand Down Expand Up @@ -2844,6 +2880,8 @@ export default {
editor: {
descriptionInputLabel: 'Description',
nameInputLabel: 'Name',
typeInputLabel: 'Type',
initialValueInputLabel: 'Initial value',
nameInputHelpText: "This is the name you'll see on your workspace.",
nameIsRequiredError: "You'll need to give your workspace a name.",
currencyInputLabel: 'Default currency',
Expand Down
40 changes: 39 additions & 1 deletion src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,9 @@ export default {
companyID: 'Empresa ID',
userID: 'Usuario ID',
disable: 'Deshabilitar',
initialValue: 'Valor inicial',
currentDate: 'Fecha actual',
value: 'Valor',
},
connectionComplete: {
title: 'Conexión completa',
Expand Down Expand Up @@ -2464,9 +2467,42 @@ export default {
title: 'No has creado ningún campo de informe',
subtitle: 'Añade un campo personalizado (texto, fecha o desplegable) que aparezca en los informes.',
},
subtitle: 'Los campos de informe se aplican a todos los gastos y pueden ser útiles cuando desees solicitar información adicional',
subtitle: 'Los campos de informe se aplican a todos los gastos y pueden ser útiles cuando quieras solicitar información adicional.',
disableReportFields: 'Desactivar campos de informe',
disableReportFieldsConfirmation: 'Estás seguro? Se eliminarán los campos de texto y fecha y se desactivarán las listas.',
textType: 'Texto',
dateType: 'Fecha',
dropdownType: 'Lista',
textAlternateText: 'Añade un campo para introducir texto libre.',
dateAlternateText: 'Añade un calendario para la selección de fechas.',
dropdownAlternateText: 'Añade una lista de opciones para elegir.',
nameInputSubtitle: 'Elige un nombre para el campo del informe.',
typeInputSubtitle: 'Elige qué tipo de campo de informe utilizar.',
initialValueInputSubtitle: 'Ingresa un valor inicial para mostrar en el campo del informe.',
listValuesInputSubtitle: 'Estos valores aparecerán en el desplegable del campo de tu informe. Los miembros pueden seleccionar los valores habilitados.',
listInputSubtitle: 'Estos valores aparecerán en la lista de campos de tu informe. Los miembros pueden seleccionar los valores habilitados.',
deleteValue: 'Eliminar valor',
deleteValues: 'Eliminar valores',
disableValue: 'Desactivar valor',
disableValues: 'Desactivar valores',
enableValue: 'Habilitar valor',
enableValues: 'Habilitar valores',
emptyReportFieldsValues: {
title: 'No has creado ningún valor en la lista',
subtitle: 'Añade valores personalizados para que aparezcan en los informes.',
},
deleteValuePrompt: '¿Estás seguro de que quieres eliminar este valor de la lista?',
deleteValuesPrompt: '¿Estás seguro de que quieres eliminar estos valores de la lista?',
listValueRequiredError: 'Ingresa un nombre para el valor de la lista',
existingListValueError: 'Ya existe un valor en la lista con este nombre',
editValue: 'Editar valor',
listValues: 'Valores de la lista',
addValue: 'Añade valor',
existingReportFieldNameError: 'Ya existe un campo de informe con este nombre',
reportFieldNameRequiredError: 'Ingresa un nombre de campo de informe',
reportFieldTypeRequiredError: 'Elige un tipo de campo de informe',
reportFieldInitialValueRequiredError: 'Elige un valor inicial de campo de informe',
genericFailureMessage: 'Se ha producido un error al actualizar el campo del informe. Por favor, inténtalo de nuevo.',
},
tags: {
tagName: 'Nombre de etiqueta',
Expand Down Expand Up @@ -2878,6 +2914,8 @@ export default {
editor: {
nameInputLabel: 'Nombre',
descriptionInputLabel: 'Descripción',
typeInputLabel: 'Tipo',
initialValueInputLabel: 'Valor inicial',
nameInputHelpText: 'Este es el nombre que verás en tu espacio de trabajo.',
nameIsRequiredError: 'Debes definir un nombre para tu espacio de trabajo.',
currencyInputLabel: 'Moneda por defecto',
Expand Down
6 changes: 6 additions & 0 deletions src/libs/API/parameters/CreateWorkspaceReportFieldParams.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type CreateWorkspaceReportFieldParams = {
policyID: string;
reportFields: string;
};

export default CreateWorkspaceReportFieldParams;
1 change: 1 addition & 0 deletions src/libs/API/parameters/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ export type {default as DeleteMoneyRequestOnSearchParams} from './DeleteMoneyReq
export type {default as HoldMoneyRequestOnSearchParams} from './HoldMoneyRequestOnSearchParams';
export type {default as UnholdMoneyRequestOnSearchParams} from './UnholdMoneyRequestOnSearchParams';
export type {default as UpdateNetSuiteSubsidiaryParams} from './UpdateNetSuiteSubsidiaryParams';
export type {default as CreateWorkspaceReportFieldParams} from './CreateWorkspaceReportFieldParams';
export type {default as OpenPolicyExpensifyCardsPageParams} from './OpenPolicyExpensifyCardsPageParams';
export type {default as RequestExpensifyCardLimitIncreaseParams} from './RequestExpensifyCardLimitIncreaseParams';
export type {default as UpdateNetSuiteGenericTypeParams} from './UpdateNetSuiteGenericTypeParams';
5 changes: 5 additions & 0 deletions src/libs/API/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ const WRITE_COMMANDS = {
UNHOLD_MONEY_REQUEST_ON_SEARCH: 'UnholdMoneyRequestOnSearch',
REQUEST_REFUND: 'User_RefundPurchase',
UPDATE_NETSUITE_SUBSIDIARY: 'UpdateNetSuiteSubsidiary',
CREATE_WORKSPACE_REPORT_FIELD: 'CreatePolicyReportField',
UPDATE_NETSUITE_SYNC_TAX_CONFIGURATION: 'UpdateNetSuiteSyncTaxConfiguration',
UPDATE_NETSUITE_EXPORTER: 'UpdateNetSuiteExporter',
UPDATE_NETSUITE_EXPORT_DATE: 'UpdateNetSuiteExportDate',
Expand Down Expand Up @@ -492,6 +493,10 @@ type WriteCommandParameters = {

// Netsuite parameters
[WRITE_COMMANDS.UPDATE_NETSUITE_SUBSIDIARY]: Parameters.UpdateNetSuiteSubsidiaryParams;

// Workspace report field parameters
[WRITE_COMMANDS.CREATE_WORKSPACE_REPORT_FIELD]: Parameters.CreateWorkspaceReportFieldParams;

[WRITE_COMMANDS.UPDATE_NETSUITE_SYNC_TAX_CONFIGURATION]: Parameters.UpdateNetSuiteGenericTypeParams<'enabled', boolean>;
[WRITE_COMMANDS.UPDATE_NETSUITE_EXPORTER]: Parameters.UpdateNetSuiteGenericTypeParams<'email', string>;
[WRITE_COMMANDS.UPDATE_NETSUITE_EXPORT_DATE]: Parameters.UpdateNetSuiteGenericTypeParams<'value', ValueOf<typeof CONST.NETSUITE_EXPORT_DATE>>;
Expand Down
Loading
Loading