Skip to content

Commit

Permalink
Merge pull request #171 from camunda-community-hub/165-adblocker
Browse files Browse the repository at this point in the history
fix: mitigate adblocker issues
  • Loading branch information
saig0 authored Apr 4, 2023
2 parents 8a69908 + 754f90a commit 6581db7
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/main/resources/public/js/incident-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ async function confirmResolveIncidentModal() {
}

if (!hasVariables) {
track("zeebePlay:single-operation", {
track?.("zeebePlay:single-operation", {
operationType: "RESOLVE_INCIDENT",
process_id: getBpmnProcessId(),
});
Expand All @@ -117,7 +117,7 @@ async function confirmResolveIncidentModal() {
"<code>" + variables + "</code>"
);

track("zeebePlay:single-operation", {
track?.("zeebePlay:single-operation", {
operationType: "RESOLVE_INCIDENT",
process_id: getBpmnProcessId(),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ if (trackingSetting.token) {
orgOwner: trackingSetting.orgOwner,
});

window.track = (...args) => mixpanel.track(...args);
window.track = (...args) => mixpanel.track?.(...args);

window.track("zeebePlay:view:page", {
window.track?.("zeebePlay:view:page", {
view: getViewName(),
url: location.href,
});
Expand Down Expand Up @@ -81,7 +81,7 @@ function trackElementInstanceCompletion(elementInstance) {
bpmnElementType === "PROCESS" &&
!elementInstanceTrackingState[bpmnElementType + ":" + elementInstance.key]
) {
track("zeebePlay:bpmnelement:completed", {
track?.("zeebePlay:bpmnelement:completed", {
element_type: "PROCESS",
process_id: bpmnId,
});
Expand All @@ -93,7 +93,7 @@ function trackElementInstanceCompletion(elementInstance) {

// track element completion
if (!elementInstanceTrackingState[connectorOrElementType]) {
track("zeebePlay:bpmnelement:completed", {
track?.("zeebePlay:bpmnelement:completed", {
[hasConnector ? "connector_type" : "element_type"]:
connectorOrElementType,
process_id: bpmnId,
Expand Down Expand Up @@ -121,7 +121,7 @@ function trackIncident(incident) {

if (incidentTrackingState[incident.key]) return;

track("zeebePlay:incident:trigger", {
track?.("zeebePlay:incident:trigger", {
error: incident.errorMessage,
process_id: getBpmnProcessId(),
});
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/public/js/view-home.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function enableButtonToCreateInstanceOfDemoProcess(processKey) {
const createInstanceButton = $("#demo-create-instance-button");
createInstanceButton.attr("disabled", false);
createInstanceButton.click(function () {
track("zeebePlay:bpmnelement:completed", {
track?.("zeebePlay:bpmnelement:completed", {
element_type: "START_EVENT",
From: "home",
process_id: "solos-transport-process",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/public/js/view-process-instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ async function rewind(task) {
newId = await createNewInstanceFromTimerStartEvent(startEvent);
}

track("zeebePlay:bpmnelement:completed", {
track?.("zeebePlay:bpmnelement:completed", {
element_type: "START_EVENT",
From: "rewind",
process_id: getBpmnProcessId(),
Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/public/js/view-process.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ function loadInstancesOfProcessLast() {
}

function createNewProcessInstance() {
track("zeebePlay:bpmnelement:completed", {
track?.("zeebePlay:bpmnelement:completed", {
element_type: "START_EVENT",
From: "processPage",
process_id: getProcessId(),
Expand All @@ -153,7 +153,7 @@ function createNewProcessInstance() {
}

function createNewProcessInstanceWithVariables() {
track("zeebePlay:bpmnelement:completed", {
track?.("zeebePlay:bpmnelement:completed", {
element_type: "START_EVENT",
From: "processPage",
process_id: getProcessId(),
Expand Down Expand Up @@ -245,7 +245,7 @@ function loadMessageSubscriptionsOfProcess() {
"</tr>"
);

const clickAction = `track('zeebePlay:bpmnelement:completed', {
const clickAction = `track?.('zeebePlay:bpmnelement:completed', {
element_type: 'START_EVENT',
From: 'processPage',
process_id: getProcessId()
Expand Down Expand Up @@ -322,7 +322,7 @@ function loadTimersOfProcess() {
);

const action =
`track('zeebePlay:bpmnelement:completed', {
`track?.('zeebePlay:bpmnelement:completed', {
element_type: 'START_EVENT',
From: 'processPage',
process_id: getProcessId()
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/fragments/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@

<script src="/js/incident-modal.js" type="text/javascript"></script>

<script src="/js/tracking.js" type="text/javascript"></script>
<script src="/js/mp_integration.js" type="text/javascript"></script>
</div>

0 comments on commit 6581db7

Please sign in to comment.