Skip to content

Commit

Permalink
feat: add new template and module for service catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
gosiexon-zen committed Sep 30, 2024
1 parent 48ecd5f commit f9a0130
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 0 deletions.
11 changes: 11 additions & 0 deletions assets/service-catalog-bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export default defineConfig([
input: {
"new-request-form": "src/modules/new-request-form/index.tsx",
"flash-notifications": "src/modules/flash-notifications/index.ts",
"service-catalog": "src/modules/service-catalog/index.tsx",
},
output: {
dir: "assets",
Expand Down
5 changes: 5 additions & 0 deletions src/modules/service-catalog/ServiceCatalog.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Span } from "@zendeskgarden/react-typography";

export function ServiceCatalog() {
return <Span>Hello from module</Span>;
}
1 change: 1 addition & 0 deletions src/modules/service-catalog/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { renderServiceCatalog } from "./renderServiceCatalog";
7 changes: 7 additions & 0 deletions src/modules/service-catalog/renderServiceCatalog.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { render } from "react-dom";

import { ServiceCatalog } from "./ServiceCatalog";

export async function renderServiceCatalog(container: HTMLElement) {
render(<ServiceCatalog />, container);
}
20 changes: 20 additions & 0 deletions templates/custom_pages/service_catalog.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<div class="container-divider"></div>
<div class="container">
<div class="sub-nav">
</div>

<h1>Service Catalog</h1>

<div id="main-content">
<div id="service-catalog"></div>
<div>Hello from template</div>
</div>
</div>

<script type="module">
import { renderServiceCatalog } from "service-catalog";
const container = document.getElementById("service-catalog");
renderServiceCatalog(container);
</script>
1 change: 1 addition & 0 deletions templates/document_head.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"imports": {
"new-request-form": "{{asset 'new-request-form-bundle.js'}}",
"flash-notifications": "{{asset 'flash-notifications-bundle.js'}}",
"service-catalog": "{{asset 'service-catalog-bundle.js'}}",
"new-request-form-translations": "{{asset 'new-request-form-translations-bundle.js'}}",
"shared": "{{asset 'shared-bundle.js'}}",
"wysiwyg": "{{asset 'wysiwyg-bundle.js'}}"
Expand Down
7 changes: 7 additions & 0 deletions templates/home_page.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@
{{/each}}
{{/if}}
{{/each}}
<li class="blocks-item">
<a href="/hc/en-us/p/service_catalog" class="blocks-item-link">
<span class="blocks-item-title">
Service Catalog
</span>
</a>
</li>
</ul>
{{pagination}}
</section>
Expand Down

0 comments on commit f9a0130

Please sign in to comment.