Skip to content

Commit

Permalink
Upd: change rapidocs configuration
Browse files Browse the repository at this point in the history
Signed-off-by: George J Padayatti <[email protected]>
  • Loading branch information
georgepadayatti committed Sep 25, 2023
1 parent 8324f7c commit 89eec9f
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 88 deletions.
91 changes: 49 additions & 42 deletions openapi/v2023.8.1/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="GovStack Consent BB APIs" />
<title>GovStack Consent BB APIs</title>
<meta name="description" content="GovStack Consent Building Block APIs" />
<title>GovStack Consent Building Block APIs</title>
<link
href="https://fonts.googleapis.com/css2?family=Hind:wght@400;700&amp;family=Roboto+Mono&amp;display=swap"
rel="stylesheet"
Expand All @@ -17,71 +17,78 @@
// JavaScript to modify render-style based on screen width
window.addEventListener("DOMContentLoaded", (event) => {
const rapiDocElement = document.querySelector("rapi-doc");
if (window.innerWidth <= 768) {
// Assuming 768px as the breakpoint for tablet size
rapiDocElement.setAttribute("render-style", "read"); // for sizes less than a tablet

// Function to apply the style when the element is available
const applyStyleToApiInfo = () => {
const mainContentElement =
rapiDocElement.shadowRoot.querySelector(".main-content");
const apiInfoElement =
rapiDocElement.shadowRoot.querySelector("#api-info");
const labelOperationPathElements =
rapiDocElement.shadowRoot.querySelectorAll(
"[part*='section-operation-webhook-method']"
);

if (
apiInfoElement &&
labelOperationPathElements &&
mainContentElement
) {
mainContentElement.style.padding = "10px";
apiInfoElement.style.marginLeft = "0";
labelOperationPathElements.forEach(function (element) {
element.style.overflowX = "scroll";
});
observer.disconnect(); // Stop observing once style is applied
}
};
// Function to apply the style when the element is available
const applyStyleToApiInfo = () => {
const header =
rapiDocElement.shadowRoot.querySelector(".main-header");
const mainContentElement =
rapiDocElement.shadowRoot.querySelector(".main-content");
const apiInfoElement =
rapiDocElement.shadowRoot.querySelector("#api-info");
const labelOperationPathElements =
rapiDocElement.shadowRoot.querySelectorAll(
"[part*='section-operation-webhook-method']"
);

// Observe changes in the Shadow DOM
const observer = new MutationObserver(applyStyleToApiInfo);
if (rapiDocElement.shadowRoot) {
observer.observe(rapiDocElement.shadowRoot, {
childList: true,
subtree: true,
if (
apiInfoElement &&
labelOperationPathElements &&
mainContentElement &&
header
) {
mainContentElement.style.padding = "10px";
apiInfoElement.style.marginLeft = "0";
header.style.padding = "8px 4px 8px 16px";
labelOperationPathElements.forEach(function (element) {
element.style.overflowX = "scroll";
});
applyStyleToApiInfo(); // Try applying the style immediately in case the element is already there
observer.disconnect(); // Stop observing once style is applied
}
};

// Observe changes in the Shadow DOM
const observer = new MutationObserver(applyStyleToApiInfo);
if (rapiDocElement.shadowRoot) {
observer.observe(rapiDocElement.shadowRoot, {
childList: true,
subtree: true,
});
applyStyleToApiInfo(); // Try applying the style immediately in case the element is already there
}
if (window.innerWidth <= 768) {
// Assuming 768px as the breakpoint for tablet size
rapiDocElement.setAttribute("render-style", "view"); // for sizes less than a tablet
} else {
rapiDocElement.setAttribute("render-style", "focused"); // for sizes greater than a tablet
rapiDocElement.setAttribute("render-style", "view"); // for sizes greater than a tablet
}
});
</script>
</head>
<body>
<rapi-doc
render-style="focused"
spec-url="./bundled.yaml"
theme="light"
show-header="false"
show-header="true"
nav-bg-color="#0a065e"
header-color="#0a065e"
nav-text-color="#fff"
primary-color="#0a065e"
persist-auth="true"
show-method-in-nav-bar="as-colored-block"
show-components="true"
allow-spec-url-load="false"
allow-spec-file-load="false"
allow-spec-file-download="true"
show-curl-before-try="true"
schema-style="table"
regular-font="Hind"
font-size="large"
mono-font="Roboto Mono"
schema-expand-level="1"
default-schema-tab="schema"
render-style="view"
>
<img
slot="nav-logo"
slot="logo"
style="height: 130px; width: 130px; margin: 0 auto"
src="./resources/logo.svg"
/>
Expand Down
2 changes: 1 addition & 1 deletion openapi/v2023.8.2/bundled.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
openapi: 3.0.0
info:
version: 2023.8.2
title: GovStack Consent BB APIs
title: Consent Building Block APIs
description: |
The Consent Building Block enables services for individuals to approve the use of their personal data by defining the principles, functions, and architecture of an information system. For organisations that process personal data, it provides the ability to know the individual's will and legitimately process such personal data. The Consent Building Block is a process-oriented GovStack Building Block facilitating auditable bilateral agreements within a multi-agent environment that integrates with most other Building Blocks.
contact:
Expand Down
89 changes: 47 additions & 42 deletions openapi/v2023.8.2/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="GovStack Consent BB APIs" />
<title>GovStack Consent BB APIs</title>
<meta name="description" content="GovStack Consent Building Block APIs" />
<title>GovStack Consent Building Block APIs</title>
<link
href="https://fonts.googleapis.com/css2?family=Hind:wght@400;700&amp;family=Roboto+Mono&amp;display=swap"
rel="stylesheet"
Expand All @@ -17,73 +17,78 @@
// JavaScript to modify render-style based on screen width
window.addEventListener("DOMContentLoaded", (event) => {
const rapiDocElement = document.querySelector("rapi-doc");
if (window.innerWidth <= 768) {
// Assuming 768px as the breakpoint for tablet size
rapiDocElement.setAttribute("render-style", "read"); // for sizes less than a tablet

// Function to apply the style when the element is available
const applyStyleToApiInfo = () => {
const mainContentElement =
rapiDocElement.shadowRoot.querySelector(".main-content");
const apiInfoElement =
rapiDocElement.shadowRoot.querySelector("#api-info");
const labelOperationPathElements =
rapiDocElement.shadowRoot.querySelectorAll(
"[part*='section-operation-webhook-method']"
);

if (
apiInfoElement &&
labelOperationPathElements &&
mainContentElement
) {
mainContentElement.style.padding = "10px";
apiInfoElement.style.marginLeft = "0";
labelOperationPathElements.forEach(function (element) {
element.style.overflowX = "scroll";
});
observer.disconnect(); // Stop observing once style is applied
}
};
// Function to apply the style when the element is available
const applyStyleToApiInfo = () => {
const header =
rapiDocElement.shadowRoot.querySelector(".main-header");
const mainContentElement =
rapiDocElement.shadowRoot.querySelector(".main-content");
const apiInfoElement =
rapiDocElement.shadowRoot.querySelector("#api-info");
const labelOperationPathElements =
rapiDocElement.shadowRoot.querySelectorAll(
"[part*='section-operation-webhook-method']"
);

// Observe changes in the Shadow DOM
const observer = new MutationObserver(applyStyleToApiInfo);
if (rapiDocElement.shadowRoot) {
observer.observe(rapiDocElement.shadowRoot, {
childList: true,
subtree: true,
if (
apiInfoElement &&
labelOperationPathElements &&
mainContentElement &&
header
) {
mainContentElement.style.padding = "10px";
apiInfoElement.style.marginLeft = "0";
header.style.padding = "8px 4px 8px 16px";
labelOperationPathElements.forEach(function (element) {
element.style.overflowX = "scroll";
});
applyStyleToApiInfo(); // Try applying the style immediately in case the element is already there
observer.disconnect(); // Stop observing once style is applied
}
};

// Observe changes in the Shadow DOM
const observer = new MutationObserver(applyStyleToApiInfo);
if (rapiDocElement.shadowRoot) {
observer.observe(rapiDocElement.shadowRoot, {
childList: true,
subtree: true,
});
applyStyleToApiInfo(); // Try applying the style immediately in case the element is already there
}
if (window.innerWidth <= 768) {
// Assuming 768px as the breakpoint for tablet size
rapiDocElement.setAttribute("render-style", "view"); // for sizes less than a tablet
} else {
rapiDocElement.setAttribute("render-style", "focused"); // for sizes greater than a tablet
rapiDocElement.setAttribute("render-style", "view"); // for sizes greater than a tablet
}
});
</script>
</head>
<body>
<rapi-doc
render-style="focused"
spec-url="./bundled.yaml"
theme="light"
show-header="false"
show-header="true"
nav-bg-color="#0a065e"
header-color="#0a065e"
nav-text-color="#fff"
primary-color="#0a065e"
persist-auth="true"
show-method-in-nav-bar="as-colored-block"
show-components="true"
allow-spec-url-load="false"
allow-spec-file-load="false"
allow-spec-file-download="true"
show-curl-before-try="true"
schema-style="table"
regular-font="Hind"
font-size="large"
mono-font="Roboto Mono"
schema-expand-level="1"
default-schema-tab="schema"
render-style="view"
>
<img
slot="nav-logo"
slot="logo"
style="height: 130px; width: 130px; margin: 0 auto"
src="./resources/logo.svg"
/>
Expand Down
5 changes: 2 additions & 3 deletions openapi/v2023.8.2/index.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
openapi: "3.0.0"
info:
version: "2023.8.2"
title: "GovStack Consent BB APIs"
title: "Consent Building Block APIs"
description: >
The Consent Building Block enables services for individuals to approve the use
of their personal data by defining the principles, functions, and architecture
Expand Down Expand Up @@ -208,8 +208,7 @@ paths:
$ref: "./paths/config/getRecentWebhookDeliveryByID.yaml"
/v2/config/webhooks/{webhookId}/delivery/{deliveryId}/redeliver:
$ref: "./paths/config/redeliverWebhook.yaml"



components:
schemas:
Log:
Expand Down

0 comments on commit 89eec9f

Please sign in to comment.