-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from qld-gov-au/QOLOE-515-GlobalAlertLayout
QOLOE-515: Include layout globalAlert CS component (also restructure template vs content)
- Loading branch information
Showing
31 changed files
with
171 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
|
||
This is the dxp spec as of 2024 Sept | ||
|
||
http://localhost:3000/schemas/v1.json | ||
http://localhost:3000/schemas/v1.json | ||
|
||
Current icon set to choose from can be see here: https://fonts.google.com/icons?icon.size=24&icon.color=%23EA3323&icon.set=Material+Icons&icon.style=Two+tone |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/** | ||
* Accordion component | ||
* Common js module to support DXP Component Service. | ||
*/ | ||
module.exports = async function (input, info) { | ||
const items = input.alertItems.map(item => ` | ||
<section class="global-alert global-alert-${item.variant}"> | ||
<div class="container-fluid"> | ||
<div class="qld-global-alert-main"> | ||
<div class="global-alert-icon"></div> | ||
<div class="global-alert-content"> | ||
<div class="global-alert-message"> | ||
${item.content} | ||
</div> | ||
<div class="global-alert-action"> | ||
${item.action?item.action:""} | ||
</div> | ||
</div> | ||
<div class="global-alert-close"> | ||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close">Close</button> | ||
</div> | ||
</div> | ||
</div> | ||
</section> | ||
`).join(''); | ||
|
||
return ` | ||
<!-- QGDS Component: Global Alert --> | ||
<div class="global-alert-include"> | ||
${items} | ||
</div> | ||
` | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
{ | ||
"$schema": "http://localhost:3000/schemas/v1.json#", | ||
"version": "1.0.1", | ||
"name": "global-alert", | ||
"displayName": "Global Alert", | ||
"description": "QGDS Bootstrap 5 - Global Alert", | ||
"icon": { | ||
"id": "notification_important", | ||
"color": { | ||
"type": "hex", | ||
"value": "#EA3323" | ||
} | ||
}, | ||
"namespace": "qgds-bs5-layout-local", | ||
"mainFunction": "main", | ||
"functions": [ | ||
{ | ||
"name": "main", | ||
"entry": "main.cjs", | ||
"input": { | ||
"type": "object", | ||
"properties": { | ||
"alertItems": { | ||
"title": "Global Alert items array", | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"variant": { | ||
"type": "string", | ||
"enum": [ | ||
"critical", | ||
"warning", | ||
"info" | ||
] | ||
}, | ||
"content": { | ||
"type": "string", | ||
"format": "multi-line" | ||
}, | ||
"action": { | ||
"type": "string", | ||
"format": "multi-line" | ||
} | ||
}, | ||
"required": ["variant", "content"] | ||
} | ||
} | ||
}, | ||
"required": ["alertItems"] | ||
}, | ||
"output": { | ||
"responseType": "html", | ||
"staticFiles": [ | ||
{ | ||
"location": "header", | ||
"file": { | ||
"type": "css", | ||
"filepath": "https://static.qgov.net.au/qgds-bootstrap5/v1/v1.x.x-latest/assets/css/qld.bootstrap.css" | ||
} | ||
}, | ||
{ | ||
"location": "footer", | ||
"file": { | ||
"type": "js", | ||
"filepath": "https://static.qgov.net.au/qgds-bootstrap5/v1/v1.x.x-latest/assets/js/bootstrap.min.js" | ||
} | ||
}, | ||
{ | ||
"location": "footer", | ||
"file": { | ||
"type": "js", | ||
"filepath": "https://static.qgov.net.au/qgds-bootstrap5/v1/v1.x.x-latest/assets/js/qld.bootstrap.min.js" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
], | ||
"previews": { | ||
"default": { | ||
"functionData": { | ||
"main": { | ||
"inputData": { | ||
"type": "file", | ||
"path": "previews/example.data.json" | ||
}, | ||
"wrapper": { | ||
"path": "previews/preview.html" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"alertItems": [ | ||
{ | ||
"variant": "critical", | ||
"content": "<strong>Testing:</strong> This website is currently undergoing testing", | ||
"action": "<a href='https://www.qld.gov.au/'><span>Read more</span></a>" | ||
}, | ||
{ | ||
"variant": "warning", | ||
"content": "<strong>Testing:</strong> This website is currently undergoing testing", | ||
"action": "<a href='https://www.qld.gov.au/'><span>Learn more</span></a>" | ||
}, | ||
{ | ||
"variant": "info", | ||
"content": "<strong>Testing:</strong> This website is currently undergoing testing", | ||
"action": "<a href='https://www.qld.gov.au/'><span>Learn more</span></a>" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<html> | ||
<head> | ||
[component://static-header] | ||
</head> | ||
<body> | ||
[component://output] | ||
[component://static-footer] | ||
</body> | ||
</html> |