Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
4a3a31a
spec(content-drive): export content to CSV, Content Search parity fir…
dario-daza Oct 14, 2026
0472ab1
spec(content-drive): replace the stale input notes with the agreed ex…
dario-daza Oct 14, 2026
64fd7d0
spec(content-drive): export only the selected language, empty listing…
dario-daza Oct 15, 2026
8d3e9b4
spec(content-drive): address the spec review on export versions, comp…
dario-daza Oct 15, 2026
6824a7b
spec(content-drive): stop counting past the export limit and keep the…
dario-daza Oct 15, 2026
e63e59c
spec(content-drive): keep root content on its site on re-import and h…
dario-daza Oct 15, 2026
f419c3f
Merge branch 'main' into 37900-content-drive-add-content-export
dario-daza Oct 15, 2026
8a81572
spec(content-drive): record the relationship-column parity decision a…
dario-daza Oct 15, 2026
2d02e6c
spec(content-drive): close the contentlet existence oracle and dedupe…
dario-daza Oct 16, 2026
0e4050f
Merge branch 'main' into 37900-content-drive-add-content-export
dario-daza Oct 16, 2026
3eaa97c
Merge branch 'main' into 37900-content-drive-add-content-export
dario-daza Nov 24, 2026
4d7f548
test(content-drive): add failing tests and stubs for the export found…
dario-daza Nov 26, 2026
78d56d4
feat(content-drive): add the export foundation and share the Content …
dario-daza Nov 26, 2026
c261675
test(content-drive): add failing tests and stubs for the filter-mode …
dario-daza Nov 26, 2026
d6b63af
Merge branch 'main' into 37900-content-drive-add-content-export
dario-daza Nov 26, 2026
60b3ac6
feat(content-drive): export everything the listing shows for one cont…
dario-daza Nov 27, 2026
c56664a
test(content-drive): cover empty, failed and not-found export outcomes
dario-daza Nov 27, 2026
007df8f
feat(content-drive): show why an export produced no file
dario-daza Nov 27, 2026
71aa3cd
test(content-drive): cover the export row limit
dario-daza Nov 27, 2026
f70bd83
feat(content-drive): never reveal unreadable content in an export
dario-daza Nov 27, 2026
96d3a38
test(content-drive): prove an exported CSV imports back in place
dario-daza Nov 27, 2026
aaf56ff
test(content-drive): cover exporting selected contentlets as a zip
dario-daza Nov 27, 2026
a9cbae2
feat(content-drive): export selected contentlets of several types
dario-daza Nov 27, 2026
8a3dfa2
test(content-drive): cover exporting whole folders
dario-daza Nov 27, 2026
3139bda
feat(content-drive): export whole folders
dario-daza Nov 27, 2026
56cd050
test(content-drive): prove selection-mode exports keep every guarantee
dario-daza Nov 27, 2026
0e334dd
Merge remote-tracking branch 'origin/37900-content-drive-add-content-…
dario-daza Nov 27, 2026
e4509d7
fix(content-drive): compile the export form on a clean build
dario-daza Nov 27, 2026
0d98f33
refactor(content-drive): close the Content Search writer and document…
dario-daza Nov 27, 2026
38239b9
test(content-drive): cover the export gaps found by convergence
dario-daza Nov 27, 2026
cdd3da6
fix(content-drive): close the export gaps found by convergence
dario-daza Nov 27, 2026
c31380c
test(content-drive): stop the selection e2e waiting on hidden workflo…
dario-daza Nov 28, 2026
b59a8a6
docs(spec): content drive export changes after the manual check
dario-daza Nov 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
import { ContentDrivePage } from '@pages';
import { createFakePayloadTextField } from '@utils/dot-content-types.mock';
import { Portlet } from '@utils/portlets';

import { expect, test } from '../../fixtures/content-drive.fixture';
import { createContentlet, deleteContentlets } from '../../requests/contentlets';
import { createFakeContentType, deleteContentType } from '../../requests/contentType';

