Skip to content

Commit 7ad2925

Browse files
committed
Merge branch 'main' of https://github.com/langflow-ai/langflow into model-provider-keys-v2
2 parents 7ae1863 + d58de83 commit 7ad2925

10 files changed

Lines changed: 312 additions & 470 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Add Community Label
2+
3+
on:
4+
pull_request_target:
5+
types: [opened]
6+
7+
jobs:
8+
add-label:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
pull-requests: write
12+
steps:
13+
- name: Add community label
14+
if: github.event.pull_request.author_association != 'MEMBER' && github.event.pull_request.author_association != 'OWNER' && github.event.pull_request.author_association != 'COLLABORATOR'
15+
uses: actions/github-script@v7
16+
with:
17+
script: |
18+
const pullRequestNumber = context.payload.pull_request.number;
19+
const repoDetails = {
20+
owner: context.repo.owner,
21+
repo: context.repo.repo,
22+
issue_number: pullRequestNumber
23+
};
24+
await github.rest.issues.addLabels({
25+
...repoDetails,
26+
labels: ['community']
27+
});

.github/workflows/deploy-docs-draft.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
env:
8686
BASE_URL: /langflow-drafts/${{ steps.extract_branch.outputs.draft_directory }}
8787
FORCE_COLOR: 0 # Disable color output
88-
SEGMENT_PUBLIC_WRITE_KEY: ${{ vars.DOCS_DRAFT_SEGMENT_PUBLIC_WRITE_KEY }}
88+
SEGMENT_PUBLIC_WRITE_KEY: ${{ vars.DOCS_DRAFT_IBM_SEGMENT_PUBLIC_WRITE_KEY }}
8989

9090
- name: Check Build Result
9191
id: buildLogFail

.github/workflows/deploy_gh-pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Build website
2727
run: cd docs && yarn build
2828
env:
29-
SEGMENT_PUBLIC_WRITE_KEY: ${{ vars.DOCS_PROD_SEGMENT_PUBLIC_WRITE_KEY }}
29+
SEGMENT_PUBLIC_WRITE_KEY: ${{ vars.DOCS_PROD_IBM_SEGMENT_PUBLIC_WRITE_KEY }}
3030

3131
# Popular action to deploy to GitHub Pages:
3232
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus

docs/docusaurus.config.js

