Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
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
5 changes: 5 additions & 0 deletions src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2164,6 +2164,7 @@ const CONST = {
ADD_OFFICE_LOCATION: 'POLICYCHANGELOG_ADD_OFFICE_LOCATION',
UPDATE_OFFICE_LOCATION: 'POLICYCHANGELOG_UPDATE_OFFICE_LOCATION',
DELETE_OFFICE_LOCATION: 'POLICYCHANGELOG_DELETE_OFFICE_LOCATION',
UPDATE_EMPLOYEE_OFFICE_LOCATION: 'POLICYCHANGELOG_UPDATE_EMPLOYEE_OFFICE_LOCATION',
ADD_RULE: 'POLICYCHANGELOG_ADD_RULE',
UPDATE_RULE: 'POLICYCHANGELOG_UPDATE_RULE',
REMOVE_RULE: 'POLICYCHANGELOG_REMOVE_RULE',
Expand Down Expand Up @@ -5067,6 +5068,8 @@ const CONST = {
MAKE_MEMBER: 'makeMember',
MAKE_ADMIN: 'makeAdmin',
CHANGE_ROLE: 'changeRole',
CHANGE_OFFICE_LOCATION: 'changeOfficeLocation',
CHANGE_WORK_ARRANGEMENT: 'changeWorkArrangement',
},
BULK_ACTION_TYPES: {
DELETE: 'delete',
Expand Down Expand Up @@ -5223,6 +5226,8 @@ const CONST = {
ADDRESS: 'address',
IS_DEFAULT: 'isDefault',
},
// The officeID that assigns a member to the company address, which isn't keyed in the workspace's officeLocations
COMPANY_ADDRESS_OFFICE_ID: '1',
WORK_ARRANGEMENT: {
OFFICE_BASED: 'officeBased',
NO_REGULAR_WORKPLACE: 'noRegularWorkplace',
Expand Down
2 changes: 2 additions & 0 deletions src/CONST/runtimeConfigured.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ const CONST_RUNTIME: ConstRuntime = {
SCREENS.SUBMIT_PLAN_WELCOME_MODAL.DYNAMIC_ROOT,
SCREENS.MONEY_REQUEST.DYNAMIC_STEP_SCAN,
SCREENS.DOMAIN.MEMBERS_MOVE_TO_GROUP,
SCREENS.WORKSPACE.MEMBERS_CHANGE_OFFICE_LOCATION,
SCREENS.WORKSPACE.MEMBERS_CHANGE_WORK_ARRANGEMENT,
SCREENS.WORKSPACE.MEMBERS_ROLE,
SCREENS.PRE_MOUNT_BUFFER,
...Object.values(SCREENS.MULTIFACTOR_AUTHENTICATION),
Expand Down
3 changes: 3 additions & 0 deletions src/ONYXKEYS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,8 @@ const ONYXKEYS = {
/** Selected domain member account IDs for the move-to-group operation */
RAM_ONLY_DOMAIN_MEMBERS_SELECTED_FOR_MOVE: 'domainMembersSelectedForMove',

/** Account IDs of the workspace members selected for a bulk office location or work arrangement change */
RAM_ONLY_WORKSPACE_MEMBERS_SELECTED_FOR_BULK_EDIT: 'workspaceMembersSelectedForBulkEdit',
/** The workspace members selected for the bulk role change, with the workspace they were selected on */
RAM_ONLY_WORKSPACE_MEMBERS_SELECTED_FOR_ROLE_CHANGE: 'workspaceMembersSelectedForRoleChange',

Expand Down Expand Up @@ -1901,6 +1903,7 @@ type OnyxValuesMapping = {
[ONYXKEYS.VIEWING_PUBLIC_ROOM_REPORT_ID]: string;
[ONYXKEYS.MY_DOMAIN_SECURITY_GROUPS]: Record<string, OnyxTypes.DomainSecurityGroupMembership>;
[ONYXKEYS.RAM_ONLY_DOMAIN_MEMBERS_SELECTED_FOR_MOVE]: string[];
[ONYXKEYS.RAM_ONLY_WORKSPACE_MEMBERS_SELECTED_FOR_BULK_EDIT]: OnyxTypes.WorkspaceMembersSelectedForBulkEdit;
[ONYXKEYS.RAM_ONLY_WORKSPACE_MEMBERS_SELECTED_FOR_ROLE_CHANGE]: OnyxTypes.WorkspaceMembersSelectedForRoleChange;
[ONYXKEYS.VERIFY_3DS_SUBSCRIPTION]: string;
[ONYXKEYS.VERIFY_3DS_SUBSCRIPTION_SOURCE]: string;
Expand Down
12 changes: 12 additions & 0 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3574,6 +3574,14 @@ const ROUTES = {
route: 'workspaces/:policyID/members/import',
getRoute: (policyID: string) => `workspaces/${policyID}/members/import` as const,
},
WORKSPACE_MEMBERS_CHANGE_OFFICE_LOCATION: {
route: 'workspaces/:policyID/members/change-office-location',
getRoute: (policyID: string) => `workspaces/${policyID}/members/change-office-location` as const,
},
WORKSPACE_MEMBERS_CHANGE_WORK_ARRANGEMENT: {
route: 'workspaces/:policyID/members/change-work-arrangement',
getRoute: (policyID: string) => `workspaces/${policyID}/members/change-work-arrangement` as const,
},
WORKSPACE_MEMBERS_IMPORTED: {
route: 'workspaces/:policyID/members/imported',
getRoute: (policyID: string) => `workspaces/${policyID}/members/imported` as const,
Expand Down Expand Up @@ -3890,6 +3898,10 @@ const ROUTES = {
route: 'workspaces/:policyID/members/:accountID/work-arrangement',
getRoute: (policyID: string, accountID: number) => `workspaces/${policyID}/members/${accountID}/work-arrangement` as const,
},
WORKSPACE_MEMBER_OFFICE_LOCATION: {
route: 'workspaces/:policyID/members/:accountID/office-location',
getRoute: (policyID: string, accountID: number) => `workspaces/${policyID}/members/${accountID}/office-location` as const,
},
WORKSPACE_CUSTOM_FIELDS: {
route: 'workspaces/:policyID/members/:accountID/:customFieldType',
getRoute: (policyID: string, accountID: number, customFieldType: CustomFieldType) => `/workspaces/${policyID}/members/${accountID}/${customFieldType}` as const,
Expand Down
3 changes: 3 additions & 0 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,8 @@ const SCREENS = {
ROOMS: 'Workspace_Rooms',
ROOM_CREATE: 'Workspace_Room_Create',
MEMBERS_IMPORT: 'Members_Import',
MEMBERS_CHANGE_OFFICE_LOCATION: 'Members_Change_Office_Location',
MEMBERS_CHANGE_WORK_ARRANGEMENT: 'Members_Change_Work_Arrangement',
MEMBERS_IMPORTED: 'Members_Imported',
MEMBERS_IMPORTED_CONFIRMATION: 'Members_Imported_Confirmation',
DYNAMIC_WORKSPACE_INVITE: 'Dynamic_Workspace_Invite',
Expand Down Expand Up @@ -967,6 +969,7 @@ const SCREENS = {
MEMBER_DETAILS_ROLE: 'Workspace_Member_Details_Role',
MEMBERS_ROLE: 'Workspace_Members_Role',
MEMBER_WORK_ARRANGEMENT: 'Workspace_Member_Work_Arrangement',
MEMBER_OFFICE_LOCATION: 'Workspace_Member_Office_Location',
INVITE_WORK_ARRANGEMENT: 'Workspace_Invite_Work_Arrangement',
MEMBER_CUSTOM_FIELD: 'Workspace_Member_Custom_Field',
MEMBER_NEW_CARD: 'Workspace_Member_NewCard',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ type WorkspaceMembersTableRowProps = {
/** Whether the custom field 2 column is visible on web screens or not */
shouldShowCustomField2Column: boolean;

/** Whether the office location column is visible on web screens or not */
shouldShowOfficeLocationColumn: boolean;
/** Whether the bank account column is visible on web screens or not */
shouldShowBankAccountColumn: boolean;

Expand All @@ -46,6 +48,7 @@ export default function WorkspaceMembersTableRow({
rowIndex,
shouldShowCustomField1Column,
shouldShowCustomField2Column,
shouldShowOfficeLocationColumn,
shouldShowBankAccountColumn,
shouldUseNarrowTableLayout,
policy,
Expand Down Expand Up @@ -114,6 +117,22 @@ export default function WorkspaceMembersTableRow({
</View>
</View>

{!shouldUseNarrowTableLayout && shouldShowOfficeLocationColumn && (
<View
style={[styles.flex1, styles.flexRow, styles.alignItemsCenter]}
{...getCellAccessibilityProps(isTableSemanticsEnabled)}
>
{!!item.officeLocationName && (
<TextWithTooltip
shouldShowTooltip
numberOfLines={1}
text={item.officeLocationName}
style={[styles.lh16, styles.optionDisplayName, styles.pre]}
/>
)}
</View>
)}

{!shouldUseNarrowTableLayout && shouldShowCustomField1Column && (
<View
style={[styles.flex1, styles.flexRow, styles.alignItemsCenter]}
Expand Down
22 changes: 21 additions & 1 deletion src/components/Tables/WorkspaceMembersTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@ import React from 'react';

import WorkspaceMembersTableRow from './WorkspaceMembersTableRow';

type WorkspaceMembersTableColumnKey = 'member' | 'role' | 'actions' | 'customField1' | 'customField2' | 'bankAccount';
type WorkspaceMembersTableColumnKey = 'member' | 'role' | 'actions' | 'officeLocation' | 'customField1' | 'customField2' | 'bankAccount';

type WorkspaceMemberRowData = TableData & {
accountID: number;
login: string;
role?: ValueOf<typeof CONST.POLICY.ROLE>;
employeeUserID?: string;
employeePayrollID?: string;
officeLocationName?: string;
bankAccountLastFour?: string;
name: string;
email: string;
Expand All @@ -57,6 +58,7 @@ type WorkspaceMembersTableProps = {
selectedKeys: string[];
shouldShowCustomField1Column: boolean;
shouldShowCustomField2Column: boolean;
shouldShowOfficeLocationColumn: boolean;
shouldShowBankAccountColumn: boolean;
onRowSelectionChange: (selectedRowKeys: string[]) => void;
headerComponent?: React.ReactElement;
Expand Down Expand Up @@ -84,6 +86,7 @@ export default function WorkspaceMembersTable({
selectedKeys,
shouldShowCustomField1Column,
shouldShowCustomField2Column,
shouldShowOfficeLocationColumn,
shouldShowBankAccountColumn,
members,
onRowSelectionChange,
Expand Down Expand Up @@ -112,6 +115,18 @@ export default function WorkspaceMembersTable({
},
},

...(shouldShowOfficeLocationColumn
? [
{
sortable: true,
key: 'officeLocation' as const,
label: translate('workspace.people.officeLocation'),
dynamicSizing: {
getContentToMeasure: (item: WorkspaceMemberRowData) => (item.officeLocationName ? [{text: item.officeLocationName, fontSize: fontScale.text}] : []),
},
},
]
: []),
...(shouldShowCustomField1Column
? [
{
Expand Down Expand Up @@ -186,6 +201,10 @@ export default function WorkspaceMembersTable({
return compareOptionalValues(item1.role, item2.role, compareRoleNames, orderMultiplier, memberNameComparison);
}

if (activeSorting.columnKey === 'officeLocation') {
return compareOptionalValues(item1.officeLocationName, item2.officeLocationName, localeCompare, orderMultiplier, memberNameComparison);
}

if (activeSorting.columnKey === 'customField1') {
return compareOptionalValues(item1.employeeUserID, item2.employeeUserID, localeCompare, orderMultiplier, memberNameComparison);
}
Expand Down Expand Up @@ -324,6 +343,7 @@ export default function WorkspaceMembersTable({
shouldUseNarrowTableLayout={shouldUseNarrowTableLayout}
shouldShowCustomField1Column={shouldShowCustomField1Column}
shouldShowCustomField2Column={shouldShowCustomField2Column}
shouldShowOfficeLocationColumn={shouldShowOfficeLocationColumn}
shouldShowBankAccountColumn={shouldShowBankAccountColumn}
policy={policy}
/>
Expand Down
9 changes: 9 additions & 0 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7379,6 +7379,10 @@ Der Control-Tarif beginnt bei 9 $ pro aktivem Mitglied und Monat.`,
'Das Mitglied arbeitet von zu Hause aus oder reist zwischen verschiedenen Standorten ohne festes Büro, daher gelten die Pendelregelungen nicht.',
futureOnlyNote: 'Änderungen gelten nur für zukünftige Kilometerberechnungen. Bestehende Kilometerabrechnungen werden nicht neu berechnet.',
},
officeLocation: 'Bürostandort',
officeLocationWithAddress: ({name, address}: {name: string; address: string}) => `${name} (${address})`,
changeOfficeLocation: 'Bürostandort ändern',
changeWorkArrangement: 'Arbeitsvereinbarung ändern',
changeRole: 'Rolle ändern',
},
card: {
Expand Down Expand Up @@ -9881,6 +9885,11 @@ Fügen Sie weitere Ausgabelimits hinzu, um den Cashflow Ihres Unternehmens zu sc
setAsPrimary: ({name}: {name: string}) => `Legen Sie den Bürositz „${name}“ als primär fest`,
setCompanyAddressAsPrimary: 'Firmenadresse als primär festlegen',
removed: ({name}: {name: string}) => `hat den Bürostandort „${name}“ entfernt`,
changedMemberOfficeLocation: ({displayName, officeLocation, previousOfficeLocation}: {displayName: string; officeLocation: string; previousOfficeLocation: string}) =>
`hat den Bürostandort von ${displayName} in ${officeLocation} geändert (zuvor ${previousOfficeLocation})`,
quotedName: ({name}: {name: string}) => `„${name}“`,
companyAddress: 'die Firmenadresse',
primaryOffice: 'das Hauptbüro',
},
workArrangement: {
set: ({arrangement}: {arrangement: string}) => `Standard-Arbeitsmodell auf ${arrangement} festlegen`,
Expand Down
9 changes: 9 additions & 0 deletions src/languages/el.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7507,6 +7507,10 @@ _Για πιο αναλυτικές οδηγίες, [επισκεφθείτε τ
optionNoRegularWorkspaceHelp: 'Το μέλος εργάζεται από το σπίτι ή ταξιδεύει μεταξύ τοποθεσιών χωρίς τακτικό γραφείο, επομένως οι κανόνες μετακίνησης δεν ισχύουν.',
futureOnlyNote: 'Οι αλλαγές ισχύουν μόνο για μελλοντικούς υπολογισμούς χιλιομέτρων. Οι υπάρχουσες δαπάνες χιλιομέτρων δεν επανυπολογίζονται.',
},
officeLocation: 'Τοποθεσία γραφείου',
officeLocationWithAddress: ({name, address}: {name: string; address: string}) => `${name} (${address})`,
changeOfficeLocation: 'Αλλαγή τοποθεσίας γραφείου',
changeWorkArrangement: 'Αλλαγή ρύθμισης εργασίας',
changeRole: 'Αλλαγή ρόλου',
},
card: {
Expand Down Expand Up @@ -10006,6 +10010,11 @@ ${reportName}`,
setAsPrimary: ({name}: {name: string}) => `ορίστε την τοποθεσία γραφείου «${name}» ως κύρια`,
setCompanyAddressAsPrimary: 'ορίστε τη διεύθυνση της εταιρείας ως κύρια',
removed: ({name}: {name: string}) => `αφαίρεσε την τοποθεσία γραφείου «${name}»`,
changedMemberOfficeLocation: ({displayName, officeLocation, previousOfficeLocation}: {displayName: string; officeLocation: string; previousOfficeLocation: string}) =>
`άλλαξε την τοποθεσία γραφείου του/της ${displayName} σε ${officeLocation} (προηγουμένως ${previousOfficeLocation})`,
quotedName: ({name}: {name: string}) => `«${name}»`,
companyAddress: 'η διεύθυνση της εταιρείας',
primaryOffice: 'το κύριο γραφείο',
},
workArrangement: {
set: ({arrangement}: {arrangement: string}) => `ορίστε την προεπιλεγμένη εργασιακή ρύθμιση σε ${arrangement}`,
Expand Down
9 changes: 9 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7706,6 +7706,10 @@ const translations = {
optionNoRegularWorkspaceHelp: "Member works from home or travels between locations with no regular office, so commute rules don't apply.",
futureOnlyNote: 'Changes apply only to future mileage calculations. Existing mileage expenses are not recalculated.',
},
officeLocation: 'Office location',
officeLocationWithAddress: ({name, address}: {name: string; address: string}) => `${name} (${address})`,
changeOfficeLocation: 'Change office location',
changeWorkArrangement: 'Change work arrangement',
removeWorkspaceMemberButtonTitle: 'Remove from workspace',
removeGroupMemberButtonTitle: 'Remove from group',
removeRoomMemberButtonTitle: 'Remove from chat',
Expand Down Expand Up @@ -10034,6 +10038,11 @@ const translations = {
setAsPrimary: ({name}: {name: string}) => `set the office location "${name}" as primary`,
setCompanyAddressAsPrimary: 'set the company address as primary',
removed: ({name}: {name: string}) => `removed the office location "${name}"`,
changedMemberOfficeLocation: ({displayName, officeLocation, previousOfficeLocation}: {displayName: string; officeLocation: string; previousOfficeLocation: string}) =>
`changed ${displayName}'s office location to ${officeLocation} (previously ${previousOfficeLocation})`,
quotedName: ({name}: {name: string}) => `"${name}"`,
companyAddress: 'the company address',
primaryOffice: 'the primary office',
},
workArrangement: {
set: ({arrangement}: {arrangement: string}) => `set the default work arrangement to ${arrangement}`,
Expand Down
9 changes: 9 additions & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7237,6 +7237,10 @@ El plan Controlar empieza en 9 $ por miembro activo al mes.`,
'La persona miembro trabaja desde casa o viaja entre ubicaciones sin una oficina fija, por lo que no se aplican las normas sobre desplazamientos.',
futureOnlyNote: 'Los cambios se aplican solo a los cálculos de kilometraje futuros. Los gastos de kilometraje existentes no se recalculan.',
},
officeLocation: 'Ubicación de la oficina',
officeLocationWithAddress: ({name, address}: {name: string; address: string}) => `${name} (${address})`,
changeOfficeLocation: 'Cambiar ubicación de la oficina',
changeWorkArrangement: 'Cambiar modalidad de trabajo',
},
accounting: {
settings: 'configuración',
Expand Down Expand Up @@ -9642,6 +9646,11 @@ ${reportName}`,
setAsPrimary: ({name}: {name: string}) => `establecer la ubicación de la oficina «${name}» como principal`,
setCompanyAddressAsPrimary: 'establecer la dirección de la empresa como principal',
removed: ({name}: {name: string}) => `eliminó la ubicación de la oficina «${name}»`,
changedMemberOfficeLocation: ({displayName, officeLocation, previousOfficeLocation}: {displayName: string; officeLocation: string; previousOfficeLocation: string}) =>
`cambió la ubicación de la oficina de ${displayName} a ${officeLocation} (previamente ${previousOfficeLocation})`,
quotedName: ({name}: {name: string}) => `"${name}"`,
companyAddress: 'la dirección de la empresa',
primaryOffice: 'la oficina principal',
},
workArrangement: {
set: ({arrangement}: {arrangement: string}) => `establecer la modalidad de trabajo predeterminada en ${arrangement}`,
Expand Down
9 changes: 9 additions & 0 deletions src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7398,6 +7398,10 @@ Le forfait Control commence à 9 $ par Membre actif et par mois.`,
'Le membre travaille à domicile ou se déplace entre plusieurs sites sans bureau fixe, donc les règles relatives aux trajets domicile-travail ne s’appliquent pas.',
futureOnlyNote: 'Les modifications s’appliquent uniquement aux calculs de kilométrage futurs. Les dépenses de kilométrage existantes ne sont pas recalculées.',
},
officeLocation: 'Lieu de bureau',
officeLocationWithAddress: ({name, address}: {name: string; address: string}) => `${name} (${address})`,
changeOfficeLocation: 'Modifier le lieu de travail',
changeWorkArrangement: 'Modifier l’organisation du travail',
changeRole: 'Modifier le rôle',
},
card: {
Expand Down Expand Up @@ -9904,6 +9908,11 @@ Ajoutez davantage de règles de dépenses pour protéger la trésorerie de l’e
setAsPrimary: ({name}: {name: string}) => `définir le lieu de travail « ${name} » comme principal`,
setCompanyAddressAsPrimary: 'définir l’adresse de l’entreprise comme principale',
removed: ({name}: {name: string}) => `a supprimé le lieu de bureau « ${name} »`,
changedMemberOfficeLocation: ({displayName, officeLocation, previousOfficeLocation}: {displayName: string; officeLocation: string; previousOfficeLocation: string}) =>
`a modifié le lieu de travail de ${displayName} en ${officeLocation} (précédemment ${previousOfficeLocation})`,
quotedName: ({name}: {name: string}) => `« ${name} »`,
companyAddress: 'l’adresse de l’entreprise',
primaryOffice: 'le bureau principal',
},
workArrangement: {
set: ({arrangement}: {arrangement: string}) => `définir l’organisation de travail par défaut sur ${arrangement}`,
Expand Down
Loading
Loading