/**
* Journey: exporting the Content Drive listing as a CSV (#37900), filter mode.
*
* With nothing selected and the listing filtered to one content type, the toolbar offers Export,
* and the browser receives a file named the way the Content Search export names it:
* `<ContentType>_contents_<M_d_yyyy>.csv`.
*
* What only a real browser can prove is the last step: that the blob the page receives is handed
* to the browser as a download under the server's file name. The rows and the headers are the
* backend suite's (`ContentDriveExportFilterModeTest`) and the Postman "Export" folder's; the
* button's visibility rules are the component spec's.
*/
test.describe('Content Drive export', () => {
test('downloads the filtered type as <Type>_contents_<date>.csv @critical', async ({
adminPage,
request,
testSuffix
}) => {
// Letters and digits only, so the sanitized type name in the file is this name unchanged.
const typeName = `CdExport${testSuffix.replace(/[^a-zA-Z0-9]/g, '')}`;
const contentType = await createFakeContentType(request, {
name: typeName,
variable: typeName,
fields: [createFakePayloadTextField({ name: 'Title', variable: 'title', sortOrder: 1 })]
});
const contentletIds: string[] = [];

try {
for (const title of [`${typeName} first`, `${typeName} second`]) {
const contentlet = await createContentlet(request, {
contentType: contentType.variable,
title
});
contentletIds.push(contentlet.identifier);
}

const drive = new ContentDrivePage(adminPage);

// The address carries the filter, so the drive opens already narrowed to the one type.
await adminPage.goto(
`${Portlet.ContentDrive}?filters=${encodeURIComponent(
`contentType:${contentType.variable}`
)}`
);
await expect(drive.toolbar).toBeVisible({ timeout: 20000 });
await drive.expectListContainsTitle(`${typeName} first`);

const exportButton = drive.toolbar.getByTestId('export-button').getByRole('button');
await expect(exportButton).toBeEnabled({ timeout: 20000 });

// Armed before the click, or a fast server finishes before anything is listening.
const download = adminPage.waitForEvent('download', { timeout: 60000 });
await exportButton.click();

expect((await download).suggestedFilename()).toMatch(
new RegExp(`^${typeName}_contents_\\d{1,2}_\\d{1,2}_\\d{4}\\.csv$`)
);
} finally {
await deleteContentlets(request, contentletIds);
await deleteContentType(request, contentType.id);
}
});

/**
* Selection mode (US2): selected contentlets of several types export as one zip, named after
* the site: `<hostname>_export_<M_d_yyyy>.zip`. Which CSVs the zip holds, and their rows, are
* `ContentDriveExportSelectionModeTest`'s; the body the button sends is the component spec's.
*/
test('downloads selected contentlets of two types as <site>_export_<date>.zip @critical', async ({
adminPage,
request,
testSuffix
}) => {
const suffix = testSuffix.replace(/[^a-zA-Z0-9]/g, '');
const typeNames = [`CdExportBlog${suffix}`, `CdExportNews${suffix}`];
const contentTypes: { id: string; variable: string }[] = [];
const contentletIds: string[] = [];
const titles: string[] = [];

try {
for (const typeName of typeNames) {
const contentType = await createFakeContentType(request, {
name: typeName,
variable: typeName,
fields: [
createFakePayloadTextField({
name: 'Title',
variable: 'title',
sortOrder: 1
})
]
});
contentTypes.push(contentType);

const title = `${typeName} selected`;
const contentlet = await createContentlet(request, {
contentType: contentType.variable,
title
});
contentletIds.push(contentlet.identifier);
titles.push(title);
}

const drive = new ContentDrivePage(adminPage);

// Narrowed to the two new types so both rows are on the first page; the selection, not
// this filter, is what gets exported.
await adminPage.goto(
`${Portlet.ContentDrive}?filters=${encodeURIComponent(
`contentType:${contentTypes.map((type) => type.variable).join(',')}`
)}`
);
await expect(drive.toolbar).toBeVisible({ timeout: 20000 });

for (const title of titles) {
await drive.expectListContainsTitle(title);
await adminPage
.getByTestId('item-row')
.filter({
has: adminPage.getByTestId('item-title-text').getByText(title, {
exact: true
})
})
.getByTestId('item-checkbox')
.click();
}

// With a selection the button sits in the selection block, beside the workflow actions.
// The actions themselves are not awaited: for contentlets of two types there may be no
// action they share, and the component then renders hidden.
const exportButton = drive.toolbar.getByTestId('export-button').getByRole('button');
await expect(exportButton).toBeEnabled({ timeout: 20000 });

// Armed before the click, or a fast server finishes before anything is listening.
const download = adminPage.waitForEvent('download', { timeout: 60000 });
await exportButton.click();

expect((await download).suggestedFilename()).toMatch(
/^.+_export_\d{1,2}_\d{1,2}_\d{4}\.zip$/
);
} finally {
await deleteContentlets(request, contentletIds);
for (const contentType of contentTypes) {
await deleteContentType(request, contentType.id);
}
}
});
});
1 change: 1 addition & 0 deletions core-web/libs/data-access/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export * from './lib/dot-categories/dot-categories.service';
export * from './lib/dot-company-configuration/dot-company-configuration.service';
export * from './lib/dot-containers/dot-containers.service';
export * from './lib/dot-content-drive/dot-content-drive.service';
export * from './lib/dot-content-drive-export/dot-content-drive-export.service';
export * from './lib/dot-content-search/dot-content-search.service';
export * from './lib/dot-content-type/dot-content-type.service';
export * from './lib/dot-content-types-info/dot-content-types-info.service';
Expand Down
Loading
Loading