Lines changed: 67 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -36,42 +36,61 @@ const config = {
3636
},
3737
...(isProduction
3838
? [
39-
// Ketch consent management script
39+
// Google Consent Mode - Set defaults before Google tags load
4040
{
4141
tagName: "script",
4242
attributes: {},
43-
innerHTML: `!function(){window.semaphore=window.semaphore||[],window.ketch=function(){window.semaphore.push(arguments)};var e=document.createElement("script");e.type="text/javascript",e.src="https://global.ketchcdn.com/web/v3/config/datastax/langflow_org_web/boot.js",e.defer=e.async=!0,document.getElementsByTagName("head")[0].appendChild(e)}();`,
43+
innerHTML: `
44+
window.dataLayer = window.dataLayer || [];
45+
function gtag(){dataLayer.push(arguments);}
46+
47+
// Set default consent to denied
48+
gtag('consent', 'default', {
49+
'ad_storage': 'denied',
50+
'ad_user_data': 'denied',
51+
'ad_personalization': 'denied',
52+
'analytics_storage': 'denied'
53+
});
54+
`,
4455
},
45-
// Ketch jurisdiction dynamic link and GA4 consent tracking
56+
// TrustArc Consent Update Listener
4657
{
4758
tagName: "script",
48-
attributes: {
49-
defer: "true",
50-
},
59+
attributes: {},
5160
innerHTML: `
52-
;(function () {
53-
const onKetchConsentGtagTrack = (consent) => {
54-
if (window.gtag &&
55-
consent.purposes &&
56-
'analytics' in consent.purposes &&
57-
'targeted_advertising' in consent.purposes
58-
) {
59-
const analyticsString = consent.purposes.analytics === true ? 'granted' : 'denied'
60-
const targetedAdsString = consent.purposes.targeted_advertising === true ? 'granted' : 'denied'
61-
const gtagObject = {
62-
analytics_storage: analyticsString,
63-
ad_personalization: targetedAdsString,
64-
ad_storage: targetedAdsString,
65-
ad_user_data: targetedAdsString,
61+
(function() {
62+
function updateGoogleConsent() {
63+
if (typeof window.truste !== 'undefined' && window.truste.cma) {
64+
var consent = window.truste.cma.callApi('getConsent', window.location.href) || {};
65+
66+
// Map TrustArc categories to Google consent types
67+
// Category 0 = Required, 1 = Functional, 2 = Advertising, 3 = Analytics
68+
var hasAdvertising = consent[2] === 1;
69+
var hasAnalytics = consent[3] === 1;
70+
71+
gtag('consent', 'update', {
72+
'ad_storage': hasAdvertising ? 'granted' : 'denied',
73+
'ad_user_data': hasAdvertising ? 'granted' : 'denied',
74+
'ad_personalization': hasAdvertising ? 'granted' : 'denied',
75+
'analytics_storage': hasAnalytics ? 'granted' : 'denied'
76+
});
77+
}
78+
}
79+
80+
// Listen for consent changes
81+
if (window.addEventListener) {
82+
window.addEventListener('cm_data_subject_consent_changed', updateGoogleConsent);
83+
window.addEventListener('cm_consent_preferences_set', updateGoogleConsent);
84+
}
85+
86+
// Initial check after TrustArc loads
87+
if (document.readyState === 'complete') {
88+
updateGoogleConsent();
89+
} else {
90+
window.addEventListener('load', updateGoogleConsent);
6691
}
67-
window.gtag('consent', 'update', gtagObject)
68-
}
69-
}
70-
if (window.ketch) {
71-
window.ketch('on', 'consent', onKetchConsentGtagTrack)
72-
}
73-
})()
74-
`,
92+
})();
93+
`,
7594
},
7695
]
7796
: []),
@@ -103,7 +122,7 @@ const config = {
103122
lastmod: "datetime",
104123
changefreq: null,
105124
priority: null,
106-
ignorePatterns: ["/preferences"],
125+
ignorePatterns: [],
107126
},
108127
gtag: {
109128
trackingID: "G-SLQFLQ3KPT",
@@ -146,27 +165,6 @@ const config = {
146165
["docusaurus-node-polyfills", { excludeAliases: ["console"] }],
147166
"docusaurus-plugin-image-zoom",
148167
["./src/plugins/segment", { segmentPublicWriteKey: process.env.SEGMENT_PUBLIC_WRITE_KEY, allowedInDev: true }],
149-
["./src/plugins/scroll-tracking", {
150-
segmentPublicWriteKey: process.env.SEGMENT_PUBLIC_WRITE_KEY,
151-
allowedInDev: true,
152-
selectors: [
153-
{
154-
selector: 'h1, h2, h3, h4, h5, h6',
155-
eventName: 'Docs.langflow.org - Heading Viewed',
156-
properties: {
157-
element_type: 'heading'
158-
}
159-
},
160-
{
161-
selector: '.ch-codeblock',
162-
eventName: 'Docs.langflow.org - Codeblock Viewed',
163-
properties: {
164-
element_type: 'code',
165-
language: 'helper:codeLanguage'
166-
}
167-
}
168-
]
169-
}],
170168
[
171169
"@docusaurus/plugin-client-redirects",
172170
{
@@ -409,26 +407,38 @@ const config = {
409407
className: "header-github-link",
410408
target: "_blank",
411409
rel: null,
412-
'data-event': 'Docs.langflow.org - Social Clicked',
413-
'data-platform': 'github'
410+
'data-event': 'UI Interaction',
411+
'data-action': 'clicked',
412+
'data-channel': 'docs',
413+
'data-element-id': 'social-github',
414+
'data-namespace': 'header',
415+
'data-platform-title': 'Langflow'
414416
},
415417
{
416418
position: "right",
417419
href: "https://twitter.com/langflow_ai",
418420
className: "header-twitter-link",
419421
target: "_blank",
420422
rel: null,
421-
'data-event': 'Docs.langflow.org - Social Clicked',
422-
'data-platform': 'x'
423+
'data-event': 'UI Interaction',
424+
'data-action': 'clicked',
425+
'data-channel': 'docs',
426+
'data-element-id': 'social-twitter',
427+
'data-namespace': 'header',
428+
'data-platform-title': 'Langflow'
423429
},
424430
{
425431
position: "right",
426432
href: "https://discord.gg/EqksyE2EX9",
427433
className: "header-discord-link",
428434
target: "_blank",
429435
rel: null,
430-
'data-event': 'Docs.langflow.org - Social Clicked',
431-
'data-platform': 'discord'
436+
'data-event': 'UI Interaction',
437+
'data-action': 'clicked',
438+
'data-channel': 'docs',
439+
'data-element-id': 'social-discord',
440+
'data-namespace': 'header',
441+
'data-platform-title': 'Langflow'
432442
},
433443
],
434444
},
@@ -464,7 +474,7 @@ const config = {
464474
{
465475
html: `<div class="footer-links">
466476
<span>© ${new Date().getFullYear()} Langflow</span>
467-
<span id="preferenceCenterContainer"> ·&nbsp; <a href="https://langflow.org/preferences">Manage Privacy Choices</a></span>
477+
<span id="preferenceCenterContainer"> ·&nbsp; <a href="#" onclick="if(typeof window !== 'undefined' && window.truste && window.truste.eu && window.truste.eu.clickListener) { window.truste.eu.clickListener(); } return false;" style="cursor: pointer;">Manage Privacy Choices</a></span>
468478
</div>`,
469479
},
470480
],

docs/src/plugins/scroll-tracking/index.js

Lines changed: 0 additions & 55 deletions
This file was deleted.

0 commit comments

Comments
 (0)