Merge pull request #5531 from overleaf/jel-web-unused-metrics-code

[web] Remove unused metrics code

GitOrigin-RevId: ffad327c02ebecfe47c4a063b8e694e5a18e3257
This commit is contained in:
Timothée Alby 2021-10-22 09:58:24 +02:00 committed by Copybot
parent e8ddc95c2f
commit 47cd2d7324
2 changed files with 0 additions and 56 deletions

View file

@ -45,30 +45,6 @@ const InstitutionsAPI = {
)
},
getInstitutionLicences(institutionId, startDate, endDate, lag, callback) {
makeAffiliationRequest(
{
method: 'GET',
path: `/api/v2/institutions/${institutionId.toString()}/institution_licences`,
body: { start_date: startDate, end_date: endDate, lag },
defaultErrorMessage: "Couldn't get institution licences",
},
callback
)
},
getInstitutionNewLicences(institutionId, startDate, endDate, lag, callback) {
makeAffiliationRequest(
{
method: 'GET',
path: `/api/v2/institutions/${institutionId.toString()}/new_institution_licences`,
body: { start_date: startDate, end_date: endDate, lag },
defaultErrorMessage: "Couldn't get institution new licences",
},
callback
)
},
getUserAffiliations(userId, callback) {
makeAffiliationRequest(
{

View file

@ -74,38 +74,6 @@ describe('InstitutionsAPI', function () {
})
})
describe('getInstitutionLicences', function () {
it('get licences', function (done) {
this.institutionId = 123
const responseBody = {
lag: 'monthly',
data: [{ key: 'users', values: [{ x: '2018-01-01', y: 1 }] }],
}
this.request.yields(null, { statusCode: 200 }, responseBody)
const startDate = '1417392000'
const endDate = '1420848000'
this.InstitutionsAPI.getInstitutionLicences(
this.institutionId,
startDate,
endDate,
'monthly',
(err, body) => {
expect(err).not.to.exist
this.request.calledOnce.should.equal(true)
const requestOptions = this.request.lastCall.args[0]
const expectedUrl = `v1.url/api/v2/institutions/${this.institutionId}/institution_licences`
requestOptions.url.should.equal(expectedUrl)
requestOptions.method.should.equal('GET')
requestOptions.body.start_date.should.equal(startDate)
requestOptions.body.end_date.should.equal(endDate)
requestOptions.body.lag.should.equal('monthly')
body.should.equal(responseBody)
done()
}
)
})
})
describe('getLicencesForAnalytics', function () {
const lag = 'daily'
const queryDate = '2017-01-07:00:00.000Z'