Skip to content

Commit

Permalink
eschweitzer78/update-2024-09-02-2300 (#384)
Browse files Browse the repository at this point in the history
* fix issue #372

* NSW DS: style omniscript action buttons

* VIC2DS: Enabled to remove primary logo override

* VIC2DS changes to hero header and demo mode for footer and header

* version

* Additional styling for NSW DS

* Upgrade to OmniStudio 250

* NSW DS loader and a few fixes
  • Loading branch information
eschweitzer78 authored Sep 2, 2024
1 parent 9477dd5 commit 16af3be
Show file tree
Hide file tree
Showing 37 changed files with 367 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export default class {
if (!e._sfGpsDsOnClickOutside)
e._sfGpsDsOnClickOutside = new Set();
e._sfGpsDsOnClickOutside.add(uuid);
console.log("tag", uuid);
}
},
handler: (e) => {
Expand All @@ -92,13 +93,14 @@ export default class {
}

/* unbind must be called only once in the disconnectedCallback method */
/* or whenever the referenced object disappears from the DOM */
unbind(pel, ref) {
const el = pel.refs[ref];

if (this._sfGpsDsOnClickOutside[ref]) {
this._sfGpsDsOnClickOutside[ref].forEach(({ event, tagger, handler }) => {
document.removeEventListener(event, handler, false);
el.removeEventListener(event, tagger, false);
if (el) el.removeEventListener(event, tagger, false);
});

delete this._sfGpsDsOnClickOutside[ref];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default class {
if (this._sfGpsDsOnWindowResize) {
window.removeEventListener(
"resize",
this._sfGpsDsOnWindowResizehandler.handler,
this._sfGpsDsOnWindowResize.handler,
false
);
delete this._sfGpsDsOnWindowResize;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ export default class SfGpsDsAuNswAccordionComm extends SfGpsDsLwc {
@api content;
@api className;

_rendered = false;

renderedCallback() {
replaceInnerHtml(this.refs.markdown, this.content);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
lwc:else
label={label}
items={_itemsArray}
link-component={linkComponent}
class-name={className}
>
</c-sf-gps-ds-au-nsw-breadcrumbs>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
lwc:else
label={label}
items={_itemsArray}
link-component={linkComponent}
class-name={className}
>
</c-sf-gps-ds-au-nsw-breadcrumbs>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
icon-name={iconName}
mobile-full-width={_mobileFullWidth}
class-name={className}
onclick={handleClick}
>
</c-sf-gps-ds-au-nsw-button>
<c-sf-gps-ds-au-nsw-button
Expand All @@ -30,7 +31,6 @@
icon-name={iconName}
mobile-full-width={_mobileFullWidth}
class-name={className}
onclick={handleClick}
>
{_link.text}
</c-sf-gps-ds-au-nsw-button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"target": "!Os",
"!.html": {
"target": "!Os.html",
"c-sf-gps-ds-spinner": "c-sf-gps-ds-spinner-os",
"c-sf-gps-ds-au-nsw-loader": "c-sf-gps-ds-au-nsw-loader-os",
"c-sf-gps-ds-au-nsw-card-comm": "c-sf-gps-ds-au-nsw-card-comm-os",
"c-sf-gps-ds-empty": "c-sf-gps-ds-empty-os",
"c-sf-gps-ds-configuration-error": "c-sf-gps-ds-configuration-error-os"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</c-sf-gps-ds-configuration-error>

<template lwc:else>
<c-sf-gps-ds-spinner lwc:if={_isLoading}> </c-sf-gps-ds-spinner>
<c-sf-gps-ds-au-nsw-loader lwc:if={_isLoading}> </c-sf-gps-ds-au-nsw-loader>
<div lwc:else class={computedClassName}>
<template for:each={_items} for:item="card">
<div key={card.index} class={computedColClassName}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
type="String"
label="Date"
description="Specifies a date context for the content, e.g. a publication date - in ISO8601 format."
editor="c/sfGpsDsStringCpe"
/>
<property
name="dateStyle"
Expand All @@ -65,24 +66,28 @@
type="String"
label="Image source"
description="Allows for different content to stand out and provide additional context - as an URL."
editor="c/sfGpsDsStringCpe"
/>
<property
name="imageAlt"
type="String"
label="Image alt"
description="Specifies an alternate text for the image, if the image cannot be displayed."
editor="c/sfGpsDsStringCpe"
/>
<property
name="tag"
type="String"
label="Tag"
description="Indicates the category of a topic or theme to further group content."
editor="c/sfGpsDsStringCpe"
/>
<property
name="className"
type="String"
label="Class name"
description="Additional CSS class to be applied."
editor="c/sfGpsDsStringCpe"
/>
</targetConfig>
</targetConfigs>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</c-sf-gps-ds-configuration-error>

<template lwc:else>
<c-sf-gps-ds-spinner lwc:if={_isLoading}> </c-sf-gps-ds-spinner>
<c-sf-gps-ds-au-nsw-loader lwc:if={_isLoading}> </c-sf-gps-ds-au-nsw-loader>

<c-sf-gps-ds-empty lwc:if={isEmpty} title="No matching content">
</c-sf-gps-ds-empty>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"!.html": {
"target": "!Os.html",
"c-sf-gps-ds-spinner": "c-sf-gps-ds-spinner-os",
"c-sf-gps-ds-au-nsw-loader": "c-sf-gps-ds-au-nsw-loader-os",
"c-sf-gps-ds-au-nsw-content-block-comm": "c-sf-gps-ds-au-nsw-content-block-comm-os",
"c-sf-gps-ds-empty": "c-sf-gps-ds-empty-os",
"c-sf-gps-ds-configuration-error": "c-sf-gps-ds-configuration-error-os"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<c-sf-gps-ds-spinner lwc:if={_isLoading}> </c-sf-gps-ds-spinner>
<c-sf-gps-ds-au-nsw-loader lwc:if={_isLoading}> </c-sf-gps-ds-au-nsw-loader>

<c-sf-gps-ds-configuration-error
lwc:if={_sfGpsDsErrors}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</c-sf-gps-ds-configuration-error>

<template lwc:else>
<c-sf-gps-ds-spinner lwc:if={_isLoading}> </c-sf-gps-ds-spinner>
<c-sf-gps-ds-au-nsw-loader lwc:if={_isLoading}> </c-sf-gps-ds-au-nsw-loader>

<c-sf-gps-ds-au-nsw-lower-footer
lwc:else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</c-sf-gps-ds-configuration-error>

<template lwc:else>
<c-sf-gps-ds-spinner lwc:if={_isLoading}> </c-sf-gps-ds-spinner>
<c-sf-gps-ds-au-nsw-loader lwc:if={_isLoading}></c-sf-gps-ds-au-nsw-loader>
<c-sf-gps-ds-au-nsw-upper-footer
lwc:else
items={_items}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
<template>
<!-- Spinner -->
<template lwc:if={isPageLoading}>
<omnistudio-spinner
variant="brand"
alternative-text="Loading..."
theme={_theme}
size="medium"
>
</omnistudio-spinner>
<c-sf-gps-ds-au-nsw-loader-os label="Loading..." size="md">
</c-sf-gps-ds-au-nsw-loader-os>
</template>

<div class={_containerClasses} aria-labelledby="fileUpload">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,11 @@
</span>

<template lwc:if={isPageLoading}>
<omnistudio-spinner
variant="brand"
alternative-text={allCustomLabelsUtil.OmniSpinnerTextLoading}
theme="slds"
size="small"
<c-sf-gps-ds-au-nsw-loader-os
label={allCustomLabelsUtil.OmniSpinnerTextLoading}
size="sm"
>
</omnistudio-spinner>
</c-sf-gps-ds-au-nsw-loader-os>
</template>
</div>
</template>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"target": "!Os.html",
"c-sf-gps-ds-au-nsw-link-list": "c-sf-gps-ds-au-nsw-link-list-os",
"c-sf-gps-ds-empty": "c-sf-gps-ds-empty-os",
"c-sf-gps-ds-configuration-error": "c-sf-gps-ds-configuration-error-os"
"c-sf-gps-ds-configuration-error": "c-sf-gps-ds-configuration-error-os",
"c-sf-gps-ds-au-nsw-loader": "c-sf-gps-ds-au-nsw-loader-os"
},
"!.js": {
"target": "!Os.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,18 @@
>
</c-sf-gps-ds-configuration-error>

<template lwc:else>
<c-sf-gps-ds-au-nsw-link-list links={_items} class-name={className}>
</c-sf-gps-ds-au-nsw-link-list>
<c-sf-gps-ds-au-nsw-loader lwc:elseif={_isLoading}>
</c-sf-gps-ds-au-nsw-loader>

<template lwc:else>
<c-sf-gps-ds-empty lwc:if={isEmpty} title="No matching content">
</c-sf-gps-ds-empty>

<c-sf-gps-ds-au-nsw-link-list
lwc:else
links={_items}
class-name={className}
>
</c-sf-gps-ds-au-nsw-link-list>
</template>
</template>
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,56 @@ import SfGpsDsIpLwc from "c/sfGpsDsIpLwc";
export default class SfGpsDsAuNswLinkCollectionComm extends NavigationMixin(
SfGpsDsIpLwc
) {
@api
get mode() {
return super.mode;
}

set mode(value) {
super.mode = value;

if (value === "Demo") {
/* eslint-disable no-unused-vars */
let cbp = this.communityBasePath;

this._items = this.mapIpData([
{
actionType: "ExternalLink",
actionValue: "https://www.nsw.gov.au/accessibility-statement",
imageUrl: null,
label: "Accessibility statement",
subMenu: [],
target: "CurrentWindow"
},
{
actionType: "ExternalLink",
actionValue: "https://www.nsw.gov.au/nsw-government/copyright",
imageUrl: null,
label: "Copyright",
subMenu: [],
target: "CurrentWindow"
},
{
actionType: "ExternalLink",
actionValue: "https://www.nsw.gov.au/nsw-government/disclaimer",
imageUrl: null,
label: "Disclaimer",
subMenu: [],
target: "CurrentWindow"
}
]);
}
}

@api
get navigationDevName() {
return super.navigationDevName;
}

set navigationDevName(value) {
super.navigationDevName = value;
}

@api
get ipName() {
return super.ipName;
Expand Down Expand Up @@ -50,10 +100,11 @@ export default class SfGpsDsAuNswLinkCollectionComm extends NavigationMixin(
data = [data];
}

return data.map((item) => ({
return data.map((item, index) => ({
...item,
text: item.text,
url: item.url
index: item.index || `item-${index + 1}`,
text: item.text || item.label,
url: item.url || item.actionValue
}));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,49 @@
</targets>
<targetConfigs>
<targetConfig targets="lightningCommunity__Default">
<property
name="mode"
type="String"
label="Mode"
datasource="Demo,Experience Cloud Navigation,Integration Procedure"
default="Experience Cloud Navigation"
/>
<property
name="navigationDevName"
type="String"
label="Navigation name"
description="Pick the nav when mode is set to Experience Cloud Navigation."
editor="c/sfGpsDsNavigationCpe"
/>
<property
name="ipName"
type="String"
label="Integration procedure name"
description="Name of the Integration procedure mapping content to this list."
editor="c/sfGpsDsStringCpe"
/>
<property
name="inputJSON"
type="String"
label="Input JSON"
description="JSON formatted input parameters for the Integration procedure."
default="{}"
editor="c/sfGpsDsStringCpe"
/>
<property
name="optionsJSON"
type="String"
label="Options JSON"
description="JSON formatted options for the Integration procedure."
default="{}"
editor="c/sfGpsDsStringCpe"
/>
<property
name="className"
type="String"
label="Class name"
description="Additional CSS class to be applied."
editor="c/sfGpsDsStringCpe"
/>
</targetConfig>
</targetConfigs>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@
*/

import { api, track } from "lwc";
import { NavigationMixin } from "lightning/navigation";
import SfGpsDsLwc from "c/sfGpsDsLwc";
import mdEngine from "c/sfGpsDsMarkdown";

export default class SfGpsDsAuNswLinkListComm extends NavigationMixin(
SfGpsDsLwc
) {
export default class SfGpsDsAuNswLinkListComm extends SfGpsDsLwc {
@api title;
@api firstChild;
@api className;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div class={titleClassName}>{_name}</div>

<template lwc:if={_isLoading}>
<c-sf-gps-ds-spinner></c-sf-gps-ds-spinner>
<c-sf-gps-ds-au-nsw-loader></c-sf-gps-ds-au-nsw-loader>
</template>

<template lwc:if={_records}>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"sfGpsDsAuNswLoader/loader": []
}
Loading

0 comments on commit 16af3be

Please sign in to comment.