Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add time to publication date and remove deprecated date fields #4856

Merged
merged 13 commits into from
May 17, 2024

Conversation

Cloud11PL
Copy link
Member

@Cloud11PL Cloud11PL commented May 10, 2024

  • Changes 'date' fields in product availability and publication to 'datetime'
  • Changes 'date' fields in page availability and publication to 'datetime'
  • Replaces deprecated fields with correct ones:
    availableForPurchase -> availableForPurchaseAt
    publicationDate -> publishedAt
    Date -> DateTime

What type of PR is this?

  • 馃拝 Refactor
  • 馃専 Feature
  • 馃敟 Bug Fix
  • 馃敥 Maintenance
  • 馃洜 Workflow CI/CD changes

Related Issues or Documents

  • closes #

Usage Instructions, Screenshots, Recordings

CleanShot 2024-05-10 at 11 01 19
CleanShot 2024-05-10 at 11 01 42
CleanShot 2024-05-10 at 11 02 05

Have you written tests?

  • Yes!
  • No... here is why: Writing tests are mandatory, please replace this text with why test are not included in this PR

[Optional] Description

Copy link

changeset-bot bot commented May 10, 2024

馃 Changeset detected

Latest commit: fa14a55

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
saleor-dashboard Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot temporarily deployed to pr-4856 May 10, 2024 09:01 Destroyed
@github-actions github-actions bot temporarily deployed to pr-4856 May 10, 2024 09:11 Destroyed
@Cloud11PL Cloud11PL marked this pull request as ready for review May 10, 2024 09:30
@Cloud11PL Cloud11PL requested a review from a team as a code owner May 10, 2024 09:30
@Cloud11PL Cloud11PL requested review from poulch and Droniu May 10, 2024 09:31
@yellowee yellowee self-requested a review May 10, 2024 09:32
@github-actions github-actions bot temporarily deployed to pr-4856 May 10, 2024 11:43 Destroyed
@github-actions github-actions bot temporarily deployed to pr-4856 May 10, 2024 13:12 Destroyed
@mirekm
Copy link
Member

mirekm commented May 10, 2024

Do we still need to fill the old date fields (availableForPurchase and publicationDate) with the selected date?

Droniu
Droniu previously approved these changes May 13, 2024
@Cloud11PL
Copy link
Member Author

@mirekm No, Saleor syncs old fields with new fields 馃檪

@github-actions github-actions bot temporarily deployed to pr-4856 May 13, 2024 08:58 Destroyed
@github-actions github-actions bot temporarily deployed to pr-4856 May 13, 2024 10:08 Destroyed
@andrzejewsky andrzejewsky self-requested a review May 13, 2024 16:55
andrzejewsky
andrzejewsky previously approved these changes May 13, 2024
@Cloud11PL Cloud11PL requested a review from Droniu May 14, 2024 06:21
Droniu
Droniu previously approved these changes May 14, 2024
@Cloud11PL Cloud11PL dismissed stale reviews from Droniu and andrzejewsky via aae8ec6 May 14, 2024 09:05
@github-actions github-actions bot temporarily deployed to pr-4856 May 14, 2024 09:07 Destroyed
@github-actions github-actions bot temporarily deployed to pr-4856 May 14, 2024 09:54 Destroyed
@yellowee yellowee removed their request for review May 14, 2024 13:01
@Cloud11PL Cloud11PL force-pushed the MERX-394-publication-date-time branch from 31fef83 to 3b3559b Compare May 15, 2024 10:15
@github-actions github-actions bot temporarily deployed to pr-4856 May 15, 2024 10:17 Destroyed
Droniu
Droniu previously approved these changes May 15, 2024
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests should follow AAA format

<RadioGroup.Item id={`isPublished-true`} value="true">
<Box display="flex" __alignItems="baseline" gap={2}>
<Text>{messages.visibleLabel}</Text>
{isPublished && publishedAt && Date.parse(publishedAt) < dateNow && (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this condition is a little difficult to read, i'd extract it but it's a nitpick really - up to you

Comment on lines 230 to 232
{isAvailableForPurchase &&
availableForPurchaseAt &&
Date.parse(availableForPurchaseAt) < dateNow && (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

andrzejewsky
andrzejewsky previously approved these changes May 15, 2024
@github-actions github-actions bot temporarily deployed to pr-4856 May 16, 2024 10:14 Destroyed
@Cloud11PL Cloud11PL dismissed stale reviews from Droniu and andrzejewsky via a31c3a0 May 16, 2024 10:31
@github-actions github-actions bot temporarily deployed to pr-4856 May 16, 2024 10:33 Destroyed
andrzejewsky

This comment was marked as outdated.

@andrzejewsky andrzejewsky self-requested a review May 17, 2024 08:44
@Cloud11PL Cloud11PL merged commit 7f729f2 into main May 17, 2024
12 of 14 checks passed
@Cloud11PL Cloud11PL deleted the MERX-394-publication-date-time branch May 17, 2024 08:56
karola312 pushed a commit that referenced this pull request May 23, 2024
* wip: replace deprecated fields

* `availableForPurchaseAt`

* visibility card + cleanup

* cleanup

* check if input is valid

* add helper text

* fix 'hidden' 2nd label

* qa fixes

* Add tests and cleanup code

* fix type

* cr fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants