[viewer] applicant -> application
This commit is contained in:
parent
7d6f504dc5
commit
559a7eece4
1 changed files with 8 additions and 8 deletions
|
|
@ -191,7 +191,7 @@
|
||||||
<div class="layout">
|
<div class="layout">
|
||||||
<aside class="sidebar">
|
<aside class="sidebar">
|
||||||
<section class="controls">
|
<section class="controls">
|
||||||
<p>Select the downloaded ZIP file to browse applicants and preview files.</p>
|
<p>Select the downloaded ZIP file to browse applications and preview files.</p>
|
||||||
<input id="zip-input" type="file" accept=".zip,application/zip">
|
<input id="zip-input" type="file" accept=".zip,application/zip">
|
||||||
<p id="status">Waiting for ZIP selection...</p>
|
<p id="status">Waiting for ZIP selection...</p>
|
||||||
</section>
|
</section>
|
||||||
|
|
@ -199,7 +199,7 @@
|
||||||
</aside>
|
</aside>
|
||||||
<main class="content">
|
<main class="content">
|
||||||
<div class="content-header">
|
<div class="content-header">
|
||||||
<h1 id="viewer-title">Applicant archive</h1>
|
<h1 id="viewer-title">Applications archive</h1>
|
||||||
<p id="viewer-subtitle">Select the ZIP file, then choose a file on the left to preview it here.</p>
|
<p id="viewer-subtitle">Select the ZIP file, then choose a file on the left to preview it here.</p>
|
||||||
<a id="viewer-download" class="viewer-download" href="#" hidden>Download current file</a>
|
<a id="viewer-download" class="viewer-download" href="#" hidden>Download current file</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -332,7 +332,7 @@
|
||||||
})
|
})
|
||||||
|
|
||||||
viewer.removeAttribute("src")
|
viewer.removeAttribute("src")
|
||||||
viewerTitle.textContent = "Applicant archive"
|
viewerTitle.textContent = "Application archive"
|
||||||
viewerSubtitle.textContent = message
|
viewerSubtitle.textContent = message
|
||||||
viewerDownload.hidden = true
|
viewerDownload.hidden = true
|
||||||
viewerDownload.removeAttribute("href")
|
viewerDownload.removeAttribute("href")
|
||||||
|
|
@ -466,13 +466,13 @@
|
||||||
const nextArchiveData = new Uint8Array(await file.arrayBuffer())
|
const nextArchiveData = new Uint8Array(await file.arrayBuffer())
|
||||||
const entries = unzipSync(nextArchiveData, {
|
const entries = unzipSync(nextArchiveData, {
|
||||||
filter(entry) {
|
filter(entry) {
|
||||||
return entry.name === "applicants.csv"
|
return entry.name === "applications.csv"
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const csvEntry = entries["applicants.csv"]
|
const csvEntry = entries["applications.csv"]
|
||||||
|
|
||||||
if (csvEntry == null) {
|
if (csvEntry == null) {
|
||||||
throw new Error("Archive does not contain applicants.csv")
|
throw new Error("Archive does not contain applications.csv")
|
||||||
}
|
}
|
||||||
|
|
||||||
const text = strFromU8(csvEntry).replace(/^\uFEFF/, "")
|
const text = strFromU8(csvEntry).replace(/^\uFEFF/, "")
|
||||||
|
|
@ -481,7 +481,7 @@
|
||||||
|
|
||||||
if (text.trim() === "") {
|
if (text.trim() === "") {
|
||||||
renderApplicants([])
|
renderApplicants([])
|
||||||
setStatus("applicants.csv is empty", false)
|
setStatus("applications.csv is empty", false)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -489,7 +489,7 @@
|
||||||
const [header, ...records] = rows
|
const [header, ...records] = rows
|
||||||
|
|
||||||
if (header == null) {
|
if (header == null) {
|
||||||
throw new Error("Unable to parse applicants.csv")
|
throw new Error("Unable to parse applications.csv")
|
||||||
}
|
}
|
||||||
|
|
||||||
const applicants = readApplicants(records.map((row) => Object.fromEntries(header.map((key, index) => [key, row[index] ?? ""]))))
|
const applicants = readApplicants(records.map((row) => Object.fromEntries(header.map((key, index) => [key, row[index] ?? ""]))))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue