(null);
const selectableKeys = rows
.filter(canSelectWorksmobileRow)
@@ -1076,7 +1167,7 @@ function ComparisonTable({
rows,
selectedKeys,
);
- const selectedUpdateUserIds = getWorksmobileSelectedUpdateUserIds(
+ const selectedImportUserIds = getWorksmobileSelectedImportUserIds(
rows,
selectedKeys,
);
@@ -1090,7 +1181,7 @@ function ComparisonTable({
selectedActionIds.length === 0 &&
selectedDeleteIds.length > 0 &&
canRunDeleteAction;
- const canRunUserUpdateAction = Boolean(onUpdateSelected);
+ const canRunUserImportAction = Boolean(onImportSelected);
const selectedActionLabel = shouldRunDeleteAction
? deleteActionLabel
: actionLabel;
@@ -1102,11 +1193,9 @@ function ComparisonTable({
? selectedActionIds.length === 0 && selectedDeleteIds.length === 0
: shouldRunDeleteAction
? selectedDeleteIds.length === 0 || deleteActionDisabled
- : requireInitialPassword
- ? selectedCreateUserIds.length === 0
- : selectedActionIds.length === 0) || actionDisabled;
- const updateActionDisabled =
- selectedUpdateUserIds.length === 0 || actionDisabled;
+ : selectedActionIds.length === 0) || actionDisabled;
+ const importActionButtonDisabled =
+ selectedImportUserIds.length === 0 || importActionDisabled;
const allSelectableSelected =
selectableKeys.length > 0 &&
selectableKeys.every((key) => selectedKeys.includes(key));
@@ -1228,7 +1317,8 @@ function ComparisonTable({
onDeleteSelected(selectedDeleteIds);
return;
}
- if (requireInitialPassword) {
+ if (requireInitialPassword && selectedCreateUserIds.length > 0) {
+ setPendingActionIds(selectedActionIds);
setPendingInitialPasswordIds(selectedCreateUserIds);
setInitialPassword("");
setInitialPasswordOpen(true);
@@ -1237,11 +1327,11 @@ function ComparisonTable({
onCreateSelected(selectedActionIds);
};
- const runUpdateAction = () => {
- if (!onUpdateSelected || selectedUpdateUserIds.length === 0) {
+ const runImportAction = () => {
+ if (!onImportSelected || selectedImportUserIds.length === 0) {
return;
}
- onUpdateSelected(selectedUpdateUserIds);
+ onImportSelected(selectedImportUserIds);
};
const confirmInitialPassword = async () => {
@@ -1251,13 +1341,18 @@ function ComparisonTable({
return;
}
try {
- await onCreateSelected(pendingInitialPasswordIds, password);
+ await onCreateSelected(
+ pendingActionIds,
+ password,
+ pendingInitialPasswordIds,
+ );
} catch {
return;
}
setInitialPasswordOpen(false);
setInitialPassword("");
setPendingInitialPasswordIds([]);
+ setPendingActionIds([]);
};
return (
@@ -1300,27 +1395,28 @@ function ComparisonTable({
}
/>
{accountStatusFilter && onAccountStatusFilterChange ? (
-
+ onAccountStatusFilterChange(
+ value as WorksmobileAccountStatusFilter,
+ )
+ }
>
- {worksmobileAccountStatusFilterOptions.map((option) => (
-
- ))}
-
+
+
+
+
+ {worksmobileAccountStatusFilterOptions.map((option) => (
+
+ {option.label}
+
+ ))}
+
+
) : null}
@@ -1380,15 +1476,15 @@ function ComparisonTable({
>
{selectedActionLabel}
- {canRunUserUpdateAction && (
+ {canRunUserImportAction && (
)}