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 9d1b514
Show file tree
Hide file tree
Showing 8 changed files with 47 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
1 change: 1 addition & 0 deletions templates/header.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<nav class="user-nav" id="user-nav" aria-label="{{t 'user_navigation'}}">
<ul class="user-nav-list">
<li>{{link 'community'}}</li>
<li><a href="/hc/en-us/p/service_catalog">Request a service</a></li>
<li>{{link 'new_request' class='submit-a-request'}}</li>
{{#unless signed_in}}
<li>
Expand Down

0 comments on commit 9d1b514

Please sign in to comment.