Skip to content

Commit

Permalink
Add store and messages builder
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruno Dias committed Dec 28, 2018
1 parent 4d76ded commit 534ee77
Show file tree
Hide file tree
Showing 15 changed files with 114 additions and 138 deletions.
15 changes: 4 additions & 11 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"parser": "babel-eslint",
"extends": [
"vtex",
"vtex-react",
"plugin:import/recommended",
"plugin:prettier/recommended"
"plugin:import/recommended"
],
"plugins": ["import", "lodash"],
"plugins": ["import"],
"rules": {
"import/no-unresolved": [
"error",
Expand All @@ -14,14 +14,7 @@
"amd": true,
"ignore": ["^([a-zA-Z@]+[-\\.]?)+"]
}
],
"lodash/import-scope": [2, "method"],
"react/jsx-curly-spacing": 0,
"react/jsx-equals-spacing": 0,
"react/jsx-indent": 0,
"react/jsx-indent-props": 0,
"react/jsx-tag-spacing": 0,
"react/jsx-wrap-multilines": 0
]
},
"env": {
"browser": true,
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- New builders are in the town! Add messages and store builders.

## [0.19.6] - 2018-12-26

### Changed
- Use Skeleton components provided by `vtex.my-account-commons`

Expand Down
1 change: 1 addition & 0 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"builders": {
"react": "2.x",
"store": "0.x",
"messages": "0.x",
"node": "3.x"
},
"scripts": {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion pages/pages.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"store/account/account/menu-links-after": {
"component": "vtex.render-runtime/ExtensionContainer"
},
"store/account/account/profile": {},
"store/account/account/profile/display": {
"component": "vtex.render-runtime/ExtensionContainer"
},
Expand All @@ -39,4 +40,4 @@
"component": "vtex.render-runtime/ExtensionContainer"
}
}
}
}
132 changes: 66 additions & 66 deletions react/components/Profile/ProfileBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,91 +37,91 @@ const ProfileBox = ({ profile, storeCountry, onEditClick, intl }) => {
},
isCorporate,
}) => (
<React.Fragment>
<div>
<div className="flex-ns flex-wrap">
<div className="mb8 flex-auto">
<DataEntry label={firstName.label}>
{firstName.value}
</DataEntry>
</div>
<div className="mb8 flex-auto">
<DataEntry label={lastName.label}>
{lastName.value}
</DataEntry>
</div>
</div>
<div className="mb8">
<DataEntry label={email.label}>{email.value}</DataEntry>
</div>
<div className="flex-ns flex-wrap">
{document && document.label && (
<React.Fragment>
<div>
<div className="flex-ns flex-wrap">
<div className="mb8 flex-auto">
<DataEntry label={document.label}>
{document.value}
<DataEntry label={firstName.label}>
{firstName.value}
</DataEntry>
</div>
<div className="mb8 flex-auto">
<DataEntry label={lastName.label}>
{lastName.value}
</DataEntry>
</div>
)}
<div className="mb8 w-50-ns">
<DataEntry label={gender.label}>{gender.value}</DataEntry>
</div>
</div>
<div className="flex-ns flex-wrap">
<div className="mb8 flex-auto">
<DataEntry label={birthDate.label}>
{birthDate.value}
</DataEntry>
</div>
<div className="mb8 w-50-ns">
<DataEntry label={homePhone.label}>
{homePhone.value}
</DataEntry>
</div>
</div>
</div>
{isCorporate && (
<div>
<div className="mb8">
<DataEntry label={corporateName.label}>
{corporateName.value}
</DataEntry>
<DataEntry label={email.label}>{email.value}</DataEntry>
</div>
{tradeName && tradeName.label && (
<div className="mb8">
<DataEntry label={tradeName.label}>
{tradeName.value}
<div className="flex-ns flex-wrap">
{document && document.label && (
<div className="mb8 flex-auto">
<DataEntry label={document.label}>
{document.value}
</DataEntry>
</div>
)}
<div className="mb8 w-50-ns">
<DataEntry label={gender.label}>{gender.value}</DataEntry>
</div>
</div>
<div className="flex-ns flex-wrap">
<div className="mb8 flex-auto">
<DataEntry label={birthDate.label}>
{birthDate.value}
</DataEntry>
</div>
)}
{corporateDocument && corporateDocument.label && (
<div className="mb8">
<DataEntry label={corporateDocument.label}>
{corporateDocument.value}
<div className="mb8 w-50-ns">
<DataEntry label={homePhone.label}>
{homePhone.value}
</DataEntry>
</div>
)}
<div className="flex-ns flex-wrap">
<div className="mb8 flex-auto">
<DataEntry label={businessPhone.label}>
{businessPhone.value}
</div>
</div>
{isCorporate && (
<div>
<div className="mb8">
<DataEntry label={corporateName.label}>
{corporateName.value}
</DataEntry>
</div>
{stateRegistration && stateRegistration.label && (
<div className="mb8 w-50-ns">
<DataEntry label={stateRegistration.label}>
{stateRegistration.value}
{tradeName && tradeName.label && (
<div className="mb8">
<DataEntry label={tradeName.label}>
{tradeName.value}
</DataEntry>
</div>
)}
{corporateDocument && corporateDocument.label && (
<div className="mb8">
<DataEntry label={corporateDocument.label}>
{corporateDocument.value}
</DataEntry>
</div>
)}
<div className="flex-ns flex-wrap">
<div className="mb8 flex-auto">
<DataEntry label={businessPhone.label}>
{businessPhone.value}
</DataEntry>
</div>
{stateRegistration && stateRegistration.label && (
<div className="mb8 w-50-ns">
<DataEntry label={stateRegistration.label}>
{stateRegistration.value}
</DataEntry>
</div>
)}
</div>
</div>
</div>
)}
</React.Fragment>
)}
)}
</React.Fragment>
)}
</ProfileSummary>
</ProfileRules>
<ExtensionPoint
id="profile/display"
id="profile-display"
render={fields => (
<div className="flex-ns flex-wrap">
{fields.map(({ label, value }) => (
Expand Down
2 changes: 1 addition & 1 deletion react/components/Profile/ProfileFormBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class ProfileFormBox extends Component {
</Button>
}>
<ExtensionPoint
id="profile/input"
id="profile-input"
registerValidator={this.registerValidator}
registerSubmitter={this.registerSubmitter}
/>
Expand Down
3 changes: 2 additions & 1 deletion react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "my-account",
"dependencies": {
"@vtex/address-form": "^2.0.2",
"@vtex/profile-form": "^2.0.3",
"apollo-client": "^2.4.7",
"classname": "0.0.0",
"exenv": "^1.2.2",
Expand All @@ -16,4 +17,4 @@
"recompose": "^0.27.1"
},
"devDependencies": {}
}
}
36 changes: 28 additions & 8 deletions store/blocks.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,30 @@
{
"my-account": {
"blocks": [],
"inheritComponent": true
},
"my-account-portal": {
"blocks": [],
"inheritComponent": true
}
"my-account": {
"blocks": [],
"inheritComponent": true
},
"my-account.routes": {
"blocks": [
"my-orders"
],
"inheritComponent": true
},
"my-account.menu-links-before": {
"blocks": [
"my-orders-link"
],
"inheritComponent": true
},
"my-account.menu-links-after": {
"blocks": [],
"inheritComponent": true
},
"my-account.profile-display": {
"blocks": [],
"inheritComponent": true
},
"my-account.profile-input": {
"blocks": [],
"inheritComponent": true
}
}
52 changes: 8 additions & 44 deletions store/interfaces.json
Original file line number Diff line number Diff line change
@@ -1,62 +1,26 @@
{
"my-account": {
"required": [],
"allowed": [],
"component": "index"
},
"my-account.routes": {
"required": [],
"allowed": [],
"required": [
"my-orders"
],
"component": "vtex.render-runtime/ExtensionContainer"
},
"my-account.menu-links-before": {
"required": [],
"allowed": [],
"required": [
"my-orders-link"
],
"component": "vtex.render-runtime/ExtensionContainer"
},
"my-account.menu-links-after": {
"required": [],
"allowed": [],
"component": "vtex.render-runtime/ExtensionContainer"
},
"my-account.profile.display": {
"required": [],
"allowed": [],
"my-account.profile-display": {
"component": "vtex.render-runtime/ExtensionContainer"
},
"my-account.profile.input": {
"required": [],
"allowed": [],
"component": "vtex.render-runtime/ExtensionContainer"
},
"my-account-portal": {
"required": [],
"allowed": [],
"component": "index"
},
"my-account-portal.routes": {
"required": [],
"allowed": [],
"component": "vtex.render-runtime/ExtensionContainer"
},
"my-account-portal.menu-links-before": {
"required": [],
"allowed": [],
"component": "vtex.render-runtime/ExtensionContainer"
},
"my-account-portal.menu-links-after": {
"required": [],
"allowed": [],
"component": "vtex.render-runtime/ExtensionContainer"
},
"my-account-portal.profile.display": {
"required": [],
"allowed": [],
"component": "vtex.render-runtime/ExtensionContainer"
},
"my-account-portal/profile.input": {
"required": [],
"allowed": [],
"my-account.profile-input": {
"component": "vtex.render-runtime/ExtensionContainer"
}
}
5 changes: 0 additions & 5 deletions store/routes.json
Original file line number Diff line number Diff line change
@@ -1,5 +0,0 @@
{
"my-account-portal": {
"path": "/legacy-extensions/account"
}
}

0 comments on commit 534ee77

Please sign in to comment.