forked from silvershop/silvershop-core
-
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 branch 'silvershop:main' into master
- Loading branch information
Showing
108 changed files
with
631 additions
and
1,186 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
docs/ export-ignore | ||
docs_user/ export-ignore | ||
.travis.yml export-ignore |
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,16 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
ci: | ||
name: CI | ||
uses: silverstripe/gha-ci/.github/workflows/ci.yml@v1 | ||
with: | ||
composer_require_extra: | ||
phpunit/phpunit:^9.5 | ||
silverstripe/silverstripe-omnipay:dev-master | ||
php-http/discovery:^1.18.1 |
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
* Addressbook checkout component | ||
* This handles a dropdown or radio buttons containing existing addresses or payment methods, | ||
* with one of the options being "create a new ____". When that last option is selected, the | ||
* other fields need to be shown, otherwise they need to be hidden. | ||
*/ | ||
function onExistingValueChange() { | ||
let existingValues = document.querySelectorAll('.hasExistingValues'); | ||
if(!existingValues) return; | ||
|
||
existingValues.forEach(function (container, idx) { | ||
let toggle = document.querySelector('.existingValues select, .existingValues input:checked'); | ||
|
||
// visible if the value is not an ID (numeric) | ||
let toggleState = Number.isNaN(parseInt(toggle.value)); | ||
let toggleFields = container.querySelectorAll(".field:not(.existingValues)"); | ||
|
||
// animate the fields - hide or show | ||
if (toggleFields && toggleFields.length > 0) { | ||
toggleFields.forEach(field => { | ||
field.style.display = toggleState ? '' : 'none'; | ||
}) | ||
} | ||
|
||
// clear them out | ||
toggleFields.forEach(field => { | ||
field.querySelectorAll('input, select, textarea').forEach(f => { | ||
f.value = ''; | ||
f.disabled = toggleState ? '' : 'disabled'; | ||
}); | ||
}); | ||
}); | ||
} | ||
|
||
let selectors = document.querySelectorAll('.existingValues select'); | ||
if(selectors) selectors.forEach(selector => selector.addEventListener('change', onExistingValueChange)); | ||
|
||
let inputs = document.querySelectorAll('.existingValues input[type=radio]') | ||
if(inputs) inputs.forEach(input => input.addEventListener('click', onExistingValueChange)); | ||
|
||
onExistingValueChange(); // handle initial state |
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
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,14 +1,16 @@ | ||
<phpunit bootstrap="vendor/silverstripe/cms/tests/bootstrap.php" colors="true"> | ||
<?xml version="1.0"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/silverstripe/cms/tests/bootstrap.php" colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"> | ||
<coverage includeUncoveredFiles="true"> | ||
<include> | ||
<directory suffix=".php">src/</directory> | ||
</include> | ||
<exclude> | ||
<directory suffix=".php">tests/php/</directory> | ||
</exclude> | ||
</coverage> | ||
<testsuites> | ||
<testsuite name="Default"> | ||
<directory>tests/php</directory> | ||
<directory>tests/php</directory> | ||
</testsuite> | ||
|
||
<filter> | ||
<whitelist addUncoveredFilesFromWhitelist="true"> | ||
<directory suffix=".php">src/</directory> | ||
<exclude> | ||
<directory suffix=".php">tests/php/</directory> | ||
</exclude> | ||
</whitelist> | ||
</filter> | ||
</testsuites> | ||
</phpunit> |
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
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
Oops, something went wrong.