mirror of
https://github.com/baserow/baserow.git
synced 2026-12-04 08:18:42 +00:00
* feat: record who triggered an automation workflow run * feat: name the clicker on a workflow a button started * feat: carry the trigger user on the automation dispatch context * feat: expose who triggered a run on the workflow history API * feat: audit log a button field click * feat: show who started a run in the workflow history * docs: say a periodic trigger can be started and how a click is recorded * fix: give the history actor label room for a full name * fix: keep the trigger user off the dispatch context actor A Local Baserow node with no integration acts as the context actor, so a run would act as whoever clicked. * fix: audit a click only once it holds the lock * feat: record who started a test run * fix: honour is_test_run in the workflow history fixture * refactor: resolve who started a run through the workspace user store * test: drop a start workflow test whose deny patch never fires * test: e2e for who started a workflow a button or a test run began * test: e2e for picking a workflow in the button field editor * refactor: read the trigger user lazily from the run's history No per-node user join; the context exposes history.triggered_by on demand. * refactor: plain serializer for who triggered a run * test: forward history fixture kwargs and hoist imports * fix: put the run's starter on its own line in the history panel The header row is 327px wide; a name beside the title wrapped it. Name resolution reuses the collaborator mixin. * docs: say exactly when a click is audited and what a nested run records * test: share e2e job polling and AI panel suppression * fix: annotate the automation dispatch context's history as a workflow history * fix: cap the button action form so a helper sentence cannot stretch the editor * fix: keep the automation dispatch context's history required The simulation's history=None is a sample-data-only exception, not the norm. * refactor: carry the dispatch context actor through own_properties Contexts that take an actor list it like any other property; the rest keep the base None. * refactor: record who started a workflow run as a subject Stores id, type and name instead of a user foreign key, so an agent can start a run without a data migration and the name survives the user being deleted. * fix: record who started a test run that waits for its event The starter is kept on the workflow with the other test state, so the event that starts the run later can still name them. * fix: forget a test run's starter when its window closes Opening or closing the test run window through a workflow update left the earlier starter in place, so a later run could name the wrong person. * fix: keep a test run's starter when undo restores an unchanged window Undo and redo send every workflow field back, so only a real change to the test run window may replace who started it. * fix: reset a test run's starter type along with its id * fix: return None from get_subject for subject types without a table anonymous, user_source.user and builder_preview_actor have no manager, so the lookup raised AttributeError. * refactor: resolve collaborator names through a core util The history panel called a mixin method without its component, which only worked while the method ignored this. * refactor: name the history's started-by line after what it shows * docs: note that a button with no actions logs no click * refactor: drop the unused triggered_by from the automation dispatch context Left over from when the clicker was the context's actor; the history already records who started the run.
85 lines
2.6 KiB
TypeScript
85 lines
2.6 KiB
TypeScript
//import { test as base } from "@playwright/test";
|
|
import { WorkspacePage } from "../pages/workspacePage";
|
|
import { createUser } from "../fixtures/user";
|
|
import { BuilderPagePage } from "../pages/builder/builderPagePage";
|
|
import { createWorkspace } from "../fixtures/workspace";
|
|
import { createBuilderPage } from "../fixtures/builder/builderPage";
|
|
import { createBuilder } from "../fixtures/builder/builder";
|
|
import { createAutomation } from "../fixtures/automation/automation";
|
|
import { createAutomationWorkflow } from "../fixtures/automation/automationWorkflow";
|
|
import { AutomationWorkflowPage } from "../pages/automation/automationWorkflowPage";
|
|
import { expect, test as base } from "@nuxt/test-utils/playwright";
|
|
|
|
// Declare the types of your fixtures.
|
|
type BaserowFixtures = {
|
|
workspacePage: WorkspacePage;
|
|
builderPagePage: BuilderPagePage;
|
|
automationWorkflowPage: AutomationWorkflowPage;
|
|
};
|
|
|
|
/**
|
|
* Fixture for all tests that need an authenticated user with an empty workspace.
|
|
*/
|
|
export const test = base.extend<BaserowFixtures>({
|
|
workspacePage: async ({ page, goto }, use) => {
|
|
// Don't show the cookie notice
|
|
await page.context().addCookies([
|
|
{
|
|
name: "baserow_dashboard_alert_closed_v2",
|
|
value: "true",
|
|
domain: "localhost",
|
|
path: "/",
|
|
},
|
|
]);
|
|
|
|
const user = await createUser();
|
|
const workspace = await createWorkspace(user);
|
|
const workspacePage = new WorkspacePage({ page, goto }, user, workspace);
|
|
await workspacePage.authenticate();
|
|
|
|
// Use the fixture value in the test.
|
|
await use(workspacePage);
|
|
|
|
// Clean up the fixture.
|
|
await workspacePage.removeAll();
|
|
},
|
|
builderPagePage: async ({ page, workspacePage, goto }, use) => {
|
|
const builder = await createBuilder(
|
|
"Test builder",
|
|
workspacePage.workspace
|
|
);
|
|
const builderPage = await createBuilderPage(
|
|
"Default page",
|
|
"/default/page",
|
|
builder
|
|
);
|
|
const builderPagePage = new BuilderPagePage(
|
|
{ page, goto },
|
|
builder,
|
|
builderPage
|
|
);
|
|
|
|
await use(builderPagePage);
|
|
|
|
await builderPagePage.removeAll();
|
|
},
|
|
automationWorkflowPage: async ({ page, workspacePage, goto }, use) => {
|
|
const automation = await createAutomation(
|
|
"Test automation",
|
|
workspacePage.workspace
|
|
);
|
|
const automationWorkflow = await createAutomationWorkflow(
|
|
"Default workflow",
|
|
automation
|
|
);
|
|
const automationWorkflowPage = new AutomationWorkflowPage(
|
|
{ page, goto },
|
|
automation,
|
|
automationWorkflow
|
|
);
|
|
|
|
await use(automationWorkflowPage);
|
|
},
|
|
});
|
|
export { expect } from "@nuxt/test-utils/playwright";
|