(core) DocLimits: display days remaining instead of days of grace period

Summary:
Before this change we would always say there are 14 days remaining,
regardless of how many actually are remaining. Let's pass around a
different `dataLimitsInfo` object that also reports the number of days
remaining.

Test Plan: Ensure the test suite passes.

Reviewers: georgegevoian

Reviewed By: georgegevoian

Differential Revision: https://phab.getgrist.com/D4332
This commit is contained in:
Jordi Gutiérrez Hermoso
2024-08-27 21:27:59 -04:00
parent 8da89b0a3d
commit 80f8168cab
7 changed files with 40 additions and 30 deletions

View File

@@ -2212,6 +2212,7 @@ describe('ApiServer', function() {
await server.dbManager.setDocsMetadata({[id]: {usage}});
}
await server.dbManager.setDocGracePeriodStart(docIds[docIds.length - 1], new Date(2000, 1, 1));
await server.dbManager.setDocGracePeriodStart(docIds[docIds.length - 2], new Date());
// Check that what's reported by /usage is accurate.
await assertOrgUsage(freeTeamOrgId, chimpy, {
@@ -2238,6 +2239,7 @@ describe('ApiServer', function() {
dataSizeBytes: 999999999,
attachmentsSizeBytes: 999999999,
}}});
await server.dbManager.setDocGracePeriodStart(docId, new Date());
// Check that /usage includes that document in the count.
await assertOrgUsage(freeTeamOrgId, chimpy, {