Skip to content

Commit

Permalink
fix: end date not displaying in redirects list (#454)
Browse files Browse the repository at this point in the history
#### What problem is this solving?

The redirects page was not showing up the end date of temporary
redirects

#### How should this be manually tested?

[Before](https://carolcanelas.myvtex.com/admin/cms/redirects/):
Enter a redirect page on the CMS module and try to look for the end date
on the UI
<img width="1020" alt="image"
src="https://github.com/vtex-apps/admin-pages/assets/95254650/62efbca9-fd3a-436b-b221-010c7c97e31f">


[After](https://carolteste--carolcanelas.myvtex.com/admin/cms/redirects/):
Now you can see the end date on the redirects UI
<img width="992" alt="image"
src="https://github.com/vtex-apps/admin-pages/assets/95254650/3675d2d3-1daf-4afd-a9dd-cc1906b94bbd">

#### Type of changes

<!--- Add a ✔️ where applicable -->

| ✔️ | Type of Change |
| --- |
-----------------------------------------------------------------------------------------
|
| ✔️ | Bug fix <!-- a non-breaking change which fixes an issue --> |
| \_ | New feature <!-- a non-breaking change which adds functionality
--> |
| \_ | Breaking change <!-- fix or feature that would cause existing
functionality to change --> |
| \_ | Technical improvements <!-- chores, refactors and overall
reduction of technical debt --> |

#### Notes

Zendesk Ticket: #833375

#### How does this PR make you feel?
[:link:](http://giphy.com/categories/emotions/)

![](https://media.giphy.com/media/hZj44bR9FVI3K/giphy.gif)
  • Loading branch information
caroolcanelas authored Jun 21, 2023
1 parent 4d6048d commit c7503c1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]


### Fixed
- Fix exhibition of the end date of temporary redirects.

## [4.51.0] - 2023-06-14 - 2023-06-05
### Added
- Redirects searcher
Expand Down
4 changes: 2 additions & 2 deletions react/components/admin/redirects/List/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ function getSchema(intl: IntlShape, locale: string, storeBindings: Binding[]) {
},
...bindingProperty,
endDate: {
cellRenderer: function EndDate(cell: { cellData: CellData }) {
cell.cellData ? (
cellRenderer: function EndDate(cell: { cellData: string }) {
return cell.cellData ? (
<span className="ph4">
{getFormattedLocalizedDate(cell.cellData, locale)}
</span>
Expand Down
10 changes: 2 additions & 8 deletions react/utils/date/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,8 @@ export const getFirstTime = (date: Date) =>

export const getFormattedLocalizedDate = (date: string, locale: string) =>
moment(date)
.toDate()
.toLocaleDateString(locale, {
day: 'numeric',
hour: 'numeric',
minute: 'numeric',
month: 'long',
year: 'numeric',
})
.locale(locale)
.format("lll")

export const getLastTime = (date: Date) => {
const dateClone = new Date(date)
Expand Down

0 comments on commit c7503c1

Please sign in to comment.