fix: make mdtodo reindex web-probe dialog-aware (#900)
Co-authored-by: Codex <codex@noreply.local>
This commit is contained in:
@@ -1711,6 +1711,19 @@ async function openMdtodoSourceConfig(command) {
|
|||||||
ensureProjectManagementCommand("openMdtodoSourceConfig");
|
ensureProjectManagementCommand("openMdtodoSourceConfig");
|
||||||
const beforeUrl = currentPageUrl();
|
const beforeUrl = currentPageUrl();
|
||||||
const beforeProject = await projectManagementCommandSnapshot();
|
const beforeProject = await projectManagementCommandSnapshot();
|
||||||
|
const existingDialog = page.locator('[data-testid="mdtodo-source-form-hwpod"], [data-testid="mdtodo-source-config-dialog"], [role="dialog"]').first();
|
||||||
|
if (await visibleLocator(existingDialog)) {
|
||||||
|
return {
|
||||||
|
beforeUrl,
|
||||||
|
afterUrl: currentPageUrl(),
|
||||||
|
type: "openMdtodoSourceConfig",
|
||||||
|
alreadyOpen: true,
|
||||||
|
beforeProject,
|
||||||
|
afterProject: await projectManagementCommandSnapshot(),
|
||||||
|
pageId,
|
||||||
|
valuesRedacted: true
|
||||||
|
};
|
||||||
|
}
|
||||||
const button = page.locator('[data-testid="mdtodo-source-config-open"]').first();
|
const button = page.locator('[data-testid="mdtodo-source-config-open"]').first();
|
||||||
await button.waitFor({ state: "visible", timeout: 15000 });
|
await button.waitFor({ state: "visible", timeout: 15000 });
|
||||||
await button.click();
|
await button.click();
|
||||||
@@ -1804,8 +1817,10 @@ async function reindexMdtodoSource(command) {
|
|||||||
const beforeUrl = currentPageUrl();
|
const beforeUrl = currentPageUrl();
|
||||||
const beforeProject = await projectManagementCommandSnapshot();
|
const beforeProject = await projectManagementCommandSnapshot();
|
||||||
await ensureMdtodoSourceConfigOpen();
|
await ensureMdtodoSourceConfigOpen();
|
||||||
const reindex = await clickProjectButtonAndMaybeWait("mdtodo-source-reindex", /^\/v1\/project-management\/mdtodo\/sources/u);
|
const dialogButton = page.locator('[data-testid="mdtodo-source-reindex-dialog"]').first();
|
||||||
return { beforeUrl, afterUrl: currentPageUrl(), type: "reindexMdtodoSource", reindex, beforeProject, afterProject: await projectManagementCommandSnapshot(), pageId, valuesRedacted: true };
|
const buttonTestId = await visibleLocator(dialogButton) ? "mdtodo-source-reindex-dialog" : "mdtodo-source-reindex";
|
||||||
|
const reindex = await clickProjectButtonAndMaybeWait(buttonTestId, /^\/v1\/project-management\/mdtodo\/sources/u);
|
||||||
|
return { beforeUrl, afterUrl: currentPageUrl(), type: "reindexMdtodoSource", buttonTestId, reindex, beforeProject, afterProject: await projectManagementCommandSnapshot(), pageId, valuesRedacted: true };
|
||||||
}
|
}
|
||||||
|
|
||||||
async function selectTaskIfCommandTargetsOne(command) {
|
async function selectTaskIfCommandTargetsOne(command) {
|
||||||
|
|||||||
Reference in New Issue
Block a user