Skip to content

Commit 3bb196e

Browse files
authored
Merge pull request #159 from SailingSteve/steveStaffClientApr3-1035pm
Minor fixes for FastLoad
2 parents facf5be + c123764 commit 3bb196e

1 file changed

Lines changed: 17 additions & 12 deletions

File tree

src/js/pages/SystemSettings/FastLoad.jsx

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ const FastLoad = () => {
3333
}, []);
3434

3535
const doFastLoad = async () => {
36+
const email = emailInputRef.current?.value || '';
37+
const password = passwordInputRef.current?.value || '';
3638
setShowUnanonButton(false);
3739
setShowUnanonOptions(false);
3840
setButtonsDisabled(true);
@@ -51,28 +53,29 @@ const FastLoad = () => {
5153
$tb.append(insertableHtml);
5254

5355
let loaded = 0;
54-
const doNotAnonymize = !(emailInputRef.current?.value && emailInputRef.current.value.length > 0 && passwordInputRef.current?.value && passwordInputRef.current.value.length > 0);
55-
console.log(`doFastLoad doNotAnonymize: ${doNotAnonymize}`);
56+
const doNotAnonymize = email.length > 0 && password.length > 0;
57+
console.log(`doFastLoad: doNotAnonymize: ${doNotAnonymize}`);
5658
/* eslint-disable no-await-in-loop */
5759
for (let i = 0; i < allowableTables.length; i++) {
5860
const table = allowableTables[i];
61+
console.log(`doFastLoad: fast-load-table-retrieve: table: ${table}, doNotAnonymize: ${doNotAnonymize}, email: '${email}'`);
5962
const tablePacket = await weConnectQueryFn('fast-load-table-retrieve', {
6063
tableName: table,
6164
doNotAnonymize,
62-
email: emailInputRef?.current?.value,
63-
password: passwordInputRef?.current?.value,
65+
email,
66+
password,
6467
}, METHOD.POST, forceMaster);
65-
console.log('response for ', table);
66-
// console.log('response for tablePacket', JSON.stringify(tablePacket));
68+
console.log('doFastLoad: response for ', table);
69+
// console.log('doFastLoad: response for tablePacket', JSON.stringify(tablePacket));
6770
if (tablePacket) {
6871
const { tableJSON } = tablePacket;
69-
if (table === 'TaskDefinition') {
70-
console.log('November 16, 2025: Need to manually insert a boolean field into the TaskDefinition table in order for that table to fast load, the field (which is only on the production sever, and not in the code) is "statusOfferDecisionNeededSetFalse"');
71-
}
72+
// if (table === 'TaskDefinition') {
73+
// console.log('doFastLoad: November 16, 2025: Need to manually insert a boolean field into the TaskDefinition table in order for that table to fast load, the field (which is only on the production sever, and not in the code) is "statusOfferDecisionNeededSetFalse"');
74+
// }
7275
const replaceResponse = await weConnectQueryFn('fast-load-local-table-replace', { tablePacket }, METHOD.POST);
7376
const count = tableJSON?.length || 0;
7477
if (replaceResponse?.error) {
75-
console.log(`replaceResonse sent an error ${replaceResponse.error}`);
78+
console.log(`doFastLoad: replaceResonse for table ${table} -- sent an error ${replaceResponse.error}`);
7679
$(`#${table}_id`).html(`<td style="color: red">${replaceResponse.error}</td>`);
7780
} else if (count === 0) {
7881
$(`#${table}_id`).html('<td style="color: red">no rows replaced by local server</td>');
@@ -81,11 +84,13 @@ const FastLoad = () => {
8184
loaded += 1;
8285
}
8386
} else {
84-
console.error('fast-load-table-retrieve failed');
87+
console.error('doFastLoad: fast-load-table-retrieve failed');
8588
$(`#${table}_id`).html('<td style="background-color: #FFFF00">Received zero rows from master</td>');
8689
}
8790
}
8891
setTablesLoaded(loaded);
92+
setButtonsDisabled(false);
93+
8994
if (loaded) {
9095
$('#done').css('display', 'contents');
9196
}
@@ -175,7 +180,7 @@ const FastLoad = () => {
175180
</div>
176181
<TextField
177182
id="search_input"
178-
label="Master Server Login Email"
183+
label="Master Server Login Email (your login to team.wevote.org)"
179184
inputRef={emailInputRef}
180185
name="firstName"
181186
defaultValue=""

0 commit comments

Comments
 (0)