Skip to content

Commit

Permalink
Merge pull request #82 from vtex-apps/fix/reorder-schema
Browse files Browse the repository at this point in the history
Reorder schema
  • Loading branch information
thiagomurakami committed Aug 5, 2019
2 parents 47897d2 + 4f1630f commit fa39906
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 34 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Changed
- Change order of `Carousel`'s schema properties to improve UX in Site Editor.

## [2.10.0] - 2019-07-29
### Added
- Autoplay configuration on the Storefront.
Expand Down
54 changes: 20 additions & 34 deletions react/Carousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,6 @@ export default class Carousel extends Component<Props, State> {
showDots: true,
}

public static uiSchema = {
banners: {
items: {
image: {
'ui:widget': 'image-uploader',
},
mobileImage: {
'ui:widget': 'image-uploader',
},
},
},
}

public static propTypes = {
/** Should change images automatically */
autoplay: PropTypes.bool.isRequired,
Expand Down Expand Up @@ -118,6 +105,7 @@ export default class Carousel extends Component<Props, State> {
},
}

// tslint:disable:object-literal-sort-keys
return {
description: 'admin/editor.carousel.description',
dependencies: {
Expand All @@ -133,32 +121,16 @@ export default class Carousel extends Component<Props, State> {
isLayout: false,
title: 'admin/editor.carousel.autoplaySpeed.title',
type: 'string',
}
}
}
]
}
},
},
},
],
},
},
properties: {
// tslint:disable-line
banners: {
items: {
// tslint:disable-line
properties: {
// tslint:disable-line
description: {
default: '',
title: 'admin/editor.carousel.banner.description.title',
type: 'string',
},
externalRoute: {
default: false,
isLayout: false,
title: 'admin/editor.carousel.banner.externalRoute.title',
type: 'boolean',
},
...externalRouteSchema,
...internalRouteSchema,
image: {
default: '',
title: 'admin/editor.carousel.banner.image.title',
Expand All @@ -175,6 +147,19 @@ export default class Carousel extends Component<Props, State> {
'ui:widget': 'image-uploader',
},
},
description: {
default: '',
title: 'admin/editor.carousel.banner.description.title',
type: 'string',
},
externalRoute: {
default: false,
isLayout: false,
title: 'admin/editor.carousel.banner.externalRoute.title',
type: 'boolean',
},
...externalRouteSchema,
...internalRouteSchema,
},
title: 'admin/editor.carousel.banner.title',
type: 'object',
Expand Down Expand Up @@ -212,6 +197,7 @@ export default class Carousel extends Component<Props, State> {
title: 'admin/editor.carousel.title',
type: 'object',
}
// tslint:enable
}

public state = {
Expand Down

0 comments on commit fa39906

Please sign in to comment.