Merge pull request #18397 from overleaf/em-revert-download-all-link

Revert "Merge pull request #18190 from overleaf/ar-add-download-all-l…

GitOrigin-RevId: 681eb2734636d76558e682dc85083bfcaa6b7d2d
This commit is contained in:
Christopher Hoskin
2024-05-17 08:05:10 +00:00
committed by Copybot
parent d7f0c66d86
commit 3342d672c2
10 changed files with 50 additions and 175 deletions
@@ -398,13 +398,6 @@ module.exports = CompileController = {
if (error) {
return next(error)
}
const qs = {}
if (req.params.file === 'output.zip') {
qs.files = req.query.files
}
const url = CompileController._getFileUrl(
projectId,
userId,
@@ -415,7 +408,7 @@ module.exports = CompileController = {
projectId,
'output-file',
url,
qs,
{},
req,
res,
next
@@ -580,20 +573,10 @@ module.exports = CompileController = {
return next(err)
}
url = new URL(`${Settings.apis.clsi.url}${url}`)
const params = new URLSearchParams(persistenceOptions.qs)
for (const [key, value] of Object.entries(qs)) {
if (Array.isArray(value)) {
for (const v of value) {
params.append(key, v)
}
continue
}
params.append(key, value)
}
url.search = params.toString()
url.search = new URLSearchParams({
...persistenceOptions.qs,
...qs,
}).toString()
const timer = new Metrics.Timer(
'proxy_to_clsi',
1,
@@ -621,10 +604,7 @@ module.exports = CompileController = {
})
for (const key of ['Content-Length', 'Content-Type']) {
const headerValue = response.headers.get(key)
if (headerValue) {
res.setHeader(key, headerValue)
}
res.setHeader(key, response.headers.get(key))
}
res.writeHead(response.status)
return pipeline(stream, res)
@@ -304,7 +304,6 @@
"doing_this_will_verify_affiliation_and_allow_log_in_2": "",
"done": "",
"download": "",
"download_all": "",
"download_metadata": "",
"download_pdf": "",
"download_zip_file": "",
@@ -33,18 +33,6 @@ function PdfFileList({ fileList }) {
<b>{file.path}</b>
</MenuItem>
))}
{fileList.other.length + fileList.top.length > 0 && fileList.archive && (
<MenuItem
download={basename(fileList.archive)}
href={fileList.archive.url}
key={fileList.archive.path}
>
<b>
{t('download_all')} ({fileList.other.length + fileList.top.length})
</b>
</MenuItem>
)}
</>
)
}
@@ -60,10 +48,6 @@ PdfFileList.propTypes = {
fileList: PropTypes.shape({
top: FilesArray,
other: FilesArray,
archive: PropTypes.shape({
path: PropTypes.string.isRequired,
url: PropTypes.string.isRequired,
}),
}),
}
@@ -1,5 +1,5 @@
const topFileTypes = ['bbl', 'gls', 'ind']
const ignoreFiles = ['output.fls', 'output.fdb_latexmk', 'output.zip']
const ignoreFiles = ['output.fls', 'output.fdb_latexmk']
export const buildFileList = (outputFiles, clsiServerId, compileGroup) => {
const files = { top: [], other: [] }
@@ -18,8 +18,6 @@ export const buildFileList = (outputFiles, clsiServerId, compileGroup) => {
const allFiles = []
let outputArchiveFile
// filter out ignored files and set some properties
for (const file of outputFiles.values()) {
if (!ignoreFiles.includes(file.path)) {
@@ -30,8 +28,6 @@ export const buildFileList = (outputFiles, clsiServerId, compileGroup) => {
}
allFiles.push(file)
} else if (file.type === 'zip') {
outputArchiveFile = file
}
}
@@ -56,14 +52,6 @@ export const buildFileList = (outputFiles, clsiServerId, compileGroup) => {
files.other.push(file)
}
}
if (outputArchiveFile) {
allFiles.forEach(
file => file.type !== 'pdf' && params.append('files', file.path)
)
outputArchiveFile.url += `?${params.toString()}`
files.archive = outputArchiveFile
}
}
return files
-1
View File
@@ -430,7 +430,6 @@
"done": "Done",
"dont_have_account": "Don’t have an account?",
"download": "Download",
"download_all": "Download all",
"download_metadata": "Download Overleaf metadata",
"download_pdf": "Download PDF",
"download_zip_file": "Download .zip file",