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

[INV-3742][INV-3733][INV-3747][INV-3746] IAPP Records can Be cached and Used when Offline #3762

Open
wants to merge 23 commits into
base: dev
Choose a base branch
from

Conversation

LocalNewsTV
Copy link
Collaborator

Overview

This PR includes the following proposed change(s):

Tip

This work runs parallel to the previously broken down work for Activity type Records for PR's #3738, #3752

Note

IAPP Records are created by two network requests with separate payload. One for when showing the Tabular data, and the second for showing the records. This is why there's a distinction When sharing / loading the types of records to display.

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)
3.6% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Comment on lines +651 to +700
} else if (IappActions.getRows.match(action)) {
const { recordSetID, page, limit, tableFiltersHash } = action.payload;
draftState.recordTables[recordSetID] ??= {};
draftState.recordTables[recordSetID].loading = true;
draftState.recordTables[recordSetID].page = page;
draftState.recordTables[recordSetID].limit = limit;
draftState.recordTables[recordSetID].tableFiltersHash = tableFiltersHash;
} else if (IappActions.getRowsSuccess.match(action)) {
{
// the hash, page, and limit all need to line up
if (
draftState.recordTables?.[action.payload.recordSetID]?.tableFiltersHash !== action.payload.tableFiltersHash
) {
console.warn(
'hash mismatch',
draftState.recordTables?.[action.payload.recordSetID]?.tableFiltersHash,
action.payload.tableFiltersHash
);
return;
}
if (Number(draftState.recordTables?.[action.payload.recordSetID]?.limit) !== Number(action.payload.limit)) {
console.warn(
'limit mismatch',
draftState.recordTables?.[action.payload.recordSetID]?.limit,
action.payload.limit
);
console.warn(
'typeof',
typeof draftState.recordTables?.[action.payload.recordSetID]?.limit,
typeof action.payload.limit
);
return;
}
if (Number(draftState.recordTables?.[action.payload.recordSetID]?.page) !== Number(action.payload.page)) {
console.warn(
'page mismatch',
draftState.recordTables?.[action.payload.recordSetID]?.page,
action.payload.page
);
return;
}
if (draftState.recordTables?.[action.payload.recordSetID]) {
draftState.recordTables[action.payload.recordSetID].rows = action.payload.rows;
} else {
draftState.recordTables[action.payload.recordSetID] = {};
draftState.recordTables[action.payload.recordSetID].rows = action.payload.rows;
} // set defaults
draftState.recordTables[action.payload.recordSetID].loading = false;
return;
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pre-existing code. Just migrated from Switch to if-else block during the actionCreator conversion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant