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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic footer Copyright date #741

Merged
merged 5 commits into from
Oct 13, 2022

Conversation

bfeister
Copy link
Collaborator

@bfeister bfeister commented Sep 29, 2022

Description

Fixes GUS W-11654144

Types of Changes

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Documentation update
  • Breaking change (could cause existing functionality to not work as expected)
  • Other changes (non-breaking changes that does not fit any of the above)

Breaking changes include:

  • Removing a public function or component or prop
  • Adding a required argument to a function
  • Changing the data type of a function parameter or return value
  • Adding a new peer dependency to package.json

Changes

  • (change1)

How to Test-Drive This PR

  • (step1)

Checklists

General

  • Changes are covered by test cases
  • CHANGELOG.md updated with a short description of changes (not required for documentation updates)

Accessibility Compliance

You must check off all items in one of the follow two lists:

  • There are no changes to UI

or...

Localization

  • Changes include a UI text update in the Retail React App (which requires translation)

@bfeister bfeister requested a review from a team as a code owner September 29, 2022 18:30
@salesforce-cla
Copy link

Thanks for the contribution! Before we can merge this, we need @bfeister to sign the Salesforce.com Contributor License Agreement.

@bfeister bfeister changed the title Dynamic foot Copyright date Dynamic footer Copyright date Sep 29, 2022
@echessman echessman requested a review from kevinxh October 3, 2022 16:48
@@ -299,7 +299,7 @@
"defaultMessage": "Terms & Conditions"
},
"checkout_footer.message.copyright": {
"defaultMessage": "2021 Salesforce or its affiliates. All rights reserved. This is a demo store only. Orders made WILL NOT be processed."
"defaultMessage": "Salesforce or its affiliates. All rights reserved. This is a demo store only. Orders made WILL NOT be processed."
Copy link
Contributor

Choose a reason for hiding this comment

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

Re: the translations, we'll need to update all of the other locales too. And then re-compile them.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks. Fixed

@bfeister
Copy link
Collaborator Author

bfeister commented Oct 3, 2022

@vmarta - any reason that npm run build-translations doesn't automatically handle all of the translation files?

@bfeister bfeister requested review from vmarta and removed request for kevinxh October 3, 2022 18:01
@bfeister
Copy link
Collaborator Author

bfeister commented Oct 3, 2022

@kevinxh removing you as a reviewer was a misclick on my part, sorry 😞

{intl.formatMessage({
id: 'checkout_footer.message.copyright',
defaultMessage:
'2021 Salesforce or its affiliates. All rights reserved. This is a demo store only. Orders made WILL NOT be processed.'
'Salesforce or its affiliates. All rights reserved. This is a demo store only. Orders made WILL NOT be processed.'
Copy link
Contributor

@vmarta vmarta Oct 4, 2022

Choose a reason for hiding this comment

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

Can you repeat the change for the other footer file too? Thanks. There are 2 kinds of footer: one for the main core pages, while the other one is for the checkout.

https://github.com/bfeister/pwa-kit/blob/7cb911ed673164cb7c9389448bf5844e7e3b1ab7/packages/template-retail-react-app/app/components/footer/index.jsx#L166-L173

And yeah, unfortunately doing so would need another round of translation updates, because they use a different message id footer.message.copyright.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done! 👍

@vmarta
Copy link
Contributor

vmarta commented Oct 5, 2022

any reason that npm run build-translations doesn't automatically handle all of the translation files?

Hmm, it should be. It will automatically compile all of the translation files. But in this case, we initially updated only the one file for en-US.json. So as a result, there is only one compiled file that's updated.


For some context here, the script does 2 things: npm run extract-default-translations && npm run compile-translations. I think it would make sense why it does that, when we consider the following expected translation workflow.

  1. In their project, the developers would hardcode the text in English, for example, which would be considered the default.
  2. Running the extract command would then extract all the hardcoded text and save them into a json file.
  3. Then they can pass that json file to their translators, which will produce additional translation files for the rest of the locales.
  4. Once received, the developers would import them into the project
  5. Then finally run the compile command for all translation files.

@bfeister bfeister requested a review from vmarta October 10, 2022 22:55
@@ -511,7 +511,7 @@
"defaultMessage": "Terms & Conditions"
},
"footer.message.copyright": {
"defaultMessage": "2021 Salesforce or its affiliates. All rights reserved. This is a demo store only. Orders made WILL NOT be processed."
"defaultMessage": "Salesforce or its affiliates. All rights reserved. This is a demo store only. Orders made WILL NOT be processed."
Copy link
Contributor

Choose a reason for hiding this comment

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

@bfeister Please update the other locales too, just like how you did here with en-US.

@vmarta
Copy link
Contributor

vmarta commented Oct 12, 2022

Minor: @bfeister what's the reason for updating the package-lock file? If it's not really necessary, let's revert the change there.

Copy link
Contributor

@vmarta vmarta left a comment

Choose a reason for hiding this comment

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

After addressing the above comments, feel free to merge the PR.. let me give you +1 in advance.

@bfeister
Copy link
Collaborator Author

bfeister commented Oct 13, 2022

@vmarta addressed 👍 reverted package-lock.json, not sure how that happened... probably npm i inside of packages/template-retail-react-app

@adamraya adamraya merged commit d5fddc3 into SalesforceCommerceCloud:develop Oct 13, 2022
bfeister added a commit to bfeister/pwa-kit that referenced this pull request Oct 20, 2022
…/W-11935976

* 'fix/W-11935976' of github.com:bfeister/pwa-kit:
  Revert "Remove custom options for react query hoc (SalesforceCommerceCloud#755)" (SalesforceCommerceCloud#775)
  Footer copyright: remove the remaining hardcoded year (SalesforceCommerceCloud#760)
  Shopper promotions hooks (SalesforceCommerceCloud#759)
  Dynamic footer Copyright date (SalesforceCommerceCloud#741)
  [commerce-sdk-react] Add mutation hooks and refactor query hooks (SalesforceCommerceCloud#726)
adamraya added a commit that referenced this pull request Oct 27, 2022
* [commerce-sdk-react] Add mutation hooks and refactor query hooks (#726)

* add mutation hook and refactor query hook

* lint

* fix eslint

* fix ts types

* fix ts type for usequery

* fix lint

* fix test

* lint

* add mutation example

* fix typo

* DRY useAuthenticated

* fix object.keys type

* use better name

* change mutation signature

* fix types

* rename mutations

* fix typos

* fix shopper login types

* fix test

* remove unused vars

* refactor mutation types

* allow useMutation to pass thru options

* remove comment

Co-authored-by: Alex Vuong <[email protected]>

* Dynamic footer Copyright date (#741)

* Update checkout-footer.jsx

* whitespace to bump CLA check

* Add translation and alternate footer changes (force push is to remove unsigned commits from git history)

* Shopper promotions hooks (#759)

* usePromotions and usePromotionsForCampaign hooks

* Footer copyright: remove the remaining hardcoded year (#760)

* Revert "Remove custom options for react query hoc (#755)" (#775)

This reverts commit 9e0f596.

* `<ImageGallery >` uses `image.link` when DIS is not set (#786)

* Fix global context pollution coming from nock (#785)

* Fix global context pollution coming from nock

* remove nock debug env var

* npm run lint:fix

* remove IDE-inserted import

* Use default locale as target if none is specified (#788)

* Use default locale as target if none is specified

* Update CHANGELOG.md

* [commerce-sdk-react] Multisite support (#769)

* add multisite support

* add test

* update comment

* pr feedback

* add locale

* add locale props to queries

* add cookie expire

* attempt to address test issues

* attempt to resolve test issue

* fix test

* fix test again

Co-authored-by: Brian Feister <[email protected]>

* ShopperOrders hooks & mutations (#766)

* Implement useOrder and usePaymentMethodsForOrder hooks

* Add useOrder shopper hook to test

* Add usePaymentMethods hook to test

* Added valid order # to test

* Updating demo

* Completed demo of useOrder and usePaymentMethods

* Added tests

* working on tests

* Fix tests

* remove custom mode

* record mock

* mock oauths/login endpoint

* added more tests

* Updating demos

* add mock response

* add mock response

* Implement hooks in test-commerce

* Began writing tests for mutation, implemented useTaxes hook, cleaned up test-commerce demo

* Passing parameters and body to mutate function

* Mutation test, tax hook, lint

* mocked response

* added removePaymentMethodForOrder hook test

* lint

* Remove mutation tests for now

* remove mutation mocks

* lint

* remove nock for mutation

* createOrder hook in test project

Co-authored-by: Alex Vuong <[email protected]>

* ShopperCustomer hooks and mutations (#762)

* `useCustomer` hook

* `useCustomerAddress` hook

* `useCustomerOrders` hook

* Solve merge conflicts

* Refactor `useCustomer` test page

* Add `useCustomerOrders` hook to test page

* Add `useCustomerBaskets` hook

* Add `useShopperCustomerProductList` hook

* Clean up

* Add ShopperCustomer mutations to test page

* Solve merge conflicts

* Wait to add test file until completed

* Add initial `useCustomer` tests

* add useRegisteredUser HOC

* clean up

* clean up

* Add query hooks tests

* Revert "Add use registered user HOC" (#783)

* Add mutation test

* Update query key structure & Invalidate cache onSuccess mutations

* lint

* Add `useQueryClient`

* Update mock responses

* Update usecustomer-returns-data.json

* PR Feedback

* Remove failing mutation test

* update mock responses

* try fix flaky test

* restore test-utils

* Solve merge conflict

Co-authored-by: Alex Vuong <[email protected]>

* [commerce-sdk-react] Implement shopper baskets hooks (#768)

* Implement queries for shopperBasket hooks

* Added UseShopperBasket page to test-commerce-sdk-react app

* Added unit tests for ShopperBasket Queries

* Added test integrations for ShopperBasket queries

* Added test integrations for shopperbasket queries

* wip

* set cache keys

* multiple refactors

* bug fixes

* lint

* revert unnecessary changes

* remove the bad test examples

* revert temp shopper customer changes

* fix test

Co-authored-by: Jainam Tushar Sheth <[email protected]>
Co-authored-by: Brian Feister <[email protected]>
Co-authored-by: Adam Raya <[email protected]>

* ApiClient config needs to  be updated when cid is changed (#790)

* Add Support policy to all SDKs (#764)

* add Support policy to all SDKs

* Additional default options for React Query (#791)

* Explore having react-query config be on user land

* PR feedback, and simplifying the default options

* Revert to making this option applied server side only

* Fix `useServerContext` returning `isServerSide=false` when on server. (#782)

* Revert contraint on prepass JSX

* PR feedback

* Nock: clean up the list of mocks after each test (#792)

* Update `instanceUrl` on `retail-react-app-demo` preset (#799)

* Update changelog files

* Bump alpha version

* Upgrade minimatch (#793)

* remove minimatch from sdk and update version in pwa-kit-dev

* update lock files

* update lock files

* add more tests

* add comment

* lint

* revert packge-lock file changes

* update pwa-kit-dev package-lock.json

* fix lockfile again

Co-authored-by: Kevin He <[email protected]>
Co-authored-by: Alex Vuong <[email protected]>
Co-authored-by: Brian Feister <[email protected]>
Co-authored-by: Alex Vuong <[email protected]>
Co-authored-by: Vincent Marta <[email protected]>
Co-authored-by: Charles Lavery <[email protected]>
Co-authored-by: Ben Chypak <[email protected]>
Co-authored-by: yunakim714 <[email protected]>
Co-authored-by: Jainam Tushar Sheth <[email protected]>
adamraya added a commit that referenced this pull request Oct 27, 2022
* Starting release process for 2.3.0

* Add guards to result sent to Einstein (#756)

* Add result guards to Einstein and PLP sendViewCategory Einstein

* Bump alpha version

* Update changelog

* 🚢 `2.3.0-alpha.2` (#800)

* [commerce-sdk-react] Add mutation hooks and refactor query hooks (#726)

* add mutation hook and refactor query hook

* lint

* fix eslint

* fix ts types

* fix ts type for usequery

* fix lint

* fix test

* lint

* add mutation example

* fix typo

* DRY useAuthenticated

* fix object.keys type

* use better name

* change mutation signature

* fix types

* rename mutations

* fix typos

* fix shopper login types

* fix test

* remove unused vars

* refactor mutation types

* allow useMutation to pass thru options

* remove comment

Co-authored-by: Alex Vuong <[email protected]>

* Dynamic footer Copyright date (#741)

* Update checkout-footer.jsx

* whitespace to bump CLA check

* Add translation and alternate footer changes (force push is to remove unsigned commits from git history)

* Shopper promotions hooks (#759)

* usePromotions and usePromotionsForCampaign hooks

* Footer copyright: remove the remaining hardcoded year (#760)

* Revert "Remove custom options for react query hoc (#755)" (#775)

This reverts commit 9e0f596.

* `<ImageGallery >` uses `image.link` when DIS is not set (#786)

* Fix global context pollution coming from nock (#785)

* Fix global context pollution coming from nock

* remove nock debug env var

* npm run lint:fix

* remove IDE-inserted import

* Use default locale as target if none is specified (#788)

* Use default locale as target if none is specified

* Update CHANGELOG.md

* [commerce-sdk-react] Multisite support (#769)

* add multisite support

* add test

* update comment

* pr feedback

* add locale

* add locale props to queries

* add cookie expire

* attempt to address test issues

* attempt to resolve test issue

* fix test

* fix test again

Co-authored-by: Brian Feister <[email protected]>

* ShopperOrders hooks & mutations (#766)

* Implement useOrder and usePaymentMethodsForOrder hooks

* Add useOrder shopper hook to test

* Add usePaymentMethods hook to test

* Added valid order # to test

* Updating demo

* Completed demo of useOrder and usePaymentMethods

* Added tests

* working on tests

* Fix tests

* remove custom mode

* record mock

* mock oauths/login endpoint

* added more tests

* Updating demos

* add mock response

* add mock response

* Implement hooks in test-commerce

* Began writing tests for mutation, implemented useTaxes hook, cleaned up test-commerce demo

* Passing parameters and body to mutate function

* Mutation test, tax hook, lint

* mocked response

* added removePaymentMethodForOrder hook test

* lint

* Remove mutation tests for now

* remove mutation mocks

* lint

* remove nock for mutation

* createOrder hook in test project

Co-authored-by: Alex Vuong <[email protected]>

* ShopperCustomer hooks and mutations (#762)

* `useCustomer` hook

* `useCustomerAddress` hook

* `useCustomerOrders` hook

* Solve merge conflicts

* Refactor `useCustomer` test page

* Add `useCustomerOrders` hook to test page

* Add `useCustomerBaskets` hook

* Add `useShopperCustomerProductList` hook

* Clean up

* Add ShopperCustomer mutations to test page

* Solve merge conflicts

* Wait to add test file until completed

* Add initial `useCustomer` tests

* add useRegisteredUser HOC

* clean up

* clean up

* Add query hooks tests

* Revert "Add use registered user HOC" (#783)

* Add mutation test

* Update query key structure & Invalidate cache onSuccess mutations

* lint

* Add `useQueryClient`

* Update mock responses

* Update usecustomer-returns-data.json

* PR Feedback

* Remove failing mutation test

* update mock responses

* try fix flaky test

* restore test-utils

* Solve merge conflict

Co-authored-by: Alex Vuong <[email protected]>

* [commerce-sdk-react] Implement shopper baskets hooks (#768)

* Implement queries for shopperBasket hooks

* Added UseShopperBasket page to test-commerce-sdk-react app

* Added unit tests for ShopperBasket Queries

* Added test integrations for ShopperBasket queries

* Added test integrations for shopperbasket queries

* wip

* set cache keys

* multiple refactors

* bug fixes

* lint

* revert unnecessary changes

* remove the bad test examples

* revert temp shopper customer changes

* fix test

Co-authored-by: Jainam Tushar Sheth <[email protected]>
Co-authored-by: Brian Feister <[email protected]>
Co-authored-by: Adam Raya <[email protected]>

* ApiClient config needs to  be updated when cid is changed (#790)

* Add Support policy to all SDKs (#764)

* add Support policy to all SDKs

* Additional default options for React Query (#791)

* Explore having react-query config be on user land

* PR feedback, and simplifying the default options

* Revert to making this option applied server side only

* Fix `useServerContext` returning `isServerSide=false` when on server. (#782)

* Revert contraint on prepass JSX

* PR feedback

* Nock: clean up the list of mocks after each test (#792)

* Update `instanceUrl` on `retail-react-app-demo` preset (#799)

* Update changelog files

* Bump alpha version

* Upgrade minimatch (#793)

* remove minimatch from sdk and update version in pwa-kit-dev

* update lock files

* update lock files

* add more tests

* add comment

* lint

* revert packge-lock file changes

* update pwa-kit-dev package-lock.json

* fix lockfile again

Co-authored-by: Kevin He <[email protected]>
Co-authored-by: Alex Vuong <[email protected]>
Co-authored-by: Brian Feister <[email protected]>
Co-authored-by: Alex Vuong <[email protected]>
Co-authored-by: Vincent Marta <[email protected]>
Co-authored-by: Charles Lavery <[email protected]>
Co-authored-by: Ben Chypak <[email protected]>
Co-authored-by: yunakim714 <[email protected]>
Co-authored-by: Jainam Tushar Sheth <[email protected]>

* 🚢 Version 2.3.0 (#802)

* Version 2.3.0

* Update changelog files

* Begin development on 2.4.0

Co-authored-by: Kevin He <[email protected]>
Co-authored-by: Alex Vuong <[email protected]>
Co-authored-by: Brian Feister <[email protected]>
Co-authored-by: Alex Vuong <[email protected]>
Co-authored-by: Vincent Marta <[email protected]>
Co-authored-by: Charles Lavery <[email protected]>
Co-authored-by: Ben Chypak <[email protected]>
Co-authored-by: yunakim714 <[email protected]>
Co-authored-by: Jainam Tushar Sheth <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants