Skip to content

Commit 126f1ac

Browse files
committed
feat: worksheet auto filter
1 parent d0021b2 commit 126f1ac

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

js/crawl/crawl.ui.js

+9
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,15 @@ const attachListeners = () => {
252252
let headers = ['URL'];
253253
if (crawlStatus.hasExtra) {
254254
headers = ['URL', 'status', 'redirect', 'Nb links on page', 'Nb links already processed', 'Nb links on external host', 'Nb links to follow', 'Links to follow'];
255+
worksheet.autoFilter = {
256+
from: 'A1',
257+
to: 'H1',
258+
};
259+
} else {
260+
worksheet.autoFilter = {
261+
from: 'A1',
262+
to: 'A1',
263+
};
255264
}
256265

257266
worksheet.addRows([

js/import/import.ui.js

+6
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,12 @@ const attachListeners = () => {
378378
DOWNLOAD_IMPORT_REPORT_BUTTON.addEventListener('click', (async () => {
379379
const workbook = new ExcelJS.Workbook();
380380
const worksheet = workbook.addWorksheet('Sheet 1');
381+
382+
worksheet.autoFilter = {
383+
from: 'A1',
384+
to: 'E1',
385+
};
386+
381387
worksheet.addRows([
382388
['URL', 'path', 'docx', 'status', 'redirect'],
383389
].concat(importStatus.rows.map(({

0 commit comments

Comments
 (0)