Delete unused PDF-related code (#6334)

* Remove new logs UI code
* Remove unused preview components
* Move metrics file
* Remove Angular PDF controllers
* Move the service worker util functions
* Remove the ide/pdfng folder
* Remove vendored pdf.js
* Remove showNewPdfPreview
* Use mockCompile
* Remove split test code

GitOrigin-RevId: 723b7440c62cda51f6ad8bb9c691900882166d21
This commit is contained in:
Alf Eaton
2022-03-16 09:03:04 +00:00
committed by Copybot
parent 7ee6b477e1
commit 9f969d07e0
58 changed files with 168 additions and 87831 deletions
@@ -1397,48 +1397,6 @@ describe('ProjectController', function () {
})
describe('feature flags', function () {
describe('showNewPdfPreview', function () {
it('should be false by default', function (done) {
this.res.render = (pageName, opts) => {
expect(opts.showNewPdfPreview).to.be.false
done()
}
this.ProjectController.loadEditor(this.req, this.res)
})
it('should be true when ?new_pdf_preview=true ', function (done) {
this.res.render = (pageName, opts) => {
expect(opts.showNewPdfPreview).to.be.true
done()
}
this.req.query.new_pdf_preview = 'true'
this.ProjectController.loadEditor(this.req, this.res)
})
it('should be true when the react-pdf-preview-rollout split test is enabled', function (done) {
this.res.render = (pageName, opts) => {
expect(opts.showNewPdfPreview).to.be.true
done()
}
this.SplitTestHandler.getAssignment
.withArgs(this.req, 'react-pdf-preview-rollout')
.yields(null, { variant: 'react-pdf-preview' })
this.ProjectController.loadEditor(this.req, this.res)
})
it('should be false when when ?new_pdf_preview=false and the split test is enabled', function (done) {
this.res.render = (pageName, opts) => {
expect(opts.showNewPdfPreview).to.be.false
done()
}
this.SplitTestHandler.getAssignment
.withArgs(this.req, 'react-pdf-preview-rollout')
.yields(null, { variant: 'react-pdf-preview' })
this.req.query.new_pdf_preview = 'false'
this.ProjectController.loadEditor(this.req, this.res)
})
})
describe('showPdfDetach', function () {
describe('showPdfDetach=false', function () {
it('should be false by default', function (done) {
@@ -1449,16 +1407,6 @@ describe('ProjectController', function () {
this.ProjectController.loadEditor(this.req, this.res)
})
it('should be false by default, even when ?new_pdf_preview=true', function (done) {
this.res.render = (pageName, opts) => {
expect(opts.showPdfDetach).to.be.false
expect(opts.showNewPdfPreview).to.be.true
done()
}
this.req.query.new_pdf_preview = 'true'
this.ProjectController.loadEditor(this.req, this.res)
})
it('should be false when the split test is enabled and ?pdf_detach=false', function (done) {
this.res.render = (pageName, opts) => {
expect(opts.showPdfDetach).to.be.false
@@ -1473,20 +1421,18 @@ describe('ProjectController', function () {
})
describe('showPdfDetach=true', function () {
it('should be true when ?pdf_detach=true, and set showNewPdfPreview as true ', function (done) {
it('should be true when ?pdf_detach=true', function (done) {
this.res.render = (pageName, opts) => {
expect(opts.showPdfDetach).to.be.true
expect(opts.showNewPdfPreview).to.be.true
done()
}
this.req.query.pdf_detach = 'true'
this.ProjectController.loadEditor(this.req, this.res)
})
it('should be true for alpha group, and set showNewPdfPreview as true', function (done) {
it('should be true for alpha group', function (done) {
this.res.render = (pageName, opts) => {
expect(opts.showPdfDetach).to.be.true
expect(opts.showNewPdfPreview).to.be.true
done()
}
this.SplitTestHandler.getAssignment