Skip to content

Commit a4c5ecc

Browse files
author
Sophia Marie Terry
committed
Merge branch 'main' into CLOUDP-329998
2 parents db9bf44 + 0826702 commit a4c5ecc

34 files changed

+34916
-7519
lines changed

.github/scripts/branded_preview.sh

Lines changed: 58 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,72 @@ for version in "${versions[@]}"; do
3131
done
3232

3333
links=""
34+
URL_COUNT=0
3435
for url in "${all_urls[@]}"; do
35-
filename=$(basename "$url")
36-
echo "$url"
37-
link="https://www.mongodb.com/docs/openapi/preview/?src=$url"
38-
echo "Branded preview: ${link}"
39-
links="${links}<li><a href='$link' target=\"_blank\">${filename}</a></li>"
36+
URL_COUNT=$((URL_COUNT + 1))
37+
filename=$(basename "${url}")
38+
echo "${url}"
39+
links="${links}<div class='url-container'><button onclick=\"generateLink(this, 'preview-url-${URL_COUNT}', '$url')\">Generate preview link for ${filename}</button><span class='preview-span' id='preview-url-${URL_COUNT}'></span></div>"
4040
done
4141

42+
# Uses a proxied endpoint for creating preview links to prevent CORS issues
4243
cat << EOF > branded-preview.html
4344
<!DOCTYPE html>
4445
<html lang="en">
46+
<head>
47+
<style>
48+
.url-container {
49+
margin: 16px 0;
50+
}
51+
52+
.preview-span {
53+
margin-left: 8px;
54+
}
55+
</style>
56+
</head>
4557
<body>
4658
<h2>Preview docs for:</h2>
47-
<ul>
48-
${links}
49-
</ul>
59+
${links}
60+
<script>
61+
async function generateLink(buttonEl, elId, url) {
62+
const previewSpan = document.getElementById(elId);
63+
if (!previewSpan) {
64+
return;
65+
}
66+
67+
buttonEl.disabled = true;
68+
previewSpan.innerHTML = 'Loading...';
69+
70+
try {
71+
const buildPreviewEndpoint = 'https://populate-data-extension.netlify.app/.netlify/functions/create-bump-preview';
72+
const res = await fetch(buildPreviewEndpoint, {
73+
method: 'POST',
74+
headers: {
75+
'Content-Type': 'application/json',
76+
},
77+
body: JSON.stringify({ url }),
78+
});
79+
80+
if (res.status === 201) {
81+
const { public_url: previewUrl } = await res.json();
82+
previewSpan.innerHTML = '';
83+
const link = document.createElement('a');
84+
link.href = previewUrl;
85+
link.textContent = previewUrl;
86+
link.target = '_blank';
87+
previewSpan.appendChild(link);
88+
}
89+
90+
if (res.status === 422) {
91+
const resText = await res.text();
92+
previewSpan.innerHTML = resText;
93+
}
94+
} catch (err) {
95+
console.error(err);
96+
previewSpan.innerHTML = 'Error!';
97+
}
98+
}
99+
</script>
50100
</body>
51101
</html>
52102
EOF

changelog/changelog.json

Lines changed: 1295 additions & 0 deletions
Large diffs are not rendered by default.

changelog/changelog.yaml

Lines changed: 776 additions & 0 deletions
Large diffs are not rendered by default.

changelog/internal/changelog-all.json

Lines changed: 1295 additions & 0 deletions
Large diffs are not rendered by default.

changelog/internal/changelog-all.yaml

Lines changed: 776 additions & 0 deletions
Large diffs are not rendered by default.

changelog/internal/metadata.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"runDate": "2025-07-23",
3-
"specRevision": "686da4c6427d39d65066d8fc9b30e32fd83b4a74",
4-
"specRevisionShort": "686da4c6427",
2+
"runDate": "2025-07-24",
3+
"specRevision": "10cfd6d1c2aa6e051faea0d2047b697c6678e28b",
4+
"specRevisionShort": "10cfd6d1c2a",
55
"versions": [
66
"2023-01-01",
77
"2023-02-01",

0 commit comments

Comments
 (0)