Skip to content

Commit

Permalink
Merge pull request #427 from vtex-apps/refactor/subcategory-pages
Browse files Browse the repository at this point in the history
refactor/subcategory pages
  • Loading branch information
vitorflg authored Jul 27, 2022
2 parents ee3b96e + 3504b72 commit d86d39b
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .vtexignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
src

.gitignore
CHANGELOG.md
./CHANGELOG.md
README.md

**/.DS_Store
Expand Down
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,33 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Added

- Warn about changes behavior on subcategory page.

## [4.49.2] - 2022-07-13

### Fixed

- Thai and context messages to fix hardcoded strings.

## [4.49.1] - 2022-07-07

### Added

- New messages to reflect change in hardcoded strings in builder hub

## [4.49.0] - 2022-06-30

### Added

- "Duplicate to other bindings" button on the topbar.

## [4.48.1] - 2022-06-28

### Fixed

- Revert v4.47.1
- Revert v4.47.2

## [4.48.0] - 2022-06-27

Expand Down
1 change: 1 addition & 0 deletions messages/context.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@
"admin/pages.editor.component-list.untitled": "admin/pages.editor.component-list.untitled",
"admin/pages.editor.components.arrayTemplate.button.add": "admin/pages.editor.components.arrayTemplate.button.add",
"admin/pages.editor.components.status.alert": "admin/pages.editor.components.status.alert",
"admin/pages.editor.components.editable.alert": "admin/pages.editor.components.editable.alert",
"admin/pages.editor.components.button.cancel": "admin/pages.editor.components.button.cancel",
"admin/pages.editor.components.button.save": "admin/pages.editor.components.button.save",
"admin/pages.editor.components.condition.date.title": "admin/pages.editor.components.condition.date.title",
Expand Down
1 change: 1 addition & 0 deletions messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@
"admin/pages.editor.component-list.title": "Versions",
"admin/pages.editor.component-list.untitled": "Untitled Block",
"admin/pages.editor.components.status.alert": "This version of the content is not being shown in the preview and to visitors.",
"admin/pages.editor.components.editable.alert": "Editing this page will reflect on every subcategory page. If you want to have the content inherited from its parent(category) level, reset it.",
"admin/pages.editor.components.arrayTemplate.button.add": "Add",
"admin/pages.editor.components.button.cancel": "Cancel",
"admin/pages.editor.components.button.save": "Save",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ const BlockConfigurationEditor: React.FunctionComponent<Props> = ({
statement => statement.verb === 'to'
)

const isSubcategoryPage = !!(
iframeRuntime.route.pageContext?.id === 'search' &&
iframeRuntime.route.pageContext?.type === 'subcategory'
)

const getStatusWarningText = () => {
if (statusFromRuntime === ConfigurationStatus.ACTIVE) {
return intl.formatMessage(messages.activationDisabledLabel)
Expand Down Expand Up @@ -217,6 +222,15 @@ const BlockConfigurationEditor: React.FunctionComponent<Props> = ({
/>
</p>
)}

{isSubcategoryPage && (
<p className="pt4 pb4 pl4 pr2 bg-warning--faded lh-copy">
<FormattedMessage
id="admin/pages.editor.components.editable.alert"
defaultMessage="Editing this page will reflect on every subcategory page. If you want to have the content inherited from its parent(category) level, reset it."
/>
</p>
)}
</div>

<div
Expand Down

0 comments on commit d86d39b

Please sign in to comment.