Skip to content

Commit 24b3e20

Browse files
authored
Merge pull request #4013 from Blargian/rename_cloudavailable_badge
Rename CloudAvailableBadge to CloudOnlyBadge to avoid confusion
2 parents 575dae2 + 260e303 commit 24b3e20

File tree

4 files changed

+20
-14
lines changed

4 files changed

+20
-14
lines changed

scripts/badger.sh

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/bin/bash
2-
32
# This script is used to generate a list of feature badges in use in the docs
43
# It runs as part of a weekly github action and the result is sent as a notification
54
# to the #docs channel in Slack.
@@ -19,33 +18,41 @@ components=(
1918
"ExperimentalBadge"
2019
"PrivatePreviewBadge"
2120
"CloudNotSupportedBadge"
22-
"CloudAvailableBadge"
21+
"CloudOnlyBadge"
22+
)
23+
24+
# Custom display names (must match order of components array)
25+
display_names=(
26+
"Beta Features"
27+
"Experimental Features"
28+
"Private Preview Features"
29+
"Cloud Unsupported Features"
30+
"Cloud Only Features"
2331
)
2432

2533
# Function to extract slug from a file's frontmatter
2634
extract_slug_from_file() {
2735
local filepath="$1"
2836
local slug=""
29-
3037
# Look for "slug: some/path/slug" in the file
3138
slug=$(grep -m 1 "^slug:" "$filepath" 2>/dev/null | sed 's/^slug:[[:space:]]*//' | tr -d '"' | tr -d "'")
32-
3339
# If no slug found, return the filepath as fallback
3440
if [ -z "$slug" ]; then
3541
slug="[no slug] $filepath"
3642
fi
37-
3843
echo "$slug"
3944
}
4045

4146
# Search for each component and collect all slugs
42-
for component in "${components[@]}"; do
43-
echo "$component:"
44-
47+
for i in "${!components[@]}"; do
48+
component="${components[$i]}"
49+
display_name="${display_names[$i]}"
50+
51+
echo "$display_name:"
4552
# Get unique files containing the component
4653
files=$(grep -rl --include="*.md" --include="*.mdx" --include="*.jsx" --include="*.tsx" \
4754
-E "<$component[[:space:]/>]|</$component>" "$DOCS_DIR" 2>/dev/null | sort -u)
48-
55+
4956
if [ -z "$files" ]; then
5057
echo " (none)"
5158
else
@@ -60,6 +67,5 @@ for component in "${components[@]}"; do
6067
fi
6168
done <<< "$files"
6269
fi
63-
6470
echo
6571
done

scripts/settings/session-settings.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ WITH
5858
name,
5959
' {#'||name||'} \n\n',
6060
multiIf(tier == 'Experimental', '<ExperimentalBadge/>\n\n', tier == 'Beta', '<BetaBadge/>\n\n', ''),
61-
if(description LIKE '%Only has an effect in ClickHouse Cloud%', '<CloudAvailableBadge/>\n\n', ''),
61+
if(description LIKE '%Only has an effect in ClickHouse Cloud%', '<CloudOnlyBadge/>\n\n', ''),
6262
if(
6363
type != '' AND default != '',
6464
format(
@@ -83,7 +83,7 @@ description: ''Settings which are found in the ``system.settings`` table.''
8383
8484
import ExperimentalBadge from \'@theme/badges/ExperimentalBadge\';
8585
import BetaBadge from \'@theme/badges/BetaBadge\';
86-
import CloudAvailableBadge from \'@theme/badges/CloudAvailableBadge\';
86+
import CloudOnlyBadge from \'@theme/badges/CloudOnlyBadge\';
8787
import SettingsInfoBlock from \'@theme/SettingsInfoBlock/SettingsInfoBlock\';
8888
import VersionHistory from \'@theme/VersionHistory/VersionHistory\';
8989

src/theme/badges/CloudAvailableBadge/index.js renamed to src/theme/badges/CloudOnlyBadge/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ const Icon = () => {
1212
)
1313
}
1414

15-
const CloudAvailableBadge = () => {
15+
const CloudOnlyBadge = () => {
1616
return (
1717
<div className={styles.cloudBadge}>
1818
<Icon />{'ClickHouse Cloud only'}
1919
</div>
2020
)
2121
}
2222

23-
export default CloudAvailableBadge
23+
export default CloudOnlyBadge

0 commit comments

Comments
 (0)