mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
Exposed originalImportSize from members importer
refs https://github.com/TryGhost/Team/issues/912 - The variable is needed as a datapoint in Ghost when sending stats about what the import size was used
This commit is contained in:
parent
e4109e38f3
commit
96b3629280
2 changed files with 8 additions and 0 deletions
|
@ -272,6 +272,8 @@ module.exports = class MembersCSVImporter {
|
||||||
const meta = {};
|
const meta = {};
|
||||||
const job = await this.prepare(pathToCSV, headerMapping, globalLabels);
|
const job = await this.prepare(pathToCSV, headerMapping, globalLabels);
|
||||||
|
|
||||||
|
meta.originalImportSize = job.batches;
|
||||||
|
|
||||||
if (this._isSet('checkEmailList') && this._importThreshold) {
|
if (this._isSet('checkEmailList') && this._importThreshold) {
|
||||||
meta.freeze = job.batches > this._importThreshold;
|
meta.freeze = job.batches > this._importThreshold;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -100,6 +100,9 @@ describe('Importer', function () {
|
||||||
should.exist(result.meta.freeze);
|
should.exist(result.meta.freeze);
|
||||||
result.meta.freeze.should.be.false();
|
result.meta.freeze.should.be.false();
|
||||||
|
|
||||||
|
should.exist(result.meta.originalImportSize);
|
||||||
|
result.meta.originalImportSize.should.equal(2);
|
||||||
|
|
||||||
fsWriteSpy.calledOnce.should.be.true();
|
fsWriteSpy.calledOnce.should.be.true();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -176,6 +179,9 @@ describe('Importer', function () {
|
||||||
should.exist(result.meta.freeze);
|
should.exist(result.meta.freeze);
|
||||||
result.meta.freeze.should.be.true();
|
result.meta.freeze.should.be.true();
|
||||||
|
|
||||||
|
should.exist(result.meta.originalImportSize);
|
||||||
|
result.meta.originalImportSize.should.equal(2);
|
||||||
|
|
||||||
fsWriteSpy.calledOnce.should.be.true();
|
fsWriteSpy.calledOnce.should.be.true();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue