Skip to content

Commit

Permalink
Merge branch 'release' into external-contri/fix/35949-duplicate-page-…
Browse files Browse the repository at this point in the history
…name-error-does-not-disappear
  • Loading branch information
alex-golovanov committed Sep 19, 2024
2 parents 695c772 + bb0ec5c commit f2a4c6f
Show file tree
Hide file tree
Showing 24 changed files with 98 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ describe(
anvilLocators.anvilWidgetNameSelector("Button2"),
);
});
it("8. Verify different modal sizes", () => {
// TODO: Enable when issue(github.com/appsmithorg/appsmith/issues/36419) is solved.
it.skip("8. Verify different modal sizes", () => {
// select all widgets and delete
agHelper.PressEscape();
agHelper.SelectAllWidgets();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {
anvilSnapshot,
} from "../../../../../support/Objects/ObjectsCore";

describe(
// TODO: Enable when issue(github.com/appsmithorg/appsmith/issues/36419) is solved.
describe.skip(
`${ANVIL_EDITOR_TEST}: Anvil tests for App Theming`,
{ tags: ["@tag.Anvil"] },
() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {
anvilSnapshot,
} from "../../../../../support/Objects/ObjectsCore";

describe(
// TODO: Enable when issue(github.com/appsmithorg/appsmith/issues/36419) is solved.
describe.skip(
`${ANVIL_EDITOR_TEST}: Anvil tests for Button Widget`,
{ tags: ["@tag.Anvil", "@tag.Visual"] },
() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {
anvilSnapshot,
} from "../../../../../support/Objects/ObjectsCore";

describe(
// TODO: Enable when issue(github.com/appsmithorg/appsmith/issues/36419) is solved.
describe.skip(
`${ANVIL_EDITOR_TEST}: Anvil tests for Checkbox Group Widget`,
{ tags: ["@tag.Anvil", "@tag.Visual"] },
() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {
anvilSnapshot,
} from "../../../../../support/Objects/ObjectsCore";

describe(
// TODO: Enable when issue(github.com/appsmithorg/appsmith/issues/36419) is solved.
describe.skip(
`${ANVIL_EDITOR_TEST}: Anvil tests for Checkbox Widget`,
{ tags: ["@tag.Anvil", "@tag.Visual"] },
() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {
anvilSnapshot,
} from "../../../../../support/Objects/ObjectsCore";

describe(
// TODO: Enable when issue(github.com/appsmithorg/appsmith/issues/36419) is solved.
describe.skip(
`${ANVIL_EDITOR_TEST}: Anvil tests for Currency Input Widget`,
{ tags: ["@tag.Anvil", "@tag.Visual"] },
() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {
anvilSnapshot,
} from "../../../../../support/Objects/ObjectsCore";

describe(
// TODO: Enable when issue(github.com/appsmithorg/appsmith/issues/36419) is solved.
describe.skip(
`${ANVIL_EDITOR_TEST}: Anvil tests for Heading Widget`,
{ tags: ["@tag.Anvil", "@tag.Visual"] },
() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {
anvilSnapshot,
} from "../../../../../support/Objects/ObjectsCore";

describe(
// TODO: Enable when issue(github.com/appsmithorg/appsmith/issues/36419) is solved.
describe.skip(
`${ANVIL_EDITOR_TEST}: Anvil tests for Icon Button Widget`,
{ tags: ["@tag.Anvil", "@tag.Visual"] },
() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {
anvilSnapshot,
} from "../../../../../support/Objects/ObjectsCore";

describe(
// TODO: Enable when issue(github.com/appsmithorg/appsmith/issues/36419) is solved.
describe.skip(
`${ANVIL_EDITOR_TEST}: Anvil tests for Inline Button Widget`,
{ tags: ["@tag.Anvil", "@tag.Visual"] },
() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {
anvilSnapshot,
} from "../../../../../support/Objects/ObjectsCore";

describe(
// TODO: Enable when issue(github.com/appsmithorg/appsmith/issues/36419) is solved.
describe.skip(
`${ANVIL_EDITOR_TEST}: Anvil tests for Input Widget`,
{ tags: ["@tag.Anvil", "@tag.Visual"] },
() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {
anvilSnapshot,
} from "../../../../../support/Objects/ObjectsCore";

describe(
// TODO: Enable when issue(github.com/appsmithorg/appsmith/issues/36419) is solved.
describe.skip(
`${ANVIL_EDITOR_TEST}: Anvil tests for Paragraph Widget`,
{ tags: ["@tag.Anvil", "@tag.Visual"] },
() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {
anvilSnapshot,
} from "../../../../../support/Objects/ObjectsCore";

describe(
// TODO: Enable when issue(github.com/appsmithorg/appsmith/issues/36419) is solved.
describe.skip(
`${ANVIL_EDITOR_TEST}: Anvil tests for Phone Input Widget`,
{ tags: ["@tag.Anvil", "@tag.Visual"] },
() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {
anvilSnapshot,
} from "../../../../../support/Objects/ObjectsCore";

describe(
// TODO: Enable when issue(github.com/appsmithorg/appsmith/issues/36419) is solved.
describe.skip(
`${ANVIL_EDITOR_TEST}: Anvil tests for Radio Group Widget`,
{ tags: ["@tag.Anvil", "@tag.Visual"] },
() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {
anvilSnapshot,
} from "../../../../../support/Objects/ObjectsCore";

describe(
// TODO: Enable when issue(github.com/appsmithorg/appsmith/issues/36419) is solved.
describe.skip(
`${ANVIL_EDITOR_TEST}: Anvil tests for Stats Widget`,
{ tags: ["@tag.Anvil", "@tag.Visual"] },
() => {
Expand All @@ -20,7 +21,7 @@ describe(
});

it("2. Preview Mode", () => {
anvilSnapshot.enterPreviewMode("StatsWidget");
anvilSnapshot.enterPreviewMode();
});

it("3. Deploy Mode", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {
anvilSnapshot,
} from "../../../../../support/Objects/ObjectsCore";

describe(
// TODO: Enable when issue(github.com/appsmithorg/appsmith/issues/36419) is solved.
describe.skip(
`${ANVIL_EDITOR_TEST}: Anvil tests for Switch Group Widget`,
{ tags: ["@tag.Anvil", "@tag.Visual"] },
() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {
anvilSnapshot,
} from "../../../../../support/Objects/ObjectsCore";

describe(
// TODO: Enable when issue(github.com/appsmithorg/appsmith/issues/36419) is solved.
describe.skip(
`${ANVIL_EDITOR_TEST}: Anvil tests for Switch Widget`,
{ tags: ["@tag.Anvil", "@tag.Visual"] },
() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {
anvilSnapshot,
} from "../../../../../support/Objects/ObjectsCore";

describe(
// TODO: Enable when issue(github.com/appsmithorg/appsmith/issues/36419) is solved.
describe.skip(
`${ANVIL_EDITOR_TEST}: Anvil tests for Table Widget`,
{ tags: ["@tag.Anvil", "@tag.Visual"] },
() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {
anvilSnapshot,
} from "../../../../../support/Objects/ObjectsCore";

describe(
// TODO: Enable when issue(github.com/appsmithorg/appsmith/issues/36419) is solved.
describe.skip(
`${ANVIL_EDITOR_TEST}: Anvil tests for Toolbar Button Widget`,
{ tags: ["@tag.Anvil", "@tag.Visual"] },
() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {
anvilSnapshot,
} from "../../../../../support/Objects/ObjectsCore";

describe(
// TODO: Enable when issue(github.com/appsmithorg/appsmith/issues/36419) is solved.
describe.skip(
`${ANVIL_EDITOR_TEST}: Anvil tests for Zone and Section Widget`,
{ tags: ["@tag.Anvil", "@tag.Visual"] },
() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,14 @@ function verifyPropertyPaneSectionState(propertySectionState) {
for (const [sectionName, shouldSectionOpen] of Object.entries(
propertySectionState,
)) {
cy.get("body").then(($body) => {
const isSectionOpen =
$body.find(`${propertySectionClass(sectionName)} .t--chevron-icon`)
.length > 0;
expect(isSectionOpen).to.equal(shouldSectionOpen);
});
cy.get(`${propertySectionClass(sectionName)}`)
.siblings(_.locators._propertyCollapse)
.find(_.locators._propertyCollapseBody)
.invoke("attr", "aria-hidden")
.then((isSectionOpen) => {
const expectedValue = shouldSectionOpen ? "false" : "true"; // Convert boolean to aria-hidden value
expect(isSectionOpen).to.equal(expectedValue);
});
}
}

Expand Down
50 changes: 34 additions & 16 deletions app/client/src/UITelemetry/PageLoadInstrumentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,23 @@ import type {
} from "web-vitals";
import isString from "lodash/isString";

type TNavigator = Navigator & {
deviceMemory: number;
connection: {
effectiveType: string;
downlink: number;
rtt: number;
saveData: boolean;
};
};

export class PageLoadInstrumentation extends InstrumentationBase {
// PerformanceObserver to observe resource timings
resourceTimingObserver: PerformanceObserver | null = null;
// Root span for the page load instrumentation
rootSpan: Span;
// List of resource URLs to ignore
ignoreResourceUrls: string[] = [];
// Timestamp when the page was last hidden
pageLastHiddenAt: number = 0;
// Duration the page was hidden for
pageHiddenFor: number = 0;
// Flag to check if navigation entry was pushed
wasNavigationEntryPushed: boolean = false;
// Set to keep track of resource entries
Expand All @@ -44,7 +50,11 @@ export class PageLoadInstrumentation extends InstrumentationBase {
}

enable(): void {
this.addVisibilityChangeListener();
// Register connection change listener
this.addConnectionAttributes();

// Add device attributes to the root span
this.addDeviceAttributes();

// Listen for LCP and FCP events
// reportAllChanges: true will report all LCP and FCP events
Expand All @@ -61,19 +71,28 @@ export class PageLoadInstrumentation extends InstrumentationBase {
}
}

private addVisibilityChangeListener() {
// Listen for page visibility changes to track time spent on hidden page
document.addEventListener("visibilitychange", () => {
if (document.visibilityState === "hidden") {
this.pageLastHiddenAt = performance.now();
} else {
const endTime = performance.now();

this.pageHiddenFor = endTime - this.pageLastHiddenAt;
}
private addDeviceAttributes() {
this.rootSpan.setAttributes({
deviceMemory: (navigator as TNavigator).deviceMemory,
hardwareConcurrency: navigator.hardwareConcurrency,
});
}

private addConnectionAttributes() {
if ((navigator as TNavigator).connection) {
const { downlink, effectiveType, rtt, saveData } = (
navigator as TNavigator
).connection;

this.rootSpan.setAttributes({
effectiveConnectionType: effectiveType,
connectionDownlink: downlink,
connectionRtt: rtt,
connectionSaveData: saveData,
});
}
}

// Handler for LCP report
private onLCPReport(metric: LCPMetricWithAttribution) {
const {
Expand Down Expand Up @@ -156,7 +175,6 @@ export class PageLoadInstrumentation extends InstrumentationBase {
element: this.getElementName(element),
entryType,
loadTime,
pageHiddenFor: this.pageHiddenFor,
},
0,
);
Expand Down
12 changes: 10 additions & 2 deletions app/client/src/UITelemetry/generateTraces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ import type {
import { SpanKind } from "@opentelemetry/api";
import { context } from "@opentelemetry/api";
import { trace } from "@opentelemetry/api";
import { deviceType, browserName, browserVersion } from "react-device-detect";
import {
deviceType,
browserName,
browserVersion,
osName,
osVersion,
} from "react-device-detect";
import { APP_MODE } from "entities/App";
import { matchBuilderPath, matchViewerPath } from "constants/routes";
import nanoid from "nanoid";
Expand All @@ -33,7 +39,7 @@ const getAppMode = memoizeOne((pathname: string) => {
return appMode;
});

const getCommonTelemetryAttributes = () => {
export const getCommonTelemetryAttributes = () => {
const pathname = window.location.pathname;
const appMode = getAppMode(pathname);

Expand All @@ -44,6 +50,8 @@ const getCommonTelemetryAttributes = () => {
browserVersion,
otlpSessionId: OTLP_SESSION_ID,
hostname: window.location.hostname,
osName,
osVersion,
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12780,7 +12780,6 @@ export const defaultAppState = {
ab_ds_binding_enabled: true,
ask_ai_js: false,
license_connection_pool_size_enabled: false,
release_widgetdiscovery_enabled: false,
ab_ai_js_function_completion_enabled: true,
release_workflows_enabled: false,
license_scim_enabled: false,
Expand Down
8 changes: 7 additions & 1 deletion app/client/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { getAppsmithConfigs } from "ee/configs";
import { PageViewTiming } from "@newrelic/browser-agent/features/page_view_timing";
import { PageViewEvent } from "@newrelic/browser-agent/features/page_view_event";
import { Agent } from "@newrelic/browser-agent/loaders/agent";
import { getCommonTelemetryAttributes } from "UITelemetry/generateTraces";

const { newRelic } = getAppsmithConfigs();
const { enableNewRelic } = newRelic;
Expand Down Expand Up @@ -56,7 +57,7 @@ const newRelicBrowserAgentConfig = {

// The agent loader code executes immediately on instantiation.
if (enableNewRelic) {
new Agent(
const newRelicBrowserAgent = new Agent(
{
...newRelicBrowserAgentConfig,
features: [PageViewTiming, PageViewEvent],
Expand All @@ -65,6 +66,11 @@ if (enableNewRelic) {
// Passing a null value throws an error as well. So we pass undefined.
undefined,
);

const { appMode, otlpSessionId } = getCommonTelemetryAttributes();

newRelicBrowserAgent.setCustomAttribute("otlpSessionId", otlpSessionId);
newRelicBrowserAgent.setCustomAttribute("appMode", appMode);
}

const shouldAutoFreeze = process.env.NODE_ENV === "development";
Expand Down

0 comments on commit f2a4c6f

Please sign in to comment.