Skip to content

Commit

Permalink
Merge pull request #282 from mvandervliet/feature/pseudo-l11n-support
Browse files Browse the repository at this point in the history
Fixes: #281 Feature/pseudo l11n support
  • Loading branch information
mvandervliet authored Jul 9, 2021
2 parents 4d7147c + 07e7c4f commit 5aab220
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 7 deletions.
2 changes: 1 addition & 1 deletion deploy/complete/docker-compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ services:

# Storefront backend API service
storefront:
image: iad.ocir.io/oracle/ateam/mushop-storefront:2.2.0
image: iad.ocir.io/oracle/ateam/mushop-storefront:2.2
hostname: storefront
restart: always
cap_drop:
Expand Down
2 changes: 1 addition & 1 deletion src/storefront/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.4
2.2.5
2 changes: 1 addition & 1 deletion src/storefront/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/storefront/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mushop-storefront",
"version": "2.2.3",
"version": "2.2.5",
"description": "MuShop eCommerce demo",
"scripts": {
"start": "gulp",
Expand Down
15 changes: 13 additions & 2 deletions src/storefront/src/scripts/mu/logical/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,22 @@ export class MuAttr extends MuMx.compose(null, MuCtxInheritOnly, MuCtxAttrMixin)
}

refresh() {
const bools = ['disabled', 'checked', 'selected', 'hidden'];
const bools = ['disabled', 'checked', 'hidden'];
const selects = ['selected', 'value'];
this.getAttrs().forEach(p => {
const bool = !!~bools.indexOf(p.to);
const val = bool ? this._ctxAttrBool(p.src) : this._ctxAttrValue(p.src);
return (val || val === 0) ? this.node.setAttribute(p.to, val) : this.node.removeAttribute(p.to);

if (this.node.nodeName === 'SELECT' && ~selects.indexOf(p.to)) {
Array.apply(null, this.node.querySelectorAll('option'))
.forEach(opt => {
return val == opt.getAttribute('value') ?
opt.setAttribute('selected', true) :
opt.removeAttribute('selected');
})
} else {
return (val || val === 0) ? this.node.setAttribute(p.to, val) : this.node.removeAttribute(p.to);
}
});
}
}
Expand Down
13 changes: 12 additions & 1 deletion src/storefront/src/templates/views/userAddress.pug
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,20 @@ div(mu-if="editing")
div.uk-width-1-1
label
div.uk-form-label Country
select.uk-select(required name="country" mu-attr mu-attr-disabled="loading")
//- select from oci region countries :)
select.uk-select(required name="country" mu-attr mu-attr-disabled="loading" mu-attr-value="address.country")
option Choose
option(value="USA" selected) USA
option(value="AUS") AUS
option(value="BRA") BRA
option(value="CHL") CHL
option(value="JPN") JPN
option(value="NLD") NLD
option(value="SAU") SAU
option(value="KOR") KOR
option(value="CHE") CHE
option(value="ARE") ARE
option(value="GBR") GBR

div.uk-width-1-1
label
Expand Down

0 comments on commit 5aab220

Please sign in to comment.