Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug(docs): Fix backup path on null #39575

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docusaurus/src/helpers/objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const getFromPaths = (obj, path, defaultValue = undefined) => {
// Try to get the value from each possible path
for (let possiblePath of possiblePaths) {
const value = get(obj, possiblePath);
if (value !== undefined) {
if (value !== undefined && value !== null) {
return value;
}
}
Expand Down
16 changes: 9 additions & 7 deletions docusaurus/src/remark/docsHeaderDecoration.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,13 @@ const plugin = () => {
const originalId = node.data.hProperties.id;

const rawCDKVersion = getFromPaths(registryEntry, "packageInfo_[oss|cloud].cdk_version");
const syncSuccessRate = getFromPaths(registryEntry, "generated_[oss|cloud].metrics.cloud.sync_success_rate");
const syncSuccessRate = getFromPaths(registryEntry, "generated_[oss|cloud].metrics.[all|cloud|oss].sync_success_rate");
const usageRate = getFromPaths(registryEntry, "generated_[oss|cloud].metrics.[all|cloud|oss].usage");
const lastUpdated = getFromPaths(registryEntry, "generated_[oss|cloud].source_file_info.metadata_last_modified");

const {version, isLatest, url} = parseCDKVersion(rawCDKVersion, latestPythonCdkVersion);

firstHeading = false;
node.children = [];
node.type = "mdxJsxFlowElement";
node.name = "HeaderDecoration";
node.attributes = toAttributes({
const attrDict = {
isOss: registryEntry.is_oss,
isCloud: registryEntry.is_cloud,
isPypiPublished: isPypiConnector(registryEntry),
Expand All @@ -70,7 +66,13 @@ const plugin = () => {
syncSuccessRate,
usageRate,
lastUpdated,
});
};

firstHeading = false;
node.children = [];
node.type = "mdxJsxFlowElement";
node.name = "HeaderDecoration";
node.attributes = toAttributes(attrDict);
}
});
};
Expand Down
Loading