Skip to content

Commit

Permalink
eschweitzer78/update-2024-06-19-2300 (#373)
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
  • Loading branch information
eschweitzer78 authored Jun 19, 2024
1 parent 29b7fb9 commit 1d215bb
Show file tree
Hide file tree
Showing 19 changed files with 505 additions and 314 deletions.
14 changes: 2 additions & 12 deletions sfGpsDs/main/default/classes/SfGpsDsEncodingOF.cls
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,9 @@ global class SfGpsDsEncodingOF implements Callable {
return false;
}

if (!(arguments[0] instanceof String)) {
setError(output, 'ARGLIST-003');
return false;
}

output.put(
'result',
EncodingUtil.urlEncode((String) arguments[0], 'UTF-8')
EncodingUtil.urlEncode(String.valueOf(arguments[0]), 'UTF-8')
);
return true;
}
Expand All @@ -47,14 +42,9 @@ global class SfGpsDsEncodingOF implements Callable {
return false;
}

if (!(arguments[0] instanceof String)) {
setError(output, 'ARGLIST-003');
return false;
}

output.put(
'result',
EncodingUtil.urlDecode((String) arguments[0], 'UTF-8')
EncodingUtil.urlDecode(String.valueOf(arguments[0]), 'UTF-8')
);
return true;
}
Expand Down
161 changes: 161 additions & 0 deletions sfGpsDs/main/default/classes/SfGpsDsEncodingOF_Test.cls
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
@isTest
public class SfGpsDsEncodingOF_Test {
final static String OP_URL_ENCODE = 'UrlEncode';
final static String OP_URL_DECODE = 'UrlDecode';

@isTest
static void urlEncodeShouldCatchSpecialChars() {
SfGpsDsEncodingOF r = new SfGpsDsEncodingOF();
Map<String, Object> output = new Map<String, Object>();
Map<String, Object> args = new Map<String, Object>{
'input' => new Map<String, Object>{
'arguments' => new List<String>{ 'Do you like this #urlstring?' }
},
'output' => output,
'options' => new Map<String, Object>()
};

Test.startTest();
Boolean rv = (Boolean) r.call(OP_URL_ENCODE, args);
Test.stopTest();

System.assertEquals(true, rv, 'UrlEncode should be successful.');
System.assertEquals(
'Do+you+like+this+%23urlstring%3F',
output.get('result'),
'UrlEncode should catch special characters'
);
}

@isTest
static void urlEncodeShouldEncodeIntegers() {
SfGpsDsEncodingOF r = new SfGpsDsEncodingOF();
Map<String, Object> output = new Map<String, Object>();
Map<String, Object> args = new Map<String, Object>{
'input' => new Map<String, Object>{
'arguments' => new List<Integer>{ 1120 }
},
'output' => output,
'options' => new Map<String, Object>()
};

Test.startTest();
Boolean rv = (Boolean) r.call(OP_URL_ENCODE, args);
Test.stopTest();

System.assertEquals(true, rv, 'UrlEncode should be successful.');
System.assertEquals(
'1120',
output.get('result'),
'UrlEncode should encode integers'
);
}

@isTest
static void urlEncodeShouldFailWithoutArgs() {
SfGpsDsEncodingOF r = new SfGpsDsEncodingOF();
Map<String, Object> output = new Map<String, Object>();
Map<String, Object> args = new Map<String, Object>{
'input' => new Map<String, Object>{ 'arguments' => new List<String>() },
'output' => output,
'options' => new Map<String, Object>()
};

Test.startTest();
Boolean rv = (Boolean) r.call(OP_URL_ENCODE, args);
Test.stopTest();

System.assertEquals(false, rv, 'UrlEncode should fail.');
}

@isTest
static void urlDecodeShouldCatchSpecialChars1() {
SfGpsDsEncodingOF r = new SfGpsDsEncodingOF();
Map<String, Object> output = new Map<String, Object>();
Map<String, Object> args = new Map<String, Object>{
'input' => new Map<String, Object>{
'arguments' => new List<String>{ 'Do+you+like+this+%23urlstring%3F' }
},
'output' => output,
'options' => new Map<String, Object>()
};

Test.startTest();
Boolean rv = (Boolean) r.call(OP_URL_DECODE, args);
Test.stopTest();

System.assertEquals(true, rv, 'UrlDecode should be successful.');
System.assertEquals(
'Do you like this #urlstring?',
output.get('result'),
'UrlDecode should catch special characters'
);
}

@isTest
static void urlDecodeShouldCatchSpecialChars2() {
SfGpsDsEncodingOF r = new SfGpsDsEncodingOF();
Map<String, Object> output = new Map<String, Object>();
Map<String, Object> args = new Map<String, Object>{
'input' => new Map<String, Object>{
'arguments' => new List<String>{
'Do%20you%20like%20this%20%23urlstring%3F'
}
},
'output' => output,
'options' => new Map<String, Object>()
};

Test.startTest();
Boolean rv = (Boolean) r.call(OP_URL_DECODE, args);
Test.stopTest();

System.assertEquals(true, rv, 'UrlDecode should be successful.');
System.assertEquals(
'Do you like this #urlstring?',
output.get('result'),
'UrlDecode should catch special characters incl %20'
);
}

@isTest
static void urlDecodeShouldEncodeIntegers() {
SfGpsDsEncodingOF r = new SfGpsDsEncodingOF();
Map<String, Object> output = new Map<String, Object>();
Map<String, Object> args = new Map<String, Object>{
'input' => new Map<String, Object>{
'arguments' => new List<Integer>{ 1120 }
},
'output' => output,
'options' => new Map<String, Object>()
};

Test.startTest();
Boolean rv = (Boolean) r.call(OP_URL_DECODE, args);
Test.stopTest();

System.assertEquals(true, rv, 'UrlDecode should be successful.');
System.assertEquals(
'1120',
output.get('result'),
'UrlDecode should decode integers'
);
}

@isTest
static void urlDecodeShouldFailWithoutArgs() {
SfGpsDsEncodingOF r = new SfGpsDsEncodingOF();
Map<String, Object> output = new Map<String, Object>();
Map<String, Object> args = new Map<String, Object>{
'input' => new Map<String, Object>{ 'arguments' => new List<String>() },
'output' => output,
'options' => new Map<String, Object>()
};

Test.startTest();
Boolean rv = (Boolean) r.call(OP_URL_DECODE, args);
Test.stopTest();

System.assertEquals(false, rv, 'UrlDecode should fail.');
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>60.0</apiVersion>
Enco<status>Active</status>
</ApexClass>

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
.omniscript-article.slds-card {
border: none;
}

.omniscript-body {
padding: 0 !important;
}

.slds-omniscript_stepform {
padding-right: 0 !important;
padding-left: 0 !important;
}

.omniscript-body {
border-right: 0 !important;
}

omnistudio-omniscript-calculation-action,
omnistudio-omniscript-delete-action,
omnistudio-omniscript-docusign-envelope-action,
omnistudio-omniscript-docusign-signature-action,
omnistudio-omniscript-dr-extract-action,
omnistudio-omniscript-dr-post-action,
omnistudio-omniscript-dr-turbo-action,
omnistudio-omniscript-dr-transform-action,
omnistudio-omniscript-http-action,
omnistudio-omniscript-ip-action,
omnistudio-omniscript-matrix-action,
c-navigate-action,
omnistudio-omniscript-pdf-action,
omnistudio-omniscript-remote-action,
omnistudio-omniscript-set-values,
omnistudio-omniscript-set-errors {
.slds-button {
--lwc-borderWidthThin: 2px;
--lwc-border-radius: var(--nsw-border-radius);
--slds-c-button-radius-border: var(--nsw-border-radius);
--slds-c-button-text-color-hover: var(--nsw-brand-dark);

border-color: var(--nsw-brand-dark);
color: var(--nsw-brand-dark);

font-size: var(--nsw-font-size-sm-mobile);
font-weight: var(--nsw-font-bold);
line-height: var(--nsw-line-height-sm-mobile);
min-height: calc(var(--nsw-line-height-sm-mobile) * var(--nsw-font-size-sm-mobile) + 2 * 0.625rem + 4px);
padding: .625rem 1.375rem;

@media (min-width: 62rem) {
font-size: var(--nsw-font-size-sm-desktop);
line-height: var(--nsw-line-height-sm-desktop);
min-height: calc(var(--nsw-line-height-sm-desktop) * var(--nsw-font-size-sm-desktop) + 2 * 0.625rem + 4px);
}

&:focus {
background-color: var(--nsw-white);
box-shadow: none;
outline: 3px solid var(--nsw-focus);
outline-offset: 3px;
}

&:hover {
background-color: var(--nsw-brand-dark);
border-color: transparent;
color: var(--nsw-text-light);
}

&.slds-button--neutral,
&.slds-button_neutral {
background-color: var(--nsw-white);
border-color: var(--nsw-brand-dark);
color: var(--nsw-brand-dark);

&:hover {
background-color: var(--nsw-brand-dark);
border-color: transparent;
color: var(--nsw-text-light);
}
}

&.slds-button--brand,
&.slds-button_brand {
background-color: var(--nsw-brand-dark);
border-color: transparent;
color: var(--nsw-text-light);

&:focus {
background-color: var(--nsw-brand-dark);
box-shadow: none;
outline: 3px solid var(--nsw-focus);
outline-offset: 3px;
}

&:hover {
background-image: linear-gradient(rgba(var(--nsw-white-rgb), .15),
rgba(var(--nsw-white-rgb), .15));
border-color: transparent;
color: var(--nsw-text-light);
}
}

& .slds-button__icon {
line-height: 0.625rem;
}
}

a {
div {
color: var(--nsw-text-link);
font-weight: var(--nsw-font-bold);
text-decoration: underline;
}

&:visited div {
color: var(--nsw-text-visited);
}

&:hover div {
background-color: var(--nsw-text-link-hover);
outline: 2px solid var(--nsw-text-link-hover);
}

&:focus div {
outline: solid 3px var(--nsw-focus);
outline-offset: 0;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1 @@
.omniscript-article.slds-card {
border: none;
}

.omniscript-body {
padding: 0 !important;
}

.slds-omniscript_stepform {
padding-right: 0 !important;
padding-left: 0 !important;
}

.omniscript-body {
border-right: 0 !important;
}
@import "./byo_aura_omnistudio-base";
Original file line number Diff line number Diff line change
@@ -1,24 +1,9 @@
@import "./byo_aura_omnistudio-base";

.omniscript-sfl-actions,
.omniscript-button-position,
.omniscript-btn-next,
.omniscript-btn-previous,
.omniscript-btn-save-for-later {
display: none !important;
}

.omniscript-article.slds-card {
border: none;
}

.omniscript-body {
padding: 0 !important;
}

.slds-omniscript_stepform {
padding-right: 0 !important;
padding-left: 0 !important;
}

.omniscript-body {
border-right: 0 !important;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
--lwc-colorTextButtonBrand: var(--nsw-text-light);
--lwc-colorTextDefault: var(--nsw-text-dark);
--lwc-colorBorderInput: var(--nsw-grey-01);
--lwc-brandTextLinkActive: var(--nsw-text-link);
}
Loading

0 comments on commit 1d215bb

Please sign in to comment.